From 9843a344786f4b3fa6155d2d2ca01d30d92b696c Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Wed, 1 Sep 2010 13:37:21 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'R3_6_1_maintenance'. Sprout from R3_6_maintenance 2010-09-01 13:37:19 UTC Darin Wright 'Bug 324072 - Debug view "Terminate/Disconnect All" doesn't work' 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.core/.classpath org.eclipse.debug.core/.cvsignore org.eclipse.debug.core/.options org.eclipse.debug.core/.project org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs org.eclipse.debug.core/.settings/org.eclipse.jdt.launching.prefs org.eclipse.debug.core/.settings/org.eclipse.pde.prefs org.eclipse.debug.core/META-INF/MANIFEST.MF org.eclipse.debug.core/about.html org.eclipse.debug.core/build.properties org.eclipse.debug.core/buildnotes_platform-debug.html org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManagerListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointsListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventSetListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionsListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationMigrationDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener2.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureProvider.java org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureType.java org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockManager.java org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java org.eclipse.debug.core/core/org/eclipse/debug/core/IStatusHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandRequest.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDisconnectHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDropToFrameHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IEnabledStateRequest.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IRestartHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IResumeHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepFiltersHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepIntoHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepOverHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepReturnHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ISuspendHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ITerminateHandler.java org.eclipse.debug.core/core/org/eclipse/debug/core/commands/package.html org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugModelProvider.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IErrorReportingExpression.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFilteredStep.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFlushableStreamMonitor.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IIndexedValue.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate2.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate2.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockExtension.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrievalExtension.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IPersistableSourceLocator.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStepFilters.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpression.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionListener.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionResult.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchpoint.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html org.eclipse.debug.core/core/org/eclipse/debug/core/package.html org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/IPersistableSourceLocator2.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerTypeDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupDirector.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputerDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainerTypeDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DefaultSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/FolderSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/LocalFileStorage.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/WorkspaceSourceContainer.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ZipEntryStorage.java org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/package.html org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/package.html org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointImportParticipantDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IExpressionsListener2.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IMementoConstants.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchablePropertyTester.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Preferences.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RefreshScopeComparator.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemPropertyResolver.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DisconnectCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DropToFrameCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ForEachCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/Request.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ResumeCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepIntoCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepOverCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepReturnCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/SuspendCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/TerminateCommand.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLocatorMementoComparator.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.properties org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourcePathComputer.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ArchiveSourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DefaultSourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DirectorySourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ExternalArchiveSourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/FolderSourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ProjectSourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/WorkspaceSourceContainerType.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ContainerResolver.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.properties org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ProjectResolver.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/WorkspaceResolver.java org.eclipse.debug.core/doc/.cvsignore org.eclipse.debug.core/doc/org_eclipse_debug_core_sourceContainerTypes.html org.eclipse.debug.core/doc/org_eclipse_debug_core_sourcePathComputers.html org.eclipse.debug.core/hglegal2003.htm org.eclipse.debug.core/ngibmcpy2003.gif org.eclipse.debug.core/plugin.properties org.eclipse.debug.core/plugin.xml org.eclipse.debug.core/r2_0_buildnotes_platform-debug.html org.eclipse.debug.core/r2_1_buildnotes_platform-debug.html org.eclipse.debug.core/r3_0_buildnotes_platform-debug.html org.eclipse.debug.core/r3_0_changes.html org.eclipse.debug.core/r3_1_buildnotes_platform-debug.html org.eclipse.debug.core/r3_1_changes.html org.eclipse.debug.core/r3_2_ buildnotes_platform-debug.html org.eclipse.debug.core/r3_3_buildnotes_platform-debug.html org.eclipse.debug.core/r3_4_buildnotes_platform-debug.html org.eclipse.debug.core/r3_5_buildnotes_platform-debug.html org.eclipse.debug.core/schema/breakpointImportParticipants.exsd org.eclipse.debug.core/schema/breakpoints.exsd org.eclipse.debug.core/schema/launchConfigurationComparators.exsd org.eclipse.debug.core/schema/launchConfigurationTypes.exsd org.eclipse.debug.core/schema/launchDelegates.exsd org.eclipse.debug.core/schema/launchModes.exsd org.eclipse.debug.core/schema/launchers.exsd org.eclipse.debug.core/schema/logicalStructureProviders.exsd org.eclipse.debug.core/schema/logicalStructureTypes.exsd org.eclipse.debug.core/schema/processFactories.exsd org.eclipse.debug.core/schema/sourceContainerTypes.exsd org.eclipse.debug.core/schema/sourceLocators.exsd org.eclipse.debug.core/schema/sourcePathComputers.exsd org.eclipse.debug.core/schema/statusHandlers.exsd org.eclipse.debug.core/schema/watchExpressionDelegates.exsd org.eclipse.debug.core/scripts/exportplugin.xml 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/LaunchFavoriteTests.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/JFaceViewerPopupTests.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/PopupTests.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/VirtualViewerContentTests.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/VirtualViewerPopupTests.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.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--- org.eclipse.core.externaltools/.classpath | 7 - org.eclipse.core.externaltools/.cvsignore | 1 - org.eclipse.core.externaltools/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 74 - .../.settings/org.eclipse.pde.prefs | 25 - .../META-INF/MANIFEST.MF | 17 - org.eclipse.core.externaltools/about.html | 28 - org.eclipse.core.externaltools/build.properties | 18 - org.eclipse.core.externaltools/plugin.properties | 16 - org.eclipse.core.externaltools/plugin.xml | 43 - .../externaltools/internal/ExternalToolsCore.java | 118 - .../internal/IExternalToolConstants.java | 213 -- .../BackgroundResourceRefresher.java | 89 - .../ExternalToolsCoreUtil.java | 282 -- .../ExternalToolsProgramMessages.java | 30 - .../ExternalToolsProgramMessages.properties | 19 - .../ProgramLaunchDelegate.java | 217 -- .../internal/model/BuilderCoreUtils.java | 340 --- .../internal/model/ExternalToolBuilder.java | 290 --- .../internal/model/ExternalToolsModelMessages.java | 24 - .../model/ExternalToolsModelMessages.properties | 13 - .../internal/registry/ExternalToolMigration.java | 410 --- .../registry/ExternalToolsMigrationMessages.java | 25 - .../ExternalToolsMigrationMessages.properties | 13 - org.eclipse.core.variables/.classpath | 7 - org.eclipse.core.variables/.cvsignore | 2 - org.eclipse.core.variables/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 96 - .../.settings/org.eclipse.pde.prefs | 17 - org.eclipse.core.variables/META-INF/MANIFEST.MF | 13 - org.eclipse.core.variables/about.html | 28 - org.eclipse.core.variables/build.properties | 18 - org.eclipse.core.variables/plugin.properties | 16 - org.eclipse.core.variables/plugin.xml | 27 - .../schema/dynamicVariables.exsd | 130 - .../schema/valueVariables.exsd | 156 -- .../variables/ContributedValueVariable.java | 142 -- .../core/internal/variables/DynamicVariable.java | 76 - .../variables/EclipseHomeVariableResolver.java | 55 - .../variables/StringSubstitutionEngine.java | 291 --- .../core/internal/variables/StringVariable.java | 81 - .../internal/variables/StringVariableManager.java | 607 ----- .../core/internal/variables/ValueVariable.java | 76 - .../core/internal/variables/VariablesMessages.java | 29 - .../variables/VariablesMessages.properties | 18 - .../eclipse/core/variables/IDynamicVariable.java | 60 - .../core/variables/IDynamicVariableResolver.java | 36 - .../eclipse/core/variables/IStringVariable.java | 57 - .../core/variables/IStringVariableManager.java | 191 -- .../org/eclipse/core/variables/IValueVariable.java | 91 - .../core/variables/IValueVariableInitializer.java | 30 - .../core/variables/IValueVariableListener.java | 47 - .../eclipse/core/variables/VariablesPlugin.java | 114 - .../src/org/eclipse/core/variables/package.html | 45 - org.eclipse.debug.core/.classpath | 7 - org.eclipse.debug.core/.cvsignore | 1 - org.eclipse.debug.core/.options | 3 - org.eclipse.debug.core/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 101 - .../.settings/org.eclipse.jdt.launching.prefs | 3 - .../.settings/org.eclipse.pde.prefs | 29 - org.eclipse.debug.core/META-INF/MANIFEST.MF | 27 - org.eclipse.debug.core/about.html | 28 - org.eclipse.debug.core/build.properties | 20 - .../buildnotes_platform-debug.html | 96 - .../core/org/eclipse/debug/core/DebugEvent.java | 457 ---- .../org/eclipse/debug/core/DebugException.java | 88 - .../core/org/eclipse/debug/core/DebugPlugin.java | 1411 ---------- .../eclipse/debug/core/IBreakpointListener.java | 69 - .../org/eclipse/debug/core/IBreakpointManager.java | 266 -- .../debug/core/IBreakpointManagerListener.java | 33 - .../eclipse/debug/core/IBreakpointsListener.java | 70 - .../org/eclipse/debug/core/IDebugEventFilter.java | 38 - .../eclipse/debug/core/IDebugEventSetListener.java | 39 - .../eclipse/debug/core/IExpressionListener.java | 53 - .../org/eclipse/debug/core/IExpressionManager.java | 169 -- .../eclipse/debug/core/IExpressionsListener.java | 56 - .../core/org/eclipse/debug/core/ILaunch.java | 178 -- .../eclipse/debug/core/ILaunchConfiguration.java | 599 ----- .../debug/core/ILaunchConfigurationListener.java | 53 - .../ILaunchConfigurationMigrationDelegate.java | 52 - .../debug/core/ILaunchConfigurationType.java | 315 --- .../core/ILaunchConfigurationWorkingCopy.java | 278 -- .../org/eclipse/debug/core/ILaunchDelegate.java | 92 - .../org/eclipse/debug/core/ILaunchListener.java | 51 - .../org/eclipse/debug/core/ILaunchManager.java | 531 ---- .../core/org/eclipse/debug/core/ILaunchMode.java | 64 - .../org/eclipse/debug/core/ILaunchesListener.java | 60 - .../org/eclipse/debug/core/ILaunchesListener2.java | 30 - .../debug/core/ILogicalStructureProvider.java | 50 - .../eclipse/debug/core/ILogicalStructureType.java | 81 - .../eclipse/debug/core/IMemoryBlockListener.java | 43 - .../eclipse/debug/core/IMemoryBlockManager.java | 97 - .../org/eclipse/debug/core/IProcessFactory.java | 66 - .../core/org/eclipse/debug/core/IRequest.java | 84 - .../org/eclipse/debug/core/IStatusHandler.java | 78 - .../org/eclipse/debug/core/IStreamListener.java | 33 - .../core/org/eclipse/debug/core/Launch.java | 594 ----- .../core/org/eclipse/debug/core/RefreshUtil.java | 293 --- .../debug/core/commands/AbstractDebugCommand.java | 407 --- .../debug/core/commands/IDebugCommandHandler.java | 82 - .../debug/core/commands/IDebugCommandRequest.java | 31 - .../debug/core/commands/IDisconnectHandler.java | 28 - .../debug/core/commands/IDropToFrameHandler.java | 27 - .../debug/core/commands/IEnabledStateRequest.java | 32 - .../debug/core/commands/IRestartHandler.java | 27 - .../debug/core/commands/IResumeHandler.java | 26 - .../debug/core/commands/IStepFiltersHandler.java | 31 - .../debug/core/commands/IStepIntoHandler.java | 27 - .../debug/core/commands/IStepOverHandler.java | 27 - .../debug/core/commands/IStepReturnHandler.java | 27 - .../debug/core/commands/ISuspendHandler.java | 26 - .../debug/core/commands/ITerminateHandler.java | 26 - .../org/eclipse/debug/core/commands/package.html | 29 - .../org/eclipse/debug/core/model/Breakpoint.java | 341 --- .../org/eclipse/debug/core/model/DebugElement.java | 168 -- .../org/eclipse/debug/core/model/IBreakpoint.java | 222 -- .../core/model/IBreakpointImportParticipant.java | 70 - .../eclipse/debug/core/model/IDebugElement.java | 63 - .../debug/core/model/IDebugModelProvider.java | 35 - .../org/eclipse/debug/core/model/IDebugTarget.java | 96 - .../org/eclipse/debug/core/model/IDisconnect.java | 50 - .../org/eclipse/debug/core/model/IDropToFrame.java | 43 - .../core/model/IErrorReportingExpression.java | 36 - .../org/eclipse/debug/core/model/IExpression.java | 67 - .../eclipse/debug/core/model/IFilteredStep.java | 46 - .../debug/core/model/IFlushableStreamMonitor.java | 50 - .../eclipse/debug/core/model/IIndexedValue.java | 71 - .../core/model/ILaunchConfigurationDelegate.java | 54 - .../core/model/ILaunchConfigurationDelegate2.java | 106 - .../eclipse/debug/core/model/ILineBreakpoint.java | 50 - .../core/model/ILogicalStructureTypeDelegate.java | 48 - .../core/model/ILogicalStructureTypeDelegate2.java | 46 - .../org/eclipse/debug/core/model/IMemoryBlock.java | 84 - .../debug/core/model/IMemoryBlockExtension.java | 243 -- .../debug/core/model/IMemoryBlockRetrieval.java | 52 - .../core/model/IMemoryBlockRetrievalExtension.java | 36 - .../core/model/IPersistableSourceLocator.java | 83 - .../org/eclipse/debug/core/model/IProcess.java | 105 - .../org/eclipse/debug/core/model/IRegister.java | 39 - .../eclipse/debug/core/model/IRegisterGroup.java | 64 - .../eclipse/debug/core/model/ISourceLocator.java | 67 - .../org/eclipse/debug/core/model/IStackFrame.java | 182 -- .../core/org/eclipse/debug/core/model/IStep.java | 96 - .../org/eclipse/debug/core/model/IStepFilters.java | 64 - .../eclipse/debug/core/model/IStreamMonitor.java | 50 - .../eclipse/debug/core/model/IStreamsProxy.java | 57 - .../eclipse/debug/core/model/IStreamsProxy2.java | 34 - .../eclipse/debug/core/model/ISuspendResume.java | 63 - .../org/eclipse/debug/core/model/ITerminate.java | 46 - .../core/org/eclipse/debug/core/model/IThread.java | 111 - .../core/org/eclipse/debug/core/model/IValue.java | 104 - .../debug/core/model/IValueModification.java | 85 - .../org/eclipse/debug/core/model/IVariable.java | 95 - .../eclipse/debug/core/model/IWatchExpression.java | 93 - .../debug/core/model/IWatchExpressionDelegate.java | 51 - .../debug/core/model/IWatchExpressionListener.java | 31 - .../debug/core/model/IWatchExpressionResult.java | 76 - .../org/eclipse/debug/core/model/IWatchpoint.java | 83 - .../core/model/LaunchConfigurationDelegate.java | 432 ---- .../eclipse/debug/core/model/LineBreakpoint.java | 62 - .../org/eclipse/debug/core/model/MemoryByte.java | 283 --- .../eclipse/debug/core/model/RuntimeProcess.java | 459 ---- .../core/org/eclipse/debug/core/model/package.html | 146 -- .../core/org/eclipse/debug/core/package.html | 115 - .../sourcelookup/AbstractSourceLookupDirector.java | 788 ------ .../AbstractSourceLookupParticipant.java | 167 -- .../sourcelookup/IPersistableSourceLocator2.java | 48 - .../debug/core/sourcelookup/ISourceContainer.java | 108 - .../core/sourcelookup/ISourceContainerType.java | 75 - .../sourcelookup/ISourceContainerTypeDelegate.java | 55 - .../core/sourcelookup/ISourceLookupDirector.java | 182 -- .../sourcelookup/ISourceLookupParticipant.java | 90 - .../core/sourcelookup/ISourcePathComputer.java | 65 - .../sourcelookup/ISourcePathComputerDelegate.java | 49 - .../containers/AbstractSourceContainer.java | 139 - .../AbstractSourceContainerTypeDelegate.java | 73 - .../containers/ArchiveSourceContainer.java | 151 -- .../containers/CompositeSourceContainer.java | 151 -- .../containers/ContainerSourceContainer.java | 209 -- .../containers/DefaultSourceContainer.java | 118 - .../containers/DirectorySourceContainer.java | 179 -- .../containers/ExternalArchiveSourceContainer.java | 276 -- .../containers/FolderSourceContainer.java | 51 - .../sourcelookup/containers/LocalFileStorage.java | 123 - .../containers/ProjectSourceContainer.java | 128 - .../containers/WorkspaceSourceContainer.java | 82 - .../sourcelookup/containers/ZipEntryStorage.java | 152 -- .../core/sourcelookup/containers/package.html | 20 - .../eclipse/debug/core/sourcelookup/package.html | 34 - .../core/BreakpointImportParticipantDelegate.java | 76 - .../debug/internal/core/BreakpointManager.java | 1192 --------- .../debug/internal/core/DebugCoreMessages.java | 141 - .../internal/core/DebugCoreMessages.properties | 112 - .../eclipse/debug/internal/core/DebugOptions.java | 34 - .../internal/core/DebugPreferenceInitializer.java | 36 - .../internal/core/EnvironmentVariableResolver.java | 55 - .../debug/internal/core/ExpressionManager.java | 674 ----- .../core/IConfigurationElementConstants.java | 344 --- .../debug/internal/core/IExpressionsListener2.java | 45 - .../internal/core/IInternalDebugCoreConstants.java | 44 - .../debug/internal/core/IMementoConstants.java | 32 - .../debug/internal/core/InputStreamMonitor.java | 176 -- .../debug/internal/core/LaunchConfiguration.java | 961 ------- .../core/LaunchConfigurationComparator.java | 69 - .../internal/core/LaunchConfigurationInfo.java | 801 ------ .../internal/core/LaunchConfigurationType.java | 516 ---- .../core/LaunchConfigurationWorkingCopy.java | 729 ------ .../debug/internal/core/LaunchDelegate.java | 250 -- .../eclipse/debug/internal/core/LaunchManager.java | 2685 -------------------- .../eclipse/debug/internal/core/LaunchMode.java | 95 - .../internal/core/LaunchablePropertyTester.java | 34 - .../internal/core/LogicalStructureManager.java | 282 -- .../internal/core/LogicalStructureProvider.java | 75 - .../debug/internal/core/LogicalStructureType.java | 150 -- .../debug/internal/core/MemoryBlockManager.java | 305 --- .../debug/internal/core/NullStreamsProxy.java | 99 - .../debug/internal/core/OutputStreamMonitor.java | 273 -- .../eclipse/debug/internal/core/Preferences.java | 415 --- .../core/PreferredDelegateModifyListener.java | 55 - .../internal/core/RefreshScopeComparator.java | 48 - .../debug/internal/core/ResourceFactory.java | 73 - .../debug/internal/core/StepFilterManager.java | 88 - .../eclipse/debug/internal/core/StreamsProxy.java | 145 -- .../internal/core/SystemPropertyResolver.java | 36 - .../internal/core/SystemVariableResolver.java | 77 - .../debug/internal/core/WatchExpression.java | 295 --- .../eclipse/debug/internal/core/XMLMemento.java | 599 ----- .../core/commands/CommandAdapterFactory.java | 122 - .../core/commands/DebugCommandRequest.java | 34 - .../internal/core/commands/DisconnectCommand.java | 49 - .../internal/core/commands/DropToFrameCommand.java | 49 - .../internal/core/commands/ForEachCommand.java | 53 - .../debug/internal/core/commands/Request.java | 59 - .../internal/core/commands/ResumeCommand.java | 40 - .../debug/internal/core/commands/StepCommand.java | 82 - .../internal/core/commands/StepFiltersCommand.java | 99 - .../internal/core/commands/StepIntoCommand.java | 40 - .../internal/core/commands/StepOverCommand.java | 44 - .../internal/core/commands/StepReturnCommand.java | 41 - .../internal/core/commands/SuspendCommand.java | 43 - .../internal/core/commands/TerminateCommand.java | 43 - .../core/sourcelookup/SourceContainerType.java | 93 - .../SourceLocatorMementoComparator.java | 53 - .../core/sourcelookup/SourceLookupMessages.java | 66 - .../sourcelookup/SourceLookupMessages.properties | 50 - .../core/sourcelookup/SourceLookupUtils.java | 148 -- .../core/sourcelookup/SourcePathComputer.java | 75 - .../containers/ArchiveSourceContainerType.java | 70 - .../containers/DefaultSourceContainerType.java | 56 - .../containers/DirectorySourceContainerType.java | 69 - .../ExternalArchiveSourceContainerType.java | 66 - .../containers/FolderSourceContainerType.java | 73 - .../containers/ProjectSourceContainerType.java | 72 - .../containers/WorkspaceSourceContainerType.java | 53 - .../internal/core/variables/ContainerResolver.java | 32 - .../debug/internal/core/variables/Messages.java | 28 - .../internal/core/variables/Messages.properties | 14 - .../internal/core/variables/ProjectResolver.java | 30 - .../internal/core/variables/ResourceResolver.java | 168 -- .../internal/core/variables/WorkspaceResolver.java | 58 - org.eclipse.debug.core/doc/.cvsignore | 15 - ...rg_eclipse_debug_core_sourceContainerTypes.html | 53 - ...org_eclipse_debug_core_sourcePathComputers.html | 58 - org.eclipse.debug.core/hglegal2003.htm | 14 - org.eclipse.debug.core/ngibmcpy2003.gif | Bin 1101 -> 0 bytes org.eclipse.debug.core/plugin.properties | 68 - org.eclipse.debug.core/plugin.xml | 254 -- .../r2_0_buildnotes_platform-debug.html | 1102 -------- .../r2_1_buildnotes_platform-debug.html | 410 --- .../r3_0_buildnotes_platform-debug.html | 994 -------- org.eclipse.debug.core/r3_0_changes.html | 260 -- .../r3_1_buildnotes_platform-debug.html | 975 ------- org.eclipse.debug.core/r3_1_changes.html | 183 -- .../r3_2_ buildnotes_platform-debug.html | 601 ----- .../r3_3_buildnotes_platform-debug.html | 747 ------ .../r3_4_buildnotes_platform-debug.html | 395 --- .../r3_5_buildnotes_platform-debug.html | 354 --- .../schema/breakpointImportParticipants.exsd | 142 -- org.eclipse.debug.core/schema/breakpoints.exsd | 133 - .../schema/launchConfigurationComparators.exsd | 119 - .../schema/launchConfigurationTypes.exsd | 252 -- org.eclipse.debug.core/schema/launchDelegates.exsd | 218 -- org.eclipse.debug.core/schema/launchModes.exsd | 118 - org.eclipse.debug.core/schema/launchers.exsd | 230 -- .../schema/logicalStructureProviders.exsd | 121 - .../schema/logicalStructureTypes.exsd | 136 - .../schema/processFactories.exsd | 122 - .../schema/sourceContainerTypes.exsd | 153 -- org.eclipse.debug.core/schema/sourceLocators.exsd | 122 - .../schema/sourcePathComputers.exsd | 139 - org.eclipse.debug.core/schema/statusHandlers.exsd | 127 - .../schema/watchExpressionDelegates.exsd | 120 - org.eclipse.debug.core/scripts/exportplugin.xml | 32 - org.eclipse.debug.examples.core/.classpath | 9 - org.eclipse.debug.examples.core/.cvsignore | 1 - org.eclipse.debug.examples.core/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 47 - .../META-INF/MANIFEST.MF | 21 - org.eclipse.debug.examples.core/about.html | 28 - org.eclipse.debug.examples.core/build.properties | 22 - .../debug/examples/pdavm/PDAVirtualMachine.java | 1427 ----------- .../pdavm/tests/vmtest10.pda | 38 - .../pdavm/tests/vmtest2.pda | 48 - .../pdavm/tests/vmtest3.pda | 13 - .../pdavm/tests/vmtest6.pda | 31 - .../pdavm/tests/vmtest8.pda | 14 - .../pdavm/tests/vmtest9.pda | 23 - .../pdavm/tests/vmtest_children.pda | 8 - org.eclipse.debug.examples.core/plugin.xml | 103 - org.eclipse.debug.examples.core/readme.html | 11 - .../samples/counter.pda | 11 - org.eclipse.debug.examples.core/samples/drop.pda | 12 - .../samples/example.pda | 35 - .../samples/fibonacci.pda | 32 - .../samples/registers.pda | 72 - org.eclipse.debug.examples.core/samples/stack.pda | 21 - .../samples/structures.pda | 29 - org.eclipse.debug.examples.core/scripts/build.xml | 66 - .../examples/core/midi/launcher/ClockControl.java | 93 - .../examples/core/midi/launcher/LengthControl.java | 36 - .../examples/core/midi/launcher/MidiLaunch.java | 165 -- .../core/midi/launcher/MidiLaunchDelegate.java | 126 - .../core/midi/launcher/SequencerControl.java | 132 - .../examples/core/midi/launcher/TempoControl.java | 89 - .../examples/core/midi/launcher/TimeControl.java | 88 - .../debug/examples/core/pda/DebugCorePlugin.java | 133 - .../core/pda/breakpoints/PDALineBreakpoint.java | 206 -- .../pda/breakpoints/PDARunToLineBreakpoint.java | 70 - .../core/pda/breakpoints/PDAWatchpoint.java | 231 -- .../core/pda/launcher/PDALaunchDelegate.java | 152 -- .../examples/core/pda/model/IPDAEventListener.java | 44 - .../debug/examples/core/pda/model/PDAArray.java | 51 - .../examples/core/pda/model/PDAArrayEntry.java | 98 - .../examples/core/pda/model/PDADebugElement.java | 109 - .../examples/core/pda/model/PDADebugTarget.java | 582 ----- .../examples/core/pda/model/PDAStackFrame.java | 260 -- .../examples/core/pda/model/PDAStackValue.java | 92 - .../debug/examples/core/pda/model/PDAThread.java | 563 ---- .../debug/examples/core/pda/model/PDAValue.java | 109 - .../debug/examples/core/pda/model/PDAVariable.java | 114 - .../core/pda/model/WordStructureDelegate.java | 53 - .../core/pda/protocol/PDABitFieldData.java | 41 - .../core/pda/protocol/PDAChildrenCommand.java | 34 - .../pda/protocol/PDAClearBreakpointCommand.java | 31 - .../examples/core/pda/protocol/PDACommand.java | 40 - .../core/pda/protocol/PDACommandResult.java | 27 - .../examples/core/pda/protocol/PDADataCommand.java | 35 - .../core/pda/protocol/PDADropFrameCommand.java | 44 - .../examples/core/pda/protocol/PDAEvalCommand.java | 43 - .../core/pda/protocol/PDAEvalResultEvent.java | 32 - .../debug/examples/core/pda/protocol/PDAEvent.java | 75 - .../core/pda/protocol/PDAEventStopCommand.java | 48 - .../examples/core/pda/protocol/PDAExitedEvent.java | 29 - .../core/pda/protocol/PDAFrameCommand.java | 36 - .../core/pda/protocol/PDAFrameCommandResult.java | 30 - .../examples/core/pda/protocol/PDAFrameData.java | 46 - .../core/pda/protocol/PDAGroupsCommand.java | 33 - .../examples/core/pda/protocol/PDAListResult.java | 43 - .../core/pda/protocol/PDANoSuchLabelEvent.java | 40 - .../core/pda/protocol/PDAPopDataCommand.java | 34 - .../core/pda/protocol/PDAPushDataCommand.java | 36 - .../core/pda/protocol/PDARegisterData.java | 43 - .../core/pda/protocol/PDARegistersCommand.java | 33 - .../pda/protocol/PDARegistersCommandResult.java | 39 - .../core/pda/protocol/PDARegistersEvent.java | 30 - .../core/pda/protocol/PDARestartCommand.java | 35 - .../core/pda/protocol/PDAResumeCommand.java | 40 - .../core/pda/protocol/PDAResumedEvent.java | 29 - .../core/pda/protocol/PDARunControlEvent.java | 69 - .../core/pda/protocol/PDASetBreakpointCommand.java | 46 - .../core/pda/protocol/PDASetDataCommand.java | 36 - .../core/pda/protocol/PDASetVarCommand.java | 38 - .../core/pda/protocol/PDAStackCommand.java | 39 - .../core/pda/protocol/PDAStackCommandResult.java | 40 - .../core/pda/protocol/PDAStackDepthCommand.java | 36 - .../pda/protocol/PDAStackDepthCommandResult.java | 31 - .../core/pda/protocol/PDAStartedEvent.java | 30 - .../examples/core/pda/protocol/PDAStepCommand.java | 45 - .../core/pda/protocol/PDAStepReturnCommand.java | 46 - .../core/pda/protocol/PDASuspendCommand.java | 40 - .../core/pda/protocol/PDASuspendedEvent.java | 43 - .../core/pda/protocol/PDATerminateCommand.java | 34 - .../core/pda/protocol/PDATerminatedEvent.java | 29 - .../protocol/PDAUnimplementedInstructionEvent.java | 41 - .../core/pda/protocol/PDAVMResumeCommand.java | 37 - .../core/pda/protocol/PDAVMResumedEvent.java | 36 - .../core/pda/protocol/PDAVMStartedEvent.java | 30 - .../core/pda/protocol/PDAVMSuspendCommand.java | 37 - .../core/pda/protocol/PDAVMSuspendedEvent.java | 44 - .../core/pda/protocol/PDAVMTerminatedEvent.java | 29 - .../examples/core/pda/protocol/PDAVarCommand.java | 39 - .../core/pda/protocol/PDAWatchCommand.java | 43 - .../debug/examples/core/pda/protocol/package.html | 99 - .../pda/sourcelookup/PDASourceLookupDirector.java | 32 - .../sourcelookup/PDASourceLookupParticipant.java | 38 - .../PDASourcePathComputerDelegate.java | 65 - .../debug/examples/ant/tasks/PreProcessor.java | 295 --- org.eclipse.debug.examples.ui/.classpath | 7 - org.eclipse.debug.examples.ui/.cvsignore | 1 - org.eclipse.debug.examples.ui/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 47 - org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF | 30 - org.eclipse.debug.examples.ui/about.html | 28 - org.eclipse.debug.examples.ui/build.properties | 20 - .../icons/full/dlcl16/pop.gif | Bin 159 -> 0 bytes .../icons/full/dlcl16/push.gif | Bin 361 -> 0 bytes .../icons/full/elcl16/pop.gif | Bin 163 -> 0 bytes .../icons/full/elcl16/push.gif | Bin 590 -> 0 bytes .../icons/full/obj16/clef.png | Bin 396 -> 0 bytes .../icons/full/obj16/note.gif | Bin 895 -> 0 bytes .../icons/full/obj16/pda.gif | Bin 182 -> 0 bytes org.eclipse.debug.examples.ui/plugin.xml | 458 ---- .../midi/adapters/CheckboxModelProxyFactory.java | 39 - .../ui/midi/adapters/ControlCellModifier.java | 67 - .../examples/ui/midi/adapters/ControlEditor.java | 41 - .../ui/midi/adapters/ControlEventHandler.java | 116 - .../ui/midi/adapters/ControlLabelProvider.java | 40 - .../ui/midi/adapters/ControlsMementoProvider.java | 41 - .../ui/midi/adapters/MidiAdapterFactory.java | 110 - .../ui/midi/adapters/MidiEventLabelProvider.java | 85 - .../ui/midi/adapters/MidiEventModelProxy.java | 34 - .../ui/midi/adapters/MidiStepOverHandler.java | 46 - .../ui/midi/adapters/SequencerColumnFactory.java | 47 - .../midi/adapters/SequencerColumnPresentation.java | 79 - .../ui/midi/adapters/SequencerContentProvider.java | 97 - .../midi/adapters/SequencerControlsModelProxy.java | 96 - .../midi/adapters/SequencerModelProxyFactory.java | 46 - .../ui/midi/adapters/TrackColumnFactory.java | 47 - .../ui/midi/adapters/TrackColumnPresentation.java | 92 - .../ui/midi/adapters/TrackContentProvider.java | 65 - .../ui/midi/adapters/TrackLabelProvider.java | 50 - .../examples/ui/midi/adapters/TrackModelProxy.java | 43 - .../ui/midi/detailpanes/ClockSliderDetailPane.java | 111 - .../midi/detailpanes/ControlDetailPaneFactory.java | 111 - .../ui/midi/detailpanes/TempoSliderDetailPane.java | 108 - .../ui/midi/launcher/MidiLaunchShortcut.java | 163 -- .../examples/ui/midi/launcher/MidiMainTab.java | 177 -- .../examples/ui/midi/launcher/MidiTabGroup.java | 33 - .../debug/examples/ui/pda/DebugUIPlugin.java | 212 -- .../examples/ui/pda/adapters/AdapterFactory.java | 48 - .../ui/pda/adapters/CommandAdapterFactory.java | 40 - .../ui/pda/adapters/ModelProxyFactory.java | 32 - .../adapters/PDADebugTargetContentProvider.java | 71 - .../ui/pda/adapters/PDADebugTargetProxy.java | 38 - .../ui/pda/adapters/PDARestartDebugCommand.java | 54 - .../ui/pda/adapters/PDAThreadEventHandler.java | 147 -- .../ui/pda/breakpoints/PDABreakpointAdapter.java | 227 -- .../pda/breakpoints/PDAEditorAdapterFactory.java | 57 - .../ui/pda/breakpoints/PDARunToLineAdapter.java | 76 - .../breakpoints/PDAToggleWatchpointsTarget.java | 168 -- .../PDAToggleWatchpointsTargetFactory.java | 84 - .../examples/ui/pda/editor/AnnotationHover.java | 45 - .../ui/pda/editor/PDAContentAssistProcessor.java | 102 - .../ui/pda/editor/PDAContentAssistant.java | 42 - .../debug/examples/ui/pda/editor/PDAEditor.java | 48 - .../ui/pda/editor/PDAEditorMessages.properties | 15 - .../debug/examples/ui/pda/editor/PDAScanner.java | 92 - .../pda/editor/PDASourceViewerConfiguration.java | 63 - .../ui/pda/editor/PopFrameActionDelegate.java | 96 - .../debug/examples/ui/pda/editor/TextHover.java | 91 - .../debug/examples/ui/pda/editor/WordFinder.java | 79 - .../ui/pda/launcher/PDALaunchShortcut.java | 77 - .../debug/examples/ui/pda/launcher/PDAMainTab.java | 196 -- .../examples/ui/pda/launcher/PDATabGroup.java | 39 - .../ui/pda/presentation/PDAModelPresentation.java | 192 -- .../ui/pda/views/AbstractDataStackViewHandler.java | 66 - .../debug/examples/ui/pda/views/CanPushTester.java | 46 - .../debug/examples/ui/pda/views/CheckboxView.java | 31 - .../debug/examples/ui/pda/views/DataStackView.java | 177 -- .../debug/examples/ui/pda/views/PopHandler.java | 60 - .../debug/examples/ui/pda/views/PushHandler.java | 37 - org.eclipse.debug.tests/.classpath | 7 - org.eclipse.debug.tests/.cvsignore | 1 - org.eclipse.debug.tests/.project | 28 - .../.settings/org.eclipse.jdt.core.prefs | 98 - org.eclipse.debug.tests/META-INF/MANIFEST.MF | 15 - org.eclipse.debug.tests/about.html | 28 - org.eclipse.debug.tests/build.properties | 19 - org.eclipse.debug.tests/plugin.properties | 13 - org.eclipse.debug.tests/plugin.xml | 86 - .../debug/tests/launching/AbstractLaunchTest.java | 77 - .../launching/AcceleratorSubstitutionTests.java | 59 - .../debug/tests/launching/DebugFileStore.java | 205 -- .../debug/tests/launching/DebugFileSystem.java | 118 - .../tests/launching/LaunchConfigurationTests.java | 1357 ---------- .../debug/tests/launching/LaunchFavoriteTests.java | 259 -- .../debug/tests/launching/LaunchHistoryTests.java | 197 -- .../debug/tests/launching/LaunchManagerTests.java | 203 -- .../debug/tests/launching/RefreshTabTests.java | 204 -- .../debug/tests/launching/TestLaunchDelegate.java | 31 - .../view/memory/DynamicRenderingBindings.java | 69 - .../debug/tests/view/memory/MemoryBlock.java | 91 - .../tests/view/memory/MemoryBlockDynamic.java | 21 - .../debug/tests/view/memory/MemoryBlockOne.java | 21 - .../debug/tests/view/memory/MemoryBlockThree.java | 21 - .../debug/tests/view/memory/MemoryBlockTwo.java | 21 - .../tests/view/memory/MemoryRenderingTests.java | 151 -- .../tests/view/memory/RenderingTypeDelegate.java | 30 - .../debug/tests/viewer/model/CheckTests.java | 176 -- .../tests/viewer/model/ChildrenUpdateTests.java | 188 -- .../debug/tests/viewer/model/ContentTests.java | 116 - .../debug/tests/viewer/model/DeltaTests.java | 634 ----- .../tests/viewer/model/FilterTransformTests.java | 136 - .../model/ITestModelUpdatesListenerConstants.java | 50 - .../tests/viewer/model/JFaceViewerCheckTests.java | 32 - .../viewer/model/JFaceViewerContentTests.java | 32 - .../tests/viewer/model/JFaceViewerDeltaTests.java | 38 - .../viewer/model/JFaceViewerPerformanceTests.java | 36 - .../tests/viewer/model/JFaceViewerPopupTests.java | 32 - .../viewer/model/JFaceViewerSelectionTests.java | 32 - .../tests/viewer/model/JFaceViewerStateTests.java | 32 - .../tests/viewer/model/JFaceViewerUpdateTests.java | 32 - .../debug/tests/viewer/model/PerformanceTests.java | 178 -- .../debug/tests/viewer/model/PopupTests.java | 245 -- .../viewer/model/PresentationContextTests.java | 54 - .../debug/tests/viewer/model/SelectionTests.java | 274 -- .../debug/tests/viewer/model/StateTests.java | 923 ------- .../eclipe/debug/tests/viewer/model/TestModel.java | 672 ----- .../viewer/model/TestModelUpdatesListener.java | 641 ----- .../model/TreeModelViewerAutopopulateAgent.java | 94 - .../debug/tests/viewer/model/UpdateTests.java | 329 --- .../viewer/model/VirtualViewerContentTests.java | 31 - .../viewer/model/VirtualViewerDeltaTests.java | 31 - .../viewer/model/VirtualViewerLazyModeTests.java | 76 - .../model/VirtualViewerPerformanceTests.java | 35 - .../viewer/model/VirtualViewerPopupTests.java | 33 - .../viewer/model/VirtualViewerSelectionTests.java | 31 - .../viewer/model/VirtualViewerStateTests.java | 31 - .../viewer/model/VirtualViewerUpdateTests.java | 31 - .../org/eclipse/debug/tests/AutomatedSuite.java | 95 - .../org/eclipse/debug/tests/PerformanceSuite.java | 46 - .../src/org/eclipse/debug/tests/TestsPlugin.java | 113 - .../debug/tests/statushandlers/StatusHandler.java | 29 - .../tests/statushandlers/StatusHandlerTests.java | 56 - org.eclipse.debug.tests/test-import/Import1.launch | 14 - org.eclipse.debug.tests/test-import/Import2.launch | 14 - org.eclipse.debug.tests/test-import/Import3.launch | 17 - org.eclipse.debug.tests/test-import/Import4.launch | 14 - org.eclipse.debug.tests/test-import/Import5.launch | 14 - org.eclipse.debug.tests/test.xml | 61 - org.eclipse.ui.console/.classpath | 7 - org.eclipse.ui.console/.cvsignore | 1 - org.eclipse.ui.console/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 99 - .../.settings/org.eclipse.pde.prefs | 29 - org.eclipse.ui.console/META-INF/MANIFEST.MF | 20 - org.eclipse.ui.console/about.html | 28 - org.eclipse.ui.console/build.properties | 21 - .../icons/full/clcl16/clear_co.gif | Bin 595 -> 0 bytes .../icons/full/clcl16/lock_co.gif | Bin 626 -> 0 bytes org.eclipse.ui.console/icons/full/clcl16/pin.gif | Bin 358 -> 0 bytes .../icons/full/cview16/console_view.gif | Bin 582 -> 0 bytes .../icons/full/dlcl16/clear_co.gif | Bin 364 -> 0 bytes .../icons/full/dlcl16/lock_co.gif | Bin 588 -> 0 bytes org.eclipse.ui.console/icons/full/dlcl16/pin.gif | Bin 223 -> 0 bytes .../icons/full/dlcl16/rem_co.gif | Bin 159 -> 0 bytes .../icons/full/elcl16/clear_co.gif | Bin 595 -> 0 bytes .../icons/full/elcl16/lock_co.gif | Bin 626 -> 0 bytes .../icons/full/elcl16/new_con.gif | Bin 612 -> 0 bytes org.eclipse.ui.console/icons/full/elcl16/pin.gif | Bin 358 -> 0 bytes .../icons/full/elcl16/rem_co.gif | Bin 163 -> 0 bytes .../icons/full/eview16/console_view.gif | Bin 582 -> 0 bytes org.eclipse.ui.console/plugin.properties | 24 - org.eclipse.ui.console/plugin.xml | 90 - .../schema/consoleFactories.exsd | 136 - .../schema/consolePageParticipants.exsd | 122 - .../schema/consolePatternMatchListeners.exsd | 153 -- org.eclipse.ui.console/scripts/exportplugin.xml | 35 - .../org/eclipse/ui/console/AbstractConsole.java | 335 --- .../src/org/eclipse/ui/console/ConsolePlugin.java | 182 -- .../src/org/eclipse/ui/console/IConsole.java | 97 - .../org/eclipse/ui/console/IConsoleConstants.java | 156 -- .../ui/console/IConsoleDocumentPartitioner.java | 51 - .../org/eclipse/ui/console/IConsoleFactory.java | 48 - .../org/eclipse/ui/console/IConsoleListener.java | 39 - .../org/eclipse/ui/console/IConsoleManager.java | 107 - .../ui/console/IConsolePageParticipant.java | 71 - .../src/org/eclipse/ui/console/IConsoleView.java | 93 - .../src/org/eclipse/ui/console/IHyperlink.java | 37 - .../src/org/eclipse/ui/console/IHyperlink2.java | 33 - .../src/org/eclipse/ui/console/IOConsole.java | 293 --- .../eclipse/ui/console/IOConsoleInputStream.java | 285 --- .../eclipse/ui/console/IOConsoleOutputStream.java | 269 -- .../eclipse/ui/console/IPatternMatchListener.java | 87 - .../ui/console/IPatternMatchListenerDelegate.java | 46 - .../src/org/eclipse/ui/console/MessageConsole.java | 153 -- .../eclipse/ui/console/MessageConsoleStream.java | 92 - .../org/eclipse/ui/console/PatternMatchEvent.java | 73 - .../src/org/eclipse/ui/console/TextConsole.java | 554 ---- .../org/eclipse/ui/console/TextConsolePage.java | 413 --- .../org/eclipse/ui/console/TextConsoleViewer.java | 699 ----- .../ui/console/actions/ClearOutputAction.java | 95 - .../ui/console/actions/CloseConsoleAction.java | 41 - .../ui/console/actions/TextViewerAction.java | 84 - .../console/actions/TextViewerGotoLineAction.java | 121 - .../org/eclipse/ui/console/actions/package.html | 20 - .../src/org/eclipse/ui/console/package.html | 36 - .../ui/internal/console/ConsoleDocument.java | 115 - .../internal/console/ConsoleDocumentAdapter.java | 394 --- .../ui/internal/console/ConsoleDropDownAction.java | 169 -- .../internal/console/ConsoleFactoryExtension.java | 121 - .../internal/console/ConsoleHyperlinkPosition.java | 51 - .../ui/internal/console/ConsoleManager.java | 471 ---- .../ui/internal/console/ConsoleMessages.java | 70 - .../ui/internal/console/ConsoleMessages.properties | 54 - .../console/ConsolePageParticipantExtension.java | 73 - .../ui/internal/console/ConsolePatternMatcher.java | 310 --- .../ui/internal/console/ConsolePluginImages.java | 158 -- .../console/ConsoleResourceBundleMessages.java | 35 - .../ConsoleResourceBundleMessages.properties | 19 - .../console/ConsoleTypePropertyTester.java | 32 - .../eclipse/ui/internal/console/ConsoleView.java | 809 ------ .../console/ConsoleViewConsoleFactory.java | 46 - .../ui/internal/console/ConsoleWorkbenchPart.java | 125 - .../ui/internal/console/FollowHyperlinkAction.java | 55 - .../ui/internal/console/HyperlinkUpdater.java | 56 - .../internal/console/IConsoleHelpContextIds.java | 46 - .../console/IInternalConsoleConstants.java | 31 - .../eclipse/ui/internal/console/IOConsolePage.java | 141 - .../ui/internal/console/IOConsolePartition.java | 209 -- .../ui/internal/console/IOConsolePartitioner.java | 699 ----- .../ui/internal/console/IOConsoleViewer.java | 144 -- .../ui/internal/console/OpenConsoleAction.java | 153 -- .../ui/internal/console/PatternMatchListener.java | 71 - .../console/PatternMatchListenerExtension.java | 153 -- .../ui/internal/console/PinConsoleAction.java | 54 - .../ui/internal/console/ScrollLockAction.java | 51 - .../ui/internal/console/ShowConsoleAction.java | 64 - org.eclipse.ui.externaltools/.classpath | 8 - org.eclipse.ui.externaltools/.cvsignore | 4 - org.eclipse.ui.externaltools/.project | 34 - .../.settings/org.eclipse.jdt.core.prefs | 97 - .../.settings/org.eclipse.jdt.ui.prefs | 3 - .../.settings/org.eclipse.pde.prefs | 29 - .../ExternalToolsBuildTab.java | 384 --- .../ExternalToolsBuilderTab.java | 531 ---- .../ExternalToolsLaunchConfigurationMessages.java | 100 - ...rnalToolsLaunchConfigurationMessages.properties | 79 - .../launchConfigurations/ExternalToolsMainTab.java | 646 ----- .../launchConfigurations/ExternalToolsUtil.java | 147 -- .../IgnoreWhiteSpaceComparator.java | 47 - .../launchConfigurations/WorkingSetComparator.java | 52 - .../internal/menu/ExternalToolMenuDelegate.java | 40 - .../menu/OpenExternalToolsConfigurations.java | 24 - .../externaltools/internal/model/BuilderUtils.java | 185 -- .../internal/model/ExternalToolsImages.java | 205 -- .../internal/model/ExternalToolsModelMessages.java | 26 - .../model/ExternalToolsModelMessages.properties | 15 - .../internal/model/ExternalToolsPlugin.java | 288 --- .../model/ExternalToolsPreferenceInitializer.java | 32 - .../internal/model/IExternalToolConstants.java | 259 -- .../model/IExternalToolsHelpContextIds.java | 37 - .../internal/model/IPreferenceConstants.java | 33 - .../internal/model/ImageDescriptorRegistry.java | 91 - .../internal/ui/BuilderLabelProvider.java | 132 - .../internal/ui/BuilderPropertyPage.java | 1242 --------- .../internal/ui/EditCommandDialog.java | 79 - .../internal/ui/ExternalToolsPreferencePage.java | 97 - .../internal/ui/ExternalToolsUIMessages.java | 69 - .../internal/ui/ExternalToolsUIMessages.properties | 58 - .../internal/ui/FileSelectionDialog.java | 245 -- .../internal/ui/TreeAndListGroup.java | 315 --- .../internal/variables/BuildFilesResolver.java | 136 - .../internal/variables/BuildProjectResolver.java | 74 - .../internal/variables/BuildTypeResolver.java | 26 - .../internal/variables/SystemPathResolver.java | 67 - .../internal/variables/VariableMessages.java | 24 - .../internal/variables/VariableMessages.properties | 13 - org.eclipse.ui.externaltools/META-INF/MANIFEST.MF | 24 - .../ExternalToolsProgramMessages.java | 28 - .../ExternalToolsProgramMessages.properties | 17 - .../ProgramBuilderTabGroup.java | 35 - .../launchConfigurations/ProgramMainTab.java | 56 - .../launchConfigurations/ProgramTabGroup.java | 37 - org.eclipse.ui.externaltools/about.html | 28 - org.eclipse.ui.externaltools/build.properties | 22 - .../buildfiles/exportplugin.xml | 38 - .../icons/full/dtool16/external_tools.gif | Bin 570 -> 0 bytes .../icons/full/etool16/external_tools.gif | Bin 587 -> 0 bytes .../icons/full/obj16/build_tab.gif | Bin 577 -> 0 bytes .../icons/full/obj16/builder.gif | Bin 574 -> 0 bytes .../icons/full/obj16/classpath.gif | Bin 338 -> 0 bytes .../icons/full/obj16/external_tools.gif | Bin 587 -> 0 bytes .../icons/full/obj16/invalid_build_tool.gif | Bin 339 -> 0 bytes .../icons/full/obj16/main_tab.gif | Bin 360 -> 0 bytes .../icons/full/wizban/ext_tools_wiz.png | Bin 4855 -> 0 bytes org.eclipse.ui.externaltools/plugin.properties | 38 - org.eclipse.ui.externaltools/plugin.xml | 203 -- .../schema/configurationDuplicationMaps.exsd | 117 - 690 files changed, 84214 deletions(-) delete mode 100644 org.eclipse.core.externaltools/.classpath delete mode 100644 org.eclipse.core.externaltools/.cvsignore delete mode 100644 org.eclipse.core.externaltools/.project delete mode 100644 org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.core.externaltools/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.core.externaltools/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.core.externaltools/about.html delete mode 100644 org.eclipse.core.externaltools/build.properties delete mode 100644 org.eclipse.core.externaltools/plugin.properties delete mode 100644 org.eclipse.core.externaltools/plugin.xml delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/ExternalToolsCore.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.properties delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.properties delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.java delete mode 100644 org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.properties delete mode 100644 org.eclipse.core.variables/.classpath delete mode 100644 org.eclipse.core.variables/.cvsignore delete mode 100644 org.eclipse.core.variables/.project delete mode 100644 org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.core.variables/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.core.variables/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.core.variables/about.html delete mode 100644 org.eclipse.core.variables/build.properties delete mode 100644 org.eclipse.core.variables/plugin.properties delete mode 100644 org.eclipse.core.variables/plugin.xml delete mode 100644 org.eclipse.core.variables/schema/dynamicVariables.exsd delete mode 100644 org.eclipse.core.variables/schema/valueVariables.exsd delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java delete mode 100644 org.eclipse.core.variables/src/org/eclipse/core/variables/package.html delete mode 100644 org.eclipse.debug.core/.classpath delete mode 100644 org.eclipse.debug.core/.cvsignore delete mode 100644 org.eclipse.debug.core/.options delete mode 100644 org.eclipse.debug.core/.project delete mode 100644 org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.debug.core/.settings/org.eclipse.jdt.launching.prefs delete mode 100644 org.eclipse.debug.core/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.debug.core/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.debug.core/about.html delete mode 100644 org.eclipse.debug.core/build.properties delete mode 100644 org.eclipse.debug.core/buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManagerListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointsListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventSetListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionsListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationMigrationDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener2.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureProvider.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IStatusHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandRequest.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDisconnectHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDropToFrameHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IEnabledStateRequest.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IRestartHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IResumeHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepFiltersHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepIntoHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepOverHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepReturnHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ISuspendHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ITerminateHandler.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/commands/package.html delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugModelProvider.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IErrorReportingExpression.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFilteredStep.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFlushableStreamMonitor.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IIndexedValue.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate2.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate2.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockExtension.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrievalExtension.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IPersistableSourceLocator.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStepFilters.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpression.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionResult.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchpoint.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/package.html delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/IPersistableSourceLocator2.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerTypeDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupDirector.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputerDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainerTypeDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DefaultSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/FolderSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/LocalFileStorage.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/WorkspaceSourceContainer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ZipEntryStorage.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/package.html delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/package.html delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointImportParticipantDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IExpressionsListener2.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IMementoConstants.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchablePropertyTester.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Preferences.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RefreshScopeComparator.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemPropertyResolver.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DisconnectCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DropToFrameCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ForEachCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/Request.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ResumeCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepIntoCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepOverCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepReturnCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/SuspendCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/TerminateCommand.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLocatorMementoComparator.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.properties delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourcePathComputer.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ArchiveSourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DefaultSourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DirectorySourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ExternalArchiveSourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/FolderSourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ProjectSourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/WorkspaceSourceContainerType.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ContainerResolver.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.properties delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ProjectResolver.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java delete mode 100644 org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/WorkspaceResolver.java delete mode 100644 org.eclipse.debug.core/doc/.cvsignore delete mode 100644 org.eclipse.debug.core/doc/org_eclipse_debug_core_sourceContainerTypes.html delete mode 100644 org.eclipse.debug.core/doc/org_eclipse_debug_core_sourcePathComputers.html delete mode 100644 org.eclipse.debug.core/hglegal2003.htm delete mode 100644 org.eclipse.debug.core/ngibmcpy2003.gif delete mode 100644 org.eclipse.debug.core/plugin.properties delete mode 100644 org.eclipse.debug.core/plugin.xml delete mode 100644 org.eclipse.debug.core/r2_0_buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/r2_1_buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/r3_0_buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/r3_0_changes.html delete mode 100644 org.eclipse.debug.core/r3_1_buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/r3_1_changes.html delete mode 100644 org.eclipse.debug.core/r3_2_ buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/r3_3_buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/r3_4_buildnotes_platform-debug.html delete mode 100755 org.eclipse.debug.core/r3_5_buildnotes_platform-debug.html delete mode 100644 org.eclipse.debug.core/schema/breakpointImportParticipants.exsd delete mode 100644 org.eclipse.debug.core/schema/breakpoints.exsd delete mode 100644 org.eclipse.debug.core/schema/launchConfigurationComparators.exsd delete mode 100644 org.eclipse.debug.core/schema/launchConfigurationTypes.exsd delete mode 100644 org.eclipse.debug.core/schema/launchDelegates.exsd delete mode 100644 org.eclipse.debug.core/schema/launchModes.exsd delete mode 100644 org.eclipse.debug.core/schema/launchers.exsd delete mode 100644 org.eclipse.debug.core/schema/logicalStructureProviders.exsd delete mode 100644 org.eclipse.debug.core/schema/logicalStructureTypes.exsd delete mode 100644 org.eclipse.debug.core/schema/processFactories.exsd delete mode 100644 org.eclipse.debug.core/schema/sourceContainerTypes.exsd delete mode 100644 org.eclipse.debug.core/schema/sourceLocators.exsd delete mode 100644 org.eclipse.debug.core/schema/sourcePathComputers.exsd delete mode 100644 org.eclipse.debug.core/schema/statusHandlers.exsd delete mode 100644 org.eclipse.debug.core/schema/watchExpressionDelegates.exsd delete mode 100644 org.eclipse.debug.core/scripts/exportplugin.xml delete mode 100644 org.eclipse.debug.examples.core/.classpath delete mode 100644 org.eclipse.debug.examples.core/.cvsignore delete mode 100644 org.eclipse.debug.examples.core/.project delete mode 100644 org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.debug.examples.core/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.debug.examples.core/about.html delete mode 100644 org.eclipse.debug.examples.core/build.properties delete mode 100644 org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda delete mode 100644 org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda delete mode 100644 org.eclipse.debug.examples.core/plugin.xml delete mode 100644 org.eclipse.debug.examples.core/readme.html delete mode 100644 org.eclipse.debug.examples.core/samples/counter.pda delete mode 100644 org.eclipse.debug.examples.core/samples/drop.pda delete mode 100644 org.eclipse.debug.examples.core/samples/example.pda delete mode 100644 org.eclipse.debug.examples.core/samples/fibonacci.pda delete mode 100644 org.eclipse.debug.examples.core/samples/registers.pda delete mode 100644 org.eclipse.debug.examples.core/samples/stack.pda delete mode 100644 org.eclipse.debug.examples.core/samples/structures.pda delete mode 100644 org.eclipse.debug.examples.core/scripts/build.xml delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java delete mode 100644 org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java delete mode 100644 org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java delete mode 100644 org.eclipse.debug.examples.ui/.classpath delete mode 100644 org.eclipse.debug.examples.ui/.cvsignore delete mode 100644 org.eclipse.debug.examples.ui/.project delete mode 100644 org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.debug.examples.ui/about.html delete mode 100644 org.eclipse.debug.examples.ui/build.properties delete mode 100644 org.eclipse.debug.examples.ui/icons/full/dlcl16/pop.gif delete mode 100644 org.eclipse.debug.examples.ui/icons/full/dlcl16/push.gif delete mode 100644 org.eclipse.debug.examples.ui/icons/full/elcl16/pop.gif delete mode 100644 org.eclipse.debug.examples.ui/icons/full/elcl16/push.gif delete mode 100644 org.eclipse.debug.examples.ui/icons/full/obj16/clef.png delete mode 100644 org.eclipse.debug.examples.ui/icons/full/obj16/note.gif delete mode 100644 org.eclipse.debug.examples.ui/icons/full/obj16/pda.gif delete mode 100644 org.eclipse.debug.examples.ui/plugin.xml delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEditor.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlLabelProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlsMementoProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventModelProxy.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiStepOverHandler.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnPresentation.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerModelProxyFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnPresentation.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackContentProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackModelProxy.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ClockSliderDetailPane.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ControlDetailPaneFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/TempoSliderDetailPane.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiLaunchShortcut.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiMainTab.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiTabGroup.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/ModelProxyFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetProxy.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/AnnotationHover.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditorMessages.properties delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PopFrameActionDelegate.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/WordFinder.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDATabGroup.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CheckboxView.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java delete mode 100644 org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java delete mode 100644 org.eclipse.debug.tests/.classpath delete mode 100644 org.eclipse.debug.tests/.cvsignore delete mode 100644 org.eclipse.debug.tests/.project delete mode 100644 org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.debug.tests/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.debug.tests/about.html delete mode 100644 org.eclipse.debug.tests/build.properties delete mode 100755 org.eclipse.debug.tests/plugin.properties delete mode 100644 org.eclipse.debug.tests/plugin.xml delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AbstractLaunchTest.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AcceleratorSubstitutionTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileSystem.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchConfigurationTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchFavoriteTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchHistoryTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchManagerTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/RefreshTabTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/TestLaunchDelegate.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/DynamicRenderingBindings.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlock.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockDynamic.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockOne.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockThree.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockTwo.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryRenderingTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/RenderingTypeDelegate.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTransformTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerCheckTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerContentTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerDeltaTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPerformanceTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPopupTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerSelectionTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerStateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerUpdateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModel.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModelUpdatesListener.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerContentTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerDeltaTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPerformanceTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPopupTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerSelectionTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerStateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerUpdateTests.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java delete mode 100644 org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java delete mode 100644 org.eclipse.debug.tests/test-import/Import1.launch delete mode 100644 org.eclipse.debug.tests/test-import/Import2.launch delete mode 100644 org.eclipse.debug.tests/test-import/Import3.launch delete mode 100644 org.eclipse.debug.tests/test-import/Import4.launch delete mode 100644 org.eclipse.debug.tests/test-import/Import5.launch delete mode 100644 org.eclipse.debug.tests/test.xml delete mode 100644 org.eclipse.ui.console/.classpath delete mode 100644 org.eclipse.ui.console/.cvsignore delete mode 100644 org.eclipse.ui.console/.project delete mode 100644 org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.ui.console/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.ui.console/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.ui.console/about.html delete mode 100644 org.eclipse.ui.console/build.properties delete mode 100644 org.eclipse.ui.console/icons/full/clcl16/clear_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/clcl16/lock_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/clcl16/pin.gif delete mode 100644 org.eclipse.ui.console/icons/full/cview16/console_view.gif delete mode 100644 org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/dlcl16/lock_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/dlcl16/pin.gif delete mode 100644 org.eclipse.ui.console/icons/full/dlcl16/rem_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/elcl16/clear_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/elcl16/lock_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/elcl16/new_con.gif delete mode 100644 org.eclipse.ui.console/icons/full/elcl16/pin.gif delete mode 100644 org.eclipse.ui.console/icons/full/elcl16/rem_co.gif delete mode 100644 org.eclipse.ui.console/icons/full/eview16/console_view.gif delete mode 100644 org.eclipse.ui.console/plugin.properties delete mode 100644 org.eclipse.ui.console/plugin.xml delete mode 100644 org.eclipse.ui.console/schema/consoleFactories.exsd delete mode 100644 org.eclipse.ui.console/schema/consolePageParticipants.exsd delete mode 100644 org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd delete mode 100644 org.eclipse.ui.console/scripts/exportplugin.xml delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleDocumentPartitioner.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleFactory.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsolePageParticipant.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink2.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListener.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListenerDelegate.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/PatternMatchEvent.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/actions/CloseConsoleAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/console/package.html delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleFactoryExtension.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleHyperlinkPosition.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePageParticipantExtension.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.properties delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleTypePropertyTester.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleViewConsoleFactory.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/HyperlinkUpdater.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/OpenConsoleAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListener.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ScrollLockAction.java delete mode 100644 org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java delete mode 100644 org.eclipse.ui.externaltools/.classpath delete mode 100644 org.eclipse.ui.externaltools/.cvsignore delete mode 100644 org.eclipse.ui.externaltools/.project delete mode 100644 org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.ui.prefs delete mode 100644 org.eclipse.ui.externaltools/.settings/org.eclipse.pde.prefs delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/ExternalToolMenuDelegate.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/OpenExternalToolsConfigurations.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsImages.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPreferenceInitializer.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IPreferenceConstants.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderLabelProvider.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/EditCommandDialog.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsPreferencePage.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.properties delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeResolver.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.java delete mode 100644 org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.properties delete mode 100644 org.eclipse.ui.externaltools/META-INF/MANIFEST.MF delete mode 100644 org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.java delete mode 100644 org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties delete mode 100644 org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java delete mode 100644 org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java delete mode 100644 org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java delete mode 100644 org.eclipse.ui.externaltools/about.html delete mode 100644 org.eclipse.ui.externaltools/build.properties delete mode 100644 org.eclipse.ui.externaltools/buildfiles/exportplugin.xml delete mode 100644 org.eclipse.ui.externaltools/icons/full/dtool16/external_tools.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/etool16/external_tools.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/obj16/build_tab.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/obj16/builder.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/obj16/classpath.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/obj16/external_tools.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/obj16/invalid_build_tool.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/obj16/main_tab.gif delete mode 100644 org.eclipse.ui.externaltools/icons/full/wizban/ext_tools_wiz.png delete mode 100644 org.eclipse.ui.externaltools/plugin.properties delete mode 100644 org.eclipse.ui.externaltools/plugin.xml delete mode 100644 org.eclipse.ui.externaltools/schema/configurationDuplicationMaps.exsd diff --git a/org.eclipse.core.externaltools/.classpath b/org.eclipse.core.externaltools/.classpath deleted file mode 100644 index 2fbb7a23e..000000000 --- a/org.eclipse.core.externaltools/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.core.externaltools/.cvsignore b/org.eclipse.core.externaltools/.cvsignore deleted file mode 100644 index c5e82d745..000000000 --- a/org.eclipse.core.externaltools/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin \ No newline at end of file diff --git a/org.eclipse.core.externaltools/.project b/org.eclipse.core.externaltools/.project deleted file mode 100644 index 4b19d2ac9..000000000 --- a/org.eclipse.core.externaltools/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.core.externaltools - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5ac4bbd18..000000000 --- a/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,74 +0,0 @@ -#Wed Sep 16 09:50:20 CDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=error -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 diff --git a/org.eclipse.core.externaltools/.settings/org.eclipse.pde.prefs b/org.eclipse.core.externaltools/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 189611f2b..000000000 --- a/org.eclipse.core.externaltools/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,25 +0,0 @@ -#Wed Oct 07 13:13:28 CDT 2009 -compilers.f.unresolved-features=1 -compilers.f.unresolved-plugins=1 -compilers.incompatible-environment=1 -compilers.p.build=1 -compilers.p.deprecated=1 -compilers.p.discouraged-class=1 -compilers.p.internal=1 -compilers.p.missing-packages=1 -compilers.p.missing-version-export-package=2 -compilers.p.missing-version-import-package=2 -compilers.p.missing-version-require-bundle=1 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=1 -compilers.p.unknown-attribute=1 -compilers.p.unknown-class=1 -compilers.p.unknown-element=1 -compilers.p.unknown-identifier=1 -compilers.p.unknown-resource=1 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.s.create-docs=false -compilers.s.doc-folder=doc -compilers.s.open-tags=1 -eclipse.preferences.version=1 diff --git a/org.eclipse.core.externaltools/META-INF/MANIFEST.MF b/org.eclipse.core.externaltools/META-INF/MANIFEST.MF deleted file mode 100644 index 30d373c4f..000000000 --- a/org.eclipse.core.externaltools/META-INF/MANIFEST.MF +++ /dev/null @@ -1,17 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-Localization: plugin -Bundle-SymbolicName: org.eclipse.core.externaltools;singleton:=true -Bundle-Version: 1.0.1.qualifier -Bundle-Activator: org.eclipse.core.externaltools.internal.ExternalToolsCore -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", - org.eclipse.debug.core;bundle-version="[3.6.0,4.0.0)", - org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)" -Bundle-RequiredExecutionEnvironment: J2SE-1.4 -Bundle-ActivationPolicy: lazy -Bundle-Vendor: %providerName -Export-Package: org.eclipse.core.externaltools.internal;x-friends:="org.eclipse.ant.launching,org.eclipse.ui.externaltools,org.eclipse.ant.ui", - org.eclipse.core.externaltools.internal.launchConfigurations;x-friends:="org.eclipse.ant.launching,org.eclipse.ui.externaltools", - org.eclipse.core.externaltools.internal.model;x-friends:="org.eclipse.ant.launching,org.eclipse.ui.externaltools,org.eclipse.ant.ui", - org.eclipse.core.externaltools.internal.registry;x-friends:="org.eclipse.ui.externaltools" diff --git a/org.eclipse.core.externaltools/about.html b/org.eclipse.core.externaltools/about.html deleted file mode 100644 index 8fcbcd90a..000000000 --- a/org.eclipse.core.externaltools/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

September 16, 2009

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.core.externaltools/build.properties b/org.eclipse.core.externaltools/build.properties deleted file mode 100644 index 81d294c95..000000000 --- a/org.eclipse.core.externaltools/build.properties +++ /dev/null @@ -1,18 +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 -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - plugin.properties,\ - about.html -src.includes = about.html diff --git a/org.eclipse.core.externaltools/plugin.properties b/org.eclipse.core.externaltools/plugin.properties deleted file mode 100644 index f2df1a6c0..000000000 --- a/org.eclipse.core.externaltools/plugin.properties +++ /dev/null @@ -1,16 +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 -############################################################################### - -pluginName=External Tools Headless Support -providerName=Eclipse.org - -Program.externalTools = Program -Builder.externalTools = Integrated External Tool Builder \ No newline at end of file diff --git a/org.eclipse.core.externaltools/plugin.xml b/org.eclipse.core.externaltools/plugin.xml deleted file mode 100644 index 08d116ea4..000000000 --- a/org.eclipse.core.externaltools/plugin.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/ExternalToolsCore.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/ExternalToolsCore.java deleted file mode 100644 index e14df9960..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/ExternalToolsCore.java +++ /dev/null @@ -1,118 +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.core.externaltools.internal; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; -import org.osgi.framework.BundleContext; - -/** - * Controls the plug-in life cycle - */ -public class ExternalToolsCore extends Plugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.core.externaltools"; //$NON-NLS-1$ - - private static final String EMPTY_STRING= ""; //$NON-NLS-1$ - - /** - * Status code indicating an unexpected internal error. - * @since 2.1 - */ - public static final int INTERNAL_ERROR = 120; - - // The shared instance - private static ExternalToolsCore plugin; - - /** - * The constructor - */ - public ExternalToolsCore() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static ExternalToolsCore getDefault() { - return plugin; - } - - /** - * Logs the specified throwable with this plug-in's log. - * - * @param t throwable to log - */ - public static void log(Throwable t) { - IStatus status= new Status(IStatus.ERROR, PLUGIN_ID, INTERNAL_ERROR, "Error logged from Ant UI: ", t); //$NON-NLS-1$ - log(status); - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status status - */ - public static void log(IStatus status) { - getDefault().getLog().log(status); - } - - /** - * Writes the message to the plug-in's log - * - * @param message the text to write to the log - */ - public static void log(String message, Throwable exception) { - IStatus status = newErrorStatus(message, exception); - log(status); - } - - /** - * Returns a new IStatus for this plug-in - */ - public static IStatus newErrorStatus(String message, Throwable exception) { - if (message == null) { - message= EMPTY_STRING; - } - return new Status(IStatus.ERROR, PLUGIN_ID, 0, message, exception); - } - - /** - * Returns a new CoreException for this plug-in - */ - public static CoreException newError(String message, Throwable exception) { - return new CoreException(new Status(IStatus.ERROR, - IExternalToolConstants.PLUGIN_ID, 0, message, exception)); - } - -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java deleted file mode 100644 index 4641a0e8c..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java +++ /dev/null @@ -1,213 +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 - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ - -package org.eclipse.core.externaltools.internal; -/** - * Defines the constants available for client use. - *

- * This interface is not intended to be extended or implemented by clients. - *

- */ -public interface IExternalToolConstants { - /** - * Plug-in identifier for external tools UI (value org.eclipse.ui.externaltools). - */ - public static final String UI_PLUGIN_ID = "org.eclipse.ui.externaltools"; //$NON-NLS-1$; - - /** - * Plug-in identifier for external tools core (value org.eclipse.core.externaltools). - */ - public static final String PLUGIN_ID = "org.eclipse.core.externaltools"; //$NON-NLS-1$; - - // ------- Refresh Variables ------- - /** - * Variable that expands to the workspace root object (value workspace). - */ - public static final String VAR_WORKSPACE = "workspace"; //$NON-NLS-1$ - /** - * Variable that expands to the project resource (value project). - */ - public static final String VAR_PROJECT = "project"; //$NON-NLS-1$ - /** - * Variable that expands to the container resource (value container). - */ - public static final String VAR_CONTAINER = "container"; //$NON-NLS-1$ - /** - * Variable that expands to a resource (value resource). - */ - public static final String VAR_RESOURCE = "resource"; //$NON-NLS-1$ - /** - * Variable that expands to the working set object (value working_set). - */ - public static final String VAR_WORKING_SET = "working_set"; //$NON-NLS-1$ - // ------- Tool Types ------- - /** - * External tool type for programs such as executables, batch files, - * shell scripts, etc (value programType). - */ - public static final String TOOL_TYPE_PROGRAM = "programType"; //$NON-NLS-1$; - - // ------- Build Types ------- - /** - * Build type indicating an incremental project build request for - * the external tool running as a builder (value incremental). - */ - public static final String BUILD_TYPE_INCREMENTAL = "incremental"; //$NON-NLS-1$ - - /** - * Build type indicating a full project build request for - * the external tool running as a builder (value full). - */ - public static final String BUILD_TYPE_FULL = "full"; //$NON-NLS-1$ - - /** - * Build type indicating an automatic project build request for - * the external tool running as a builder (value auto). - */ - public static final String BUILD_TYPE_AUTO = "auto"; //$NON-NLS-1$ - - /** - * Build type indicating a clean project build request for - * the external tool running as a builder (value clean). - */ - public static final String BUILD_TYPE_CLEAN = "clean"; //$NON-NLS-1$ - - /** - * Build type indicating no project build request for - * the external tool running as a builder (value none). - */ - public static final String BUILD_TYPE_NONE = "none"; //$NON-NLS-1$ - - // ------- Launch configuration types -------- - /** - * Program launch configuration type identifier. - */ - public static final String ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"; //$NON-NLS-1$ - - /** - * Program builder launch configuration type identifier. Program project - * builders are of this type. - */ - public static final String ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"; //$NON-NLS-1$ - - // ------- Launch configuration category -------- - /** - * Identifier for external tools launch configuration category. Launch - * configuration types for external tools that appear in the external tools - * launch configuration dialog should belong to this category. - */ - public static final String ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY = "org.eclipse.ui.externaltools"; //$NON-NLS-1$ - /** - * Identifier for external tools launch configuration builders category. - * Launch configuration types that can be added as project builders should - * belong to this category. - */ - public static final String ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY = "org.eclipse.ui.externaltools.builder"; //$NON-NLS-1$ - - // ------- Common External Tool Launch Configuration Attributes ------- - - /** - * Boolean attribute indicating if external tool output should be captured. - * Default value is false. - * @deprecated since 3.1 Replaced by org.eclipse.debug.core.DebugPlugin.ATTR_CAPTURE_OUTPUT - */ - public static final String ATTR_CAPTURE_OUTPUT = UI_PLUGIN_ID + ".ATTR_CAPTURE_OUTPUT"; //$NON-NLS-1$ - /** - * String attribute identifying the location of an external. Default value - * is null. Encoding is tool specific. - */ - public static final String ATTR_LOCATION = UI_PLUGIN_ID + ".ATTR_LOCATION"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if the user should be prompted for - * arguments before running a tool. Default value is false. - * THIS ATTRIBUTE IS NOT USED. - */ - public static final String ATTR_PROMPT_FOR_ARGUMENTS = UI_PLUGIN_ID + ".ATTR_PROMPT_FOR_ARGUMENTS"; //$NON-NLS-1$ - - /** - * String attribute identifying the scope of resources that should trigger an - * external tool to run. Default value is null - * indicating that the builder will be triggered for all changes. - */ - public static final String ATTR_BUILDER_SCOPE = UI_PLUGIN_ID + ".ATTR_BUILD_SCOPE"; //$NON-NLS-1$ - - /** - * String attribute containing an array of build kinds for which an - * external tool builder should be run. - */ - public static final String ATTR_RUN_BUILD_KINDS = UI_PLUGIN_ID + ".ATTR_RUN_BUILD_KINDS"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if the console should be shown on external - * tool output. Default value is false. - */ - public static final String ATTR_SHOW_CONSOLE = UI_PLUGIN_ID + ".ATTR_SHOW_CONSOLE"; //$NON-NLS-1$ - - /** - * String attribute containing the arguments that should be passed to the - * tool. Default value is null, and encoding is tool specific. - */ - public static final String ATTR_TOOL_ARGUMENTS = UI_PLUGIN_ID + ".ATTR_TOOL_ARGUMENTS"; //$NON-NLS-1$ - - /** - * String attribute identifying the working directory of an external tool. - * Default value is null, which indicates a default working - * directory, which is tool specific. - */ - public static final String ATTR_WORKING_DIRECTORY = UI_PLUGIN_ID + ".ATTR_WORKING_DIRECTORY"; //$NON-NLS-1$ - - /** - * String attribute identifying whether an external tool builder configuration - * is enabled. The default value is true, which indicates - * that the configuration will be executed as appropriate by the builder. - */ - public static final String ATTR_BUILDER_ENABLED = UI_PLUGIN_ID + ".ATTR_BUILDER_ENABLED"; //$NON-NLS-1$ - - /** - * Boolean attribute identifying whether an external tool launcher should execute - * synchronously (value false) or asynchronously (value true). - * Default value is - */ - public static final String ATTR_LAUNCH_IN_BACKGROUND = "org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND"; //$NON-NLS-1$ - - /** - * Status code indicating an unexpected internal error. - */ - public static final int ERR_INTERNAL_ERROR = 150; - - /** - * String attribute identifying a non-external tool builder launch configuration that is disabled - * The value is the name of the disabled builder. - */ - public static final String ATTR_DISABLED_BUILDER = UI_PLUGIN_ID + ".ATTR_DISABLED_BUILDER"; //$NON-NLS-1$ - - /** - * boolean attribute identifying that an external tool builder has been configured for triggering - * using the ICommand.setBuilding(int) mechanism - * @since 3.1 - */ - public static final String ATTR_TRIGGERS_CONFIGURED = UI_PLUGIN_ID + ".ATTR_TRIGGERS_CONFIGURED"; //$NON-NLS-1$ - - /** - * String attribute identifying the build scope for a launch configuration. - * null indicates the default workspace build. - */ - public static final String ATTR_BUILD_SCOPE = UI_PLUGIN_ID + ".ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE"; //$NON-NLS-1$ - - /** - * Attribute identifier specifying whether referenced projects should be - * considered when computing the projects to build. Default value is - * true. - */ - public static final String ATTR_INCLUDE_REFERENCED_PROJECTS = UI_PLUGIN_ID + ".ATTR_INCLUDE_REFERENCED_PROJECTS"; //$NON-NLS-1$ -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java deleted file mode 100644 index de772967d..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java +++ /dev/null @@ -1,89 +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.core.externaltools.internal.launchConfigurations; - - -import org.eclipse.core.externaltools.internal.ExternalToolsCore; -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.DebugPlugin; -import org.eclipse.debug.core.IDebugEventSetListener; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.RefreshUtil; -import org.eclipse.debug.core.model.IProcess; - -/** - * Refreshes resources as specified by a launch configuration, when - * an associated process terminates. - */ -public class BackgroundResourceRefresher implements IDebugEventSetListener { - - private ILaunchConfiguration fConfiguration; - private IProcess fProcess; - - - - public BackgroundResourceRefresher(ILaunchConfiguration configuration, IProcess process) { - fConfiguration = configuration; - fProcess = process; - } - - /** - * If the process has already terminated, resource refreshing is done - * immediately in the current thread. Otherwise, refreshing is done when the - * process terminates. - */ - public void startBackgroundRefresh() { - synchronized (fProcess) { - if (fProcess.isTerminated()) { - refresh(); - } else { - DebugPlugin.getDefault().addDebugEventListener(this); - } - } - } - - /* (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() == fProcess && event.getKind() == DebugEvent.TERMINATE) { - DebugPlugin.getDefault().removeDebugEventListener(this); - refresh(); - break; - } - } - } - - /** - * Submits a job to do the refresh - */ - protected void refresh() { - Job job= new Job(ExternalToolsProgramMessages.BackgroundResourceRefresher_0) { - public IStatus run(IProgressMonitor monitor) { - try { - RefreshUtil.refreshResources(fConfiguration, monitor); - } catch (CoreException e) { - ExternalToolsCore.log(e); - return e.getStatus(); - } - return Status.OK_STATUS; - } - }; - job.schedule(); - } -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java deleted file mode 100644 index d316f27e9..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java +++ /dev/null @@ -1,282 +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 - * Keith Seitz (keiths@redhat.com) - Bug 27243 (environment variables contribution) - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.core.externaltools.internal.launchConfigurations; - - -import java.io.File; - -import org.eclipse.core.externaltools.internal.ExternalToolsCore; -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -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.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.IStringVariableManager; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.RefreshUtil; -import org.eclipse.osgi.util.NLS; - -/** - * Utilities for external tool launch configurations. - *

- * This class it not intended to be instantiated. - *

- */ -public class ExternalToolsCoreUtil { - - /** - * Throws a core exception with an error status object built from - * the given message, lower level exception, and error code. - * @param message the status message - * @param exception lower level exception associated with the - * error, or null if none - * @param code error code - */ - protected static void abort(String message, Throwable exception, int code) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, IExternalToolConstants.PLUGIN_ID, code, message, exception)); - } - - /** - * Expands and returns the location attribute of the given launch - * configuration. The location is - * verified to point to an existing file, in the local file system. - * - * @param configuration launch configuration - * @return an absolute path to a file in the local file system - * @throws CoreException if unable to retrieve the associated launch - * configuration attribute, if unable to resolve any variables, or if the - * resolved location does not point to an existing file in the local file - * system - */ - public static IPath getLocation(ILaunchConfiguration configuration) throws CoreException { - String location = configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, (String) null); - if (location == null) { - abort(NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_Location_not_specified_by__0__1, new String[] { configuration.getName()}), null, 0); - } else { - String expandedLocation = getStringVariableManager().performStringSubstitution(location); - if (expandedLocation == null || expandedLocation.length() == 0) { - String msg = NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_invalidLocation__0_, new Object[] { configuration.getName()}); - abort(msg, null, 0); - } else { - File file = new File(expandedLocation); - if (file.isFile()) { - return new Path(expandedLocation); - } - - String msg = NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_invalidLocation__0_, new Object[] { configuration.getName()}); - abort(msg, null, 0); - } - } - // execution will not reach here - return null; - } - - /** - * Returns a boolean specifying whether or not output should be captured for - * the given configuration - * - * @param configuration the configuration from which the value will be - * extracted - * @return boolean specifying whether or not output should be captured - * @throws CoreException if unable to access the associated attribute - */ - public static boolean getCaptureOutput(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true); - } - - /** - * Expands and returns the working directory attribute of the given launch - * configuration. Returns null if a working directory is not - * specified. If specified, the working is verified to point to an existing - * directory in the local file system. - * - * @param configuration launch configuration - * @return an absolute path to a directory in the local file system, or - * null if unspecified - * @throws CoreException if unable to retrieve the associated launch - * configuration attribute, if unable to resolve any variables, or if the - * resolved location does not point to an existing directory in the local - * file system - */ - public static IPath getWorkingDirectory(ILaunchConfiguration configuration) throws CoreException { - String location = configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) null); - if (location != null) { - String expandedLocation = getStringVariableManager().performStringSubstitution(location); - if (expandedLocation.length() > 0) { - File path = new File(expandedLocation); - if (path.isDirectory()) { - return new Path(expandedLocation); - } - String msg = NLS.bind(ExternalToolsProgramMessages.ExternalToolsUtil_invalidDirectory__0_, new Object[] { expandedLocation, configuration.getName()}); - abort(msg, null, 0); - } - } - return null; - } - - /** - * Expands and returns the arguments attribute of the given launch - * configuration. Returns null if arguments are not specified. - * - * @param configuration launch configuration - * @return an array of resolved arguments, or null if - * unspecified - * @throws CoreException if unable to retrieve the associated launch - * configuration attribute, or if unable to resolve any variables - */ - public static String[] getArguments(ILaunchConfiguration configuration) throws CoreException { - String args = configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, (String) null); - if (args != null) { - String expanded = getStringVariableManager().performStringSubstitution(args); - return parseStringIntoList(expanded); - } - return null; - } - - private static IStringVariableManager getStringVariableManager() { - return VariablesPlugin.getDefault().getStringVariableManager(); - } - - /** - * Returns whether the given launch configuration is enabled. This property - * is intended only to apply to external tool builder configurations and - * determines whether the project builder will launch the configuration - * when it builds. - * - * @param configuration the configuration for which the enabled state should - * be determined. - * @return whether the given configuration is enabled to be run when a build occurs. - * @throws CoreException if unable to access the associated attribute - */ - public static boolean isBuilderEnabled(ILaunchConfiguration configuration) throws CoreException { - return configuration.getAttribute(IExternalToolConstants.ATTR_BUILDER_ENABLED, true); - } - - /** - * Returns the collection of resources for the build scope as specified by the given launch configuration. - * - * @param configuration launch configuration - * @throws CoreException if an exception occurs while retrieving the resources - */ - public static IResource[] getResourcesForBuildScope(ILaunchConfiguration configuration) throws CoreException { - String scope = configuration.getAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, (String) null); - if (scope == null) { - return null; - } - - return RefreshUtil.toResources(scope); - } - - /** - * Parses the argument text into an array of individual - * strings using the space character as the delimiter. - * An individual argument containing spaces must have a - * double quote (") at the start and end. Two double - * quotes together is taken to mean an embedded double - * quote in the argument text. - * - * @param arguments the arguments as one string - * @return the array of arguments - */ - public static String[] parseStringIntoList(String arguments) { - if (arguments == null || arguments.length() == 0) { - return new String[0]; - } - String[] res= DebugPlugin.parseArguments(arguments); - return res; - } - /** - * Returns a collection of projects referenced by a build scope attribute. - * - * @return collection of projects referred to by configuration - */ - public static IProject[] getBuildProjects(ILaunchConfiguration configuration, String buildScopeId) { - - String scope = null; - String id = buildScopeId ; - if (id == null) { - id = IExternalToolConstants.ATTR_BUILD_SCOPE ; - } - try { - scope = configuration.getAttribute(id, (String)null); - } catch (CoreException e) { - return null; - } - if (scope == null) { - return null; - } - if (scope.startsWith("${projects:")) { //$NON-NLS-1$ - String pathString = scope.substring(11, scope.length() - 1); - if (pathString.length() > 1) { - String[] names = pathString.split(","); //$NON-NLS-1$ - IProject[] projects = new IProject[names.length]; - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - for (int i = 0; i < names.length; i++) { - projects[i] = root.getProject(names[i]); - } - return projects; - } - } else if (scope.equals("${project}")) { //$NON-NLS-1$ - IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); - try { - String pathString = manager.performStringSubstitution("${selected_resource_path}"); //$NON-NLS-1$ - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(pathString)); - if (res != null && res.getProject() != null) { - return new IProject[]{res.getProject()}; - } - } catch (CoreException e) { - // unable to resolve a selection - } - } - return new IProject[0]; - } - - /** - * Whether referenced projects should be considered when building. Only valid - * when a set of projects is to be built. - * - * @param configuration - * @return whether referenced projects should be considerd when building - * @throws CoreException if unable to access the associated attribute - */ - public static boolean isIncludeReferencedProjects(ILaunchConfiguration configuration, String includeReferencedProjectsId) throws CoreException { - String id = includeReferencedProjectsId; - if (id == null) { - id = IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS ; - } - return configuration.getAttribute(id, true); - } - - /** - * Returns whether the given external builder configuration should build asynchronously. - * - * @param configuration the configuration - * @return whether the configuration is configured to build asynchronously - */ - public static boolean isAsynchronousBuild(ILaunchConfiguration configuration) { - boolean launchInBackground= false; - try { - launchInBackground= configuration.getAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, false); - } catch (CoreException ce) { - ExternalToolsCore.log(ce); - } - return launchInBackground; - } -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.java deleted file mode 100644 index 889fe2b12..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.java +++ /dev/null @@ -1,30 +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.core.externaltools.internal.launchConfigurations; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsProgramMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsProgramMessages";//$NON-NLS-1$ - - public static String BackgroundResourceRefresher_0; - - public static String ProgramLaunchDelegate_3; - public static String ProgramLaunchDelegate_4; - - public static String ExternalToolsUtil_Location_not_specified_by__0__1; - public static String ExternalToolsUtil_invalidLocation__0_; - public static String ExternalToolsUtil_invalidDirectory__0_; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ExternalToolsProgramMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.properties b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.properties deleted file mode 100644 index e76e7cdbd..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsProgramMessages.properties +++ /dev/null @@ -1,19 +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 -############################################################################### - -BackgroundResourceRefresher_0=Refreshing resources... - -ProgramLaunchDelegate_3=Running {0}... -ProgramLaunchDelegate_4=An IProcess could not be created for the launch - -ExternalToolsUtil_Location_not_specified_by__0__1=Location not specified by {0} -ExternalToolsUtil_invalidLocation__0_ = The file does not exist for the external tool named {0}. -ExternalToolsUtil_invalidDirectory__0_ = The working directory {0} does not exist for the external tool named {1}. \ No newline at end of file diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java deleted file mode 100644 index 00d1c63f8..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java +++ /dev/null @@ -1,217 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Keith Seitz (keiths@redhat.com) - environment variables contribution (Bug 27243) - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.core.externaltools.internal.launchConfigurations; - -import java.io.File; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.resources.IProject; -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.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.RefreshUtil; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.model.LaunchConfigurationDelegate; -import org.eclipse.osgi.util.NLS; - -/** - * Launch delegate for a program. - */ -public class ProgramLaunchDelegate extends LaunchConfigurationDelegate { - - /** - * Launch configuration attribute - a boolean value indicating whether a - * configuration should be launched in the background. Default value is true. - *

- * This constant is defined in org.eclipse.debug.ui, but has to be copied here to support - * headless launching. - *

- */ - private static final String ATTR_LAUNCH_IN_BACKGROUND = "org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND"; //$NON-NLS-1$ - - /** - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, - * java.lang.String, org.eclipse.debug.core.ILaunch, - * org.eclipse.core.runtime.IProgressMonitor) - */ - public void launch(ILaunchConfiguration configuration, String mode, - ILaunch launch, IProgressMonitor monitor) throws CoreException { - - if (monitor.isCanceled()) { - return; - } - - // resolve location - IPath location = ExternalToolsCoreUtil.getLocation(configuration); - - if (monitor.isCanceled()) { - return; - } - - // resolve working directory - IPath workingDirectory = ExternalToolsCoreUtil - .getWorkingDirectory(configuration); - - if (monitor.isCanceled()) { - return; - } - - // resolve arguments - String[] arguments = ExternalToolsCoreUtil.getArguments(configuration); - - if (monitor.isCanceled()) { - return; - } - - int cmdLineLength = 1; - if (arguments != null) { - cmdLineLength += arguments.length; - } - String[] cmdLine = new String[cmdLineLength]; - cmdLine[0] = location.toOSString(); - if (arguments != null) { - System.arraycopy(arguments, 0, cmdLine, 1, arguments.length); - } - - File workingDir = null; - if (workingDirectory != null) { - workingDir = workingDirectory.toFile(); - } - - if (monitor.isCanceled()) { - return; - } - - String[] envp = DebugPlugin.getDefault().getLaunchManager() - .getEnvironment(configuration); - - if (monitor.isCanceled()) { - return; - } - - Process p = DebugPlugin.exec(cmdLine, workingDir, envp); - IProcess process = null; - - // add process type to process attributes - Map processAttributes = new HashMap(); - String programName = location.lastSegment(); - String extension = location.getFileExtension(); - if (extension != null) { - programName = programName.substring(0, programName.length() - - (extension.length() + 1)); - } - programName = programName.toLowerCase(); - processAttributes.put(IProcess.ATTR_PROCESS_TYPE, programName); - - if (p != null) { - monitor.beginTask(NLS.bind( - ExternalToolsProgramMessages.ProgramLaunchDelegate_3, - new String[] { configuration.getName() }), - IProgressMonitor.UNKNOWN); - process = DebugPlugin.newProcess(launch, p, location.toOSString(), - processAttributes); - } - if (p == null || process == null) { - if (p != null) - p.destroy(); - throw new CoreException(new Status(IStatus.ERROR, - IExternalToolConstants.PLUGIN_ID, - IExternalToolConstants.ERR_INTERNAL_ERROR, - ExternalToolsProgramMessages.ProgramLaunchDelegate_4, null)); - } - process.setAttribute(IProcess.ATTR_CMDLINE, - generateCommandLine(cmdLine)); - - if (configuration.getAttribute(ATTR_LAUNCH_IN_BACKGROUND, true)) { - // refresh resources after process finishes - String scope = configuration.getAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, (String)null); - if (scope != null) { - BackgroundResourceRefresher refresher = new BackgroundResourceRefresher(configuration, process); - refresher.startBackgroundRefresh(); - } - } else { - // wait for process to exit - while (!process.isTerminated()) { - try { - if (monitor.isCanceled()) { - process.terminate(); - break; - } - Thread.sleep(50); - } catch (InterruptedException e) { - } - } - - // refresh resources - RefreshUtil.refreshResources(configuration, monitor); - } - } - - private String generateCommandLine(String[] commandLine) { - if (commandLine.length < 1) - return ""; //$NON-NLS-1$ - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < commandLine.length; i++) { - buf.append(' '); - char[] characters = commandLine[i].toCharArray(); - StringBuffer command = new StringBuffer(); - boolean containsSpace = false; - for (int j = 0; j < characters.length; j++) { - char character = characters[j]; - if (character == '\"') { - command.append('\\'); - } else if (character == ' ') { - containsSpace = true; - } - command.append(character); - } - if (containsSpace) { - buf.append('\"'); - buf.append(command); - buf.append('\"'); - } else { - buf.append(command); - } - } - return buf.toString(); - } - - /* - * (non-Javadoc) - * - * @see - * org.eclipse.debug.core.model.LaunchConfigurationDelegate#getBuildOrder - * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String) - */ - protected IProject[] getBuildOrder(ILaunchConfiguration configuration, - String mode) throws CoreException { - IProject[] projects = ExternalToolsCoreUtil.getBuildProjects( - configuration, null); - if (projects == null) { - return null; - } - boolean isRef = ExternalToolsCoreUtil.isIncludeReferencedProjects( - configuration, null); - if (isRef) { - return computeReferencedBuildOrder(projects); - } - return computeBuildOrder(projects); - } -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java deleted file mode 100644 index f3b7acd6d..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java +++ /dev/null @@ -1,340 +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.core.externaltools.internal.model; - -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.externaltools.internal.registry.ExternalToolMigration; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; - -/** - * Utility methods for working with external tool project builders. - */ -public class BuilderCoreUtils { - - public static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$ - - /** - * Constant used to find a builder using the 3.0-interim format - */ - public static final String BUILDER_FOLDER_NAME = ".externalToolBuilders"; //$NON-NLS-1$ - /** - * Constant used to represent the current project in the 3.0-final format. - */ - public static final String PROJECT_TAG = ""; //$NON-NLS-1$ - - public static final String VERSION_1_0 = "1.0"; //$NON-NLS-1$ - public static final String VERSION_2_1 = "2.1"; //$NON-NLS-1$ - // The format shipped up to and including Eclipse 3.0 RC1 - public static final String VERSION_3_0_interim = "3.0.interim"; //$NON-NLS-1$ - // The format shipped in Eclipse 3.0 final - public static final String VERSION_3_0_final = "3.0"; //$NON-NLS-1$ - - private static final String BUILD_TYPE_SEPARATOR = ","; //$NON-NLS-1$ - private static final int[] DEFAULT_BUILD_TYPES = new int[] { - IncrementalProjectBuilder.INCREMENTAL_BUILD, - IncrementalProjectBuilder.FULL_BUILD }; - - /** - * Returns a launch configuration from the given ICommand arguments. If the - * given arguments are from an old-style external tool, an unsaved working - * copy will be created from the arguments and returned. - * - * @param commandArgs - * the builder ICommand arguments - * @return a launch configuration, a launch configuration working copy, or - * null if not possible. - */ - public static ILaunchConfiguration configFromBuildCommandArgs( - IProject project, Map commandArgs, String[] version) { - String configHandle = (String) commandArgs.get(LAUNCH_CONFIG_HANDLE); - if (configHandle == null) { - // Probably an old-style (Eclipse 1.0 or 2.0) external tool. Try to - // migrate. - version[0] = VERSION_1_0; - return ExternalToolMigration.configFromArgumentMap(commandArgs); - } - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfiguration configuration = null; - if (configHandle.startsWith(PROJECT_TAG)) { - version[0] = VERSION_3_0_final; - IPath path = new Path(configHandle); - IFile file = project.getFile(path.removeFirstSegments(1)); - if (file.exists()) { - configuration = manager.getLaunchConfiguration(file); - } - } else { - // Try treating the handle as a file name. - // This is the format used in 3.0 RC1. - IPath path = new Path(BUILDER_FOLDER_NAME).append(configHandle); - IFile file = project.getFile(path); - if (file.exists()) { - version[0] = VERSION_3_0_interim; - configuration = manager.getLaunchConfiguration(file); - } else { - try { - // Treat the configHandle as a memento. This is the format - // used in Eclipse 2.1. - configuration = manager - .getLaunchConfiguration(configHandle); - } catch (CoreException e) { - } - if (configuration != null) { - version[0] = VERSION_2_1; - } - } - } - return configuration; - } - - public static void configureTriggers(ILaunchConfiguration config, - ICommand newCommand) throws CoreException { - newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, false); - newCommand.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, - false); - newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, false); - newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, false); - String buildKinds = config.getAttribute( - IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) null); - int[] triggers = BuilderCoreUtils.buildTypesToArray(buildKinds); - for (int i = 0; i < triggers.length; i++) { - switch (triggers[i]) { - case IncrementalProjectBuilder.FULL_BUILD: - newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, - true); - break; - case IncrementalProjectBuilder.INCREMENTAL_BUILD: - newCommand.setBuilding( - IncrementalProjectBuilder.INCREMENTAL_BUILD, true); - break; - case IncrementalProjectBuilder.AUTO_BUILD: - newCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, - true); - break; - case IncrementalProjectBuilder.CLEAN_BUILD: - newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, - true); - break; - } - } - if (!config.getAttribute( - IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false)) { - ILaunchConfigurationWorkingCopy copy = config.getWorkingCopy(); - copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, - true); - copy.doSave(); - } - } - - /** - * Returns whether the given configuration is an "unmigrated" builder. - * Unmigrated builders are external tools that are stored in an old format - * but have not been migrated by the user. Old format builders are always - * translated into launch config working copies in memory, but they're not - * considered "migrated" until the config has been saved and the project - * spec updated. - * - * @param config - * the config to examine - * @return whether the given config represents an unmigrated builder - */ - public static boolean isUnmigratedConfig(ILaunchConfiguration config) { - return config.isWorkingCopy() - && ((ILaunchConfigurationWorkingCopy) config).getOriginal() == null; - } - - /** - * Converts the given config to a build command which is stored in the given - * command. - * - * @return the configured build command - */ - public static ICommand toBuildCommand(IProject project, - ILaunchConfiguration config, ICommand command) throws CoreException { - Map args = null; - if (isUnmigratedConfig(config)) { - // This config represents an old external tool builder that hasn't - // been edited. Try to find the old ICommand and reuse the - // arguments. - // The goal here is to not change the storage format of old, - // unedited builders. - ICommand[] commands = project.getDescription().getBuildSpec(); - for (int i = 0; i < commands.length; i++) { - ICommand projectCommand = commands[i]; - String name = ExternalToolMigration - .getNameFromCommandArgs(projectCommand.getArguments()); - if (name != null && name.equals(config.getName())) { - args = projectCommand.getArguments(); - break; - } - } - } else { - if (config instanceof ILaunchConfigurationWorkingCopy) { - ILaunchConfigurationWorkingCopy workingCopy = (ILaunchConfigurationWorkingCopy) config; - if (workingCopy.getOriginal() != null) { - config = workingCopy.getOriginal(); - } - } - args = new HashMap(); - // Launch configuration builders are stored with a project-relative - // path - StringBuffer buffer = new StringBuffer(PROJECT_TAG); - // Append the project-relative path (workspace path minus first - // segment) - buffer.append('/').append( - config.getFile().getFullPath().removeFirstSegments(1)); - args.put(LAUNCH_CONFIG_HANDLE, buffer.toString()); - } - command.setBuilderName(ExternalToolBuilder.ID); - command.setArguments(args); - return command; - } - - /** - * Returns the folder where project builders should be stored or - * null if the folder could not be created - */ - public static IFolder getBuilderFolder(IProject project, boolean create) { - IFolder folder = project.getFolder(BUILDER_FOLDER_NAME); - if (!folder.exists() && create) { - try { - folder.create(true, true, new NullProgressMonitor()); - } catch (CoreException e) { - return null; - } - } - return folder; - } - - /** - * Migrates the launch configuration working copy, which is based on an old- - * style external tool builder, to a new, saved launch configuration. The - * returned launch configuration will contain the same attributes as the - * given working copy with the exception of the configuration name, which - * may be changed during the migration. The name of the configuration will - * only be changed if the current name is not a valid name for a saved - * config. - * - * @param workingCopy - * the launch configuration containing attributes from an - * old-style project builder. - * @return ILaunchConfiguration a new, saved launch configuration whose - * attributes match those of the given working copy as well as - * possible - * @throws CoreException - * if an exception occurs while attempting to save the new - * launch configuration - */ - public static ILaunchConfiguration migrateBuilderConfiguration( - IProject project, ILaunchConfigurationWorkingCopy workingCopy) - throws CoreException { - workingCopy.setContainer(getBuilderFolder(project, true)); - // Before saving, make sure the name is valid - String name = workingCopy.getName(); - name = name.replace('/', '.'); - if (name.charAt(0) == ('.')) { - name = name.substring(1); - } - IStatus status = ResourcesPlugin.getWorkspace().validateName(name, - IResource.FILE); - if (!status.isOK()) { - name = "ExternalTool"; //$NON-NLS-1$ - } - name = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(name); - workingCopy.rename(name); - return workingCopy.doSave(); - } - - /** - * Converts the build types string into an array of build kinds. - * - * @param buildTypes - * the string of built types to convert - * @return the array of build kinds. - */ - public static int[] buildTypesToArray(String buildTypes) { - if (buildTypes == null || buildTypes.length() == 0) { - return DEFAULT_BUILD_TYPES; - } - - int count = 0; - boolean incremental = false; - boolean full = false; - boolean auto = false; - boolean clean = false; - - StringTokenizer tokenizer = new StringTokenizer(buildTypes, - BUILD_TYPE_SEPARATOR); - while (tokenizer.hasMoreTokens()) { - String token = tokenizer.nextToken(); - if (IExternalToolConstants.BUILD_TYPE_INCREMENTAL.equals(token)) { - if (!incremental) { - incremental = true; - count++; - } - } else if (IExternalToolConstants.BUILD_TYPE_FULL.equals(token)) { - if (!full) { - full = true; - count++; - } - } else if (IExternalToolConstants.BUILD_TYPE_AUTO.equals(token)) { - if (!auto) { - auto = true; - count++; - } - } else if (IExternalToolConstants.BUILD_TYPE_CLEAN.equals(token)) { - if (!clean) { - clean = true; - count++; - } - } - } - - int[] results = new int[count]; - count = 0; - if (incremental) { - results[count] = IncrementalProjectBuilder.INCREMENTAL_BUILD; - count++; - } - if (full) { - results[count] = IncrementalProjectBuilder.FULL_BUILD; - count++; - } - if (auto) { - results[count] = IncrementalProjectBuilder.AUTO_BUILD; - count++; - } - if (clean) { - results[count] = IncrementalProjectBuilder.CLEAN_BUILD; - count++; - } - - return results; - } -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java deleted file mode 100644 index 244a833f6..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java +++ /dev/null @@ -1,290 +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 - * Matthew Conway - Bug 175186 - *******************************************************************************/ -package org.eclipse.core.externaltools.internal.model; - - -import java.util.Map; - -import org.eclipse.core.externaltools.internal.ExternalToolsCore; -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil; -import org.eclipse.core.externaltools.internal.registry.ExternalToolMigration; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.osgi.util.NLS; -import org.osgi.framework.Bundle; - -/** - * This project builder implementation will run an external tool during the - * build process. - */ -public final class ExternalToolBuilder extends IncrementalProjectBuilder { - private final class IgnoreTeamPrivateChanges implements IResourceDeltaVisitor { - private boolean[] fTrueChange; - private IgnoreTeamPrivateChanges(boolean[] trueChange) { - super(); - fTrueChange= trueChange; - } - public boolean visit(IResourceDelta visitDelta) throws CoreException { - IResource resource= visitDelta.getResource(); - if (resource instanceof IFile) { - fTrueChange[0]= true; - return false; - } - return true; - } - } - - public static final String ID = "org.eclipse.ui.externaltools.ExternalToolBuilder"; //$NON-NLS-1$; - - private static String buildType = IExternalToolConstants.BUILD_TYPE_NONE; - - private static IProject buildProject= null; - private static IResourceDelta buildDelta= null; - - /* (non-Javadoc) - * @see org.eclipse.core.internal.events.InternalBuilder#build(int, java.util.Map, org.eclipse.core.runtime.IProgressMonitor) - */ - protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { - if (ExternalToolsCore.getDefault().getBundle().getState() != Bundle.ACTIVE) { - return null; - } - - ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), args, new String[1]); - if (config == null) { - throw ExternalToolsCore.newError(ExternalToolsModelMessages.ExternalToolBuilder_0, null); - } - IProject[] projectsWithinScope= null; - IResource[] resources = ExternalToolsCoreUtil.getResourcesForBuildScope(config); - if (resources != null) { - projectsWithinScope= new IProject[resources.length]; - for (int i = 0; i < resources.length; i++) { - projectsWithinScope[i]= resources[i].getProject(); - } - } - boolean kindCompatible= commandConfiguredForKind(config, kind); - if (kindCompatible && configEnabled(config)) { - doBuildBasedOnScope(resources, kind, config, monitor); - } - - return projectsWithinScope; - } - - private boolean commandConfiguredForKind(ILaunchConfiguration config, int kind) { - try { - if (!(config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) { - ICommand command= getCommand(); - //adapt the builder command to make use of the 3.1 support for setting command build kinds - //this will only happen once for builder/command defined before the support existed - BuilderCoreUtils.configureTriggers(config, command); - IProjectDescription desc= getProject().getDescription(); - ICommand[] commands= desc.getBuildSpec(); - int index= getBuilderCommandIndex(commands, command); - if (index != -1) { - commands[index]= command; - desc.setBuildSpec(commands); - getProject().setDescription(desc, null); - ILaunchConfigurationWorkingCopy copy= config.getWorkingCopy(); - copy.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true); - copy.doSave(); - } - return command.isBuilding(kind); - } - } catch (CoreException e) { - ExternalToolsCore.log(e); - return true; - } - return true; - } - - private int getBuilderCommandIndex(ICommand[] buildSpec, ICommand command) { - Map commandArgs= command.getArguments(); - if (commandArgs == null) { - return -1; - } - String handle= (String) commandArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE); - if (handle == null) { - return -1; - } - for (int i = 0; i < buildSpec.length; ++i) { - ICommand buildSpecCommand= buildSpec[i]; - if (ID.equals(buildSpecCommand.getBuilderName())) { - Map buildSpecArgs= buildSpecCommand.getArguments(); - if (buildSpecArgs != null) { - String buildSpecHandle= (String) buildSpecArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE); - if (handle.equals(buildSpecHandle)) { - return i; - } - } - } - } - return -1; - } - - /** - * Returns whether the given builder config is enabled or not. - * - * @param config the config to examine - * @return whether the config is enabled - */ - private boolean configEnabled(ILaunchConfiguration config) { - try { - return ExternalToolsCoreUtil.isBuilderEnabled(config); - } catch (CoreException e) { - ExternalToolsCore.log(e); - } - return true; - } - - private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException { - boolean buildForChange = true; - if (kind != FULL_BUILD) { //scope not applied for full builds - if (resources != null && resources.length > 0) { - buildForChange = buildScopeIndicatesBuild(resources); - } - } - - if (buildForChange) { - launchBuild(kind, config, monitor); - } - } - - private void launchBuild(int kind, ILaunchConfiguration config, IProgressMonitor monitor) throws CoreException { - monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, new String[] { config.getName()})); - buildStarted(kind); - // The default value for "launch in background" is true in debug core. If - // the user doesn't go through the UI, the new attribute won't be set. This means - // that existing Ant builders will try to run in the background (and likely conflict with - // each other) without migration. - config= ExternalToolMigration.migrateRunInBackground(config); - config.launch(ILaunchManager.RUN_MODE, monitor); - buildEnded(); - } - - /** - * Returns the build type being performed if the - * external tool is being run as a project builder. - * - * @return one of the IExternalToolConstants.BUILD_TYPE_* constants. - */ - public static String getBuildType() { - return buildType; - } - - /** - * Returns the project that is being built and has triggered the current external - * tool builder. null is returned if no build is currently occurring. - * - * @return project being built or null. - */ - public static IProject getBuildProject() { - return buildProject; - } - - /** - * Returns the IResourceDelta that is being built and has triggered the current external - * tool builder. null is returned if no build is currently occurring. - * - * @return resource delta for the build or null - */ - public static IResourceDelta getBuildDelta() { - return buildDelta; - } - - /** - * Stores the currently active build kind and build project when a build begins - * @param buildKind - */ - private void buildStarted(int buildKind) { - switch (buildKind) { - case IncrementalProjectBuilder.INCREMENTAL_BUILD : - buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL; - buildDelta = getDelta(getProject()); - break; - case IncrementalProjectBuilder.FULL_BUILD : - buildType = IExternalToolConstants.BUILD_TYPE_FULL; - break; - case IncrementalProjectBuilder.AUTO_BUILD : - buildType = IExternalToolConstants.BUILD_TYPE_AUTO; - buildDelta = getDelta(getProject()); - break; - case IncrementalProjectBuilder.CLEAN_BUILD : - buildType = IExternalToolConstants.BUILD_TYPE_CLEAN; - break; - default : - buildType = IExternalToolConstants.BUILD_TYPE_NONE; - break; - } - buildProject= getProject(); - } - - /** - * Clears the current build kind, build project and build delta when a build finishes. - */ - private void buildEnded() { - buildType= IExternalToolConstants.BUILD_TYPE_NONE; - buildProject= null; - buildDelta= null; - } - - private boolean buildScopeIndicatesBuild(IResource[] resources) { - for (int i = 0; i < resources.length; i++) { - IResourceDelta delta = getDelta(resources[i].getProject()); - if (delta == null) { - //project just added to the workspace..no previous build tree - return true; - } - IPath path= resources[i].getProjectRelativePath(); - IResourceDelta change= delta.findMember(path); - if (change != null) { - final boolean[] trueChange= new boolean[1]; - trueChange[0]= false; - try { - change.accept(new IgnoreTeamPrivateChanges(trueChange)); - } catch (CoreException e) { - ExternalToolsCore.log("Internal error resolving changed resources during build", e); //$NON-NLS-1$ - } - - return trueChange[0]; //filtered out team private changes - } - } - return false; - } - - protected void clean(IProgressMonitor monitor) throws CoreException { - ICommand command= getCommand(); - ILaunchConfiguration config= BuilderCoreUtils.configFromBuildCommandArgs(getProject(), command.getArguments(), new String[1]); - if (!configEnabled(config)) { - return; - } - - if ((!config.getAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, false))) { - //old behavior - super.clean(monitor); - return; - } - - launchBuild(IncrementalProjectBuilder.CLEAN_BUILD, config, monitor); - } -} \ No newline at end of file diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.java deleted file mode 100644 index 9e38b5041..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.java +++ /dev/null @@ -1,24 +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.core.externaltools.internal.model; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsModelMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.core.externaltools.internal.model.ExternalToolsModelMessages";//$NON-NLS-1$ - - public static String ExternalToolBuilder_Running__0_____1; - public static String ExternalToolBuilder_0; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ExternalToolsModelMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.properties b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.properties deleted file mode 100644 index 0f16fe71a..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolsModelMessages.properties +++ /dev/null @@ -1,13 +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 -############################################################################### - -ExternalToolBuilder_Running__0_____1=Running {0}... -ExternalToolBuilder_0=The builder launch configuration could not be found. diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java deleted file mode 100644 index a06bc8782..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java +++ /dev/null @@ -1,410 +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.core.externaltools.internal.registry; - - -import java.util.ArrayList; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.core.externaltools.internal.ExternalToolsCore; -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -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.core.ILaunchManager; -import org.eclipse.debug.core.RefreshUtil; - - -/** - * Responsible reading an old external tool format and creating - * and migrating it to create a new external tool. - */ -public final class ExternalToolMigration { - /** - * Structure to represent a variable definition within a - * source string. - */ - public static final class VariableDefinition { - /** - * Index in the source text where the variable started - * or -1 if no valid variable start tag - * identifier found. - */ - public int start = -1; - - /** - * Index in the source text of the character following - * the end of the variable or -1 if no - * valid variable end tag found. - */ - public int end = -1; - - /** - * The variable's name found in the source text, or - * null if no valid variable found. - */ - public String name = null; - - /** - * The variable's argument found in the source text, or - * null if no valid variable found or if - * the variable did not specify an argument - */ - public String argument = null; - - /** - * Create an initialized variable definition. - */ - private VariableDefinition() { - super(); - } - } - - /** - * Variable tag indentifiers - */ - private static final String VAR_TAG_START = "${"; //$NON-NLS-1$ - private static final String VAR_TAG_END = "}"; //$NON-NLS-1$ - private static final String VAR_TAG_SEP = ":"; //$NON-NLS-1$ - - /** - * External tool type for Ant build files (value antBuildType). - */ - public static final String TOOL_TYPE_ANT_BUILD = "antBuildType"; //$NON-NLS-1$; - /** - * Ant builder launch configuration type identifier. Ant project builders - * are of this type. - */ - public static final String ID_ANT_BUILDER_LAUNCH_CONFIGURATION_TYPE = "org.eclipse.ant.AntBuilderLaunchConfigurationType"; //$NON-NLS-1$ - - public static final String RUN_TARGETS_ATTRIBUTE = TOOL_TYPE_ANT_BUILD + ".runTargets"; //$NON-NLS-1$; - - /** - * String attribute indicating the Ant targets to execute. Default value is - * null which indicates that the default target is to be - * executed. Format is a comma separated listing of targets. - * NOTE: This value is copied here from org.eclipse.ant.ui.internal.IAntLaunchConfigurationConstants. - * Ant no longer resides in External Tools and this plug-in. This value is kept here only - * for migration. - */ - public static final String ATTR_ANT_TARGETS = IExternalToolConstants.UI_PLUGIN_ID + ".ATTR_ANT_TARGETS"; //$NON-NLS-1$ - - /* - * 2.0 External Tool Tags - */ - public static final String TAG_TOOL_TYPE = "!{tool_type}"; //$NON-NLS-1$ - public static final String TAG_TOOL_NAME = "!{tool_name}"; //$NON-NLS-1$ - public static final String TAG_TOOL_LOCATION = "!{tool_loc}"; //$NON-NLS-1$ - public static final String TAG_TOOL_ARGUMENTS = "!{tool_args}"; //$NON-NLS-1$ - public static final String TAG_TOOL_DIRECTORY = "!{tool_dir}"; //$NON-NLS-1$ - public static final String TAG_TOOL_REFRESH = "!{tool_refresh}"; //$NON-NLS-1$ - public static final String TAG_TOOL_SHOW_LOG = "!{tool_show_log}"; //$NON-NLS-1$ - public static final String TAG_TOOL_BUILD_TYPES = "!{tool_build_types}"; //$NON-NLS-1$ - public static final String TAG_TOOL_BLOCK = "!{tool_block}"; //$NON-NLS-1$ - - // Known kind of tools - private static final String TOOL_TYPE_ANT = "org.eclipse.ui.externaltools.type.ant"; //$NON-NLS-1$ - private static final String TOOL_TYPE_PROGRAM = "org.eclipse.ui.externaltools.type.program"; //$NON-NLS-1$ - - /* - * 2.1 External Tool Keys - */ - public static final String TAG_TYPE = "type"; //$NON-NLS-1$ - public static final String TAG_NAME = "name"; //$NON-NLS-1$ - public static final String TAG_LOCATION = "location"; //$NON-NLS-1$ - public static final String TAG_WORK_DIR = "workDirectory"; //$NON-NLS-1$ - public static final String TAG_CAPTURE_OUTPUT = "captureOutput"; //$NON-NLS-1$ - public static final String TAG_SHOW_CONSOLE = "showConsole"; //$NON-NLS-1$ - public static final String TAG_RUN_BKGRND = "runInBackground"; //$NON-NLS-1$ - public static final String TAG_PROMPT_ARGS = "promptForArguments"; //$NON-NLS-1$ - public static final String TAG_ARGS = "arguments"; //$NON-NLS-1$ - public static final String TAG_REFRESH_SCOPE = "refreshScope"; //$NON-NLS-1$ - public static final String TAG_REFRESH_RECURSIVE = "refreshRecursive"; //$NON-NLS-1$ - public static final String TAG_RUN_BUILD_KINDS = "runForBuildKinds"; //$NON-NLS-1$ - public static final String TAG_EXTRA_ATTR = "extraAttribute"; //$NON-NLS-1$ - public static final String TAG_VERSION = "version"; //$NON-NLS-1$ - - private static final String EXTRA_ATTR_SEPARATOR = "="; //$NON-NLS-1$ - - private static final String VERSION_21 = "2.1"; //$NON-NLS-1$; - - private static final String TRUE = "true"; //$NON-NLS-1$ - private static final String FALSE = "false"; //$NON-NLS-1$ - - /** - * Allows no instances. - */ - private ExternalToolMigration() { - super(); - } - - /** - * Returns a launch configuration working copy from the argument map or - * null if the given map cannot be interpreted as a 2.0 or 2.1 - * branch external tool. The returned working copy will be unsaved and its - * location will be set to the metadata area. - */ - public static ILaunchConfigurationWorkingCopy configFromArgumentMap(Map args) { - String version = (String) args.get(TAG_VERSION); - if (VERSION_21.equals(version)) { - return configFrom21ArgumentMap(args); - } - return configFrom20ArgumentMap(args); - } - - public static ILaunchConfigurationWorkingCopy configFrom21ArgumentMap(Map commandArgs) { - String name = (String) commandArgs.get(TAG_NAME); - String type = (String) commandArgs.get(TAG_TYPE); - - ILaunchConfigurationWorkingCopy config = newConfig(type, name); - if (config == null) { - return null; - } - - config.setAttribute(IExternalToolConstants.ATTR_LOCATION, (String) commandArgs.get(TAG_LOCATION)); - config.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) commandArgs.get(TAG_WORK_DIR)); - config.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, TRUE.equals(commandArgs.get(TAG_CAPTURE_OUTPUT))); - config.setAttribute(IExternalToolConstants.ATTR_SHOW_CONSOLE, TRUE.equals(commandArgs.get(TAG_SHOW_CONSOLE))); - config.setAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, TRUE.equals(commandArgs.get(TAG_RUN_BKGRND))); - config.setAttribute(IExternalToolConstants.ATTR_PROMPT_FOR_ARGUMENTS, TRUE.equals(commandArgs.get(TAG_PROMPT_ARGS))); - config.setAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, (String) commandArgs.get(TAG_REFRESH_SCOPE)); - config.setAttribute(RefreshUtil.ATTR_REFRESH_RECURSIVE, TRUE.equals(commandArgs.get(TAG_REFRESH_RECURSIVE))); - - config.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, (String) commandArgs.get(TAG_RUN_BUILD_KINDS)); - - String args = (String) commandArgs.get(TAG_ARGS); - if (args != null) { - config.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, args); - } - - String extraAttributes = (String) commandArgs.get(TAG_EXTRA_ATTR); - if (extraAttributes != null) { - StringTokenizer tokenizer = new StringTokenizer(extraAttributes, EXTRA_ATTR_SEPARATOR); - while (tokenizer.hasMoreTokens()) { - String key = tokenizer.nextToken(); - if (!tokenizer.hasMoreTokens()) - break; - String value = tokenizer.nextToken(); - if (key.equals(RUN_TARGETS_ATTRIBUTE)) { - // 2.1 implementation only defined 1 "extra attribute" - config.setAttribute(ATTR_ANT_TARGETS, value); - } - } - } - return config; - } - - /** - * Creates an external tool from the map. - */ - public static ILaunchConfigurationWorkingCopy configFrom20ArgumentMap(Map args) { - // Update the type... - String type = (String) args.get(TAG_TOOL_TYPE); - if (TOOL_TYPE_ANT.equals(type)) { - type = TOOL_TYPE_ANT_BUILD; - } else if (TOOL_TYPE_PROGRAM.equals(type)){ - type = IExternalToolConstants.TOOL_TYPE_PROGRAM; - } else { - return null; - } - - String name = (String) args.get(TAG_TOOL_NAME); - - ILaunchConfigurationWorkingCopy config = newConfig(type, name); - if (config == null) { - return null; - } - - // Update the location... - String location = (String) args.get(TAG_TOOL_LOCATION); - config.setAttribute(IExternalToolConstants.ATTR_LOCATION, location); - - // Update the refresh scope... - String refresh = (String) args.get(TAG_TOOL_REFRESH); - if (refresh != null) { - VariableDefinition varDef = extractVariableDefinition(refresh, 0); - if ("none".equals(varDef.name)) { //$NON-NLS-1$ - refresh = null; - } - config.setAttribute(RefreshUtil.ATTR_REFRESH_SCOPE, refresh); - } - - // Update the arguments - String arguments = (String) args.get(TAG_TOOL_ARGUMENTS); - if (type.equals(TOOL_TYPE_ANT_BUILD)) { - String targetNames = null; - if (arguments != null) { - int start = 0; - ArrayList targets = new ArrayList(); - StringBuffer buffer = new StringBuffer(); - VariableDefinition varDef = extractVariableDefinition(arguments, start); - while (varDef.end != -1) { - if ("ant_target".equals(varDef.name) && varDef.argument != null) { //$NON-NLS-1$ - targets.add(varDef.argument); - buffer.append(arguments.substring(start, varDef.start)); - } else { - buffer.append(arguments.substring(start, varDef.end)); - } - start = varDef.end; - varDef = extractVariableDefinition(arguments, start); - } - buffer.append(arguments.substring(start, arguments.length())); - arguments = buffer.toString(); - - buffer.setLength(0); - for (int i = 0; i < targets.size(); i++) { - String target = (String) targets.get(i); - if (target != null && target.length() > 0) { - buffer.append(target); - buffer.append(","); //$NON-NLS-1$ - } - } - targetNames = buffer.toString(); - } - if (targetNames != null && targetNames.length() > 0) { - config.setAttribute(ATTR_ANT_TARGETS, targetNames); - } - } - config.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments); - - // Collect the rest of the information - config.setAttribute(IExternalToolConstants.ATTR_SHOW_CONSOLE, TRUE.equals(args.get(TAG_TOOL_SHOW_LOG))); - config.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, TRUE.equals(args.get(TAG_TOOL_SHOW_LOG))); - config.setAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, FALSE.equals(args.get(TAG_TOOL_BLOCK))); - String buildKinds= (String) args.get(TAG_TOOL_BUILD_TYPES); - if (buildKinds != null) { - buildKinds= buildKinds.replace(';', ','); // Replace the old separator with the new - } - config.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buildKinds); - config.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String) args.get(TAG_TOOL_DIRECTORY)); - return config; - } - - /** - * Returns a new working copy with the given external tool name and external - * tool type or null if no config could be created. - */ - private static ILaunchConfigurationWorkingCopy newConfig(String type, String name) { - if (type == null || name == null) { - return null; - } - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType configType; - if (TOOL_TYPE_ANT_BUILD.equals(type)) { - configType = manager.getLaunchConfigurationType(ID_ANT_BUILDER_LAUNCH_CONFIGURATION_TYPE); - } else if (IExternalToolConstants.TOOL_TYPE_PROGRAM.equals(type)) { - configType = manager.getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE); - } else { - return null; - } - try { - if (configType != null) { - return configType.newInstance(null, name); - } - } catch (CoreException e) { - ExternalToolsCore.log(e); - } - return null; - } - - /** - * Returns the tool name extracted from the given command argument map. - * Extraction is attempted using 2.0 and 2.1 external tool formats. - */ - public static String getNameFromCommandArgs(Map commandArgs) { - String name= (String) commandArgs.get(TAG_NAME); - if (name == null) { - name= (String) commandArgs.get(TAG_TOOL_NAME); - } - return name; - } - - /** - * Migrate the old RUN_IN_BACKGROUND launch config attribute to the new - * LAUNCH_IN_BACKGROUND attribute provided by the debug ui plugin. - * - * @param config the config to migrate - * @return the migrated config - */ - public static ILaunchConfiguration migrateRunInBackground(ILaunchConfiguration config) { - String noValueFlag= "NoValue"; //$NON-NLS-1$ - String attr= null; - try { - attr = config.getAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, noValueFlag); - } catch (CoreException e) { - // Exception will occur if the attribute is already set because the attribute is actually a boolean. - // No migration necessary. - return config; - } - if (noValueFlag.equals(attr)) { - //the old constant - String ATTR_RUN_IN_BACKGROUND= IExternalToolConstants.UI_PLUGIN_ID + ".ATTR_RUN_IN_BACKGROUND"; //$NON-NLS-1$ - boolean runInBackground= false; - try { - runInBackground = config.getAttribute(ATTR_RUN_IN_BACKGROUND, runInBackground); - } catch (CoreException e) { - ExternalToolsCore.log(ExternalToolsMigrationMessages.ExternalToolMigration_37, e); - } - try { - ILaunchConfigurationWorkingCopy workingCopy= config.getWorkingCopy(); - workingCopy.setAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, runInBackground); - config= workingCopy.doSave(); - } catch (CoreException e) { - ExternalToolsCore.log(ExternalToolsMigrationMessages.ExternalToolMigration_38, e); - } - } - return config; - } - - /** - * Extracts a variable name and argument from the given string. - * - * @param text the source text to parse for a variable tag - * @param start the index in the string to start the search - * @return the variable definition - */ - public static VariableDefinition extractVariableDefinition(String text, int start) { - VariableDefinition varDef = new VariableDefinition(); - - varDef.start = text.indexOf(VAR_TAG_START, start); - if (varDef.start < 0){ - return varDef; - } - start = varDef.start + VAR_TAG_START.length(); - - int end = text.indexOf(VAR_TAG_END, start); - if (end < 0) { - return varDef; - } - varDef.end = end + VAR_TAG_END.length(); - if (end == start) { - return varDef; - } - - int mid = text.indexOf(VAR_TAG_SEP, start); - if (mid < 0 || mid > end) { - varDef.name = text.substring(start, end); - } else { - if (mid > start) { - varDef.name = text.substring(start, mid); - } - mid = mid + VAR_TAG_SEP.length(); - if (mid < end) { - varDef.argument = text.substring(mid, end); - } - } - - return varDef; - } -} diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.java deleted file mode 100644 index 3e5fa46f7..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.java +++ /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 - Initial API and implementation - **********************************************************************/ -package org.eclipse.core.externaltools.internal.registry; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsMigrationMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.core.externaltools.internal.registry.launchConfigurations.ExternalToolsUIMessages";//$NON-NLS-1$ - - public static String ExternalToolMigration_37; - public static String ExternalToolMigration_38; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, - ExternalToolsMigrationMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.properties b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.properties deleted file mode 100644 index 1e18e673e..000000000 --- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolsMigrationMessages.properties +++ /dev/null @@ -1,13 +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 -############################################################################### - -ExternalToolMigration_37=An exception occurred accessing external tool\'s \"run in background\" attribute -ExternalToolMigration_38=An exception occurred attempting to migrate external tool\'s \"run in background\" attribute diff --git a/org.eclipse.core.variables/.classpath b/org.eclipse.core.variables/.classpath deleted file mode 100644 index ce7393340..000000000 --- a/org.eclipse.core.variables/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.core.variables/.cvsignore b/org.eclipse.core.variables/.cvsignore deleted file mode 100644 index 693869726..000000000 --- a/org.eclipse.core.variables/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -bin -doc diff --git a/org.eclipse.core.variables/.project b/org.eclipse.core.variables/.project deleted file mode 100644 index 03df26fb2..000000000 --- a/org.eclipse.core.variables/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.core.variables - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 05664ee2f..000000000 --- a/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,96 +0,0 @@ -#Thu Feb 26 08:16:51 CST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=disabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.core.variables/.settings/org.eclipse.pde.prefs b/org.eclipse.core.variables/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 7eebeb8c9..000000000 --- a/org.eclipse.core.variables/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,17 +0,0 @@ -#Tue Jan 30 11:38:48 CST 2007 -compilers.incompatible-environment=1 -compilers.p.build=1 -compilers.p.deprecated=1 -compilers.p.illegal-att-value=0 -compilers.p.missing-packages=0 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=1 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=1 -compilers.p.unknown-element=0 -compilers.p.unknown-resource=1 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.p.unused-element-or-attribute=1 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.core.variables/META-INF/MANIFEST.MF b/org.eclipse.core.variables/META-INF/MANIFEST.MF deleted file mode 100644 index 906536ff5..000000000 --- a/org.eclipse.core.variables/META-INF/MANIFEST.MF +++ /dev/null @@ -1,13 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.core.variables; singleton:=true -Bundle-Version: 3.2.400.qualifier -Bundle-Activator: org.eclipse.core.variables.VariablesPlugin -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.core.internal.variables;x-internal:=true, - org.eclipse.core.variables -Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.3.0,4.0.0)" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/org.eclipse.core.variables/about.html b/org.eclipse.core.variables/about.html deleted file mode 100644 index 460233046..000000000 --- a/org.eclipse.core.variables/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 2, 2006

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.core.variables/build.properties b/org.eclipse.core.variables/build.properties deleted file mode 100644 index bcf8553e1..000000000 --- a/org.eclipse.core.variables/build.properties +++ /dev/null @@ -1,18 +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 -############################################################################### -bin.includes = plugin.xml,\ - plugin.properties,\ - .,\ - about.html,\ - META-INF/ -source.. = src/ -src.includes = about.html,\ - schema/ diff --git a/org.eclipse.core.variables/plugin.properties b/org.eclipse.core.variables/plugin.properties deleted file mode 100644 index 88108aaa6..000000000 --- a/org.eclipse.core.variables/plugin.properties +++ /dev/null @@ -1,16 +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 -############################################################################### - -pluginName=Core Variables -providerName=Eclipse.org -valueVariablesExtensionPointName=Value Variables -dynamicVariablesExtensionPointName=Dynamic Variables -eclipse_home.description=The location of the base installation for the running platform diff --git a/org.eclipse.core.variables/plugin.xml b/org.eclipse.core.variables/plugin.xml deleted file mode 100644 index 4e1456384..000000000 --- a/org.eclipse.core.variables/plugin.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - diff --git a/org.eclipse.core.variables/schema/dynamicVariables.exsd b/org.eclipse.core.variables/schema/dynamicVariables.exsd deleted file mode 100644 index 5168a891f..000000000 --- a/org.eclipse.core.variables/schema/dynamicVariables.exsd +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for defining dynamic variables used in string substitution. The value of a dynamic variable is resolved at the time a string substitution is performed, with an optional argument. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - specifies a unique name for this variable. - - - - - - - specifies a Java class which implements <code>org.eclipse.core.variables.IDynamicVariableResolver</code>, which is used to determine the value of the variable - - - - - - - - - - specifies a human-readable description of this variable - - - - - - - - - - Whether this variable supports an argument. When unspecified, the implied value is <code>true</code>. - - - - - - - - - - - - 3.0 - - - - - - - - - The following is a definition of a dynamic variable that resolves to the name of the selected resource: -<pre> - <extension point="org.eclipse.core.variables.dynamicVariables"> - <variable - name="resource_name" - expanderClass="com.example.ResourceNameExpander" - description="The name of the selected resource"> - </variable> - </extension> -</pre> - - - - - - - - - Value of the attribute <b>resolver</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.core.variables.IDynamicVariableResolver</b>. - - - - - - - - - Copyright (c) 2003, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.core.variables/schema/valueVariables.exsd b/org.eclipse.core.variables/schema/valueVariables.exsd deleted file mode 100644 index 7dd314c57..000000000 --- a/org.eclipse.core.variables/schema/valueVariables.exsd +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for defining variables used for string substitution. A value variable has a static value. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - specifies a unique name for this variable. - - - - - - - Specifies whether this variable is read only. When true, this variable's value will always be derived from the extension and cannot be edited by the user. When false, this variable's value will be initialized from any <code>initialValue</code> attribtue or initializer class, and can be modified by the user. Once a read-write variable is modified, it's value is persisted and overrides any value specified by an extension's <code>initialValue</code> or initializer class. When unspecified, the value of this attribute is <code>false</code>. This attribute was added in the 3.3 release. - - - - - - - specifies the initial value for this variable. When specified, an <code>initializerClass</code> attribute must not be specified. - - - - - - - specifies the fully qualified name of the Java class that implements <code>org.eclipse.core.variables.IValueVariableInitializer</code>. When specified, an <code>initialValue</code> attribute must not be specified. - - - - - - - - - - specifies a human-readable description of this variable. - - - - - - - - - - - - - - - 3.0 - - - - - - - - - The following is an example of a value variable contribution with an initial value: - -<p> -<pre> - <extension point="org.eclipse.core.variables.valueVariables"> - <variable - name="FOO_HOME" - initialValue="/usr/local/foo"> - </variable> - </extension> -</pre> -</p> - -In the example above, the specified variable is created with the initial value "/usr/local/foo". - - The following is an example of a value variable contribution with an initializer class: -<p> -<pre> - <extension point="org.eclipse.core.variables.valueVariables"> - <variable - name="FOO_HOME" - initializerClass="com.example.FooLocator"> - </variable> - </extension> -</pre> -</p> - -In the example above, the variable FOO_HOME is created and the class "com.example.FooLocator" will be -used to initialize the value the first time it's requested. - - - - - - - - - Value of the attribute <b>initializerClass</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.core.variables.IValueVariableInitializer</b>. - - - - - - - - - Copyright (c) 2003, 2006 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java deleted file mode 100644 index f53bf67e1..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.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.core.internal.variables; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.variables.IValueVariable; -import org.eclipse.core.variables.IValueVariableInitializer; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.osgi.util.NLS; - -/** - * Implementation of a value variable. - */ -public class ContributedValueVariable extends StringVariable implements IValueVariable { - - /** - * Variable value or null if none - */ - private String fValue; - - /** - * Whether this variable's value has been initialized - */ - private boolean fInitialized = false; - - /** - * Whether this variable is read only. If true, users cannot change the value. - */ - private boolean fReadOnly; - - /** - * Constructs a new value variable with the given name, description, read only - * property and associated configuration element. The value will be initialized - * from the configuration element the first time getValue() is called. - * - * @param name variable name - * @param description variable description or null - * @param readOnly whether the variable should be a read only variable - * @param configurationElement configuration element - */ - public ContributedValueVariable(String name, String description, boolean readOnly, IConfigurationElement configurationElement) { - super(name, description, configurationElement); - fReadOnly = readOnly; - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#setValue(java.lang.String) - */ - public void setValue(String value) { - if (!isReadOnly() || !isInitialized()){ - fValue = value; - setInitialized(true); - StringVariableManager.getDefault().notifyChanged(this); - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#getValue() - */ - public String getValue() { - if (!isInitialized()) { - initialize(); - } - return fValue; - } - - /** - * Initialize this variable's value from the configuration element. - */ - private void initialize() { - if (getConfigurationElement() != null) { - // check for a explicit value specified in plug-in XML - String value = getConfigurationElement().getAttribute("initialValue"); //$NON-NLS-1$ - if (value == null) { - // check for initializer - String className = getConfigurationElement().getAttribute("initializerClass"); //$NON-NLS-1$ - if (className != null) { - try { - Object object = getConfigurationElement().createExecutableExtension("initializerClass"); //$NON-NLS-1$ - if (object instanceof IValueVariableInitializer) { - IValueVariableInitializer initializer = (IValueVariableInitializer)object; - initializer.initialize(this); - } else { - VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0} - initializer must be an instance of IValueVariableInitializer.", new String[]{getName()}), null); //$NON-NLS-1$ - } - } catch (CoreException e) { - VariablesPlugin.logMessage(NLS.bind("Unable to initialize variable {0}",new String[]{getName()}), e); //$NON-NLS-1$ - } - } - } else { - setValue(value); - } - } - setInitialized(true); - } - - /** - * Returns whether this variable has been initialized with a value by one of: - * - * @return whether this variable has been initialized with a value - */ - protected boolean isInitialized() { - return fInitialized; - } - - /** - * Sets whether this variable has been initialized with a value. - * - * @param initialized whether this variable has been initialized - */ - protected void setInitialized(boolean initialized) { - fInitialized = initialized; - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#isReadOnly() - */ - public boolean isReadOnly() { - return fReadOnly; - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#isContributed() - */ - public boolean isContributed() { - return getConfigurationElement() != null; - } - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java deleted file mode 100644 index f2d48d810..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java +++ /dev/null @@ -1,76 +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.core.internal.variables; - -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.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.osgi.util.NLS; - -/** - * Dynamic variable - */ -public class DynamicVariable extends StringVariable implements IDynamicVariable { - - /** - * Resolver, or null until needed - */ - private IDynamicVariableResolver fResolver; - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IContextVariable#getValue(java.lang.String) - */ - public String getValue(String argument) throws CoreException { - if (!supportsArgument()) { - // check for an argument - not supported - if (argument != null && argument.length() > 0) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.DynamicVariable_0, new String[]{argument, getName()}), null)); - } - } - if (fResolver == null) { - String name = getConfigurationElement().getAttribute("resolver"); //$NON-NLS-1$ - if (name == null) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable {0} must specify a resolver.",new String[]{getName()}), null)); //$NON-NLS-1$ - } - Object object = getConfigurationElement().createExecutableExtension("resolver"); //$NON-NLS-1$ - if (object instanceof IDynamicVariableResolver) { - fResolver = (IDynamicVariableResolver)object; - } else { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind("Contributed context variable resolver for {0} must be an instance of IContextVariableResolver.",new String[]{getName()}), null)); //$NON-NLS-1$ - } - } - return fResolver.resolveValue(this, argument); - } - - /** - * Constructs a new context variable. - * - * @param name variable name - * @param description variable description or null - * @param configurationElement configuration element - */ - public DynamicVariable(String name, String description, IConfigurationElement configurationElement) { - super(name, description, configurationElement); - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IDynamicVariable#supportsArgument() - */ - public boolean supportsArgument() { - String arg = getConfigurationElement().getAttribute("supportsArgument"); //$NON-NLS-1$ - return arg == null || Boolean.valueOf(arg).booleanValue(); - } - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java deleted file mode 100644 index ac5e100d8..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java +++ /dev/null @@ -1,55 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.core.internal.variables; - -import java.net.URL; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; -import org.eclipse.osgi.service.datalocation.Location; - -/** - * Resolver for ${eclipse_home} - * - * @since 3.2 - */ -public class EclipseHomeVariableResolver implements IDynamicVariableResolver { - - public String resolveValue(IDynamicVariable variable, String argument) throws CoreException { - Location installLocation = Platform.getInstallLocation(); - if (installLocation != null) { - URL url = installLocation.getURL(); - if (url != null) { - - // Try to convert the URL to an OS string, to be consistent with - // how other variables, like ${workspace_loc} resolve. See - // ResourceResolver.translateToValue(). [bugzilla 263535] - String file = url.getFile(); - IPath path = Path.fromOSString(file); - String osstr = path.toOSString(); - if (osstr.length() != 0) { - return osstr; - } - - if (file.length() != 0) { - return file; - } - } - } - return null; - } - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java deleted file mode 100644 index 94bd5d7ea..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java +++ /dev/null @@ -1,291 +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.core.internal.variables; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Stack; -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.IStringVariableManager; -import org.eclipse.core.variables.IValueVariable; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.osgi.util.NLS; - -/** - * Performs string substitution for context and value variables. - */ -public class StringSubstitutionEngine { - - // delimiters - private static final String VARIABLE_START = "${"; //$NON-NLS-1$ - private static final char VARIABLE_END = '}'; - private static final char VARIABLE_ARG = ':'; - // parsing states - private static final int SCAN_FOR_START = 0; - private static final int SCAN_FOR_END = 1; - - /** - * Resulting string - */ - private StringBuffer fResult; - - /** - * Whether substitutions were performed - */ - private boolean fSubs; - - /** - * Stack of variables to resolve - */ - private Stack fStack; - - class VariableReference { - - // the text inside the variable reference - private StringBuffer fText; - - public VariableReference() { - fText = new StringBuffer(); - } - - public void append(String text) { - fText.append(text); - } - - public String getText() { - return fText.toString(); - } - - } - - /** - * Performs recursive string substitution and returns the resulting string. - * - * @param expression expression to resolve - * @param reportUndefinedVariables whether to report undefined variables as an error - * @param manager registry of variables - * @return the resulting string with all variables recursively - * substituted - * @exception CoreException if unable to resolve a referenced variable or if a cycle exists - * in referenced variables - */ - public String performStringSubstitution(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException { - substitute(expression, reportUndefinedVariables, resolveVariables, manager); - List resolvedVariableSets = new ArrayList(); - while (fSubs) { - HashSet resolved = substitute(fResult.toString(), reportUndefinedVariables, true, manager); - - for(int i=resolvedVariableSets.size()-1; i>=0; i--) { - - HashSet prevSet = (HashSet)resolvedVariableSets.get(i); - - if (prevSet.equals(resolved)) { - HashSet conflictingSet = new HashSet(); - for (; i= 0) { - int length = start - pos; - // copy non-variable text to the result - if (length > 0) { - fResult.append(expression.substring(pos, start)); - } - pos = start + 2; - state = SCAN_FOR_END; - - fStack.push(new VariableReference()); - } else { - // done - no more variables - fResult.append(expression.substring(pos)); - pos = expression.length(); - } - break; - case SCAN_FOR_END: - // be careful of nested variables - start = expression.indexOf(VARIABLE_START, pos); - int end = expression.indexOf(VARIABLE_END, pos); - if (end < 0) { - // variables are not completed - VariableReference tos = (VariableReference)fStack.peek(); - tos.append(expression.substring(pos)); - pos = expression.length(); - } else { - if (start >= 0 && start < end) { - // start of a nested variable - int length = start - pos; - if (length > 0) { - VariableReference tos = (VariableReference)fStack.peek(); - tos.append(expression.substring(pos, start)); - } - pos = start + 2; - fStack.push(new VariableReference()); - } else { - // end of variable reference - VariableReference tos = (VariableReference)fStack.pop(); - String substring = expression.substring(pos, end); - tos.append(substring); - resolvedVariables.add(substring); - - pos = end + 1; - String value= resolve(tos, reportUndefinedVariables, resolveVariables, manager); - if (value == null) { - value = ""; //$NON-NLS-1$ - } - if (fStack.isEmpty()) { - // append to result - fResult.append(value); - state = SCAN_FOR_START; - } else { - // append to previous variable - tos = (VariableReference)fStack.peek(); - tos.append(value); - } - } - } - break; - } - } - // process incomplete variable references - while (!fStack.isEmpty()) { - VariableReference tos = (VariableReference)fStack.pop(); - if (fStack.isEmpty()) { - fResult.append(VARIABLE_START); - fResult.append(tos.getText()); - } else { - VariableReference var = (VariableReference)fStack.peek(); - var.append(VARIABLE_START); - var.append(tos.getText()); - } - } - - - return resolvedVariables; - } - - /** - * Resolve and return the value of the given variable reference, - * possibly null. - * - * @param var - * @param reportUndefinedVariables whether to report undefined variables as - * an error - * @param resolveVariables whether to resolve the variables value or just to validate that this variable is valid - * @param manager variable registry - * @return variable value, possibly null - * @exception CoreException if unable to resolve a value - */ - private String resolve(VariableReference var, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException { - String text = var.getText(); - int pos = text.indexOf(VARIABLE_ARG); - String name = null; - String arg = null; - if (pos > 0) { - name = text.substring(0, pos); - pos++; - if (pos < text.length()) { - arg = text.substring(pos); - } - } else { - name = text; - } - IValueVariable valueVariable = manager.getValueVariable(name); - if (valueVariable == null) { - IDynamicVariable dynamicVariable = manager.getDynamicVariable(name); - if (dynamicVariable == null) { - // no variables with the given name - if (reportUndefinedVariables) { - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_3, new String[]{name}), null)); - } - // leave as is - return getOriginalVarText(var); - } - - if (resolveVariables) { - fSubs = true; - return dynamicVariable.getValue(arg); - } - //leave as is - return getOriginalVarText(var); - } - - if (arg == null) { - if (resolveVariables) { - fSubs = true; - return valueVariable.getValue(); - } - //leave as is - return getOriginalVarText(var); - } - // error - an argument specified for a value variable - throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{valueVariable.getName()}), null)); - } - - private String getOriginalVarText(VariableReference var) { - StringBuffer res = new StringBuffer(var.getText()); - res.insert(0, VARIABLE_START); - res.append(VARIABLE_END); - return res.toString(); - } -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java deleted file mode 100644 index 498b411b5..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.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.core.internal.variables; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.variables.IStringVariable; - -/** - * Common implementation of context and value variables - */ -public abstract class StringVariable implements IStringVariable { - - /** - * Variable name - */ - private String fName; - - /** - * Variable description, or null - */ - private String fDescription; - - /** - * Configuration element associated with this variable, or null - */ - private IConfigurationElement fConfigurationElement; - - /** - * Constructs a new variable with the given name, description and configuration element. - * - * @param name variable name - * @param description variable description, or null - * @param configurationElement configuration element or null - */ - public StringVariable(String name, String description, IConfigurationElement configurationElement) { - fName = name; - fDescription = description; - fConfigurationElement = configurationElement; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getName() - */ - public String getName() { - return fName; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getDescription() - */ - public String getDescription() { - return fDescription; - } - - /** - * Returns the configuration element associated with this variable, or null - * if none. - * - * @return configuration element or null - */ - protected IConfigurationElement getConfigurationElement() { - return fConfigurationElement; - } - - /** - * @see IValueVariable#setDescription(String) - * @param description - */ - public void setDescription(String description) { - fDescription = description; - } - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java deleted file mode 100644 index e015008bd..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java +++ /dev/null @@ -1,607 +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 - * Stefan Liebig - Bug 242685 StringVariableManager - Variable contributions may silently override existing variables - *******************************************************************************/ -package org.eclipse.core.internal.variables; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; -import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IStringVariable; -import org.eclipse.core.variables.IStringVariableManager; -import org.eclipse.core.variables.IValueVariable; -import org.eclipse.core.variables.IValueVariableListener; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.osgi.util.NLS; -import org.osgi.service.prefs.BackingStoreException; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.xml.sax.helpers.DefaultHandler; - -/** - * Singleton string variable manager. - */ -public class StringVariableManager implements IStringVariableManager, IPreferenceChangeListener { - - /** - * Dynamic variables - maps variable names to variables. - */ - private Map fDynamicVariables; - - /** - * Value variables - maps variable names to variables. - */ - private Map fValueVariables; - - /** - * Variable listeners - */ - private ListenerList fListeners; - - // notifications - private static final int ADDED = 0; - private static final int CHANGED = 1; - private static final int REMOVED = 2; - - /** - * Singleton variable manager. - */ - private static StringVariableManager fgManager; - - // true during internal updates indicates that change notification - // should be suppressed/ignored. - private boolean fInternalChange = false; - - // Variable extension point constants - private static final String ATTR_NAME= "name"; //$NON-NLS-1$ - private static final String ATTR_DESCRIPTION="description"; //$NON-NLS-1$ - private static final String ATTR_READ_ONLY="readOnly"; //$NON-NLS-1$ - // Persisted variable XML constants - private static final String VALUE_VARIABLES_TAG= "valueVariables"; //$NON-NLS-1$ - private static final String VALUE_VARIABLE_TAG= "valueVariable"; //$NON-NLS-1$ - private static final String NAME_TAG= "name"; //$NON-NLS-1$ - private static final String VALUE_TAG= "value"; //$NON-NLS-1$ - private static final String DESCRIPTION_TAG="description"; //$NON-NLS-1$ - private static final String READ_ONLY_TAG="readOnly"; //$NON-NLS-1$ - // XML values - private static final String TRUE_VALUE= "true"; //$NON-NLS-1$ - private static final String FALSE_VALUE= "false"; //$NON-NLS-1$ - // preference store key for value variables - private static final String PREF_VALUE_VARIABLES= VariablesPlugin.getUniqueIdentifier() + ".valueVariables"; //$NON-NLS-1$ - - /** - * Notifies a string variable listener in a safe runnable to handle - * exceptions. - */ - class StringVariableNotifier implements ISafeRunnable { - - private IValueVariableListener fListener; - private int fType; - private IValueVariable[] fVariables; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, "An exception occurred during string variable change notification", exception); //$NON-NLS-1$ - VariablesPlugin.log(status); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.variablesAdded(fVariables); - break; - case REMOVED: - fListener.variablesRemoved(fVariables); - break; - case CHANGED: - fListener.variablesChanged(fVariables); - break; - } - } - - /** - * Notifies the given listener of the add/change/remove - * - * @param listener the listener to notify - * @param launch the launch that has changed - * @param update the type of change - */ - public void notify(IValueVariable[] variables, int update) { - fVariables = variables; - fType = update; - Object[] copiedListeners= fListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IValueVariableListener)copiedListeners[i]; - SafeRunner.run(this); - } - fVariables = null; - fListener = null; - // persist variables whenever there is an add/change/remove - storeValueVariables(); - } - } - - /** - * Returns a new notifier. - * - * @return a new notifier - */ - private StringVariableNotifier getNotifier() { - return new StringVariableNotifier(); - } - - /** - * Returns the default string variable manager - * - * @return string variable manager - */ - public static StringVariableManager getDefault() { - if (fgManager == null) { - fgManager = new StringVariableManager(); - } - return fgManager; - } - - /** - * Constructs a new string variable manager. - */ - private StringVariableManager() { - fListeners = new ListenerList(); - } - - /** - * Load contributed variables and persisted variables - */ - private synchronized void initialize() { - if (fDynamicVariables == null) { - fInternalChange = true; - fDynamicVariables = new HashMap(5); - fValueVariables = new HashMap(5); - loadContributedValueVariables(); - loadPersistedValueVariables(); - loadDynamicVariables(); - new InstanceScope().getNode(VariablesPlugin.PI_CORE_VARIABLES).addPreferenceChangeListener(this); - fInternalChange = false; - } - } - - /** - * Loads contributed dynamic variables - */ - private void loadDynamicVariables() { - IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(VariablesPlugin.PI_CORE_VARIABLES, EXTENSION_POINT_DYNAMIC_VARIABLES); - 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) { - VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$ - continue; - } - String description= element.getAttribute(ATTR_DESCRIPTION); - DynamicVariable variable= new DynamicVariable(name, description, element); - Object old = fDynamicVariables.put(variable.getName(), variable); - if (old != null) { - DynamicVariable oldVariable = (DynamicVariable)old; - VariablesPlugin.logMessage(NLS.bind("Dynamic variable extension from bundle ''{0}'' overrides existing extension variable ''{1}'' from bundle ''{2}''", //$NON-NLS-1$ - new String[] {element.getDeclaringExtension().getContributor().getName(),oldVariable.getName(), - oldVariable.getConfigurationElement().getDeclaringExtension().getContributor().getName()}), null); - } - } - } - - /** - * Loads contributed value variables. This is done before loading persisted values. - */ - private void loadContributedValueVariables() { - IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(VariablesPlugin.PI_CORE_VARIABLES, EXTENSION_POINT_VALUE_VARIABLES); - 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) { - VariablesPlugin.logMessage(NLS.bind("Variable extension missing required 'name' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()}), null); //$NON-NLS-1$ - continue; - } - String description= element.getAttribute(ATTR_DESCRIPTION); - boolean isReadOnly = TRUE_VALUE.equals(element.getAttribute(ATTR_READ_ONLY)); - - IValueVariable variable = new ContributedValueVariable(name, description, isReadOnly, element); - Object old = fValueVariables.put(name, variable); - if (old != null) { - StringVariable oldVariable = (StringVariable)old; - VariablesPlugin.logMessage(NLS.bind("Contributed variable extension from bundle ''{0}'' overrides existing extension variable ''{1}'' from bundle ''{2}''", //$NON-NLS-1$ - new String[] {element.getDeclaringExtension().getContributor().getName(),oldVariable.getName(), - oldVariable.getConfigurationElement().getDeclaringExtension().getContributor().getName()}), null); - } - } - } - - /** - * Loads persisted value variables from the preference store. This is done after - * loading value variables from the extension point. If a persisted variable has the - * same name as a extension contributed variable the variable's value will be set to - * the persisted value unless either a) The persisted value is null, or - * b) the variable is read-only. - */ - private void loadPersistedValueVariables() { - String variablesString = Platform.getPreferencesService().getString(VariablesPlugin.PI_CORE_VARIABLES, PREF_VALUE_VARIABLES, "", null); //$NON-NLS-1$ - if (variablesString.length() == 0) { - return; - } - Element root= null; - try { - ByteArrayInputStream stream = new ByteArrayInputStream(variablesString.getBytes("UTF-8")); //$NON-NLS-1$ - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - parser.setErrorHandler(new DefaultHandler()); - root = parser.parse(stream).getDocumentElement(); - } catch (Exception e) { - VariablesPlugin.logMessage("An exception occurred while loading persisted value variables.", e); //$NON-NLS-1$ - return; - } - if (!root.getNodeName().equals(VALUE_VARIABLES_TAG)) { - VariablesPlugin.logMessage("Invalid format encountered while loading persisted value variables.", null); //$NON-NLS-1$ - return; - } - NodeList list= root.getChildNodes(); - 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(VALUE_VARIABLE_TAG)) { - VariablesPlugin.logMessage(NLS.bind("Invalid XML element encountered while loading value variables: {0}", new String[] {node.getNodeName()}), null); //$NON-NLS-1$ - continue; - } - String name= element.getAttribute(NAME_TAG); - if (name.length() > 0) { - String value= element.getAttribute(VALUE_TAG); - String description= element.getAttribute(DESCRIPTION_TAG); - boolean readOnly= TRUE_VALUE.equals(element.getAttribute(READ_ONLY_TAG)); - - IValueVariable existing = getValueVariable(name); - if (existing == null){ - ValueVariable variable = new ValueVariable(name, description, readOnly, value); - fValueVariables.put(name, variable); - } else if (!existing.isReadOnly() && value != null){ - existing.setValue(value); - } - } else { - VariablesPlugin.logMessage("Invalid variable entry encountered while loading value variables. Variable name is null.", null); //$NON-NLS-1$ - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getVariables() - */ - public synchronized IStringVariable[] getVariables() { - initialize(); - List list = new ArrayList(fDynamicVariables.size() + fValueVariables.size()); - list.addAll(fDynamicVariables.values()); - list.addAll(fValueVariables.values()); - return (IStringVariable[]) list.toArray(new IStringVariable[list.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getValueVariables() - */ - public synchronized IValueVariable[] getValueVariables() { - initialize(); - return (IValueVariable[]) fValueVariables.values().toArray(new IValueVariable[fValueVariables.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getDynamicVariables() - */ - public synchronized IDynamicVariable[] getDynamicVariables() { - initialize(); - return (IDynamicVariable[]) fDynamicVariables.values().toArray(new IDynamicVariable[fDynamicVariables.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#performStringSubstitution(java.lang.String) - */ - public String performStringSubstitution(String expression) throws CoreException { - return performStringSubstitution(expression, true); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#newValueVariable(java.lang.String, java.lang.String) - */ - public IValueVariable newValueVariable(String name, String description) { - return newValueVariable(name, description, false, null); - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IStringVariableManager#newValueVariable(java.lang.String, java.lang.String, boolean, java.lang.String) - */ - public IValueVariable newValueVariable(String name, String description, boolean readOnly, String value) { - return new ValueVariable(name, description, readOnly, value); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#addVariables(org.eclipse.debug.internal.core.stringsubstitution.IValueVariable[]) - */ - public synchronized void addVariables(IValueVariable[] variables) throws CoreException { - initialize(); - MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.StringVariableManager_26, null); - for (int i = 0; i < variables.length; i++) { - IValueVariable variable = variables[i]; - if (getValueVariable(variable.getName()) != null) { - status.add(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, NLS.bind(VariablesMessages.StringVariableManager_27, new String[]{variable.getName()}), null)); - } - } - if (status.isOK()) { - for (int i = 0; i < variables.length; i++) { - IValueVariable variable = variables[i]; - fValueVariables.put(variable.getName(), variable); - } - IValueVariable[] copy = new IValueVariable[variables.length]; - System.arraycopy(variables, 0, copy, 0, variables.length); - getNotifier().notify(copy, ADDED); - return; - } - throw new CoreException(status); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#removeVariables(org.eclipse.debug.internal.core.stringsubstitution.IValueVariable[]) - */ - public synchronized void removeVariables(IValueVariable[] variables) { - initialize(); - List removed = new ArrayList(variables.length); - for (int i = 0; i < variables.length; i++) { - IValueVariable variable = variables[i]; - if (fValueVariables.remove(variable.getName()) != null) { - removed.add(variable); - } - } - if (removed.size() > 0) { - getNotifier().notify((IValueVariable[])removed.toArray(new IValueVariable[removed.size()]), REMOVED); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getDynamicVariable(java.lang.String) - */ - public synchronized IDynamicVariable getDynamicVariable(String name) { - initialize(); - return (IDynamicVariable) fDynamicVariables.get(name); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getValueVariable(java.lang.String) - */ - public synchronized IValueVariable getValueVariable(String name) { - initialize(); - return (IValueVariable) fValueVariables.get(name); - } - - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#addValueVariableListener(org.eclipse.debug.internal.core.stringsubstitution.IValueVariableListener) - */ - public void addValueVariableListener(IValueVariableListener listener) { - fListeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#removeValueVariableListener(org.eclipse.debug.internal.core.stringsubstitution.IValueVariableListener) - */ - public void removeValueVariableListener(IValueVariableListener listener) { - fListeners.remove(listener); - } - - /** - * Returns a memento representing the value variables currently registered. - * - * @return memento representing the value variables currently registered - * @throws IOException if an I/O exception occurs while creating the XML. - */ - private String getValueVariablesAsXML() throws IOException, ParserConfigurationException, TransformerException { - IValueVariable[] variables = getValueVariables(); - - Document document= getDocument(); - Element rootElement= document.createElement(VALUE_VARIABLES_TAG); - document.appendChild(rootElement); - for (int i = 0; i < variables.length; i++) { - IValueVariable variable = variables[i]; - if (!variable.isReadOnly()){ - // don't persist read-only variables or un-initialized contributed variables - if (!variable.isContributed() || ((ContributedValueVariable)variable).isInitialized()) { - Element element= document.createElement(VALUE_VARIABLE_TAG); - element.setAttribute(NAME_TAG, variable.getName()); - String value= variable.getValue(); - if (value != null) { - element.setAttribute(VALUE_TAG, value); - } - element.setAttribute(READ_ONLY_TAG, variable.isReadOnly() ? TRUE_VALUE : FALSE_VALUE); - String description= variable.getDescription(); - if (description != null) { - element.setAttribute(DESCRIPTION_TAG, description); - } - rootElement.appendChild(element); - } - } - } - return serializeDocument(document); - } - - private Document getDocument() throws ParserConfigurationException { - DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder docBuilder = dfactory.newDocumentBuilder(); - Document doc =docBuilder.newDocument(); - return doc; - } - - /** - * Serializes a XML document into a string - encoded in UTF8 format, - * with platform line separators. - * - * @param doc document to serialize - * @return the document as a string - * @throws TransformerException if an unrecoverable error occurs during the serialization - * @throws IOException if the encoding attempted to be used is not supported - */ - private String serializeDocument(Document doc) throws TransformerException, UnsupportedEncodingException { - ByteArrayOutputStream s= new ByteArrayOutputStream(); - - TransformerFactory factory= TransformerFactory.newInstance(); - Transformer transformer= factory.newTransformer(); - transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ - - DOMSource source= new DOMSource(doc); - StreamResult outputTarget= new StreamResult(s); - transformer.transform(source, outputTarget); - - return s.toString("UTF8"); //$NON-NLS-1$ - } - - /** - * Saves the value variables currently registered in the - * preference store. - */ - private synchronized void storeValueVariables() { - String variableString= ""; //$NON-NLS-1$ - if (!fValueVariables.isEmpty()) { - try { - variableString= getValueVariablesAsXML(); - } catch (IOException e) { - VariablesPlugin.log(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), IStatus.ERROR, "An exception occurred while storing launch configuration variables.", e)); //$NON-NLS-1$ - return; - } catch (ParserConfigurationException e) { - VariablesPlugin.log(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), IStatus.ERROR, "An exception occurred while storing launch configuration variables.", e)); //$NON-NLS-1$ - return; - } catch (TransformerException e) { - VariablesPlugin.log(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), IStatus.ERROR, "An exception occurred while storing launch configuration variables.", e)); //$NON-NLS-1$ - return; - } - } - fInternalChange = true; - try { - IEclipsePreferences prefs = new InstanceScope().getNode(VariablesPlugin.PI_CORE_VARIABLES); - prefs.put(PREF_VALUE_VARIABLES, variableString); - prefs.flush(); - } - catch(BackingStoreException bse) { - VariablesPlugin.log(bse); - } - fInternalChange = false; - } - - /** - * Fire a change notification for the given variable. - * - * @param variable the variable that has changed - */ - protected void notifyChanged(IValueVariable variable) { - if (!fInternalChange) { - IValueVariable existing = getValueVariable(variable.getName()); - if (variable.equals(existing)) { - // do not do change notification for unregistered variables - getNotifier().notify(new IValueVariable[]{variable}, CHANGED); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#generateVariableExpression(java.lang.String, java.lang.String) - */ - public String generateVariableExpression(String varName, String arg) { - StringBuffer buffer = new StringBuffer(); - buffer.append("${"); //$NON-NLS-1$ - buffer.append(varName); - if (arg != null) { - buffer.append(":"); //$NON-NLS-1$ - buffer.append(arg); - } - buffer.append("}"); //$NON-NLS-1$ - return buffer.toString(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#performStringSubstitution(java.lang.String, boolean) - */ - public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException { - return new StringSubstitutionEngine().performStringSubstitution(expression, reportUndefinedVariables, true, this); - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IStringVariableManager#validateStringVariables(java.lang.String) - */ - public void validateStringVariables(String expression) throws CoreException { - new StringSubstitutionEngine().validateStringVariables(expression, this); - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IStringVariableManager#getContributingPluginId(org.eclipse.core.variables.IStringVariable) - */ - public String getContributingPluginId(IStringVariable variable) { - if (variable instanceof StringVariable) { - return ((StringVariable) variable).getConfigurationElement().getContributor().getName(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) - */ - public void preferenceChange(PreferenceChangeEvent event) { - if (PREF_VALUE_VARIABLES.equals(event.getKey())) { - synchronized (this) { - if (!fInternalChange) { - fValueVariables.clear(); - loadPersistedValueVariables(); - loadContributedValueVariables(); - } - } - } - } -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java deleted file mode 100644 index 3bac3d076..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java +++ /dev/null @@ -1,76 +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.core.internal.variables; - -import org.eclipse.core.variables.IValueVariable; - -/** - * Implementation of a value variable. - */ -public class ValueVariable extends StringVariable implements IValueVariable { - - /** - * Variable value or null if none - */ - private String fValue; - - /** - * Whether this variable is read only. If true, users cannot change the value. - */ - private boolean fReadOnly; - - /** - * Constructs a new value variable with the given name, description, read only - * property and string value. Value can be null. - * - * @param name variable name - * @param description variable description or null - * @param readOnly whether the variable should be a read only variable - * @param value the initial value of the variable or null - */ - public ValueVariable(String name, String description, boolean readOnly, String value) { - super(name, description, null); - fReadOnly = readOnly; - fValue = value; - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#setValue(java.lang.String) - */ - public void setValue(String value) { - if (!isReadOnly()){ - fValue = value; - StringVariableManager.getDefault().notifyChanged(this); - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#getValue() - */ - public String getValue() { - return fValue; - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#isReadOnly() - */ - public boolean isReadOnly() { - return fReadOnly; - } - - /* (non-Javadoc) - * @see org.eclipse.core.variables.IValueVariable#isContributed() - */ - public boolean isContributed() { - return false; - } - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java deleted file mode 100644 index d6afcfda2..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.java +++ /dev/null @@ -1,29 +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.core.internal.variables; - -import org.eclipse.osgi.util.NLS; - -public class VariablesMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.core.internal.variables.VariablesMessages";//$NON-NLS-1$ - - public static String StringSubstitutionEngine_3; - public static String StringSubstitutionEngine_4; - - public static String StringVariableManager_26; - public static String StringVariableManager_27; - - public static String DynamicVariable_0; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, VariablesMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties deleted file mode 100644 index 945dbd36a..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/VariablesMessages.properties +++ /dev/null @@ -1,18 +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 -############################################################################### - -StringSubstitutionEngine_3=Reference to undefined variable {0} -StringSubstitutionEngine_4=Variable {0} does not accept arguments - -StringVariableManager_26=Variables with the specified names are already registered. -StringVariableManager_27=Variable named {0} already registered - -DynamicVariable_0=Unsupported argument {0} specified for variable {1} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java deleted file mode 100644 index b81fff749..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariable.java +++ /dev/null @@ -1,60 +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.core.variables; - -import org.eclipse.core.runtime.CoreException; - -/** - * A dynamic variable is a variable whose value is computed dynamically - * by a resolver at the time a string substitution is performed. A dynamic - * variable is contributed by an extension. - *

- * The following is a definition of a dynamic variable that resolves to the name of the selected resource: - *

- *  <extension point="org.eclipse.core.variables.dynamicVariables">
- *    <variable 
- *       name="resource_name"
- *       resolver="com.example.ResourceNameResolver"
- *       description="The name of the selected resource"
- *       supportsArgument="false">
- *    </variable>
- *  </extension>
- * 
- *

- *

- * Clients contributing a dynamic variable provide an implementation of - * {@link org.eclipse.core.variables.IDynamicVariableResolver}. - *

- * @since 3.0 - * @noimplement This interface is not intended to be implemented by clients. - */ -public interface IDynamicVariable extends IStringVariable { - - /** - * Returns the value of this variable when referenced with the given - * argument, possibly null. - * - * @param argument argument present in variable expression or null - * if none - * @return value of this variable when referenced with the given argument, possibly - * null - * @throws CoreException if unable to resolve a value for this variable - */ - public String getValue(String argument) throws CoreException; - - /** - * Returns whether this variable supports an argument, as specified - * by this variable's extension definition in plug-in XML. - * - * @return whether this variable supports an argument - */ - public boolean supportsArgument(); -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.java deleted file mode 100644 index b5cefaafb..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IDynamicVariableResolver.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.core.variables; - -import org.eclipse.core.runtime.CoreException; - -/** - * Resolves the value for a dynamic variable. A dynamic variable extension - * contributes a resolver which must implement this interface. - *

- * Clients contributing a dynamic variable are intended to provide an implementation - * of this interface. - *

- * @since 3.0 - */ -public interface IDynamicVariableResolver { - - /** - * Resolves and returns a value for the specified variable when referenced - * with the given argument, possibly null - * - * @param variable variable to resolve a value for - * @param argument argument present in expression or null if none - * @return variable value, possibly null - * @throws CoreException if unable to resolve a value for the given variable - */ - public String resolveValue(IDynamicVariable variable, String argument) throws CoreException; -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java deleted file mode 100644 index 70c3e25f0..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariable.java +++ /dev/null @@ -1,57 +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.core.variables; - - -/** - * A variable that can be referenced in an expression, which resolves to a string - * value. Variables are referenced in expressions via their name, in the following - * format. - *
- * ${varname} or ${varname:argument}
- * 
- *

- * A variable is identified by its name, and optionally accepts an argument. When an - * argument is present, a colon separates the variable name from its argument. - *

- *

- * Variables can be contributed by extensions or programmatically. There are two - * kinds of variables. - *

    - *
  • IValueVariable - variables that have a value (with getter and setter), and - * accept no arguments. The value of this type of variable is resolved at the time - * its value is set via its setter API.
  • - *
  • IDynamicVariable - variables whose value is resolved at the time - * a string substitution is performed by a contributed resolver. Dynamic variables - * may accept an argument.
  • - *
- *

- * @since 3.0 - * @noimplement This interface is not intended to be implemented by clients. - */ -public interface IStringVariable { - - /** - * Returns the name of this variable. A variable is uniquely identified by - * its name. - * - * @return variable name - */ - public String getName(); - - /** - * Returns a human readable description of this variable, possibly null - * - * @return a description of this variable, or null if none - */ - public String getDescription(); - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java deleted file mode 100644 index e3502e99b..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IStringVariableManager.java +++ /dev/null @@ -1,191 +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.core.variables; - -import org.eclipse.core.runtime.CoreException; - -/** - * Registry for string variables. - * @since 3.0 - * @noimplement This interface is not intended to be implemented by clients. - */ -public interface IStringVariableManager { - - /** - * Simple identifier constant (value "dynamicVariables") for the - * dynamic variables extension point. - */ - public static final String EXTENSION_POINT_DYNAMIC_VARIABLES = "dynamicVariables"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "valueVariables") for the - * value variables extension point. - */ - public static final String EXTENSION_POINT_VALUE_VARIABLES = "valueVariables"; //$NON-NLS-1$ - - /** - * Returns all registered variables. - * - * @return a collection of all registered variables - */ - public IStringVariable[] getVariables(); - - /** - * Returns all registered value variables. - * - * @return a collection of all registered value variables - */ - public IValueVariable[] getValueVariables(); - - /** - * Returns the value variable with the given name, or null - * if none. - * - * @param name variable name - * @return the value variable with the given name, or null - * if none - */ - public IValueVariable getValueVariable(String name); - - /** - * Returns all registered dynamic variables. - * - * @return a collection of all registered dynamic variables - */ - public IDynamicVariable[] getDynamicVariables(); - - /** - * Returns the dynamic variable with the given name or null - * if none. - * - * @param name variable name - * @return the dynamic variable with the given name or null - * if none - */ - public IDynamicVariable getDynamicVariable(String name); - - /** - * Returns the plug-in identifier of the plug-in that contributed the - * given variable via extension or null if the given - * variable wasn't contributed via extension. - * - * @param variable the variable - * @return the plug-in identifier of the plug-in that contributed the - * given variable or null - * @since 3.1 - */ - public String getContributingPluginId(IStringVariable variable); - - /** - * Recursively resolves and replaces all variable references in the given - * expression with their corresponding values. Reports errors for references - * to undefined variables (equivalent to calling - * performStringSubstitution(expression, true)). - * - * @param expression expression referencing variables - * @return expression with variable references replaced with variable values - * @throws CoreException if unable to resolve the value of one or more variables - */ - public String performStringSubstitution(String expression) throws CoreException; - - /** - * Recursively resolves and replaces all variable references in the given - * expression with their corresponding values. Allows the client to control - * whether references to undefined variables are reported as an error (i.e. - * an exception is thrown). - * - * @param expression expression referencing variables - * @param reportUndefinedVariables whether a reference to an undefined variable - * is to be considered an error (i.e. throw an exception) - * @return expression with variable references replaced with variable values - * @throws CoreException if unable to resolve the value of one or more variables - */ - public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException; - - /** - * Validates variables references in the given expression and reports errors - * for references to undefined variables. - * - * @param expression expression referencing variables - * @throws CoreException if one or more referenced variables do not exist - */ - public void validateStringVariables(String expression) throws CoreException; - - /** - * Returns a new read-write value variable with the given name and description - * with a null value. - * - * @param name variable name, cannot be null - * @param description variable description, possibly null - * @return a new value variable - */ - public IValueVariable newValueVariable(String name, String description); - - /** - * Returns a new value variable with the given properties. - * - * @param name variable name, cannot be null - * @param description variable description, possibly null - * @param readOnly whether this variable is to be a read only variable - * @param value the string value to initialize this variable to - should - * not be null for read-only variables - * @return a new value variable - * @since 3.3 - */ - public IValueVariable newValueVariable(String name, String description, boolean readOnly, String value); - - /** - * Adds the given variables to the variable registry. - * - * @param variables the variables to add - * @throws CoreException if one or more variables to add has a name collision with - * an existing variable - */ - public void addVariables(IValueVariable[] variables) throws CoreException; - - /** - * Removes the given variables from the registry. Has no effect for unregistered - * variables. - * - * @param variables variables to remove - */ - public void removeVariables(IValueVariable[] variables); - - /** - * Registers the given listener for value variable notifications. Has no effect - * if an identical listener is already registered. - * - * @param listener value variable listener to add - */ - public void addValueVariableListener(IValueVariableListener listener); - - /** - * Removes the given listener from the list of registered value variable - * listeners. Has no effect if an identical listener is not already registered. - * - * @param listener value variable listener to remove - */ - public void removeValueVariableListener(IValueVariableListener listener); - - /** - * Convenience method that returns an expression referencing the given - * variable and optional argument. For example, calling the method with - * a varName of my_var and an argument - * of my_arg results in the string $(my_var:my_arg}. - * - * @param varName variable name - * @param arg argument text or null - * @return an expression referencing the given variable and - * optional argument - */ - public String generateVariableExpression(String varName, String arg); - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java deleted file mode 100644 index 4b25138d0..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariable.java +++ /dev/null @@ -1,91 +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.core.variables; - -/** - * A variable with a value that can be set and retrieved. The context in which - * a value variable is referenced does not effect the value of the variable. - * A value variable can be contributed by an extension or created programmatically. - * A contributor may optionally specify an initial value for a variable, or - * provide a delegate that will initialize the variable with a value. - *

- * Since 3.3, a variable can be specified as a "read only" preventing users from changing - * the value after it has been initialized. Furthermore, a read only variable that is - * contributed by an extension will always load the value from the extension. - *

- *

- * Example of a value variable contribution with an initial value, the specified - * variable is created with the initial value "/usr/local/foo". - *

- *  <extension point="org.eclipse.core.variables.valueVariables">
- *   <variable
- *    name="FOO_HOME"
- *    initialValue="/usr/local/foo">
- *   </variable>
- *  </extension>
- * 
- *

- *

- * Example of a value variable contribution with an initializer class, the class - * "com.example.FooLocator" will be used to initialize the value the first time - * it's requested. - *

- *  <extension point="org.eclipse.core.variables.valueVariables">
- *   <variable
- *    name="FOO_HOME"
- *    initializerClass="com.example.FooLocator">
- *   </variable>
- *  </extension>
- * 
- *

- * @since 3.0 - * @noimplement This interface is not intended to be implemented by clients. - */ -public interface IValueVariable extends IStringVariable { - - /** - * Sets the value of this variable to the given value. - * Since 3.3, this has no effect if this variable is read only. - * - * @param value variable value - */ - public void setValue(String value); - - /** - * Returns the value of this variable, or null if none. - * - * @return the value of this variable, or null if none - */ - public String getValue(); - - /** - * Returns whether this variable was contributed by an extension. - * - * @return whether this variable was contributed by an extension - */ - public boolean isContributed(); - - /** - * Returns whether this variable is read only. - * - * @return whether this variable is read only - * @since 3.3 - */ - public boolean isReadOnly(); - - /** - * Sets the description of this variable to the given value. - * - * @param description variable description, possibly null - */ - public void setDescription(String description); - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java deleted file mode 100644 index 035a907db..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableInitializer.java +++ /dev/null @@ -1,30 +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.core.variables; - -/** - * Value variable initializers compute an initial value for a value - * variable contributed by an extension, which is not defined with an initial - * value. This provides a mechanism for programmatically computing the initial - * value of a value variable. - *

- * Clients may implement this interface. - *

- * @since 3.0 - */ -public interface IValueVariableInitializer { - /** - * Initializes the specified variable. - * - * @param variable variable to initialize - */ - public void initialize(IValueVariable variable); -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java deleted file mode 100644 index 37dac25df..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/IValueVariableListener.java +++ /dev/null @@ -1,47 +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.core.variables; - -/** - * A string variable listener is notified of variables as they are added - * and removed from the string variable manager. As well, listeners are - * notified when a value variable changes value. - *

- * Clients may implement this interface. - *

- * @since 3.0 - */ -public interface IValueVariableListener { - - /** - * Notification the given variables have been added to the variable - * manager. - * - * @param variables added variables - */ - public void variablesAdded(IValueVariable[] variables); - - /** - * Notification the given variables have been removed from the variable - * manager. - * - * @param variables removed variables - */ - public void variablesRemoved(IValueVariable[] variables); - - /** - * Notification the given variables have been changed value. - * - * @param variables changed variables - */ - public void variablesChanged(IValueVariable[] variables); - -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java b/org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java deleted file mode 100644 index 4fa1b74a5..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/VariablesPlugin.java +++ /dev/null @@ -1,114 +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.core.variables; - -import org.eclipse.core.internal.variables.StringVariableManager; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.Status; - -/** - * The plug-in runtime class for the Core Variables plug-in. - * @since 3.0 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - */ -public class VariablesPlugin extends Plugin { - - /** - * Status code indicating an unexpected internal error. - */ - public static final int INTERNAL_ERROR = 120; - - /** - * Status code indicating a variable reference cycle error. - */ - public static final int REFERENCE_CYCLE_ERROR = 130; - - /** - * The single instance of this plug-in runtime class. - */ - private static VariablesPlugin plugin; - - /** - * Unique identifier constant (value "org.eclipse.core.variables") - * for the Core Variables plug-in. - */ - public static final String PI_CORE_VARIABLES = "org.eclipse.core.variables"; //$NON-NLS-1$ - - - /** - * Constructs an instance of this plug-in runtime class. - *

- * An instance of this plug-in runtime class is automatically created - * when the facilities provided by the Variables plug-in are required. - * Clients must never explicitly instantiate a plug-in runtime class. - *

- */ - public VariablesPlugin() { - super(); - plugin = this; - } - - /** - * Returns this plug-in instance. - * - * @return the single instance of this plug-in runtime class - */ - public static VariablesPlugin getDefault() { - return plugin; - } - - /** - * Logs the specified throwable with this plug-in's log. - * - * @param t throwable to log - */ - public static void log(Throwable t) { - log(new Status(IStatus.ERROR, PI_CORE_VARIABLES, INTERNAL_ERROR, "Error logged from Core Variables: ", t)); //$NON-NLS-1$ - } - - /** - * Logs the given message with this plug-in's log and the given - * throwable or null if none. - * @param message the message to log - * @param throwable the exception that occurred or null if none - */ - public static void logMessage(String message, Throwable throwable) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), INTERNAL_ERROR, message, throwable)); - } - - /** - * 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); - } - - /** - * Convenience method which returns the unique identifier of this plug-in. - */ - public static String getUniqueIdentifier() { - return PI_CORE_VARIABLES; - } - - /** - * Returns the string variable manager. - * - * @return the string variable manager - */ - public IStringVariableManager getStringVariableManager() { - return StringVariableManager.getDefault(); - } -} diff --git a/org.eclipse.core.variables/src/org/eclipse/core/variables/package.html b/org.eclipse.core.variables/src/org/eclipse/core/variables/package.html deleted file mode 100644 index 0d27de0b3..000000000 --- a/org.eclipse.core.variables/src/org/eclipse/core/variables/package.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - -Eclipse Debug Platform - - - - -

Provides support for defining and contributing variables for the purpose of - string substitution.

- -

Package Specification

- -

This package provides classes and interfaces to support the definition and - contribution of variables for the purpose of string substitution. The plug-in - supports the recursive replacement of variables referenced by name in arbitrary - strings with the value of the variable. Two types of variables are provided - - value variables (IValueVariable) and dynamic variables (IDynamicVariable). - A value variable has a simple setter and getter for its current value. A dynamic - variable has an associated resolver that provides a variable's value each time - it is referenced (replaced) in a string substitution. A dynamic variable may - also provide an argument in its reference that can be used by its resolver to - determine its substitution value.

-

A variable manager (IStringVariableManager) is provided to manage - the set of defined variables. Value variables may be created via API on the - variable manager, or contributed via the valueVariables extension - point. Dynamic variables must be contributed via the dynamicVariables - extension point. The variable manager also provides change notification for - value variables. The variable manager also provides an API for performing string - substitution, which accepts a string, and returns a string with all variable - references replaced by associated variable values.

-

Variables are referenced in strings by enclosing them in braces, preceded with - a dollar sign. For example, consider a variable defined with the name foo, - and referenced in the following string: "abc${foo}ghi". - If the value of foo is "def", the result - of a string substitution would be "abcdefghi". In the - case of a dynamic variable, an (optional) argument is supplied by appending - a colon and argument value after the variable name. For example "${foo:bar}". - In this case, the resolver associated with foo would be provided - with the referenced argument (bar) when asked to resolve a value - for the variable foo.

- - diff --git a/org.eclipse.debug.core/.classpath b/org.eclipse.debug.core/.classpath deleted file mode 100644 index 3138d4b81..000000000 --- a/org.eclipse.debug.core/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.debug.core/.cvsignore b/org.eclipse.debug.core/.cvsignore deleted file mode 100644 index c5e82d745..000000000 --- a/org.eclipse.debug.core/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin \ No newline at end of file diff --git a/org.eclipse.debug.core/.options b/org.eclipse.debug.core/.options deleted file mode 100644 index 47e155156..000000000 --- a/org.eclipse.debug.core/.options +++ /dev/null @@ -1,3 +0,0 @@ -org.eclipse.debug.core/debug=false -org.eclipse.debug.core/debug/commands=false -org.eclipse.debug.core/debug/events=false \ No newline at end of file diff --git a/org.eclipse.debug.core/.project b/org.eclipse.debug.core/.project deleted file mode 100644 index c3e32f2fd..000000000 --- a/org.eclipse.debug.core/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.debug.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0cf89c08a..000000000 --- a/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,101 +0,0 @@ -#Thu Feb 26 08:13:04 CST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled -org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH -org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.debug.core/.settings/org.eclipse.jdt.launching.prefs b/org.eclipse.debug.core/.settings/org.eclipse.jdt.launching.prefs deleted file mode 100644 index f2a3bc396..000000000 --- a/org.eclipse.debug.core/.settings/org.eclipse.jdt.launching.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Feb 26 08:13:04 CST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning diff --git a/org.eclipse.debug.core/.settings/org.eclipse.pde.prefs b/org.eclipse.debug.core/.settings/org.eclipse.pde.prefs deleted file mode 100644 index 06466d6c2..000000000 --- a/org.eclipse.debug.core/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,29 +0,0 @@ -#Mon Dec 14 12:02:07 CST 2009 -compilers.f.unresolved-features=1 -compilers.f.unresolved-plugins=1 -compilers.incompatible-environment=1 -compilers.p.build=1 -compilers.p.build.missing.output=1 -compilers.p.deprecated=1 -compilers.p.discouraged-class=1 -compilers.p.illegal-att-value=0 -compilers.p.internal=1 -compilers.p.missing-packages=0 -compilers.p.missing-version-export-package=2 -compilers.p.missing-version-import-package=2 -compilers.p.missing-version-require-bundle=2 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=1 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=0 -compilers.p.unknown-element=0 -compilers.p.unknown-identifier=1 -compilers.p.unknown-resource=0 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.p.unused-element-or-attribute=1 -compilers.s.create-docs=false -compilers.s.doc-folder=doc -compilers.s.open-tags=1 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.debug.core/META-INF/MANIFEST.MF b/org.eclipse.debug.core/META-INF/MANIFEST.MF deleted file mode 100644 index 7d68a2244..000000000 --- a/org.eclipse.debug.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,27 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.debug.core; singleton:=true -Bundle-Version: 3.6.0.qualifier -Bundle-ClassPath: . -Bundle-Activator: org.eclipse.debug.core.DebugPlugin -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.debug.core, - org.eclipse.debug.core.commands, - org.eclipse.debug.core.model, - org.eclipse.debug.core.sourcelookup, - org.eclipse.debug.core.sourcelookup.containers, - org.eclipse.debug.internal.core;x-friends:="org.eclipse.debug.ui", - org.eclipse.debug.internal.core.commands;x-friends:="org.eclipse.debug.ui", - org.eclipse.debug.internal.core.sourcelookup;x-friends:="org.eclipse.debug.ui", - org.eclipse.debug.internal.core.sourcelookup.containers;x-friends:="org.eclipse.debug.ui", - org.eclipse.debug.internal.core.variables;x-friends:="org.eclipse.debug.ui" -Require-Bundle: org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)";visibility:=reexport, - org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", - org.eclipse.core.filesystem;bundle-version="[1.2.0,2.0.0)", - org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)" -Bundle-ActivationPolicy: lazy -Import-Package: com.ibm.icu.text -Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/org.eclipse.debug.core/about.html b/org.eclipse.debug.core/about.html deleted file mode 100644 index 460233046..000000000 --- a/org.eclipse.debug.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

About This Content

- -

June 2, 2006

-

License

- -

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

- -

If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

- - - \ No newline at end of file diff --git a/org.eclipse.debug.core/build.properties b/org.eclipse.debug.core/build.properties deleted file mode 100644 index 192bc8445..000000000 --- a/org.eclipse.debug.core/build.properties +++ /dev/null @@ -1,20 +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 -############################################################################### -bin.includes = .options,\ - plugin.xml,\ - plugin.properties,\ - .,\ - about.html,\ - META-INF/ -source.. = core/ -src.includes = about.html,\ - schema/ -output.. = bin/ diff --git a/org.eclipse.debug.core/buildnotes_platform-debug.html b/org.eclipse.debug.core/buildnotes_platform-debug.html deleted file mode 100644 index fda3b85b2..000000000 --- a/org.eclipse.debug.core/buildnotes_platform-debug.html +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - Platform Debug Release Notes - - -

Eclipse 3.6 Debug Platform Build Notes

- -

Summary of API changes in 3.6

- -

AbstractLaunchHistoryAction

-

What is affected: -

    -
  • Method addition: public void runWithEvent(IAction action, Event event)
  • -
  • Method addition: public void init(IAction action)
  • -
  • Implemented Interface: org.eclipse.ui.IActionDelegate2
  • -
-

Description: The implementation of org.eclipse.ui.IActionDelegate2 and the addition of the two implemented -methods allows for the Ctrl key modifier to be used to open the last launched launch configuration when clicking on any launch history action. -

Action required: This is a backwards compatible change. No action required.

- -

ILaunchManager

-

What is affected: -

    -
  • Method addition: public String generateLaunchConfigurationName(String namePrefix)
  • -
  • Method addition: public boolean isValidLaunchConfigurationName(String configname) throws IllegalArgumentException
  • -
  • Constant addition: public static final String ATTR_PRIVATE
  • -
-

Description: The generateLaunchConfigurationName(String namePrefix) method is a replacement for the traditional generateUniqueLaunchConfigurationNameFrom(configname) method - which has been deprecated. -The new method behaves the same as its predecessor but also provides error checking on the new name to ensure it does not use any system reserved characters or names, like com on Windows for example. If an invalid name or character is found -the method makes an effort to correct the name in one of two ways: -

    -
  • If an invalid name is given the configuration will be renamed to launch_configuration
  • -
  • Any invalid characters found will be replaced with _
  • -
-Action required: This is a backwards compatible change. No action required. -

-

-Description: The isValidLaunchConfigurationName(String configname) method is used to validate the specified configuration name and throws an IllegalArgumentException. This method provides -the validation for the generateLaunchConfigurationName(String namePrefix) method.

-

Action required: This is a backwards compatible change. No action required.

-

Description: The ATTR_PRIVATE constant is a launch configuration attribute key used to identify whether a launch configuration should appear in the debug user interface (launch history, launch dialog, etc.). The value is a boolean. This attribute was previously defined in the debug UI plug-in, but was moved to core for headless plug-is that need to specify a value for this attribute.

-

Action required: This is a backwards compatible change. No action required.

- -

DebugCommandAction base class

-

What is affected: -

    -
  • Class addition: org.eclipse.debug.ui.actions.DebugCommandAction
  • -
  • Class addition: org.eclipse.debug.ui.actions.DebugCommandHandler
  • -
  • Class addition: org.eclipse.debug.core.commands.AbstractDebugCommand
  • -
-

Description:The IDebugCommandHandler interface allows debugger to implement debug action handlers which execute asynchronously. Most of the debugger actions user this interface to communicate with the debug model. However, debuggers which need to add their own asynchronous actions had to duplicate the debug framework actions which invoke the IDebugCommandHandler handlers. DebugCommandAction and DebugCommandHandler are base classes which can be extended by debuggers to implement new types of actions with asynchronous execution handlers. Also, this change includes a standard base class AbstractDebugCommand to help implement the IDebugCommandHandler interface.

-

Action required: This is a backwards compatible change. No action required.

- -

IRestartHandler

-

What is affected: -

    -
  • Interface addition: org.eclipse.debug.core.commands.IRestartHandler
  • -
-

Description:The IRestartHandler interface enables a new "Restart" command. If a debugger supplies the IRestartHandler as an adapter to debug model elements, the new Restart command will be enabled. The restart command appears in the Debug view context menu and can be configured as a short cut.

-

Action required: This is a backwards compatible change. No action required.

- -

RefreshUtil

-

What is affected: -

    -
  • Class addition: org.eclipse.debug.core.RefreshUtil
  • -
-

Description:The RefreshUtil class provides API to create and restore mementos for resource collections as well as a convenience API for refreshing resources. This support was moved to org.eclipse.debug.core from org.eclispe.debug.ui such that headless plug-ins can leverage these features.

-

Action required: This is a backwards compatible change. No action required.

- -

Launch Time Stamps

-

What is affected: -

    -
  • Constant addition: DebugPlugin - public static final String ATTR_LAUNCH_TIMESTAMP
  • -
-

Description:A time stamp value is added to all launch objects representing the time a - launch configuration's launch(...) method was called. The value of the launch attribute is a - String representing a long generated from System.currentTimeMillis(). The attribute value - can be obtained from ILaunch.getAttrbute(DebugPlugin.ATTR_LAUNCH_TIMESTAMP). -

Action required: This is a backwards compatible change. No action required.

- -

IDetailPane3

-

What is affected: -

    -
  • Interface addition: org.eclipse.debug.ui.IDetailPane3
  • -
-

Description:An optional interface that detail pane extensions may implement in order - to interact with the containing part's ISaveablePart function. -

Action required: This is a backwards compatible change. No action required.

- -

 

- - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java deleted file mode 100644 index 1c867f7c8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java +++ /dev/null @@ -1,457 +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.core; - - -import java.util.EventObject; - -import org.eclipse.debug.internal.core.DebugCoreMessages; - -/** - * A debug event describes an event in a program being debugged or - * in a running process. Debug models and process implementations - * are required to generate debug events as specified by this class. - *

- * The following list defines the events generated for each debug - * model element. - * The getSource() method of a debug event - * returns the element associated with the event. - * Creation events are guaranteed to occur in a top - * down order - that is, parents are created before children. - * Termination events are guaranteed to occur in a bottom up order - - * that is, children before parents. However, termination events are not guaranteed - * for all elements that are created. That is, terminate events can be coalesced - a - * terminate event for a parent signals that all children have been terminated. - *

- *

- * A debug model may define model specific events by specifying a debug event - * kind of MODEL_SPECIFIC. A model specific event is identified by the - * event source (i.e. by the debug model that generated the event). The detail of - * a model specific event is client defined. Note that model specific events are - * not understood by the debug platform, and are thus ignored. - *

- *

- * The generic CHANGE event can be fired at any time by any element. - * Generally, a client of a debug model, such as as a UI, can get sufficient - * information to update by listening/responding to the other event kinds. However, - * if a debug model needs to inform clients of a change that is not specified - * by create/terminate/suspend/resume, the CHANGE event may be used. - * For example, generally, the only way a thread or any of its children can change - * state between a suspend and resume operation, is if the thread or owning debug - * target is terminated. However, if a debug model supports some other operation - * that would allow a debug element to change state while suspended, the debug model - * would fire a change event for that element. The valid detail codes for a - * change event are:

    - *
  • STATE - indicates the state of an element has changed, but its - * children are not affected. A client would use a state change event to update - * a label of the affected element, but would not update any children.
  • - *
  • CONTENT - indicates that a debug element's value or contents have - * changed in some way. For example, when the value of a variable is changed - * explicitly, the variable should fire a content change event.
  • - *
- *

- *
    - *
  • IProcess - *
      - *
    • CREATE - a process has been created and is executing.
    • - *
    • TERMINATE - a process has terminated.
    • - *
    - *
  • IDebugTarget - *
      - *
    • CREATE - a debug target has been created and is ready - * to begin a debug session.
    • - *
    • TERMINATE - a debug target has terminated and the debug - * session has ended.
    • - *
    • SUSPEND - a debug target has suspended. Event detail provides - * the reason for the suspension:
        - *
      • STEP_END - a request to step has completed
      • - *
      • BREAKPOINT - a breakpoint has been hit
      • - *
      • CLIENT_REQUEST - a client request has caused the target to suspend - * (i.e. an explicit call to suspend())
      • - *
      • UNSPECIFIED - the reason for the suspend is not specified
      • - *
      - *
    • - *
    • RESUME - a debug target has resumed. Event detail provides - * the reason for the resume:
        - *
      • STEP_INTO - a target is being resumed because of a request to step into
      • - *
      • STEP_OVER - a target is being resumed because of a request to step over
      • - *
      • STEP_RETURN - a target is being resumed because of a request to step return
      • - *
      • CLIENT_REQUEST - a client request has caused the target to be resumed - * (i.e. an explicit call to resume())
      • - *
      • UNSPECIFIED - The reason for the resume is not specified
      • - *
      - *
    • - *
    - *
  • - *
  • IThread - *
      - *
    • CREATE - a thread has been created in a debug target.
    • - *
    • TERMINATE - a thread has terminated.
    • - *
    • SUSPEND - a thread has suspended execution. Event detail provides - * the reason for the suspension:
        - *
      • STEP_END - a request to step has completed
      • - *
      • BREAKPOINT - a breakpoint has been hit
      • - *
      • CLIENT_REQUEST - a client request has caused the thread to suspend - * (i.e. an explicit call to suspend())
      • - *
      • EVALUATION - an expression evaluation has ended that may - * have had side effects in the debug target.
      • - *
      • EVALUATION_IMPLICIT - an expression evaluation has ended that - * had no side effects in the debug target.
      • - *
      • UNSPECIFIED - the reason for the suspend is not specified
      • - *
      - *
    • - *
    • RESUME - a thread has resumed execution. Event detail provides - * the reason for the resume:
        - *
      • STEP_INTO - a thread is being resumed because of a request to step into
      • - *
      • STEP_OVER - a thread is being resumed because of a request to step over
      • - *
      • STEP_RETURN - a thread is being resumed because of a request to step return
      • - *
      • CLIENT_REQUEST - a client request has caused the thread to be resumed - * (i.e. an explicit call to resume())
      • - *
      • EVALUATION - an expression evaluation has started that may - * have side effects in the debug target.
      • - *
      • EVALUATION_IMPLICIT - an expression evaluation has started that - * will have no side effects in the debug target.
      • - *
      • UNSPECIFIED - The reason for the resume is not specified
      • - *
      - *
    • - *
    - *
  • - *
  • IStackFrame - no events are specified for stack frames. - * When a thread is suspended, it has stack frames. When a thread resumes, - * stack frames are unavailable. - *
  • - *
  • IVariable - no events are specified for variables. - * When a thread is suspended, stack frames have variables. When a thread resumes, - * variables are unavailable. - *
  • - *
  • IValue - no events are specified for values. - *
  • - *
- * - */ -public final class DebugEvent extends EventObject { - - /** - * All objects that can be serialized should have a stable serialVersionUID - */ - private static final long serialVersionUID = 1L; - - /** - * Resume event kind. - */ - public static final int RESUME= 0x0001; - - /** - * Suspend event kind. - */ - public static final int SUSPEND= 0x0002; - - /** - * Create event kind. - */ - public static final int CREATE= 0x0004; - - /** - * Terminate event kind. - */ - public static final int TERMINATE= 0x0008; - - /** - * Change event kind. - */ - public static final int CHANGE= 0x0010; - - /** - * Model specific event kind. The detail codes - * for a model specific event are client defined. - * - * @since 2.1.2 - */ - public static final int MODEL_SPECIFIC= 0x0020; - - /** - * Step start detail. Indicates a thread was resumed by a step - * into action. - * @since 2.0 - */ - public static final int STEP_INTO= 0x0001; - - /** - * Step start detail. Indicates a thread was resumed by a step - * over action. - * @since 2.0 - */ - public static final int STEP_OVER= 0x0002; - - /** - * Step start detail. Indicates a thread was resumed by a step - * return action. - * @since 2.0 - */ - public static final int STEP_RETURN= 0x0004; - - /** - * Step end detail. Indicates a thread was suspended due - * to the completion of a step action. - */ - public static final int STEP_END= 0x0008; - - /** - * Breakpoint detail. Indicates a thread was suspended by - * a breakpoint. - */ - public static final int BREAKPOINT= 0x0010; - - /** - * Client request detail. Indicates a thread was suspended due - * to a client request. - */ - public static final int CLIENT_REQUEST= 0x0020; - - /** - * Evaluation detail. Indicates that a thread was resumed or - * suspended to perform an expression evaluation. - * - * @since 2.0 - */ - public static final int EVALUATION = 0x0040; - - /** - * Evaluation detail. Indicates that a thread was resumed or - * suspended to perform an implicit expression evaluation. - * An implicit evaluation is an evaluation that is performed - * as an indirect result of a user action. - * Clients may use this detail event to decide whether or not - * to alert the user that an evaluation is taking place.. - * - * @since 2.0 - */ - public static final int EVALUATION_IMPLICIT = 0x0080; - - /** - * State change detail. Indicates the state of a single - * debug element has changed. Only valid for CHANGE - * events. - * - * @since 2.0 - */ - public static final int STATE = 0x0100; - - /** - * Content change detail. Indicates the content of a debug element - * (and potentially its children) has changed. Only valid for - * CHANGE events. - * - * @since 2.0 - */ - public static final int CONTENT = 0x0200; - - /** - * Constant indicating that the kind or detail of a debug - * event is unspecified. - */ - public static final int UNSPECIFIED = 0; - - /** - * The kind of event - one of the kind constants defined by - * this class. - */ - private int fKind= UNSPECIFIED; - - /** - * The detail of the event - one of the detail constants defined by - * this class. - */ - private int fDetail= UNSPECIFIED; - - /** - * Client defined data field. - * - * @since 2.1.2 - */ - private Object fData = null; - - /** - * Constructs a new debug event of the given kind with a detail code of - * UNSPECIFIED. - * - * @param eventSource the object associated with the event - * @param kind the kind of debug event (one of the - * kind constants defined by this class) - */ - public DebugEvent(Object eventSource, int kind) { - this(eventSource, kind, UNSPECIFIED); - } - - /** - * Constructs a new debug event of the given kind with the given detail. - * - * @param eventSource the object associated with the event - * @param kind the kind of debug event (one of the - * kind constants defined by this class) - * @param detail extra information about the event (one of the - * detail constants defined by this class or a client defined detail if this is a model specific event) - */ - public DebugEvent(Object eventSource, int kind, int detail) { - super(eventSource); - if ((kind & (RESUME | SUSPEND | CREATE | TERMINATE | CHANGE | MODEL_SPECIFIC)) == 0) - throw new IllegalArgumentException(DebugCoreMessages.DebugEvent_illegal_kind); - if (kind != MODEL_SPECIFIC && detail != UNSPECIFIED && (detail & (STEP_END | STEP_INTO | STEP_OVER | STEP_RETURN | BREAKPOINT | CLIENT_REQUEST |EVALUATION | EVALUATION_IMPLICIT | STATE | CONTENT)) == 0) - throw new IllegalArgumentException(DebugCoreMessages.DebugEvent_illegal_detail); - fKind= kind; - fDetail= detail; - } - - /** - * Returns a constant describing extra detail about the event - either one - * of the detail constants defined by this class, possibly - * UNSPECIFIED, or a client defined detail if this is a model specific event. - * - * @return the detail code - */ - public int getDetail() { - return fDetail; - } - - /** - * Returns this event's kind - one of the kind constants defined by this class. - * - * @return the kind code - */ - public int getKind() { - return fKind; - } - - /** - * Returns whether this event's detail indicates the - * beginning of a step event. This event's detail is one - * of STEP_INTO, STEP_OVER, or - * STEP_RETURN. - * - * @return whether this event's detail indicates the beginning - * of a step event. - * @since 2.0 - */ - public boolean isStepStart() { - return (getDetail() & (STEP_INTO | STEP_OVER | STEP_RETURN)) > 0; - } - - /** - * Returns whether this event's detail indicates an - * evaluation. This event's detail is one - * of EVALUATION, or EVALUATION_IMPLICIT. - * - * @return whether this event's detail indicates an evaluation. - * @since 2.0 - */ - public boolean isEvaluation() { - return (getDetail() & (EVALUATION | EVALUATION_IMPLICIT)) > 0; - } - - /** - * Sets this event's application defined data. - * - * @param data application defined data - * @since 2.1.2 - */ - public void setData(Object data) { - fData = data; - } - - /** - * Returns this event's application defined data, or null if none - * - * @return application defined data, or null if none - * @since 2.1.2 - */ - public Object getData() { - return fData; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - StringBuffer buf = new StringBuffer("DebugEvent["); //$NON-NLS-1$ - if (getSource() != null) { - buf.append(getSource().toString()); - } else { - buf.append("null"); //$NON-NLS-1$ - } - buf.append(", "); //$NON-NLS-1$ - switch (getKind()) { - case CREATE: - buf.append("CREATE"); //$NON-NLS-1$ - break; - case TERMINATE: - buf.append("TERMINATE"); //$NON-NLS-1$ - break; - case RESUME: - buf.append("RESUME"); //$NON-NLS-1$ - break; - case SUSPEND: - buf.append("SUSPEND"); //$NON-NLS-1$ - break; - case CHANGE: - buf.append("CHANGE"); //$NON-NLS-1$ - break; - case UNSPECIFIED: - buf.append("UNSPECIFIED"); //$NON-NLS-1$ - break; - case MODEL_SPECIFIC: - buf.append("MODEL_SPECIFIC"); //$NON-NLS-1$ - break; - } - buf.append(", "); //$NON-NLS-1$ - switch (getDetail()) { - case BREAKPOINT: - buf.append("BREAKPOINT"); //$NON-NLS-1$ - break; - case CLIENT_REQUEST: - buf.append("CLIENT_REQUEST"); //$NON-NLS-1$ - break; - case STEP_END: - buf.append("STEP_END"); //$NON-NLS-1$ - break; - case STEP_INTO: - buf.append("STEP_INTO"); //$NON-NLS-1$ - break; - case STEP_OVER: - buf.append("STEP_OVER"); //$NON-NLS-1$ - break; - case STEP_RETURN: - buf.append("STEP_RETURN"); //$NON-NLS-1$ - break; - case EVALUATION: - buf.append("EVALUATION"); //$NON-NLS-1$ - break; - case EVALUATION_IMPLICIT: - buf.append("EVALUATION_IMPLICIT"); //$NON-NLS-1$ - break; - case STATE: - buf.append("STATE"); //$NON-NLS-1$ - break; - case CONTENT: - buf.append("CONTENT"); //$NON-NLS-1$ - break; - case UNSPECIFIED: - buf.append("UNSPECIFIED"); //$NON-NLS-1$ - break; - default: - // model specific - buf.append(getDetail()); - break; - } - buf.append("]"); //$NON-NLS-1$ - return buf.toString(); - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java deleted file mode 100644 index b1a7c3dec..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugException.java +++ /dev/null @@ -1,88 +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.core; - - - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; - - -/** - * A checked exception representing a failure. - *

- * Defines status codes relevant to the debug plug-in. When a - * debug exception is thrown, it contains a status object describing - * the cause of the exception. The status objects originating from the - * debug plug-in use the codes defined in this class. - *

- * @see IStatus - * @noextend This class is not intended to be subclassed by clients. - */ -public class DebugException extends CoreException { - - /** - * All objects that can be serialized should have a stable serialVersionUID - */ - private static final long serialVersionUID = 1L; - - /** - * Indicates a request made of a debug element has failed - * on the target side. - */ - public static final int TARGET_REQUEST_FAILED = 5010; - - /** - * Indicates a request is not supported by the capabilities of a debug element. - * For example, a request was made to terminate an element that does not - * support termination. - */ - public static final int NOT_SUPPORTED = 5011; - - /** - * Indicates that a request made of manager has failed, or a request made of a - * debug element has failed on the client side (that is, before the request was - * sent to the debug target). - */ - public static final int REQUEST_FAILED = 5012; - - /** - * Indicates an internal error. This is an unexpected state. - */ - public static final int INTERNAL_ERROR = 5013; - - /** - * Indicates an improperly configured breakpoint. Breakpoints have a minimal - * set of required attributes as defined by the breakpoint manager. - * - * @see IBreakpointManager - */ - public static final int CONFIGURATION_INVALID = 5014; - - /** - * Indicates a launch configuration could not be restored because its - * launch configuration type definition is missing. - * - * @since 3.0 - */ - public static final int MISSING_LAUNCH_CONFIGURATION_TYPE = 5020; - - /** - * Constructs a new debug exception with the given status object. - * - * @param status the status object describing this exception - * @see IStatus - */ - public DebugException(IStatus status) { - super(status); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java deleted file mode 100644 index d3869d23b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java +++ /dev/null @@ -1,1411 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core; - - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.FactoryConfigurationError; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; - -import org.eclipse.core.resources.ISaveContext; -import org.eclipse.core.resources.ISaveParticipant; -import org.eclipse.core.resources.ResourcesPlugin; -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.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.PlatformObject; -import org.eclipse.core.runtime.Plugin; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDisconnect; -import org.eclipse.debug.core.model.IDropToFrame; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.model.IStep; -import org.eclipse.debug.core.model.IStepFilters; -import org.eclipse.debug.core.model.ISuspendResume; -import org.eclipse.debug.core.model.ITerminate; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.RuntimeProcess; -import org.eclipse.debug.internal.core.BreakpointManager; -import org.eclipse.debug.internal.core.DebugCoreMessages; -import org.eclipse.debug.internal.core.DebugOptions; -import org.eclipse.debug.internal.core.ExpressionManager; -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.core.LogicalStructureManager; -import org.eclipse.debug.internal.core.MemoryBlockManager; -import org.eclipse.debug.internal.core.Preferences; -import org.eclipse.debug.internal.core.StepFilterManager; -import org.eclipse.debug.internal.core.commands.CommandAdapterFactory; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupUtils; -import org.eclipse.osgi.service.environment.Constants; -import org.osgi.framework.BundleContext; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import com.ibm.icu.text.MessageFormat; - -/** - * There is one instance of the debug plug-in available from - * DebugPlugin.getDefault(). The debug plug-in provides: - *
    - *
  • access to the breakpoint manager
  • - *
  • access to the launch manager
  • - *
  • access to the expression manager
  • - *
  • access to the registered launcher extensions
  • - *
  • access to the memory block manager
  • - *
  • debug event notification
  • - *
  • status handlers
  • - *
- * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - */ -public class DebugPlugin extends Plugin { - - /** - * Unique identifier constant (value "org.eclipse.debug.core") - * for the Debug Core plug-in. - */ - private static final String PI_DEBUG_CORE = "org.eclipse.debug.core"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "launchConfigurationTypes") - * for the launch configuration types extension point. - * - * @since 2.0 - */ - public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES= "launchConfigurationTypes"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "launchConfigurationComparators") - * for the launch configuration comparators extension point. - * - * @since 2.0 - */ - public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS= "launchConfigurationComparators"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "breakpoints") for the - * breakpoints extension point. - * - * @since 2.0 - */ - public static final String EXTENSION_POINT_BREAKPOINTS= "breakpoints"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "statusHandlers") for the - * status handlers extension point. - * - * @since 2.0 - */ - public static final String EXTENSION_POINT_STATUS_HANDLERS= "statusHandlers"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "sourceLocators") for the - * source locators extension point. - * - * @since 2.0 - */ - public static final String EXTENSION_POINT_SOURCE_LOCATORS= "sourceLocators"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "launchModes") for the - * source modes extension point. - * - * @since 3.0 - */ - public static final String EXTENSION_POINT_LAUNCH_MODES= "launchModes"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "launchDelegates") for the - * launch delegates extension point. - * - * @since 3.0 - */ - public static final String EXTENSION_POINT_LAUNCH_DELEGATES= "launchDelegates"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "processFactories") for the - * process factories extension point. - * - * @since 3.0 - */ - public static final String EXTENSION_POINT_PROCESS_FACTORIES = "processFactories"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "logicalStructureTypes") for the - * logical structure types extension point. - * - * @since 3.0 - */ - public static final String EXTENSION_POINT_LOGICAL_STRUCTURE_TYPES = "logicalStructureTypes"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "logicalStructureProviders") for the - * logical structure types extension point. - * - * @since 3.1 - */ - public static final String EXTENSION_POINT_LOGICAL_STRUCTURE_PROVIDERS = "logicalStructureProviders"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "sourceContainerTypes") for the - * source container types extension point. - * - * @since 3.0 - */ - public static final String EXTENSION_POINT_SOURCE_CONTAINER_TYPES = "sourceContainerTypes"; //$NON-NLS-1$ - - /** - * Simple identifier constant (value "sourcePathComputers") for the - * source path computers extension point. - * - * @since 3.0 - */ - public static final String EXTENSION_POINT_SOURCE_PATH_COMPUTERS = "sourcePathComputers"; //$NON-NLS-1$ - - /** - * Simple identifier constant for the launch options extension point - * - * @since 3.3 - */ - public static final String EXTENSION_POINT_LAUNCH_OPTIONS = "launchOptions"; //$NON-NLS-1$ - - /** - * Simple identifier constant for the breakpoint import participant extension point - * - * @since 3.5 - */ - public static final String EXTENSION_POINT_BREAKPOINT_IMPORT_PARTICIPANTS = "breakpointImportParticipants"; //$NON-NLS-1$ - - /** - * Status code indicating an unexpected error. - * - * @since 3.4 - */ - public static final int ERROR = 125; - - /** - * Status code indicating an unexpected internal error. Internal errors - * should never be displayed to the user in dialogs or status text. - * Internal error messages are not translated. - */ - public static final int INTERNAL_ERROR = 120; - - /** - * Status code indicating that the Eclipse runtime does not support - * launching a program with a working directory. This feature is only - * available if Eclipse is run on a 1.3 runtime or higher. - *

- * A status handler may be registered for this error condition, - * and should return a Boolean indicating whether the program - * should be re-launched with the default working directory. - *

- */ - public static final int ERR_WORKING_DIRECTORY_NOT_SUPPORTED = 115; - - /** - * The launch configuration attribute that designates the process factory ID - * for the process factory to be used when creating a new process as a result of launching - * the launch configuration. - * @since 3.0 - */ - public static final String ATTR_PROCESS_FACTORY_ID = "process_factory_id"; //$NON-NLS-1$ - - /** - * The launch attribute that designates whether or not it's associated - * launch should capture output. Value is a string representing a boolean - - * true or false. When unspecified, the default - * value is considered true. - * - * @since 3.1 - */ - public static final String ATTR_CAPTURE_OUTPUT = PI_DEBUG_CORE + ".capture_output"; //$NON-NLS-1$ - - /** - * The launch attribute that stores the time stamp of when a launch configuration was - * launched. Value is {@link Long#toString(long)} of {@link System#currentTimeMillis()}. - * - * @since 3.6 - */ - public static final String ATTR_LAUNCH_TIMESTAMP = PI_DEBUG_CORE + ".launch.timestamp"; //$NON-NLS-1$ - - /** - * This launch attribute designates the encoding to be used by the console - * associated with the launch. - *

- * For release 3.3, the system encoding is used when unspecified. Since 3.4, - * the inherited encoding is used when unspecified. See {@link ILaunchManager} for a - * description in getEncoding(ILaunchConfiguration). - *

- *

- * Value of this constant is the same as the value of the old - * IDebugUIConstants.ATTR_CONSOLE_ENCODING constant for backward - * compatibility. - *

- * @since 3.3 - */ - public static final String ATTR_CONSOLE_ENCODING = "org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING"; //$NON-NLS-1$ - - /** - * The singleton debug plug-in instance. - */ - private static DebugPlugin fgDebugPlugin= null; - - /** - * The singleton breakpoint manager. - */ - private BreakpointManager fBreakpointManager; - - /** - * The singleton expression manager. - */ - private ExpressionManager fExpressionManager; - - /** - * The singleton launch manager. - */ - private LaunchManager fLaunchManager; - - /** - * The singleton memory block manager. - * @since 3.1 - */ - private MemoryBlockManager fMemoryBlockManager; - - /** - * The collection of debug event listeners. - */ - private ListenerList fEventListeners = new ListenerList(); - - /** - * Event filters, or null if none. - */ - private ListenerList fEventFilters = new ListenerList(); - - /** - * Whether this plug-in is in the process of shutting - * down. - */ - private boolean fShuttingDown= false; - - /** - * Table of status handlers. Keys are {plug-in identifier, status code} - * pairs, and values are associated IConfigurationElements. - */ - private HashMap fStatusHandlers = null; - - /** - * Map of process factories. Keys are process factory IDs - * and values are associated IConfigurationElements. - * @since 3.0 - */ - private HashMap fProcessFactories = null; - - /** - * Mode constants for the event notifier - */ - private static final int NOTIFY_FILTERS = 0; - private static final int NOTIFY_EVENTS = 1; - - - /** - * Queue of debug events to fire to listeners and asynchronous runnables to execute - * in the order received. - * - * @since 3.1 - */ - private List fEventQueue = new ArrayList(); - - /** - * Job to fire events to listeners. - * @since 3.1 - */ - private EventDispatchJob fEventDispatchJob = new EventDispatchJob(); - - /** - * Event dispatch job. Processes event queue of debug events and runnables. - * - * @since 3.1 - */ - class EventDispatchJob extends Job { - - EventNotifier fNotifier = new EventNotifier(); - AsynchRunner fRunner = new AsynchRunner(); - - /** - * Creates a new event dispatch job. - */ - public EventDispatchJob() { - super(DebugCoreMessages.DebugPlugin_1); - setPriority(Job.INTERACTIVE); - setSystem(true); - } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - protected IStatus run(IProgressMonitor monitor) { - - while (!fEventQueue.isEmpty()) { - Object next = null; - synchronized (fEventQueue) { - if (!fEventQueue.isEmpty()) { - next = fEventQueue.remove(0); - } - } - if (next instanceof Runnable) { - fRunner.async((Runnable) next); - } else if (next != null) { - fNotifier.dispatch((DebugEvent[]) next); - } - } - return Status.OK_STATUS; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#shouldRun() - */ - public boolean shouldRun() { - return shouldSchedule(); - } - /* (non-Javadoc) - * @see org.eclipse.core.internal.jobs.InternalJob#shouldSchedule() - */ - public boolean shouldSchedule() { - return !(isShuttingDown() || fEventListeners.isEmpty()); - } - - } - - /** - * Returns the singleton instance of the debug plug-in. - * - * @return the debug plug-in - */ - public static DebugPlugin getDefault() { - return fgDebugPlugin; - } - - /** - * Sets the singleton instance of the debug plug-in. - * - * @param plugin the debug plug-in, or null - * when shutting down - */ - private static void setDefault(DebugPlugin plugin) { - fgDebugPlugin = plugin; - } - - /** - * Convenience method which returns the unique identifier of this plug-in. - * - * @return debug plug-in identifier - */ - public static String getUniqueIdentifier() { - return PI_DEBUG_CORE; - } - - /** - * Constructs the debug plug-in. - *

- * An instance of this plug-in runtime class is automatically created - * when the facilities provided by this plug-in are required. - * Clients must never explicitly instantiate a plug-in runtime class. - *

- */ - public DebugPlugin() { - super(); - setDefault(this); - } - - /** - * Adds the given listener to the collection of registered debug - * event listeners. Has no effect if an identical listener is already - * registered. - * - * @param listener the listener to add - * @since 2.0 - */ - public void addDebugEventListener(IDebugEventSetListener listener) { - fEventListeners.add(listener); - } - - /** - * Notifies all registered debug event set listeners of the given - * debug events. Events which are filtered by a registered debug event - * filter are not fired. - * - * @param events array of debug events to fire - * @see IDebugEventFilter - * @see IDebugEventSetListener - * @since 2.0 - */ - public void fireDebugEventSet(DebugEvent[] events) { - if (isShuttingDown() || events == null || fEventListeners.isEmpty()) - return; - synchronized (fEventQueue) { - fEventQueue.add(events); - } - fEventDispatchJob.schedule(); - } - - /** - * Asynchronously executes the given runnable in a separate - * thread, after debug event dispatch has completed. If debug - * events are not currently being dispatched, the runnable is - * scheduled to run in a separate thread immediately. - * - * @param r runnable to execute asynchronously - * @since 2.1 - */ - public void asyncExec(Runnable r) { - synchronized (fEventQueue) { - fEventQueue.add(r); - } - fEventDispatchJob.schedule(); - } - - /** - * Returns the breakpoint manager. - * - * @return the breakpoint manager - * @see IBreakpointManager - */ - public synchronized IBreakpointManager getBreakpointManager() { - if (fBreakpointManager == null) { - fBreakpointManager = new BreakpointManager(); - } - return fBreakpointManager; - } - - /** - * Returns the launch manager. - * - * @return the launch manager - * @see ILaunchManager - */ - public synchronized ILaunchManager getLaunchManager() { - if (fLaunchManager == null) { - fLaunchManager = new LaunchManager(); - } - return fLaunchManager; - } - - /** - * Returns the memory block manager. - * @return the memory block manager. - * @see IMemoryBlockManager - * @since 3.1 - */ - public synchronized IMemoryBlockManager getMemoryBlockManager(){ - if (fMemoryBlockManager == null) { - fMemoryBlockManager = new MemoryBlockManager(); - } - return fMemoryBlockManager; - } - - /** - * Returns the status handler registered for the given - * status, or null if none. - * - * @param status status for which a status handler has been requested - * @return the status handler registered for the given - * status, or null if none - * @since 2.0 - */ - public IStatusHandler getStatusHandler(IStatus status) { - boolean enabled = Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, true, null); - if (!enabled) { - return null; - } - StatusHandlerKey key = new StatusHandlerKey(status.getPlugin(), status.getCode()); - if (fStatusHandlers == null) { - initializeStatusHandlers(); - } - IConfigurationElement config = (IConfigurationElement)fStatusHandlers.get(key); - if (config != null) { - try { - Object handler = config.createExecutableExtension(IConfigurationElementConstants.CLASS); - if (handler instanceof IStatusHandler) { - return (IStatusHandler)handler; - } - invalidStatusHandler(null, MessageFormat.format("Registered status handler {0} does not implement required interface IStatusHandler.", new String[] {config.getDeclaringExtension().getUniqueIdentifier()})); //$NON-NLS-1$ - } catch (CoreException e) { - log(e); - } - } - return null; - } - - /** - * Returns the expression manager. - * - * @return the expression manager - * @see IExpressionManager - * @since 2.0 - */ - public synchronized IExpressionManager getExpressionManager() { - if (fExpressionManager == null) { - fExpressionManager = new ExpressionManager(); - } - return fExpressionManager; - } - - /** - * Removes the given listener from the collection of registered debug - * event listeners. Has no effect if an identical listener is not already - * registered. - * - * @param listener the listener to remove - * @since 2.0 - */ - public void removeDebugEventListener(IDebugEventSetListener listener) { - fEventListeners.remove(listener); - } - - /* (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - try { - setShuttingDown(true); - - if (fLaunchManager != null) { - fLaunchManager.shutdown(); - } - if (fBreakpointManager != null) { - fBreakpointManager.shutdown(); - } - if (fMemoryBlockManager != null) { - fMemoryBlockManager.shutdown(); - } - - fEventListeners.clear(); - fEventFilters.clear(); - - SourceLookupUtils.shutdown(); - Preferences.savePreferences(DebugPlugin.getUniqueIdentifier()); - ResourcesPlugin.getWorkspace().removeSaveParticipant(getUniqueIdentifier()); - } finally { - super.stop(context); - setDefault(null); - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - DebugOptions.initDebugOptions(); - ResourcesPlugin.getWorkspace().addSaveParticipant(getUniqueIdentifier(), - new ISaveParticipant() { - public void saving(ISaveContext saveContext) throws CoreException { - Preferences.savePreferences(DebugPlugin.getUniqueIdentifier()); - } - public void rollback(ISaveContext saveContext) {} - public void prepareToSave(ISaveContext saveContext) throws CoreException {} - public void doneSaving(ISaveContext saveContext) {} - }); - //command adapters - IAdapterManager manager= Platform.getAdapterManager(); - CommandAdapterFactory actionFactory = new CommandAdapterFactory(); - manager.registerAdapters(actionFactory, IDisconnect.class); - manager.registerAdapters(actionFactory, IDropToFrame.class); - manager.registerAdapters(actionFactory, IStep.class); - manager.registerAdapters(actionFactory, IStepFilters.class); - manager.registerAdapters(actionFactory, ISuspendResume.class); - manager.registerAdapters(actionFactory, ITerminate.class); - manager.registerAdapters(actionFactory, ILaunch.class); - manager.registerAdapters(actionFactory, IProcess.class); - manager.registerAdapters(actionFactory, IDebugElement.class); - } - - /** - * Creates and returns a new process representing the given - * java.lang.Process. A streams proxy is created - * for the I/O streams in the system process. The process - * is added to the given launch. - *

- * If the launch configuration associated with the given launch - * specifies a process factory, it will be used to instantiate - * the new process. - *

- * @param launch the launch the process is contained in - * @param process the system process to wrap - * @param label the label assigned to the process - * @return the process - * @see IProcess - * @see IProcessFactory - */ - public static IProcess newProcess(ILaunch launch, Process process, String label) { - return newProcess(launch, process, label, null); - } - - /** - * Creates and returns a new process representing the given - * java.lang.Process. A streams proxy is created - * for the I/O streams in the system process. The process - * is added to the given launch, and the process is initialized - * with the given attribute map. - *

- * If the launch configuration associated with the given launch - * specifies a process factory, it will be used to instantiate - * the new process. - *

- * @param launch the launch the process is contained in - * @param process the system process to wrap - * @param label the label assigned to the process - * @param attributes initial values for the attribute map - * @return the process null can be returned if errors occur dealing with the process factory - * designated to create the process. - * @see IProcess - * @see IProcessFactory - * @since 2.1 - */ - public static IProcess newProcess(ILaunch launch, Process process, String label, Map attributes) { - ILaunchConfiguration config= launch.getLaunchConfiguration(); - String processFactoryID= null; - if (config != null) { - try { - processFactoryID= config.getAttribute(ATTR_PROCESS_FACTORY_ID, (String)null); - } catch (CoreException e) { - } - } - if (processFactoryID != null) { - DebugPlugin plugin= DebugPlugin.getDefault(); - if (plugin.fProcessFactories == null) { - plugin.initializeProcessFactories(); - } - IConfigurationElement element= (IConfigurationElement) plugin.fProcessFactories.get(processFactoryID); - if (element == null) { - return null; - } - IProcessFactory processFactory= null; - try { - processFactory = (IProcessFactory)element.createExecutableExtension(IConfigurationElementConstants.CLASS); - } catch (CoreException exception) { - log(exception); - return null; - } - return processFactory.newProcess(launch, process, label, attributes); - } - return new RuntimeProcess(launch, process, label, attributes); - } - - /** - * Returns any logical structure types that have been contributed for the given - * value. - * - * @param value the value for which logical structure types have been requested - * @return logical structure types that have been contributed for the given - * value, possibly an empty collection - * - * @since 3.0 - */ - public static ILogicalStructureType[] getLogicalStructureTypes(IValue value) { - return LogicalStructureManager.getDefault().getLogicalStructureTypes(value); - } - - /** - * Returns the default logical structure type among the given combination of - * logical structure types, or null if none. When the given combination - * of logical structure type is applicable for a value, the default logical structure - * type is used to display a value. - * - * @param types a combination of structures applicable to a value - * @return the default structure that should be used to display the value - * or null if none - * - * @since 3.1 - */ - public static ILogicalStructureType getDefaultStructureType(ILogicalStructureType[] types) { - return LogicalStructureManager.getDefault().getSelectedStructureType(types); - } - - /** - * Sets the default logical structure type among the given combination of logical structure - * types. The logical structure types provided should all be applicable to a single - * value. Specifying null indicates there is no default logical structure - * for the given combination of types. - * - * @param types a combination of logical structure types applicable to a value - * @param def the default logical structure among the given combination of types - * or null if none - * - * @since 3.1 - */ - public static void setDefaultStructureType(ILogicalStructureType[] types, ILogicalStructureType def) { - LogicalStructureManager.getDefault().setEnabledType(types, def); - } - - /** - * Convenience method that performs a runtime exec on the given command line - * in the context of the specified working directory, and returns the - * resulting process. If the current runtime does not support the - * specification of a working directory, the status handler for error code - * ERR_WORKING_DIRECTORY_NOT_SUPPORTED is queried to see if the - * exec should be re-executed without specifying a working directory. - * - * @param cmdLine the command line - * @param workingDirectory the working directory, or null - * @return the resulting process or null if the exec is - * canceled - * @exception CoreException if the exec fails - * @see Runtime - * - * @since 2.1 - */ - public static Process exec(String[] cmdLine, File workingDirectory) throws CoreException { - return exec(cmdLine, workingDirectory, null); - } - - /** - * Convenience method that performs a runtime exec on the given command line - * in the context of the specified working directory, and returns the - * resulting process. If the current runtime does not support the - * specification of a working directory, the status handler for error code - * ERR_WORKING_DIRECTORY_NOT_SUPPORTED is queried to see if the - * exec should be re-executed without specifying a working directory. - * - * @param cmdLine the command line - * @param workingDirectory the working directory, or null - * @param envp the environment variables set in the process, or null - * @return the resulting process or null if the exec is - * canceled - * @exception CoreException if the exec fails - * @see Runtime - * - * @since 3.0 - */ - public static Process exec(String[] cmdLine, File workingDirectory, String[] envp) throws CoreException { - Process p= null; - try { - if (workingDirectory == null) { - p= Runtime.getRuntime().exec(cmdLine, envp); - } else { - p= Runtime.getRuntime().exec(cmdLine, envp, workingDirectory); - } - } catch (IOException e) { - Status status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_0, e); - throw new CoreException(status); - } catch (NoSuchMethodError e) { - //attempting launches on 1.2.* - no ability to set working directory - IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERR_WORKING_DIRECTORY_NOT_SUPPORTED, DebugCoreMessages.DebugPlugin_Eclipse_runtime_does_not_support_working_directory_2, e); - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(status); - - if (handler != null) { - Object result = handler.handleStatus(status, null); - if (result instanceof Boolean && ((Boolean)result).booleanValue()) { - p= exec(cmdLine, null); - } - } - } - return p; - } - - /** - * Returns whether this plug-in is in the process of - * being shutdown. - * - * @return whether this plug-in is in the process of - * being shutdown - */ - private boolean isShuttingDown() { - return fShuttingDown; - } - - /** - * Sets whether this plug-in is in the process of - * being shutdown. - * - * @param value whether this plug-in is in the process of - * being shutdown - */ - private void setShuttingDown(boolean value) { - fShuttingDown = value; - } - - /** - * Returns the collection of debug event listeners registered - * with this plug-in. - * - * @return list of registered debug event listeners, instances - * of IDebugEventSetListeners - */ - private Object[] getEventListeners() { - return fEventListeners.getListeners(); - } - - /** - * Adds the given debug event filter to the registered - * event filters. Has no effect if an identical filter - * is already registered. - * - * @param filter debug event filter - * @since 2.0 - */ - public void addDebugEventFilter(IDebugEventFilter filter) { - fEventFilters.add(filter); - } - - /** - * Removes the given debug event filter from the registered - * event filters. Has no effect if an identical filter - * is not already registered. - * - * @param filter debug event filter - * @since 2.0 - */ - public void removeDebugEventFilter(IDebugEventFilter filter) { - fEventFilters.remove(filter); - } - - /** - * Logs the given message if in debug mode. - * - * @param message the message to log - * @since 2.0 - */ - public static void logDebugMessage(String message) { - if (getDefault().isDebugging()) { - // this message is intentionally not externalized, as an exception may - // be due to the resource bundle itself - log(new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, MessageFormat.format(DebugCoreMessages.DebugPlugin_2, new String[] {message}), null)); - } - } - - /** - * Logs the given message with this plug-in's log and the given - * throwable or null if none. - * @param message the message to log - * @param throwable the exception that occurred or null if none - */ - public static void logMessage(String message, Throwable throwable) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, message, throwable)); - } - - /** - * Logs the specified status with this plug-in's log. - * - * @param status status to log - * @since 2.0 - */ - 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 - * @since 2.0 - */ - public static void log(Throwable t) { - IStatus status= new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_3, t); - log(status); - } - - /** - * Register status handlers. - * - */ - private void initializeStatusHandlers() { - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.PI_DEBUG_CORE, EXTENSION_POINT_STATUS_HANDLERS); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fStatusHandlers = new HashMap(infos.length); - for (int i= 0; i < infos.length; i++) { - IConfigurationElement configurationElement = infos[i]; - String id = configurationElement.getAttribute("plugin"); //$NON-NLS-1$ - String code = configurationElement.getAttribute("code"); //$NON-NLS-1$ - - if (id != null && code != null) { - try { - StatusHandlerKey key = new StatusHandlerKey(id, Integer.parseInt(code)); - fStatusHandlers.put(key, configurationElement); - } catch (NumberFormatException e) { - // invalid status handler - invalidStatusHandler(e, configurationElement.getAttribute("id")); //$NON-NLS-1$ - } - } else { - // invalid status handler - invalidStatusHandler(null, configurationElement.getAttribute("id")); //$NON-NLS-1$ - } - } - } - - /** - * Register process factories. - * - */ - private void initializeProcessFactories() { - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.PI_DEBUG_CORE, EXTENSION_POINT_PROCESS_FACTORIES); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fProcessFactories = new HashMap(infos.length); - for (int i= 0; i < infos.length; i++) { - IConfigurationElement configurationElement = infos[i]; - String id = configurationElement.getAttribute("id"); //$NON-NLS-1$ - String clss = configurationElement.getAttribute("class"); //$NON-NLS-1$ - if (id != null && clss != null) { - fProcessFactories.put(id, configurationElement); - } else { - // invalid process factory - String badDefiner= infos[i].getContributor().getName(); - log(new Status(IStatus.ERROR, DebugPlugin.PI_DEBUG_CORE, ERROR, MessageFormat.format(DebugCoreMessages.DebugPlugin_4, new String[] {badDefiner, id}), null)); - } - } - } - - private void invalidStatusHandler(Exception e, String id) { - log(new Status(IStatus.ERROR, DebugPlugin.PI_DEBUG_CORE, ERROR, MessageFormat.format(DebugCoreMessages.DebugPlugin_5, new String[] {id}), e)); - } - - /** - * Key for status handler extensions - a plug-in identifier/code pair - */ - class StatusHandlerKey { - - String fPluginId; - int fCode; - - StatusHandlerKey(String pluginId, int code) { - fPluginId = pluginId; - fCode = code; - } - - public int hashCode() { - return fPluginId.hashCode() + fCode; - } - - public boolean equals(Object obj) { - if (obj instanceof StatusHandlerKey) { - StatusHandlerKey s = (StatusHandlerKey)obj; - return fCode == s.fCode && fPluginId.equals(s.fPluginId); - } - return false; - } - } - - /** - * Executes runnables after event dispatch is complete. - * - * @since 3.0 - */ - class AsynchRunner implements ISafeRunnable { - - private Runnable fRunnable = null; - - void async(Runnable runnable) { - fRunnable = runnable; - SafeRunner.run(this); - fRunnable = null; - - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_6, exception); - log(status); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - fRunnable.run(); - } - - } - - /** - * Filters and dispatches events in a safe runnable to handle any - * exceptions. - */ - class EventNotifier implements ISafeRunnable { - - private DebugEvent[] fEvents; - private IDebugEventSetListener fListener; - private IDebugEventFilter fFilter; - private int fMode; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - switch (fMode) { - case NOTIFY_FILTERS: - IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_7, exception); - log(status); - break; - case NOTIFY_EVENTS: - status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_8, exception); - log(status); - break; - } - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fMode) { - case NOTIFY_FILTERS: - fEvents = fFilter.filterDebugEvents(fEvents); - break; - case NOTIFY_EVENTS: - fListener.handleDebugEvents(fEvents); - break; - } - } - - /** - * Filter and dispatch the given events. If an exception occurs in one - * listener, events are still fired to subsequent listeners. - * - * @param events debug events - */ - void dispatch(DebugEvent[] events) { - fEvents = events; - Object[] filters = fEventFilters.getListeners(); - if (filters.length > 0) { - fMode = NOTIFY_FILTERS; - for (int i = 0; i < filters.length; i++) { - fFilter = (IDebugEventFilter)filters[i]; - SafeRunner.run(this); - if (fEvents == null || fEvents.length == 0) { - return; - } - } - } - - fMode = NOTIFY_EVENTS; - Object[] listeners= getEventListeners(); - if (DebugOptions.DEBUG_EVENTS) { - for (int i = 0; i < fEvents.length; i++) { - System.out.println(fEvents[i]); - } - } - for (int i= 0; i < listeners.length; i++) { - fListener = (IDebugEventSetListener)listeners[i]; - SafeRunner.run(this); - } - fEvents = null; - fFilter = null; - fListener = null; - } - - } - - /** - * Creates and returns a new XML document. - * - * @return a new XML document - * @throws CoreException if unable to create a new document - * @since 3.0 - */ - public static Document newDocument()throws CoreException { - try { - return LaunchManager.getDocument(); - } catch (ParserConfigurationException e) { - abort("Unable to create new XML document.", e); //$NON-NLS-1$ - } - return null; - } - - /** - * Serializes the given XML document into a string. - * - * @param document XML document to serialize - * @return a string representing the given document - * @throws CoreException if unable to serialize the document - * @since 3.0 - */ - public static String serializeDocument(Document document) throws CoreException { - try { - return LaunchManager.serializeDocument(document); - } catch (TransformerException e) { - abort("Unable to serialize XML document.", e); //$NON-NLS-1$ - } catch (IOException e) { - abort("Unable to serialize XML document.",e); //$NON-NLS-1$ - } - return null; - } - - /** - * Parses the given string representing an XML document, returning its - * root element. - * - * @param document XML document as a string - * @return the document's root element - * @throws CoreException if unable to parse the document - * @since 3.0 - */ - public static Element parseDocument(String document) throws CoreException { - Element root = null; - InputStream stream = null; - try{ - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - parser.setErrorHandler(new DefaultHandler()); - stream = new ByteArrayInputStream(document.getBytes("UTF8")); //$NON-NLS-1$ - root = parser.parse(stream).getDocumentElement(); - } catch (ParserConfigurationException e) { - abort("Unable to parse XML document.", e); //$NON-NLS-1$ - } catch (FactoryConfigurationError e) { - abort("Unable to parse XML document.", e); //$NON-NLS-1$ - } catch (SAXException e) { - abort("Unable to parse XML document.", e); //$NON-NLS-1$ - } catch (IOException e) { - abort("Unable to parse XML document.", e); //$NON-NLS-1$ - } finally { - try{ - if (stream != null) { - stream.close(); - } - } catch(IOException e) { - abort("Unable to parse XML document.", e); //$NON-NLS-1$ - } - } - return root; - } - - /** - * Throws an exception with the given message and underlying exception. - * - * @param message error message - * @param exception underlying exception, or null - * @throws CoreException - */ - private static void abort(String message, Throwable exception) throws CoreException { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, message, exception); - throw new CoreException(status); - } - - /** - * Utility class to parse command line arguments. - * - * @since 3.1 - */ - private static class ArgumentParser { - private String fArgs; - private int fIndex= 0; - private int ch= -1; - - public ArgumentParser(String args) { - fArgs= args; - } - - public String[] parseArguments() { - List v= new ArrayList(); - - ch= getNext(); - while (ch > 0) { - if (Character.isWhitespace((char)ch)) { - ch= getNext(); - } else { - if (ch == '"') { - StringBuffer buf = new StringBuffer(); - buf.append(parseString()); - if (buf.length() == 0 && Platform.getOS().equals(Constants.OS_WIN32)) { - // empty string on windows platform - buf.append("\"\""); //$NON-NLS-1$ - } - v.add(buf.toString()); - } else { - v.add(parseToken()); - } - } - } - - String[] result= new String[v.size()]; - v.toArray(result); - return result; - } - - private int getNext() { - if (fIndex < fArgs.length()) - return fArgs.charAt(fIndex++); - return -1; - } - - private String parseString() { - ch= getNext(); - if (ch == '"') { - ch= getNext(); - return ""; //$NON-NLS-1$ - } - StringBuffer buf= new StringBuffer(); - while (ch > 0 && ch != '"') { - if (ch == '\\') { - ch= getNext(); - if (ch != '"') { // Only escape double quotes - buf.append('\\'); - } else { - if (Platform.getOS().equals(Constants.OS_WIN32)) { - // @see Bug 26870. Windows requires an extra escape for embedded strings - buf.append('\\'); - } - } - } - if (ch > 0) { - buf.append((char)ch); - ch= getNext(); - } - } - ch= getNext(); - return buf.toString(); - } - - private String parseToken() { - StringBuffer buf= new StringBuffer(); - - while (ch > 0 && !Character.isWhitespace((char)ch)) { - if (ch == '\\') { - ch= getNext(); - if (Character.isWhitespace((char)ch)) { - // end of token, don't lose trailing backslash - buf.append('\\'); - return buf.toString(); - } - if (ch > 0) { - if (ch != '"') { // Only escape double quotes - buf.append('\\'); - } else { - if (Platform.getOS().equals(Constants.OS_WIN32)) { - // @see Bug 26870. Windows requires an extra escape for embedded strings - buf.append('\\'); - } - } - buf.append((char)ch); - ch= getNext(); - } else if (ch == -1) { // Don't lose a trailing backslash - buf.append('\\'); - } - } else if (ch == '"') { - buf.append(parseString()); - } else { - buf.append((char)ch); - ch= getNext(); - } - } - return buf.toString(); - } - } - - /** - * Parses the given command line into separate arguments that can be passed to - * DebugPlugin.exec(String[], File). Embedded quotes and slashes - * are escaped. - * - * @param args command line arguments as a single string - * @return individual arguments - * @since 3.1 - */ - public static String[] parseArguments(String args) { - if (args == null) - return new String[0]; - ArgumentParser parser= new ArgumentParser(args); - String[] res= parser.parseArguments(); - - return res; - } - - /** - * Sets whether step filters should be applied to step commands. This - * setting is a global option applied to all registered debug targets. - * - * @param useStepFilters whether step filters should be applied to step - * commands - * @since 3.3 - * @see org.eclipse.debug.core.model.IStepFilters - */ - public static void setUseStepFilters(boolean useStepFilters) { - getStepFilterManager().setUseStepFilters(useStepFilters); - } - - /** - * Returns whether step filters are applied to step commands. - * - * @return whether step filters are applied to step commands - * @since 3.3 - * @see org.eclipse.debug.core.model.IStepFilters - * @see org.eclipse.debug.core.commands.IStepFiltersHandler - */ - public static boolean isUseStepFilters() { - return getStepFilterManager().isUseStepFilters(); - } - - /** - * Returns the step filter manager. - * - * @return step filter manager - */ - private static StepFilterManager getStepFilterManager() { - return ((LaunchManager)getDefault().getLaunchManager()).getStepFilterManager(); - } - - /** - * Returns an adapter of the specified type for the given object or null - * if none. The object itself is returned if it is an instance of the specified type. - * If the object is adaptable and does not subclass PlatformObject, and - * does not provide the specified adapter directly, the platform's adapter manager - * is consulted for an adapter. - * - * @param element element to retrieve adapter for - * @param type adapter type - * @return adapter or null - * @since 3.4 - */ - public static Object getAdapter(Object element, Class type) { - Object adapter = null; - if (element != null) { - if (type.isInstance(element)) { - return element; - } else { - if (element instanceof IAdaptable) { - adapter = ((IAdaptable)element).getAdapter(type); - } - // for objects that don't subclass PlatformObject, check the platform's adapter manager - if (adapter == null && !(element instanceof PlatformObject)) { - adapter = Platform.getAdapterManager().getAdapter(element, type); - } - } - } - return adapter; - } - -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.java deleted file mode 100644 index 49e4bef97..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointListener.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.core; - - - -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.debug.core.model.IBreakpoint; - -/** - * A breakpoint listener is notified of breakpoint additions, - * removals, and changes. Listeners register and unregister with the - * breakpoint manager. - *

- * Clients may implement this interface. - *

- * @see IBreakpointManager - */ - -public interface IBreakpointListener { - - /** - * Notifies this listener that the given breakpoint has been added - * to the breakpoint manager. - * - * @param breakpoint the added breakpoint - * @since 2.0 - */ - public void breakpointAdded(IBreakpoint breakpoint); - /** - * Notifies this listener that the given breakpoint has been removed - * from the breakpoint manager. - * If the given breakpoint has been removed because it has been deleted, - * the associated marker delta is also provided. - * - * @param breakpoint the removed breakpoint - * @param delta the associated marker delta, or null when - * the breakpoint is removed from the breakpoint manager without - * being deleted - * - * @see org.eclipse.core.resources.IMarkerDelta - * @since 2.0 - */ - public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta); - - /** - * Notifies this listener that an attribute of the given breakpoint has - * changed, as described by the delta. - * - * @param breakpoint the changed breakpoint - * @param delta the marker delta that describes the changes - * with the marker associated with the given breakpoint, or - * null when the breakpoint change does not generate - * a marker delta - * - * @see org.eclipse.core.resources.IMarkerDelta - * @since 2.0 - */ - public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java deleted file mode 100644 index d79e3545c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManager.java +++ /dev/null @@ -1,266 +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.core; - - -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.IBreakpointImportParticipant; - -/** - * The breakpoint manager manages the collection of breakpoints - * in the workspace. A breakpoint suspends the execution of a - * program being debugged. The kinds of breakpoints supported by each - * debug architecture and the information required to create those - * breakpoints is defined by each debug architecture. - * Breakpoint creation is a client responsibility. - *

- * Clients interested in breakpoint change notification may - * register with the breakpoint manager - see - * IBreakpointListener and IBreakpointsListener - *

- * @see org.eclipse.debug.core.IBreakpointListener - * @see org.eclipse.debug.core.IBreakpointsListener - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface IBreakpointManager { - /** - * Adds the given breakpoint to the collection of registered breakpoints - * in the workspace and notifies all registered listeners. This has no effect - * if the given breakpoint is already registered. - * - * @param breakpoint the breakpoint to add - * - * @exception CoreException if adding fails. Reasons include:
    - *
  • CONFIGURATION_INVALID - the required MODEL_IDENTIFIER attribute - * is not set on the breakpoint marker.
  • - *
  • A CoreException occurred while verifying the MODEL_IDENTIFIER - * attribute.
  • - *
- * @since 2.0 - */ - public void addBreakpoint(IBreakpoint breakpoint) throws CoreException; - - /** - * Adds the given breakpoints to the collection of registered breakpoints - * in the workspace and notifies all registered listeners. Has no effect - * on breakpoints that are already registered. - * - * @param breakpoints the breakpoints to add - * - * @exception CoreException if adding fails. Reasons include:
    - *
  • CONFIGURATION_INVALID - the required MODEL_IDENTIFIER attribute - * is not set on a breakpoint marker.
  • - *
  • A CoreException occurred while verifying a MODEL_IDENTIFIER - * attribute.
  • - *
- * @since 2.1 - */ - public void addBreakpoints(IBreakpoint[] breakpoints) throws CoreException; - - /** - * Returns the breakpoint associated with the given marker or - * null if no such breakpoint exists - * - * @param marker the marker - * @return the breakpoint associated with the marker - * or null if none exists - * @since 2.0 - */ - public IBreakpoint getBreakpoint(IMarker marker); - - /** - * Returns a collection of all registered breakpoints. - * Returns an empty array if no breakpoints are registered. - * - * @return an array of breakpoints - * @since 2.0 - */ - public IBreakpoint[] getBreakpoints(); - - /** - * Returns whether there are any registered breakpoints. - * - * @return whether there are any registered breakpoints - * @since 2.0 - */ - public boolean hasBreakpoints(); - - /** - * Returns a collection of all breakpoints registered for the - * given debug model. Answers an empty array if no breakpoints are registered - * for the given debug model. - * - * @param modelIdentifier identifier of a debug model plug-in - * @return an array of breakpoints - * @since 2.0 - */ - public IBreakpoint[] getBreakpoints(String modelIdentifier); - - /** - * Returns whether the given breakpoint is currently - * registered with this breakpoint manager. - * - * @param breakpoint a breakpoint - * @return whether the breakpoint is registered - * @since 2.0 - */ - public boolean isRegistered(IBreakpoint breakpoint); - - /** - * Notifies all registered listeners that the given - * breakpoint has changed. Has no effect if the given - * breakpoint is not currently registered. - * - * This method is intended to be used when a breakpoint - * attribute is changed that does not alter the breakpoint's - * underlying marker, that is, when notification will not occur - * via the marker delta mechanism. - * - * @param breakpoint the breakpoint that has changed. - * @since 2.0 - */ - public void fireBreakpointChanged(IBreakpoint breakpoint); - - /** - * Removes the given breakpoint from the breakpoint manager, deletes - * the marker associated with the breakpoint if the delete flag - * is true, and notifies all registered - * listeners. Has no effect if the given breakpoint is not currently - * registered. - * - * @param breakpoint the breakpoint to remove - * @param delete whether to delete the marker associated with the - * breakpoint - * @exception CoreException if an exception occurs while deleting the - * underlying marker. - * @since 2.0 - */ - public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException; - - /** - * Removes the given breakpoints from the breakpoint manager, deletes - * the markers associated with the breakpoints if the delete flag - * is true, and notifies all registered - * listeners. Has no effect on breakpoints not currently - * registered. - * - * @param breakpoints the breakpoints to remove - * @param delete whether to delete the markers associated with the - * breakpoints - * @exception CoreException if an exception occurs while deleting an - * underlying marker. - * @since 2.1 - */ - public void removeBreakpoints(IBreakpoint[] breakpoints, boolean delete) throws CoreException; - - /** - * Adds the given listener to the collection of registered breakpoint listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to add - */ - public void addBreakpointListener(IBreakpointListener listener); - - /** - * Removes the given listener from the collection of registered breakpoint listeners. - * Has no effect if an identical listener is not already registered. - * - * @param listener the listener to remove - */ - public void removeBreakpointListener(IBreakpointListener listener); - - /** - * Adds the given listener to the collection of registered breakpoint listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to add - * @since 2.1 - */ - public void addBreakpointListener(IBreakpointsListener listener); - - /** - * Removes the given listener from the collection of registered breakpoint listeners. - * Has no effect if an identical listener is not already registered. - * - * @param listener the listener to remove - * @since 2.1 - */ - public void removeBreakpointListener(IBreakpointsListener listener); - - /** - * Adds the given listener to the collection of registered breakpoint manager - * listeners. Has no effect if an identical listener is already registered. - * - * @param listener the listener to add - * @since 3.0 - */ - public void addBreakpointManagerListener(IBreakpointManagerListener listener); - - /** - * Removes the given listener from the collection of registered breakpoint manager - * listeners. Has no effect if an identical listener is not already registered. - * - * @param listener the listener to remove - * @since 3.0 - */ - public void removeBreakpointManagerListener(IBreakpointManagerListener listener); - - /** - * Returns whether or not this breakpoint manager is enabled. - * When a breakpoint manager is enabled, all breakpoints - * should be honored. When it is disabled, breakpoints should - * not be honored, regardless of each breakpoint's enabled state. - * - * @return whether or not this breakpoint manager is enabled - * @since 3.0 - */ - public boolean isEnabled(); - - /** - * Sets the enabled state of this breakpoint manager. When - * enabled, breakpoints should be honoured. When disabled, all - * breakpoints should be ignored. - * - * @param enabled whether this breakpoint manager should be - * enabled - * @since 3.0 - */ - public void setEnabled(boolean enabled); - - /** - * Returns the name (user readable String) of the given - * breakpoint's type or null if none has been - * specified. - * - * @param breakpoint the breakpoint - * @return the name of the given breakpoint's type or null - * @since 3.1 - */ - public String getTypeName(IBreakpoint breakpoint); - - /** - * Returns an array of {@link IBreakpointImportParticipant}s for the given - * breakpoint marker id, never null. - * - * @param markertype - * @return an array of {@link IBreakpointImportParticipant}s for the given marker type, - * never null - * @throws CoreException if an exception occurs - * @since 3.5 - */ - public IBreakpointImportParticipant[] getImportParticipants(String markertype) throws CoreException; - -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManagerListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManagerListener.java deleted file mode 100644 index e8839bce2..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointManagerListener.java +++ /dev/null @@ -1,33 +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.core; - -/** - * A breakpoint manager listener is notified when the breakpoint manager's - * enablement changes. When the breakpoint manager is disabled, no breakpoints - * should be honored. When the breakpoint manager is enabled, breakpoints should - * be honored as usual. - *

- * Clients may implement this interface. - *

- * @see IBreakpointManager - * @since 3.0 - */ -public interface IBreakpointManagerListener { - - /** - * Notifies the listener that the breakpoint manager's enablement - * has changed. - * - * @param enabled whether or not the breakpoint manager is enabled - */ - public void breakpointManagerEnablementChanged(boolean enabled); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointsListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointsListener.java deleted file mode 100644 index 6e0aa6ef5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IBreakpointsListener.java +++ /dev/null @@ -1,70 +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.core; - - -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.debug.core.model.IBreakpoint; - -/** - * A breakpoints listener is notified of breakpoint additions, - * removals, and changes. Listeners register and unregister with the - * breakpoint manager. - *

- * This interface is analogous to IBreakpointListener except - * notifications are batched for more than one breakpoint when possible. - *

- *

- * Clients may implement this interface. - *

- * @see IBreakpointManager - * @since 2.1 - */ - -public interface IBreakpointsListener { - - /** - * Notifies this listener that the given breakpoints have been added - * to the breakpoint manager. - * - * @param breakpoints the added breakpoints - */ - public void breakpointsAdded(IBreakpoint[] breakpoints); - /** - * Notifies this listener that the given breakpoints have been removed - * from the breakpoint manager. - * If a breakpoint has been removed because it has been deleted, - * the associated marker delta is also provided. - * - * @param breakpoints the removed breakpoints - * @param deltas the associated marker deltas. Entries may be - * null when a breakpoint is removed from the breakpoint - * manager without being deleted - * - * @see org.eclipse.core.resources.IMarkerDelta - */ - public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas); - - /** - * Notifies this listener that the given breakpoints have - * changed, as described by the corresponding deltas. - * - * @param breakpoints the changed breakpoints - * @param deltas the marker deltas that describe the changes - * with the markers associated with the given breakpoints. Entries - * may be null when a breakpoint change does not generate - * a marker delta - * - * @see org.eclipse.core.resources.IMarkerDelta - */ - public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java deleted file mode 100644 index ece27fe66..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventFilter.java +++ /dev/null @@ -1,38 +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.core; - - -/** - * An event filter allows clients to intercept debug events. - * Event filters are registered with the debug plug-in. - *

- * Clients may implement this interface. - *

- * @see DebugPlugin - * @since 2.0 - */ -public interface IDebugEventFilter { - - /** - * Filters the given set of debug events, and returns the set of debug - * events that should be fired to registered listeners - null - * or an empty collection if no debug events should be fired. - *

- * When multiple event filters are registered, events are passed through - * all filters. That is, the events returned from the first filter are - * passed through the second filter, and so on. - *

- * @param events set of debug events to filter - * @return the set of debug events to fire - */ - public DebugEvent[] filterDebugEvents(DebugEvent[] events); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventSetListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventSetListener.java deleted file mode 100644 index 683270baa..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IDebugEventSetListener.java +++ /dev/null @@ -1,39 +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.core; - - -/** - * A debug event set listener registers with the debug plug-in - * to receive event notification from programs being run or debugged. - *

- * When more than one event is reported, each event has occurred at the - * same location in a target program. For example, a breakpoint may - * reside at the same location at which a step request completes. In - * this case the breakpoint event and step end event are reported together - * in the same event set. - *

- *

- * Clients may implement this interface. - *

- * @see DebugEvent - * @since 2.0 - */ -public interface IDebugEventSetListener { - /** - * Notifies this listener of the given debug events. - * All of the events in the given event collection occurred - * at the same location the program be run or debugged. - * - * @param events the debug events - */ - public void handleDebugEvents(DebugEvent[] events); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.java deleted file mode 100644 index d82e6bfba..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionListener.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.core; - - - -import org.eclipse.debug.core.model.IExpression; - -/** - * An expression listener is notified of expression additions, - * removals, and changes. Listeners register and unregister with the - * expression manager. - *

- * Clients may implement this interface. - *

- * @see IExpressionManager - * @since 2.0 - */ - -public interface IExpressionListener { - - /** - * Notifies this listener that the given expression has been added - * to the expression manager. - * - * @param expression the added expression - */ - public void expressionAdded(IExpression expression); - /** - * Notifies this listener that the given expression has been removed - * from the expression manager. - * - * @param expression the removed expression - */ - public void expressionRemoved(IExpression expression); - - /** - * Notifies this listener that the given expression has - * changed. - * - * @param expression the changed expression - */ - public void expressionChanged(IExpression expression); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java deleted file mode 100644 index fc42306fa..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionManager.java +++ /dev/null @@ -1,169 +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.core; - - -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.core.model.IWatchExpression; -import org.eclipse.debug.core.model.IWatchExpressionDelegate; - -/** - * The expression manager manages the collection of registered - * expressions in the workspace. An expression is a snippet of code - * that can be evaluated to produce a value. Expression creation - * and evaluation are client responsibilities. - *

- * Clients interested in expression change notification may - * register with the expression manager - see - * IExpressionListener and IExpressionsListener. - *

- * @see org.eclipse.debug.core.model.IExpression - * @see org.eclipse.debug.core.IExpressionListener - * @see org.eclipse.debug.core.IExpressionsListener - * @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 IExpressionManager { - /** - * Adds the given expression to the collection of registered expressions - * in the workspace and notifies all registered listeners. This has no effect - * if the given expression is already registered. - * - * @param expression the expression to add - */ - public void addExpression(IExpression expression); - - /** - * Adds the given expressions to the collection of registered expressions - * in the workspace and notifies all registered listeners. Has no effect - * on expressions already registered. - * - * @param expressions the expressions to add - * @since 2.1 - */ - public void addExpressions(IExpression[] expressions); - - /** - * Creates and returns a new watch expression with the - * given text. The returned expression is not added to - * this manager. - * - * @return new watch expression - * @param expressionText the text for the new expression - * @since 3.0 - */ - public IWatchExpression newWatchExpression(String expressionText); - - /** - * Returns a collection of all registered expressions, - * possibly empty. - * - * @return an array of expressions - */ - public IExpression[] getExpressions(); - - /** - * Returns whether there are any registered expressions - * - * @return whether there are any registered expressions - */ - public boolean hasExpressions(); - - /** - * Returns a collection of all expressions registered for the - * given debug model,possibly empty. - * - * @param modelIdentifier identifier of a debug model plug-in - * @return an array of expressions - */ - public IExpression[] getExpressions(String modelIdentifier); - - /** - * Removes the given expression from the expression manager, - * and notifies all registered listeners. Has no effect if the - * given expression is not currently registered. - * - * @param expression the expression to remove - */ - public void removeExpression(IExpression expression); - - /** - * Removes the given expressions from the collection of registered expressions - * in the workspace and notifies all registered listeners. Has no effect - * on expressions not already registered. - * - * @param expressions the expressions to remove - * @since 2.1 - */ - public void removeExpressions(IExpression[] expressions); - - /** - * Adds the given listener to the collection of registered expression listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to add - */ - public void addExpressionListener(IExpressionListener listener); - - /** - * Removes the given listener from the collection of registered expression listeners. - * Has no effect if an identical listener is not already registered. - * - * @param listener the listener to remove - */ - public void removeExpressionListener(IExpressionListener listener); - - /** - * Adds the given listener to the collection of registered expression listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to add - * @since 2.1 - */ - public void addExpressionListener(IExpressionsListener listener); - - /** - * Removes the given listener from the collection of registered expression listeners. - * Has no effect if an identical listener is not already registered. - * - * @param listener the listener to remove - * @since 2.1 - */ - public void removeExpressionListener(IExpressionsListener listener); - - /** - * Returns a new watch expression delegate for the given debug - * model or null if no delegate is available. - * - * @param id the unique identifier of a debug model for which a - * watch expression delegate has been contributed - * @return a watch expression delegate associated with the given model - * or null if none - * @since 3.0 - * @see IWatchExpressionDelegate - */ - public IWatchExpressionDelegate newWatchExpressionDelegate(String id); - - /** - * Returns whether a watch expression delegate has been contributed for - * the given debug model. - * - * @param id the unique identifier of a debug model - * @return whether a watch expression delegate has been contributed for - * the given debug model - * @since 3.1 - * @see IWatchExpressionDelegate - */ - public boolean hasWatchExpressionDelegate(String id); -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionsListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionsListener.java deleted file mode 100644 index a73a72eb2..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IExpressionsListener.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.core; - - -import org.eclipse.debug.core.model.IExpression; - -/** - * An expression listener is notified of expression additions, - * removals, and changes. Listeners register and unregister with the - * expression manager. - *

- * This interface is analogous to IExpressionListener, except - * notifications are batched for more than when expression when possible. - *

- *

- * Clients may implement this interface. - *

- * @see IExpressionManager - * @since 2.1 - */ - -public interface IExpressionsListener { - - /** - * Notifies this listener that the given expressions have been added - * to the expression manager. - * - * @param expressions the added expressions - */ - public void expressionsAdded(IExpression[] expressions); - /** - * Notifies this listener that the given expressions has been removed - * from the expression manager. - * - * @param expressions the removed expressions - */ - public void expressionsRemoved(IExpression[] expressions); - - /** - * Notifies this listener that the given expressions have - * changed. - * - * @param expressions the changed expressions - */ - public void expressionsChanged(IExpression[] expressions); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.java deleted file mode 100644 index 96b595e30..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunch.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.core; - - -import org.eclipse.core.runtime.IAdaptable; -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.core.model.ITerminate; - -/** - * A launch is the result of launching a debug session - * and/or one or more system processes. - *

- * Clients are not required to implement this interface - they should use the implementation - * provided by the class Launch. However, clients may implement this interface - * as required. - *

- * @see Launch - * @see org.eclipse.debug.core.IProcessFactory - */ -public interface ILaunch extends ITerminate, IAdaptable { - /** - * Returns the children of this launch - a collection - * of one or more debug targets and processes, possibly empty. - * - * @return an array (element type:IDebugTarget or IProcess), - * or an empty array - */ - public Object[] getChildren(); - /** - * Returns the primary (first) debug target associated with this launch, or null - * if no debug target is associated with this launch. All debug targets - * associated with this launch may be retrieved by - * getDebugTargets(). - * - * @return the primary debug target associated with this launch, or null - */ - public IDebugTarget getDebugTarget(); - - /** - * Returns the processes that were launched, - * or an empty collection if no processes were launched. - * - * @return array of processes - */ - public IProcess[] getProcesses(); - - /** - * Returns all the debug targets associated with this launch, - * or an empty collection if no debug targets are associated - * with this launch. The primary debug target is the first - * in the collection (if any). - * - * @return array of debug targets - * @since 2.0 - */ - public IDebugTarget[] getDebugTargets(); - - /** - * Adds the given debug target to this launch. Has no effect - * if the given debug target is already associated with this - * launch. Registered listeners are notified that this launch - * has changed. - * - * @param target debug target to add to this launch - * @since 2.0 - */ - public void addDebugTarget(IDebugTarget target); - - /** - * Removes the given debug target from this launch. Has no effect - * if the given debug target is not already associated with this - * launch. Registered listeners are notified that this launch - * has changed. - * - * @param target debug target to remove from this launch - * @since 2.0 - */ - public void removeDebugTarget(IDebugTarget target); - - /** - * Adds the given process to this launch. Has no effect - * if the given process is already associated with this - * launch. Registered listeners are notified that this launch - * has changed. - * - * @param process the process to add to this launch - * @since 2.0 - */ - public void addProcess(IProcess process); - - /** - * Removes the given process from this launch. Has no effect - * if the given process is not already associated with this - * launch. Registered listeners are notified that this launch - * has changed. - * - * @param process the process to remove from this launch - * @since 2.0 - */ - public void removeProcess(IProcess process); - - /** - * Returns the source locator to use for locating source elements for - * the debug target associated with this launch, or null - * if source lookup is not supported. - * - * @return the source locator - */ - public ISourceLocator getSourceLocator(); - - /** - * Sets the source locator to use for locating source elements for - * the debug target associated with this launch, or null - * if source lookup is not supported. - * - * @param sourceLocator source locator or null - * @since 2.0 - */ - public void setSourceLocator(ISourceLocator sourceLocator); - - /** - * Returns the mode of this launch - one of the mode constants defined by - * the launch manager. - * - * @return the launch mode - * @see ILaunchManager - */ - public String getLaunchMode(); - - /** - * Returns the configuration that was launched, or null - * if no configuration was launched. - * - * @return the launched configuration or null - * @since 2.0 - */ - public ILaunchConfiguration getLaunchConfiguration(); - - /** - * Sets the value of a client defined attribute. - * - * @param key the attribute key - * @param value the attribute value - * @since 2.0 - */ - public void setAttribute(String key, String value); - - /** - * Returns the value of a client defined attribute. - * - * @param key the attribute key - * @return value the attribute value, or null if undefined - * @since 2.0 - */ - public String getAttribute(String key); - - /** - * Returns whether this launch contains at least one process - * or debug target. - * - * @return whether this launch contains at least one process - * or debug target - * @since 2.0 - */ - public boolean hasChildren(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java deleted file mode 100644 index 811a89f6a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java +++ /dev/null @@ -1,599 +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.core; - - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.resources.IFile; -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.IProgressMonitor; - -/** - * A launch configuration describes how to launch an application. - * Each launch configuration is an instance of a type of launch - * configuration as described by a launch configuration type - * extension. Each launch configuration has a launch configuration - * delegate which performs the actual launching of a - * configuration. - *

- * A launch configuration may be shared in a repository via - * standard VCM mechanisms, or may be stored locally, essentially - * making the launch configuration private for a single user. - * Thus, a launch configuration may stored as a file in the - * workspace (shared), or as a file in the debug plug-in's state - * location. - *

- * A launch configuration is a handle to its underlying storage. - * Methods annotated as "handle-only" do not require a configuration - * to exist. Methods that require an underlying configuration to exist - * throw a CoreException when an underlying configuration - * is missing. - *

- *

- * A launch configuration is modified by obtaining a working copy - * of a launch configuration, modifying the working copy, and then - * saving the working copy. - *

- *

- * Clients that define a launch configuration delegate extension implement the - * ILaunchConfigurationDelegate interface. - *

- * @see ILaunchConfigurationType - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate - * @see ILaunchConfigurationWorkingCopy - * @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 ILaunchConfiguration extends IAdaptable { - - /** - * The file extension for launch configuration files - * (value "launch"). - */ - public static final String LAUNCH_CONFIGURATION_FILE_EXTENSION = "launch"; //$NON-NLS-1$ - - /** - * Launch configuration attribute storing an identifier of - * a persistable source locator extension. When this attribute is - * specified, a new source locator will be created automatically and - * associated with the launch for this configuration. - * - * @see org.eclipse.debug.core.model.IPersistableSourceLocator - */ - public static final String ATTR_SOURCE_LOCATOR_ID = DebugPlugin.getUniqueIdentifier() + ".source_locator_id"; //$NON-NLS-1$ - - /** - * Launch configuration attribute storing a memento of a - * source locator. When this attribute is specified in - * conjunction with a source locator id, the source locator - * created for a launch will be initialized with this memento. - * When not specified, but a source locator id is specified, - * the source locator will be initialized to default values. - * - * @see org.eclipse.debug.core.model.IPersistableSourceLocator - */ - public static final String ATTR_SOURCE_LOCATOR_MEMENTO = DebugPlugin.getUniqueIdentifier() + ".source_locator_memento"; //$NON-NLS-1$ - - /** - * Returns whether the contents of this launch configuration are - * equal to the contents of the given launch configuration. - * - * @param configuration launch configuration - * @return whether the contents of this launch configuration are equal to the contents - * of the specified launch configuration. - */ - public boolean contentsEqual(ILaunchConfiguration configuration); - - /** - * Returns a copy of this launch configuration, as a - * working copy, with the specified name. The new - * working copy does not refer back to this configuration - * as its original launch configuration (the working copy - * will return null for getOriginal()). - * When the working copy is saved it will not effect this - * launch configuration. - * - * @param name the name of the copy - * @return a copy of this launch configuration - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while initializing the contents of the - * working copy from this configuration's underlying storage.
  • - *
- * @see ILaunchConfigurationWorkingCopy#getOriginal() - */ - public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException; - - /** - * Deletes this launch configuration. This configuration's underlying - * storage is deleted. Has no effect if this configuration - * does not exist. - * - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while deleting this configuration's - * underlying storage.
  • - *
- */ - public void delete() throws CoreException; - - /** - * Returns whether this launch configuration's underlying - * storage exists. This is a handle-only method. - * - * @return whether this launch configuration's underlying - * storage exists - */ - public boolean exists(); - - /** - * Returns the boolean-valued attribute with the given name. - * Returns the given default value if the attribute is undefined. - * - * @param attributeName the name of the attribute - * @param defaultValue the value to use if no value is found - * @return the value or the default value if no value was found. - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while retrieving the attribute from - * underlying storage.
  • - *
  • An attribute with the given name exists, but does not - * have a boolean value
  • - *
- */ - public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException; - - /** - * Returns the integer-valued attribute with the given name. - * Returns the given default value if the attribute is undefined. - * - * @param attributeName the name of the attribute - * @param defaultValue the value to use if no value is found - * @return the value or the default value if no value was found. - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while retrieving the attribute from - * underlying storage.
  • - *
  • An attribute with the given name exists, but does not - * have an integer value
  • - *
- */ - public int getAttribute(String attributeName, int defaultValue) throws CoreException; - - /** - * Returns the java.util.List-valued attribute with the given name. - * Returns the given default value if the attribute is undefined. - * - * @param attributeName the name of the attribute - * @param defaultValue the value to use if no value is found - * @return the value or the default value if no value was found. - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while retrieving the attribute from - * underlying storage.
  • - *
  • An attribute with the given name exists, but does not - * have a List value
  • - *
- */ - public List getAttribute(String attributeName, List defaultValue) throws CoreException; - - /** - * Returns the java.util.Set-valued attribute with the given name. - * Returns the given default value if the attribute is undefined. - * - * @param attributeName the name of the attribute - * @param defaultValue the value to use if no value is found - * @return the value or the default value if no value was found. - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while retrieving the attribute from - * underlying storage.
  • - *
  • An attribute with the given name exists, but does not - * have a List value
  • - *
- * - * @since 3.3 - */ - public Set getAttribute(String attributeName, Set defaultValue) throws CoreException; - - /** - * Returns the java.util.Map-valued attribute with the given name. - * Returns the given default value if the attribute is undefined. - * - * @param attributeName the name of the attribute - * @param defaultValue the value to use if no value is found - * @return the value or the default value if no value was found. - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while retrieving the attribute from - * underlying storage.
  • - *
  • An attribute with the given name exists, but does not - * have a Map value
  • - *
- */ - public Map getAttribute(String attributeName, Map defaultValue) throws CoreException; - - /** - * Returns the string-valued attribute with the given name. - * Returns the given default value if the attribute is undefined. - * - * @param attributeName the name of the attribute - * @param defaultValue the value to use if no value is found - * @return the value or the default value if no value was found. - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while retrieving the attribute from - * underlying storage.
  • - *
  • An attribute with the given name exists, but does not - * have a String value
  • - *
- */ - public String getAttribute(String attributeName, String defaultValue) throws CoreException; - - /** - * Returns a map containing the attributes in this launch configuration. - * Returns an empty map if this configuration has no attributes. - *

- * Modifying the map does not affect this launch configuration's attributes. - * A launch configuration is modified by obtaining a working copy of that - * launch configuration, modifying the working copy, and then saving the working - * copy. - *

- * @return a map of attribute keys and values - * @exception CoreException unable to generate/retrieve an attribute map - * @since 2.1 - */ - public Map getAttributes() throws CoreException; - - /** - * Returns this launch configuration's type's category, or null - * if unspecified. This is a handle-only method. - * - * @return this launch configuration's type's category, or null - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • Unable to retrieve or instantiate this launch configuration's type.
  • - *
- * @since 2.1 - */ - public String getCategory() throws CoreException; - - /** - * Returns the file this launch configuration is stored - * in, or null if this configuration is stored - * locally with the workspace. This is a handle-only method. - * - * @return the file this launch configuration is stored - * in, or null if this configuration is stored - * locally with the workspace - */ - public IFile getFile(); - - /** - * Returns the location of this launch configuration as a - * path in the local file system or null if it cannot - * be mapped to a location in the local file system. This is a handle-only method. - *

- * Since 3.5, this method can return null. For example, when a - * launch configuration is stored in the workspace as an {@link IFile} in - * an external file system ({@link EFS}). - *

- * - * @return the location of this launch configuration as a - * path file system or null if it cannot be mapped - * to a location in the local file system. Since 3.5, this method - * can return null. - * @deprecated Since a launch configuration does not need to be stored in the local - * file system, this attribute should no longer be used to identify a launch configuration. - */ - public IPath getLocation(); - - /** - * Returns the resources this launch configuration is associated with or null - * if none. Clients contributing launch configuration types are responsible for maintaining - * resource mappings as appropriate. - * - * @return the resources this launch configuration is associated with or null - * @throws CoreException unable to get the mapped resource - * @since 3.2 - */ - public IResource[] getMappedResources() throws CoreException; - - /** - * Returns a memento for this launch configuration, or null - * if unable to generate a memento for this configuration. A memento - * can be used to re-create a launch configuration, via the - * launch manager. - * - * @return a memento for this configuration - * @see ILaunchManager#getLaunchConfiguration(String) - * @exception CoreException if an exception occurs generating this - * launch configuration's memento - */ - public String getMemento() throws CoreException; - - /** - * Returns the name of this launch configuration. This is - * a handle-only method. - * - * @return the name of this launch configuration - */ - public String getName(); - - /** - * Returns the launch modes that have been set on this configuration. - * An empty set is returned if no specific launch modes have been set - * on a launch configuration. - *

- * Setting launch modes on a configuration allows a launch to be - * performed in mixed mode - for example, debug and profile at the - * same time. - *

- * @return this configuration's launch modes, possibly an empty set - * @exception CoreException if an exception occurs retrieving modes - * @since 3.3 - */ - public Set getModes() throws CoreException; - - /** - * Returns the preferred launch delegate that has been set on this - * configuration or null if one is not specified. - * - * @param modes mode set for which a preferred delegate has been requested - * @return this configuration's preferred launch delegate for the specified mode set, or - * null if one is not specified - * @exception CoreException if an exception occurs retrieving preferred delegate - * @since 3.3 - */ - public ILaunchDelegate getPreferredDelegate(Set modes) throws CoreException; - - /** - * Returns the type of this launch configuration. This is a - * handle-only method. - * - * @return the type of this launch configuration - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • Unable to retrieve or instantiate this launch configuration's type.
  • - *
- * @see ILaunchConfigurationType - */ - public ILaunchConfigurationType getType() throws CoreException; - - /** - * Returns a working copy of this launch configuration. - * Since 3.3, if this method is called on a working copy, a nested working - * copy is created (a working copy of a working copy). - * Changes to the working copy will be applied to this - * launch configuration when saved, or to the parent working copy. - * The working copy will refer to this launch configuration as its original - * launch configuration, or the working copy it was created from. - *

- * When a working copy (B) is created from a working copy (A), the newly - * created working copy (B) is initialized with the attributes from - * the first working copy (A). Whenever a working copy is saved, it is written - * back to the working copy from which it was created: in this example working - * copy B will write back to working copy A, and A will write back to the - * original launch configuration. - *

- * @return a working copy of this launch configuration, or a nested working copy if called - * on an instance of ILaunchConfigurationWorkingCopy - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • An exception occurs while initializing the contents of the - * working copy from this configuration's underlying storage.
  • - *
- * @see ILaunchConfigurationWorkingCopy#getOriginal() - */ - public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException; - - /** - * Returns whether this configuration contains an attribute with the given name. - * - * @param attributeName the name of the attribute - * @return true if this configuration has the specified attribute false otherwise - * @throws CoreException if unable to retrieve attributes - * - * @since 3.4 - */ - public boolean hasAttribute(String attributeName) throws CoreException; - - /** - * Returns whether this launch configuration is stored - * locally within the workspace. This is a handle-only method. - * - * @return whether this launch configuration is stored - * locally with the workspace - */ - public boolean isLocal(); - - /** - * Returns whether this launch configuration is a candidate for migration. - * - * @return whether this launch configuration is a candidate for migration - * @throws CoreException - * @see ILaunchConfigurationMigrationDelegate - * @since 3.2 - */ - public boolean isMigrationCandidate() throws CoreException ; - - /** - * Returns whether this launch configuration is a working - * copy. Launch configurations which return true - * to this method can be safely cast to - * org.eclipse.debug.core.ILaunchConfigurationWorkingCopy. - * This is a handle-only method. - * - * @return whether this launch configuration is a working - * copy - */ - public boolean isWorkingCopy(); - - /** - * Launches this configuration in the specified mode by delegating to - * this configuration's launch configuration delegate, and returns the - * resulting launch. - *

- * Equivalent to calling launch(String, IProgressMontitor, boolean) - * with a build flag of false. - *

- * @param mode the mode in which to launch, one of the mode constants - * defined by ILaunchManager - RUN_MODE or DEBUG_MODE. - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return the resulting launch - * @exception CoreException if this method fails. Reasons include:
    - *
  • unable to instantiate the underlying launch configuration delegate
  • - *
  • the launch fails (in the delegate) - *
- */ - public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException; - - /** - * Launches this configuration in the specified mode by delegating to - * this configuration's launch configuration delegate, and returns the - * resulting launch. - *

- * If this configuration's launch delegate implements - * ILaunchConfigurationDelegate2, the launch delegate will - * be consulted to provide a launch object for the launch, - * perform pre-launch checks, and build before the launch. - * If build is true and the associated launch - * delegate does not implement ILaunchConfigurationDelegate2 - * an incremental workspace build will be performed before the launch - * by the debug platform. - *

- *

- * The resulting launch object is registered with the launch manager - * before passing it to this configuration's delegate launch method, for - * contributions (debug targets and processes). - *

- *

- * If the delegate contributes a source locator to the launch, that - * source locator is used. Otherwise an appropriate source locator is - * contributed to the launch based on the values of - * ATTR_SOURCE_LOCATOR_ID and - * ATTR_SOURCE_LOCATOR_MEMENTO. If the launch is canceled (via - * the given progress monitor), the launch is removed from the launch - * manager. The launch is returned whether canceled or not. Invoking this - * method causes the underlying launch configuration delegate to be - * instantiated (if not already). - *

- * @param mode the mode in which to launch, one of the mode constants - * defined by ILaunchManager - RUN_MODE or DEBUG_MODE. - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @param build whether the workspace should be built before the launch - * @return resulting launch - * @throws CoreException if an exception occurs during the launch sequence - * @since 3.0 - */ - public ILaunch launch(String mode, IProgressMonitor monitor, boolean build) throws CoreException; - - /** - * Launches this configuration in the specified mode by delegating to - * this configuration's launch configuration delegate, and returns the - * resulting launch. - *

- * If this configuration's launch delegate implements - * ILaunchConfigurationDelegate2, the launch delegate will - * be consulted to provide a launch object for the launch, - * perform pre-launch checks, and build before the launch. - * If build is true and the associated launch - * delegate does not implement ILaunchConfigurationDelegate2 - * an incremental workspace build will be performed before the launch - * by the debug platform. - *

- *

- * When register is true, the resulting launch object - * is registered with the launch manager before passing it to this configuration's delegate - * launch method, for contributions (debug targets and processes). When - * register is false, the launch is not registered with - * the launch manager. Clients that launch configurations without registering - * a launch should register appropriate debug event filters to intercept events - * from unregistered launches. - *

- *

- * If the delegate contributes a source locator to the launch, that - * source locator is used. Otherwise an appropriate source locator is - * contributed to the launch based on the values of - * ATTR_SOURCE_LOCATOR_ID and - * ATTR_SOURCE_LOCATOR_MEMENTO. If the launch is canceled (via - * the given progress monitor), the launch is removed from the launch - * manager. The launch is returned whether canceled or not. Invoking this - * method causes the underlying launch configuration delegate to be - * instantiated (if not already). - *

- * @param mode the mode in which to launch, one of the mode constants - * defined by ILaunchManager - RUN_MODE or DEBUG_MODE. - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @param build whether the workspace should be built before the launch - * @param register whether to register the resulting launch with the launch manager - * @return resulting launch - * @throws CoreException if an exception occurs during the launch sequence - * @since 3.1 - */ - public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException; - - /** - * Migrates this launch configuration to be compatible with current tooling. - * Has no effect if this configuration is not a candidate for migration. - * Migration is performed by a launch configuration migration delegate. - * @throws CoreException if migration fails - * @since 3.2 - * @see ILaunchConfigurationMigrationDelegate - */ - public void migrate() throws CoreException; - - /** - * Returns whether this launch configuration supports the - * specified mode. This is a handle-only method. - * - * @param mode a mode in which a configuration can be launched, one of - * the mode constants defined by ILaunchManager - RUN_MODE or - * DEBUG_MODE. - * @return whether this launch configuration supports the - * specified mode - * @exception CoreException if this method fails. Reasons include: - *
    - *
  • Unable to retrieve this launch configuration's type.
  • - *
- */ - public boolean supportsMode(String mode) throws CoreException; - - /** - * Returns whether this launch configuration is read-only. - * A read-only configuration cannot be modified. - * - * @return whether this configuration is read-only - * - * @since 3.3 - */ - public boolean isReadOnly(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java deleted file mode 100644 index dc7b84fa4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationListener.java +++ /dev/null @@ -1,53 +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.core; - - -/** - * Notified when a launch configuration is created, - * deleted, or changed. - *

- * Clients may implement this interface. - *

- * @since 2.0 - */ -public interface ILaunchConfigurationListener { - - /** - * The given launch configuration has been created. - * - * @param configuration the newly created launch configuration - */ - public void launchConfigurationAdded(ILaunchConfiguration configuration); - - /** - * The given launch configuration has changed in some way. - * The configuration may be a working copy. - * - * @param configuration the launch configuration that has - * changed - */ - public void launchConfigurationChanged(ILaunchConfiguration configuration); - - /** - * The given launch configuration has been deleted. - *

- * The launch configuration no longer exists. Data stored - * in the configuration can no longer be accessed, however - * handle-only attributes of the launch configuration - * can be retrieved. - *

- * - * @param configuration the deleted launch configuration - */ - public void launchConfigurationRemoved(ILaunchConfiguration configuration); -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationMigrationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationMigrationDelegate.java deleted file mode 100644 index ce4e3d014..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationMigrationDelegate.java +++ /dev/null @@ -1,52 +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.core; - -import org.eclipse.core.runtime.CoreException; - -/** - * Responsible for migrating launch configurations between different versions of Eclipse. - * A migration delegate is contributed as an optional attribute of a - * launchConfigurationType extension and is responsible for identifying - * migration candidates and migrating launch configurations of that type. - *

- * For example, since 3.2 launch configurations may have resources mapped to them. A migration - * delegate could assign appropriate resources to a launch configuration create in an earlier - * version. - *

- *

- * Clients may implement this interface. - *

- * @since 3.2 - */ -public interface ILaunchConfigurationMigrationDelegate { - - /** - * Returns whether the given launch configuration requires migration. - * - * @param candidate potential migration candidate - * @return whether the given launch configuration requires migration - * @throws CoreException if an exception occurs determining the status of the - * given configuration - */ - public boolean isCandidate(ILaunchConfiguration candidate) throws CoreException; - - /** - * Migrates the given launch configuration to be compatible with the current tooling. - * - * @param candidate the candidate to be migrated, which can be a launch configuration - * or working copy - * @throws CoreException if an exception occurs during migration - */ - public void migrate(ILaunchConfiguration candidate) throws CoreException; - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java deleted file mode 100644 index 1a24538b5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java +++ /dev/null @@ -1,315 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core; - - -import java.util.Set; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; - -/** - * Describes and creates instances of a specific type of - * launch configuration. Launch configuration types are - * defined by extensions. - *

- * A launch configuration type extension is defined in plugin.xml. - * Following is an example definition of a launch configuration - * type extension. - *

- * <extension point="org.eclipse.debug.core.launchConfigurationTypes">
- *   <launchConfigurationType 
- *      id="com.example.ExampleIdentifier"
- *      delegate="com.example.ExampleLaunchConfigurationDelegate"
- *      modes="run, debug"
- *      name="Example Application">
- *      sourceLocatorId="com.example.SourceLocator">
- *      sourcePathComputerId="com.example.SourcePathComputer">
- *   </launchConfigurationType>
- * </extension>
- * 
- * The attributes are specified as follows: - *
    - *
  • id specifies a unique identifier for this launch configuration - * type.
  • - *
  • delegate specifies the fully qualified name of the java class - * that implements ILaunchConfigurationDelegate. Launch configuration - * instances of this type will delegate to instances of this class - * to perform launching.
  • - *
  • modes specifies a comma separated list of the modes this - * type of launch configuration supports - "run" and/or "debug".
  • - *
  • name specifies a human readable name for this type - * of launch configuration.
  • - *
  • category is an optional attribute that specifies a category - * for this launch configuration type. Categories are client defined. This - * attribute was added in the 2.1 release.
  • - *
  • sourceLocatorId an optional unique identifier of a sourceLocator extension that - * is used to create the source locator for sessions launched using launch configurations - * of this type. This attribute was added in the 3.0 release.
  • - *
  • sourcePathComputerId an optional unique identifier of a sourcePathComputer extension - * that is used to compute a default source lookup path for launch configurations of this type. - * This attribute was added in the 3.0 release.
  • - *
- *

- *

- * The category attribute has been added in release 2.1, such that other - * tools may re-use the launch configuration framework for purposes other than - * the standard running and debugging of programs under development. Such that - * clients may access arbitrary attributes specified in launch configuration type - * extension definitions, the method getAttribute has also been - * added. Launch configurations that are to be recognized as standard run/debug - * launch configurations should not specify the category attribute. - *

- *

- * Clients that define a launch configuration delegate extension implement the - * ILaunchConfigurationDelegate interface. - *

- * @see ILaunchConfiguration - * @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 ILaunchConfigurationType extends IAdaptable { - - /** - * Returns the attribute with the given name, as specified by this launch - * configuration type's extension definition, or null if - * unspecified. - * - * @param attributeName attribute name - * @return the specified extension attribute, or null - * @since 2.1 - */ - public String getAttribute(String attributeName); - - /** - * Returns this launch configuration type's category, or null - * if unspecified. This corresponds to the category attribute specified in - * the extension definition. - * - * @return this launch configuration type's category, or null - * @since 2.1 - */ - public String getCategory(); - - /** - * Returns the launch configuration delegate for launch - * configurations of this type, for run mode. - * The first time this method is called, the delegate is instantiated. - * - * @return launch configuration delegate - * @exception CoreException if unable to instantiate the - * delegate - * @deprecated use getDelegate(String) to specify mode - */ - public ILaunchConfigurationDelegate getDelegate() throws CoreException; - - /** - * Returns the launch configuration delegate for launch - * configurations of this type, for the specified mode. The first time - * this method is called for a mode, the delegate is instantiated. - * Launch delegates may be contributed to a launch configuration type - * via the extension point org.eclipse.debug.core.launchDelegates - * - * @param mode launch mode - * @return launch configuration delegate - * @exception CoreException if unable to instantiate the - * delegate - * @since 3.0 - * @deprecated since 3.3, the method getDelegates(Set) should be used - * instead, as there can be more than one capable delegate per mode or combination - * of modes - */ - public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException; - - /** - * Returns the delegates capable of launching in the specified modes, possibly - * an empty set. - * - * @param modes set of launch modes - * @return the ILaunchDelegates capable of launching - * in the specified modes or an empty collection if none - * @throws CoreException - * @since 3.3 - */ - public ILaunchDelegate[] getDelegates(Set modes) throws CoreException; - - /** - * Returns the preferred launch delegate for this type in the specified mode combination - * or null if there is no preferred delegate. - * - * @param modes the set of modes to support - * @return the preferred delegate or null if none - * @throws CoreException - * - * @since 3.3 - */ - public ILaunchDelegate getPreferredDelegate(Set modes) throws CoreException; - - /** - * Sets the preferred launch delegate for this type in the specified mode combination. - * Specify null as a preferred delegate to remove any preferred delegate - * setting for this launch configuration type. - * - * @param modes launch mode combination - * @param delegate preferred launch delegate or null - * @throws CoreException - * - * @since 3.3 - */ - public void setPreferredDelegate(Set modes, ILaunchDelegate delegate) throws CoreException; - - /** - * Returns whether this launch configuration supports the specified launch - * mode combination. - * - * @param modes launch mode combination - * @return whether the launch mode combination is supported - * @since 3.3 - */ - public boolean supportsModeCombination(Set modes); - - /** - * Returns the unique identifier for this type of launch configuration - * - * @return the unique identifier for this type of launch configuration - */ - public String getIdentifier(); - - /** - * Returns the name of this type of launch configuration. - * - * @return the name of this type of launch configuration - */ - public String getName(); - - /** - * Returns the identifier of the plug-in that contributes this launch configuration type. - * - * @return the identifier of the plug-in that contributes this launch configuration type - * @since 3.0 - */ - public String getPluginIdentifier(); - - /** - * Returns the identifier of the persistable source locator registered with - * this launch configurations type, or null if unspecified. - * A source locator can be specified by a launch configuration type or - * launch delegate extension's sourceLocatorId attribute. - *

- * Only one source locator should be provided per launch configuration type - * and its launch delegates. - *

- * @return the identifier of the persistable source locator registered with - * this launch configurations type, or null if unspecified - * @since 3.0 - */ - public String getSourceLocatorId(); - - /** - * Returns the source path computer registered with this launch configuration - * type or null if unspecified. A source path computer can be - * specified by a launch configuration type or launch delegate extension's - * sourcePathComputerId attribute. - *

- * Only one source path computer should be provided per launch configuration type - * and its launch delegates. - *

- * @return the source path computer registered with this launch configuration - * type or null if unspecified - * @since 3.0 - */ - public ISourcePathComputer getSourcePathComputer(); - - /** - * Returns all of the registered supported modes for this launch configuration type. - * This method does not return null. - * - *

- * The returned set does not convey any mode combination capability nor does it describe how or what the type can launch, all this method does is return - * a set of strings of all the modes in some way associated with this type - *

- * - * @return the set of all supported modes - * @since 3.2 - * - * @deprecated Since 3.3 all modes are provided as sets and not individual strings. The method getSupportedModeCombinations - * should be used instead to retrieve the complete listing of supported modes and their allowable combinations. - */ - public Set getSupportedModes(); - - /** - * Returns a java.util.Set of java.util.Sets containing all of the - * supported launch mode combinations for this type. - * - * @return a set of sets of all the supported mode combinations supported by this type - * - * @since 3.3 - */ - public Set getSupportedModeCombinations(); - - /** - * Returns whether this launch configuration type is public. Public configuration - * types are available for use by the user, for example, the user can create new - * configurations based on public types through the UI. Private types are not - * accessible in this way, but are still available through the methods on - * ILaunchManager. - * - * @return whether this launch configuration type is public. - */ - public boolean isPublic(); - - /** - * Returns a new launch configuration working copy of this type, - * that resides in the specified container, with the given name. - * When container is null, the configuration - * will reside locally in the metadata area. - * Note: a launch configuration is not actually created until the working copy is saved. - *

- * The configuration name parameter cannot contain file separator characters - * (sub directories) when the container is null (i.e. when the - * configuration is to be stored in the local metadata area. - *

- * @param container the container in which the new configuration will - * reside, or null if the configuration should reside - * locally with the metadata. - * @param name name for the launch configuration - * @return a new launch configuration working copy instance of this type - * @exception CoreException if an instance of this type - * of launch configuration could not be created for any - * reason - */ - public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) throws CoreException; - - /** - * Returns whether this type of launch configuration supports - * the specified mode. - * - * @param mode a mode in which a configuration can be launched, one of - * the mode constants defined by ILaunchManager - RUN_MODE or - * DEBUG_MODE. - * @return whether this kind of launch configuration supports the - * specified mode - */ - public boolean supportsMode(String mode); - - /** - * Returns the name of the plug-in that contributed this launch configuration type. - * - * @return name of contributing plug-in - * @since 3.3 - */ - public String getContributorName(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java deleted file mode 100644 index a7ffcb85a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java +++ /dev/null @@ -1,278 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core; - - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; - -/** - * An editable copy of a launch configuration. Attributes of a - * launch configuration are modified by modifying the attributes - * of a working copy, and then saving the working copy. - *

- * Since 3.3, working copies can be nested. For example a working copy B can - * be created from the original launch configuration A. Then a nested working - * copy C can be created from working copy B. When the doSave() method - * is called on C, changes are written back to its parent working copy B without - * effecting the original launch configuration A. When doSave() is called - * on B, the changes are persisted back to the original A. - *

- *

- * Clients that define a launch configuration delegate extension implement the - * ILaunchConfigurationDelegate interface. - *

- * @see ILaunchConfiguration - * @see ILaunchConfigurationType - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate - * @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 ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, IAdaptable { - - /** - * Returns whether this configuration has been modified - * since it was last saved or created. - * - * @return whether this configuration has been modified - * since it was last saved or created - */ - public boolean isDirty(); - - /** - * Saves this working copy to its underlying file and returns - * a handle to the resulting launch configuration. - * Has no effect if this configuration does not need saving. - * Creates the underlying file if not yet created. - *

- * Since 3.3, if this is a nested working copy, the contents of this working copy are - * saved to the parent working copy and the parent working copy is returned without - * effecting the original launch configuration. - *

- * @return handle to saved launch configuration - * @exception CoreException if an exception occurs while - * writing this configuration to its underlying file. - */ - public ILaunchConfiguration doSave() throws CoreException; - - /** - * Sets the integer-valued attribute with the given name. - * - * @param attributeName the name of the attribute, cannot be null - * @param value the value - */ - public void setAttribute(String attributeName, int value); - - /** - * Sets the String-valued attribute with the given name. - * If the value is null, the attribute is removed from - * this launch configuration. - * - * @param attributeName the name of the attribute, cannot be null - * @param value the value, or null if the attribute is to be undefined - */ - public void setAttribute(String attributeName, String value); - - /** - * Sets the java.util.List-valued attribute with the given name. - * The specified List must contain only String-valued entries. - * If the value is null, the attribute is removed from - * this launch configuration. - * - * @param attributeName the name of the attribute, cannot be null - * @param value the value, or null if the attribute is to be undefined - */ - public void setAttribute(String attributeName, List value); - - /** - * Sets the java.util.Map-valued attribute with the given name. - * The specified Map must contain only String keys and String values. - * If the value is null, the attribute is removed from - * this launch configuration. - * - * @param attributeName the name of the attribute, cannot be null - * @param value the value, or null if the attribute is to be undefined - */ - public void setAttribute(String attributeName, Map value); - - /** - * Sets the java.util.Set-valued attribute with the given name. - * The specified Set must contain only String values. - * If the value is null, the attribute is removed from - * this launch configuration. - * - * @param attributeName the name of the attribute, cannot be null - * @param value the value, or null if the attribute is to be undefined - * @since 3.6 - */ - public void setAttribute(String attributeName, Set value); - - /** - * Sets the boolean-valued attribute with the given name. - * - * @param attributeName the name of the attribute, cannot be null - * @param value the value - */ - public void setAttribute(String attributeName, boolean value); - - /** - * Returns the original launch configuration this working copy - * was created from or null if this is a new - * working copy created from a launch configuration type. - * - * @return the original launch configuration, or null - */ - public ILaunchConfiguration getOriginal(); - - /** - * Renames this launch configuration to the specified name. - * The new name cannot be null. Has no effect if the name - * is the same as the current name. If this working copy is based - * on an existing launch configuration, this will cause - * the underlying launch configuration file to be renamed when - * this working copy is saved. - * - * @param name the new name for this configuration - */ - public void rename(String name); - - /** - * Sets the container this launch configuration will be stored - * in when saved. When set to null, this configuration - * will be stored locally with the workspace. The specified - * container must exist, if specified. - *

- * If this configuration is changed from local to non-local, - * a file will be created in the specified container when - * saved. The local file associated with this configuration - * will be deleted. - *

- *

- * If this configuration is changed from non-local to local, - * a file will be created locally when saved. - * The original file associated with this configuration in - * the workspace will be deleted. - *

- * - * @param container the container in which to store this - * launch configuration, or null if this - * configuration is to be stored locally - */ - public void setContainer(IContainer container); - - /** - * Sets the attributes of this launch configuration to be the ones contained - * in the given map. The values must be an instance of one of the following - * classes: String, Integer, or - * Boolean, List, Map. Attributes - * previously set on this launch configuration but not included in the given - * map are considered to be removals. Setting the given map to be - * null is equivalent to removing all attributes. - * - * @param attributes a map of attribute names to attribute values. - * Attribute names are not allowed to be null - * @since 2.1 - */ - public void setAttributes(Map attributes); - - /** - * Sets the resources associated with this launch configuration, possibly null. - * Clients contributing launch configuration types are responsible for maintaining - * resource mappings. - * - * @param resources the resource to map to this launch configuration or null - * @since 3.2 - */ - public void setMappedResources(IResource[] resources); - - /** - * Set the launch modes for this configuration. - * Over-writes existing launch modes. - *

- * Setting launch modes on a configuration allows the configuration to - * be launched in a mixed mode - for example, debug and profile. - *

- * @param modes launch mode identifiers to set on this configuration - * or null to clear mode settings - * - * @since 3.3 - */ - public void setModes(Set modes); - - /** - * Set the preferred launch delegates' id for the given mode set. Passing in null as a delegate - * id will cause the mapping for the specified mode set (if any) to be removed. - * - * @param modes the set of modes to set this delegate id for - * @param delegateId the id of the delegate to associate as preferred for the specified mode set - * or null to clear the setting - * - * @since 3.3 - */ - public void setPreferredLaunchDelegate(Set modes, String delegateId); - - /** - * Adds the specified launch modes to this configuration's settings. - *

- * Setting launch modes on a configuration allows the configuration to - * be launched in a mixed mode - for example, debug and profile. - *

- * @param modes launch mode identifiers to append to the current set of - * launch modes set on this configuration - * - * @since 3.3 - */ - public void addModes(Set modes); - - /** - * Removes the specified launch modes from this configuration's settings. - *

- * Setting launch modes on a configuration allows the configuration to - * be launched in a mixed mode - for example, debug and profile. - *

- * @param modes launch mode identifiers to remove from the current set of - * launch modes set on this configuration - * - * @since 3.3 - */ - public void removeModes(Set modes); - - /** - * Removes the specified attribute from the this configuration and returns - * the previous value associated with the specified attribute name, or null - * if there was no mapping for the attribute. Note that for int's and booleans, - * corresponding Integer and Boolean objects are returned. - *

- * This method allows non-object attributes to be removed. - *

- * @param attributeName the name of the attribute to remove - * @return previous value of the attribute or null - * - * @since 3.4 - */ - public Object removeAttribute(String attributeName); - - /** - * Returns the parent of this working copy or null if this working - * copy is not a nested copy of another working copy. - * - * @return parent or null - * @since 3.3 - */ - public ILaunchConfigurationWorkingCopy getParent(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java deleted file mode 100644 index b9af5cd34..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java +++ /dev/null @@ -1,92 +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.core; - -import java.util.List; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; - -/** - * A proxy to an {@link ILaunchConfigurationDelegate}. Represents a - * launch delegate contributed to the org.eclipse.debug.core.launchDelegates - * extension point. - * @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 ILaunchDelegate { - - /** - * Returns this delegate's unique identifier. - * - * @return launch delegate identifier - */ - public String getId(); - - /** - * Returns a human readable name for this launch delegate - * or null if none. - * - * @return name or null - */ - public String getName(); - - /** - * Returns a description of this launch delegate, or - * null if none. - * - * @return description or null - */ - public String getDescription(); - - /** - * Returns the name of the plug-in that contributed this delegate. - * - * @return contributor name - */ - public String getContributorName(); - - /** - * Returns the underlying launch configuration. - * Causes the delegate to be instantiated. - * - * @return launch configuration delegate - * @exception CoreException if unable to instantiate the delegate - */ - public ILaunchConfigurationDelegate getDelegate() throws CoreException; - - /** - * Returns the complete set of launch modes supported by this delegate as a list of sets. - * Each set contains one of more launch mode identifiers. When a set contains more than - * one launch mode, it indicates that a mixed launch mode is supported. - * If no modes are available an empty list is returned. - * - * @return the complete set of launch modes this delegate supports - */ - public List getModes(); - - /** - * Returns the id of the plug-in that contributed this launch delegate. - * - * @return the id of the plug-in that contributed this launch delegate - */ - public String getPluginIdentifier(); - - /** - * Returns the specified perspective id for the given mode set, or null if one is not provided - * @param modes the set of modes to get the perspective id - * @return the perspective id associated with the given mode set, or null if none provided - */ - public String getPerspectiveId(Set modes); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.java deleted file mode 100644 index 427b6f4f9..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchListener.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.core; - - -/** - * A launch listener is notified of launches as they - * are added and removed from the launch manager. Also, - * when a process or debug target is added to a launch, - * listeners are notified of a change. - *

- * Clients may implement this interface. - *

- * @see org.eclipse.debug.core.ILaunch - * @see org.eclipse.debug.core.ILaunchesListener - */ -public interface ILaunchListener { - /** - * Notifies this listener that the specified - * launch has been removed. - * - * @param launch the removed launch - * @since 2.0 - */ - public void launchRemoved(ILaunch launch); - /** - * Notifies this listener that the specified launch - * has been added. - * - * @param launch the newly added launch - * @since 2.0 - */ - public void launchAdded(ILaunch launch); - /** - * Notifies this listener that the specified launch - * has changed. For example, a process or debug target - * has been added to the launch. - * - * @param launch the changed launch - * @since 2.0 - */ - public void launchChanged(ILaunch launch); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java deleted file mode 100644 index 08be84bfe..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java +++ /dev/null @@ -1,531 +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.core; - - -import java.util.Map; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; - -/** - * The launch manager manages the set of registered launches, maintaining - * a collection of active processes and debug targets. Clients interested - * in launch notification may register with the launch manager. - * @see ILaunch - * @see ILaunchListener - * @noimplement This interface is not intended to be implemented by clients. - * @noextend This interface is not intended to be extended by clients. - */ -public interface ILaunchManager { - /** - * A launch in a normal, non-debug mode(value "run"). - */ - public static final String RUN_MODE= "run"; //$NON-NLS-1$ - /** - * A launch in a special debug mode (value "debug"). - */ - public static final String DEBUG_MODE= "debug"; //$NON-NLS-1$ - /** - * A launch in a special profile mode (value "profile"). - * @since 3.0 - */ - public static final String PROFILE_MODE= "profile"; //$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 in the user interface (launch history or the launch - * configuration dialog). - * - * @since 3.6 - */ - public static final String ATTR_PRIVATE = "org.eclipse.debug.ui.private"; //$NON-NLS-1$ - - /** - * Launch configuration attribute name. The value is a map of environment - * variables passed into Runtime.exec(...) when a launch configuration is launched. - * Default value is null which indicates the default environment - * should be used. - * - * @since 3.0 - */ - public static final String ATTR_ENVIRONMENT_VARIABLES = DebugPlugin.getUniqueIdentifier() + ".environmentVariables"; //$NON-NLS-1$ - - /** - * Launch configuration attribute name. The value is a boolean value specifying - * whether the environment variables in a launch configuration - * should be appended to the native environment (i.e. when true), - * or if they should replace the environment (i.e. false). The - * default value is true. - * - * @since 3.0 - */ - public static final String ATTR_APPEND_ENVIRONMENT_VARIABLES = DebugPlugin.getUniqueIdentifier() + ".appendEnvironmentVariables"; //$NON-NLS-1$ - - /** - * Adds the specified launch and notifies listeners. Has no - * effect if an identical launch is already registered. - * - * @param launch the launch to add - * @since 2.0 - */ - public void addLaunch(ILaunch launch); - /** - * Adds the given launch configuration listener to the list - * of listeners notified when a launch configuration is - * added, removed, or changed. Has no effect if the given listener - * is already registered. - * - * @param listener launch configuration listener - * @since 2.0 - */ - public void addLaunchConfigurationListener(ILaunchConfigurationListener listener); - /** - * Adds the specified launch objects and notifies listeners. Has no - * effect on identical launch objects already registered. - * - * @param launches the launch objects to add - * @since 2.1 - */ - public void addLaunches(ILaunch[] launches); - /** - * Adds the given listener to the collection of registered launch listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to register - * @since 2.1 - */ - public void addLaunchListener(ILaunchesListener listener); - /** - * Adds the given listener to the collection of registered launch listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to register - */ - public void addLaunchListener(ILaunchListener listener); - /** - * Return a String that can be used as the name of a launch configuration. The name - * is guaranteed to be unique (no existing launch configurations will have this name). - * The name that is returned uses the namePrefix as a starting point. If - * there is no existing launch configuration with this name, then namePrefix - * is returned. Otherwise, the value returned consists of the specified prefix plus - * some suffix that guarantees uniqueness. - * - * @param namePrefix the String that the returned name must begin with - * @return launch configuration name - * @since 2.0 - * @deprecated since 3.6 clients should use the {@link #generateLaunchConfigurationName(String)} method which - * will perform validation of the name and correct unsupported name parts. - */ - public String generateUniqueLaunchConfigurationNameFrom(String namePrefix); - - /** - * Returns a string that can be used as the name of a launch configuration. The name - * is guaranteed to be unique (no existing launch configurations will have this name). - * The name that is returned uses the namePrefix as a starting point. If - * there is no existing launch configuration with this name, then namePrefix - * is returned. Otherwise, the value returned consists of the specified prefix plus - * some suffix that guarantees uniqueness. - *

- * If the name prefix does not pass name validation any illegal parts of the name will be removed - * during the name generation. Illegal characters will be replaced with '_' and illegal names will be - * replaced with "_reserved_". - *

- * @param namePrefix the string that the returned name should begin with - * @return launch configuration name - * @since 3.6 - */ - public String generateLaunchConfigurationName(String namePrefix); - - /** - * Returns if the given name is valid or not. If an invalid name part is located - * an {@link IllegalArgumentException} is thrown. - * - * @param configname the name to check - * @return true if the given name is valid or throws an exception if not, where an invalid name - * is either a reserved system name (like 'aux' on Win 32) or the name contains invalid characters (like ':' or '/'). - * @throws IllegalArgumentException if the name is invalid, where an invalid - * is either a reserved system name (like 'aux' on Win 32) or the name contains invalid characters (like ':' or '/'). - * @since 3.6 - */ - public boolean isValidLaunchConfigurationName(String configname) throws IllegalArgumentException; - - /** - * Returns the collection of debug targets currently registered with this - * launch manager. - * - * @return an array of debug targets - */ - public IDebugTarget[] getDebugTargets(); - /** - * Returns an array of environment variables to be used when - * launching the given configuration or null if unspecified. - * Each entry is of the form "var_name=value". - * - * @return an array of environment variables to use when launching the given - * configuration or null if unspecified - * @param configuration launch configuration - * @throws CoreException if unable to access associated attribute or if - * unable to resolve a variable in an environment variable's value - * @since 3.0 - */ - public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException; - /** - * This method returns the character encoding to use when launching the specified ILaunchConfiguration. - * The returned encoding can be derived from one of three places in the following order: - *
    - *
  1. An attribute saved on the configuration itself (where no attribute means use the default encoding).
  2. - *
  3. The mapped resources for the configuration, in the event one of them has a specific encoding that - * is not the workspace default. If there are more than one mapped resource we optimistically ask only the first resource - * for its encoding.
  4. - *
  5. We ask the ResourcesPlugin for the workspace preference (which resolves back to the system - * property file.encoding if the user has made no changes to the workspace encoding preference).
  6. - *
- * @param configuration the ILaunchConfiguration to get the encoding for - * @return the encoding to use when launching the specified ILaunchConfiguration - * @throws CoreException - * - * @since 3.4 - */ - public String getEncoding(ILaunchConfiguration configuration) throws CoreException; - /** - * Returns a handle to the launch configuration contained - * in the specified file. This method does not check if the specified IFile is - * a launch configuration file or that it exists in the local or - * remote file system. - * - * @param file launch configuration file - * @return a handle to the launch configuration contained - * in the specified file - * @since 2.0 - */ - public ILaunchConfiguration getLaunchConfiguration(IFile file); - /** - * Returns a handle to the launch configuration specified by - * the given memento. The configuration may not exist. - * - * @param memento launch configuration memento - * @return a handle to the launch configuration specified by - * the given memento - * @exception CoreException if the given memento is invalid or - * an exception occurs parsing the memento - * @see ILaunchConfiguration#getMemento() - * @since 2.0 - */ - public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException; - /** - * Returns all launch configurations defined in the workspace. - * - * @return all launch configurations defined in the workspace - * @exception CoreException if an exception occurs retrieving configurations - * @since 2.0 - */ - public ILaunchConfiguration[] getLaunchConfigurations() throws CoreException; - /** - * Returns all launch configurations of the specified type defined in the workspace - * - * @param type a launch configuration type - * @return all launch configurations of the specified type defined in the workspace - * @exception CoreException if an error occurs while retrieving - * a launch configuration - * @since 2.0 - */ - public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException; - - /** - * Returns the launch configuration type extension with the specified - * id, or null if it does not exist. - * - * @param id unique identifier for a launch configuration type extension - * @return the launch configuration type extension with the specified - * id, or null if it does not exist - * @since 2.0 - */ - public ILaunchConfigurationType getLaunchConfigurationType(String id); - - /** - * Returns all defined launch configuration type extensions - * - * @return all defined launch configuration type extensions - * @since 2.0 - */ - public ILaunchConfigurationType[] getLaunchConfigurationTypes(); - - /** - * Returns the collection of launches currently registered - * with this launch manager. - * - * @return an array of launches - */ - public ILaunch[] getLaunches(); - - /** - * Returns the launch mode registered with the given mode identifier, - * or null if none. - * - * @param mode mode identifier - * @return launch mode or null - * @since 3.0 - */ - public ILaunchMode getLaunchMode(String mode); - - /** - * Returns all registered launch modes. - * - * @return all registered launch modes - * @since 3.0 - */ - public ILaunchMode[] getLaunchModes(); - - /** - * Returns a collection of launch configurations that required migration to be - * compatible with current tooling. - * - * @return a collection of launch configurations that required migration - * @exception org.eclipse.core.runtime.CoreException if an exception occurs determining - * migration candidates - * @since 3.2 - */ - public ILaunchConfiguration[] getMigrationCandidates() throws CoreException; - - /** - * When a launch configuration is created or moved, registered launch - * configuration listeners (see ILaunchConfigurationListener) - * are notified of an add notification for the new configuration. If the - * notification is the result of a move this method will return a handle to - * the launch configuration that the added launch configuration was moved - * from. This method returns null if the added launch - * configuration was not the result of a rename or move. This information is - * only available during the add notification call back - * launchConfigurationAdded. - *

- * Renaming a configuration is considered the same as moving a - * configuration. - *

- * - * @param addedConfiguration a launch configuration for which an add - * notification is being broadcast - * @return the launch configuration that the added launch configuration was - * moved from, or null if the add notification is not the - * result of a move - * @since 2.1 - */ - public ILaunchConfiguration getMovedFrom(ILaunchConfiguration addedConfiguration); - - /** - * When a launch configuration is deleted or moved, registered launch - * configuration listeners (see ILaunchConfigurationListener) - * are notified of a remove notification for launch configuration that has - * been deleted. If the notification is the result of a move this method - * will return a handle to the launch configuration that the removed launch - * configuration was moved to. This method returns null if the - * removed launch configuration was not the result of a rename or move. This - * information is only available during the add notification call back - * launchConfigurationRemoved. - *

- * Renaming a configuration is considered the same as moving a - * configuration. - *

- * - * @param removedConfiguration a launch configuration for which a - * remove notification is being broadcast - * @return the launch configuration that the removed launch configuration - * was moved to, or null if the add notification is not the - * result of a move - * @since 2.1 - */ - public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration); - - /** - * Returns the native system environment variables as a map of - * variable names and values (Strings). - *

- * Note that WIN32 system environment preserves - * the case of variable names but is otherwise case insensitive. - * Depending on what you intend to do with the environment, the - * lack of normalization may or may not be create problems. On - * WIN32, this method normalizes mixed-case keys variable names - * to upper case. Use {@link #getNativeEnvironmentCasePreserved()} - * instead to get a WIN32 system environment where the keys are - * the mixed-case variable names recorded by the OS. - *

- * - * @return the native system environment variables; on WIN32, mixed-case - * variable names (keys) have been normalized to upper case - * (key type: String; value type: String) - * @since 3.0 - */ - public Map getNativeEnvironment(); - - /** - * Returns the native system environment variables as a map of - * variable names and values (Strings). - *

- * Note that WIN32 system environment preserves - * the case of variable names but is otherwise case insensitive. - * Depending on what you intend to do with the environment, the - * lack of normalization may or may not be create problems. This - * method returns mixed-case keys using the variable names - * recorded by the OS. - * Use {@link #getNativeEnvironment()} instead to get a WIN32 system - * environment where all keys have been normalized to upper case. - *

- * - * @return the native system environment variables; on WIN32, mixed-case - * variable names (keys) are returned without normalization - * (key type: String; value type: String) - * @since 3.1 - */ - public Map getNativeEnvironmentCasePreserved(); - - /** - * Returns the collection of processes currently registered with this - * launch manager. - * - * @return an array of processes - */ - public IProcess[] getProcesses(); - - /** - * Returns the source container type extension registered with the - * given unique identifier, or null if none. - * - * @param id unique identifier of a source container type extension - * @return the source container type extension registered with the - * given unique identifier, or null if none - * @since 3.0 - */ - public ISourceContainerType getSourceContainerType(String id); - - /** - * Returns all registered source container type extensions. - * - * @return all registered source container type extensions - * @since 3.0 - */ - public ISourceContainerType[] getSourceContainerTypes(); - - /** - * Returns a source path computer to compute a default source lookup path for - * the given launch configuration, or null if a source path - * computer has not been registered for the associated launch configuration - * type. - * - * @param configuration a launch configuration - * @return a source path computer registered for the associated launch - * configurations type, or null if unspecified - * @throws CoreException if an exception occurs while instantiating a source - * path computer - * @since 3.0 - */ - public ISourcePathComputer getSourcePathComputer(ILaunchConfiguration configuration) throws CoreException; - - /** - * Returns the source path computer extension registered with the given - * unique identifier, or null if none. - * - * @param id source path computer identifier - * @return the source path computer extension registered with the given - * unique identifier, or null if none - * @since 3.0 - */ - public ISourcePathComputer getSourcePathComputer(String id); - - /** - * Return true if there is a launch configuration with the specified name, - * false otherwise. - * - * @return whether a launch configuration already exists with the given name - * @param name the name of the launch configuration whose existence is being checked - * @exception CoreException if unable to retrieve existing launch configuration names - * @since 2.0 - */ - public boolean isExistingLaunchConfigurationName(String name) throws CoreException; - - /** - * Returns whether the given launch is currently registered. - * - * @param launch a launch - * @return whether the launch is currently registered - * @since 3.1 - */ - public boolean isRegistered(ILaunch launch); - - /** - * Creates and returns a new source locator of the specified - * type. - * - * @param identifier the identifier associated with a - * persistable source locator extension - * @return a source locator - * @exception CoreException if an exception occurs creating - * the source locator - * @since 2.0 - */ - public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException; - - /** - * Removes the specified launch and notifies listeners. - * Has no effect if an identical launch is not already - * registered. - * - * @param launch the launch to remove - * @since 2.0 - */ - public void removeLaunch(ILaunch launch); - - /** - * Removes the given launch configuration listener from the list - * of listeners notified when a launch configuration is - * added, removed, or changed. Has no effect if the given listener - * is not already registered. - * - * @param listener launch configuration listener - * @since 2.0 - */ - public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener); - - /** - * Removes the specified launch objects and notifies listeners. - * Has no effect on identical launch objects that are not already - * registered. - * - * @param launches the launch objects to remove - * @since 2.1 - */ - public void removeLaunches(ILaunch[] launches); - - /** - * Removes the given listener from the collection of registered launch listeners. - * Has no effect if an identical listener is not already registered. - * - * @param listener the listener to unregister - * @since 2.1 - */ - public void removeLaunchListener(ILaunchesListener listener); - - /** - * Removes the given listener from the collection of registered launch listeners. - * Has no effect if an identical listener is not already registered. - * - * @param listener the listener to unregister - */ - public void removeLaunchListener(ILaunchListener listener); - -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java deleted file mode 100644 index 9f9849d9a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchMode.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core; - -/** - * A launch mode. The debug platform contributes launch modes - * for run, debug, and profile. Clients may contribute additional launch - * modes in plug-in XML via the launchModes extension point. - *

- * Following is an example launch mode contribution for profiling. A launch - * mode has an unique identifier specified by the mode attribute - * and a human readable label specified by the label attribute. - *

- *  <extension point="org.eclipse.debug.core.launchModes">
- *   <launchMode
- *    mode="profile"
- *    label="Profile">
- *   </launchMode>
- *  </extension>
- * 
- *

- * @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 ILaunchMode { - - /** - * Returns the unique identifier for this launch mode. - * - * @return the unique identifier for this launch mode - */ - public String getIdentifier(); - - /** - * Returns a human readable label for this launch mode. - * - * @return a human readable label for this launch mode - */ - public String getLabel(); - - /** - * Returns a human readable label for this launch mode when used in a - * cascade menu. For example, "Run As". Allows the label to be - * properly externalized. - *

- * A new attribute has been added the the launch mode extension in 3.2 - * to specify this label. When unspecified a default label is generated - * by concatenation, for backwards compatibility. - *

- * @return human readable label for this launch mode when used in a - * cascade menu - * @since 3.2 - */ - public String getLaunchAsLabel(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener.java deleted file mode 100644 index e6c8232b4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener.java +++ /dev/null @@ -1,60 +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.core; - - -/** - * A launches listener is notified of launches as they - * are added and removed from the launch manager. Also, - * when a process or debug target is added to a launch, - * listeners are notified of a change. - *

- * This interface is analogous to {@link ILaunchListener}, except - * notifications are batched to include more than one launch object - * when possible. - *

- *

- * Clients may implement this interface. - *

- *

- * Clients may also implement the extension interface {@link ILaunchesListener2} for - * notification of more than one launch being terminated. - *

- * @see org.eclipse.debug.core.ILaunch - * @see org.eclipse.debug.core.ILaunchManager - * @see ILaunchListener - * @see ILaunchesListener2 - * @since 2.1 - */ -public interface ILaunchesListener { - /** - * Notifies this listener that the specified - * launches have been removed. - * - * @param launches the removed launch objects - */ - public void launchesRemoved(ILaunch[] launches); - /** - * Notifies this listener that the specified launches - * have been added. - * - * @param launches the newly added launch objects - */ - public void launchesAdded(ILaunch[] launches); - /** - * Notifies this listener that the specified launches - * have changed. For example, a process or debug target - * has been added to a launch. - * - * @param launches the changed launch object - */ - public void launchesChanged(ILaunch[] launches); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener2.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener2.java deleted file mode 100644 index 7bf7022ca..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchesListener2.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.core; - -/** - * Enhancements to the launches listener interface. Provides notification - * when one or more launches terminate. - *

- * Clients implementing launches listener may implement - * this interface. - *

- * @since 3.0 - */ -public interface ILaunchesListener2 extends ILaunchesListener { - - /** - * Notification that the given launches have terminated. - * - * @param launches the launches that have terminated - */ - public void launchesTerminated(ILaunch[] launches); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureProvider.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureProvider.java deleted file mode 100644 index df4fb4872..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureProvider.java +++ /dev/null @@ -1,50 +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.core; - -import org.eclipse.debug.core.model.IValue; - -/** - * Provides logical structure types applicable to a raw implementation value from - * a debug model. Associated with a logical structure provider extension. - *

- * The following is an example of a logical structure provider extension: - *

- *  <extension point="org.eclipse.debug.core.logicalStructureProviders">
- *   <logicalStructureProvider
- *    class="com.example.ExampleLogicalStructureProvider"
- *    modelIdentifier="com.example.debug.model">
- *   </logicalStructureProvider>
- * </extension>
- * 
- *

- * In the example above, the specified logical structure provider will be consulted for - * alternative logical structures for values from the com.example.debug.model - * debug model as they are displayed in the variables view. - *

- *

- * Clients contributing logical structure providers must implement this - * interface. - *

- * @since 3.1 - * @see org.eclipse.debug.core.ILogicalStructureType - */ -public interface ILogicalStructureProvider { - - /** - * Returns the logical structure types which are applicable to the given value. - * - * @param value value for which logical structure types are being requested - * @return the logical structure types which are applicable to the given value - */ - public ILogicalStructureType[] getLogicalStructureTypes(IValue value); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureType.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureType.java deleted file mode 100644 index ae049d52b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILogicalStructureType.java +++ /dev/null @@ -1,81 +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.core; - -import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate; -import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2; - -/** - * Provides a value representing the logical structure of a raw implementation value - * from a debug model. Logical structures are useful for navigating complex data - * structures. Logical structure types are contributed via extensions in plug-in XML, - * and provide a delegate for performing logical value computation. Logical - * structure types can be retrieved from the DebugPlugin. - *

- * Following is example plug-in XML to define a logical structure type. - *

- *
- * <extension point="org.eclipse.debug.core.logicalStructureTypes">
- *  <logicalStructureType
- *   id="com.example.ExampleLogicalStructure"
- *   class="com.example.ExampleLogicalStructureDelegate"
- *   modelIdentifier="com.example.debug.model"
- *   description="Ordered Collection">
- *  </logicalStructureType>
- * </extension>
- * 
- *

- * The attributes are specified as follows: - *

    - *
  • id - unique identifier for this logical structure type
  • - *
  • class - fully qualified name of class that implements - * ILogicalStructureTypeDelegate
  • - *
  • modelIdentifier - identifier of the debug model this logical structure - * type is associated with
  • - *
  • description - description of the logical structure provided
  • - *
- *

- *

- * Clients contributing logicalStructureType extensions are not intended to implement - * this interface. Rather, they provide an ILogicalStructureTypeDelegate - * that optionally implements ILogicalStructureTypeDelegate2 to provide - * dynamic descriptions of logical structures. - * Since 3.1, clients contributing logicalStructureProviders extensions may implement this - * interface to return a collection of logical structure types applicable to a value. - *

- * @since 3.0 - * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate - * @see org.eclipse.debug.core.ILogicalStructureProvider - */ -public interface ILogicalStructureType extends ILogicalStructureTypeDelegate, ILogicalStructureTypeDelegate2 { - - /** - * Returns a simple description of the logical structure provided by this - * structure type. - *

- * Since 3.1, this method can return null if this logical structure - * type's delegate implements ILogicalStructureTypeDelegate2. - *

- * - * @return a simple description of the logical structure provided by this - * structure type, possibly null - */ - public String getDescription(); - - /** - * Returns this logical structure type's unique identifier, as defined - * in plug-in XML. - * - * @return this logical structure type's unique identifier - */ - public String getId(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockListener.java deleted file mode 100644 index 65ff4d535..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockListener.java +++ /dev/null @@ -1,43 +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.core; - -import org.eclipse.debug.core.model.IMemoryBlock; - -/** - * A memory block listener is notified of the addition and removal - * of memory blocks with the memory block manager. Listeners must - * register with the memory block manager for notification. - *

- * Clients may implement this interface. - *

- * @since 3.1 - */ -public interface IMemoryBlockListener { - - /** - * Notification the given memory blocks have been added to the - * memory block manager. - * - * @param memory blocks added to the memory block manager - */ - void memoryBlocksAdded(IMemoryBlock[] memory); - - /** - * Notification the given memory blocks have been removed from - * the memory block manager. - * - * @param memory blocks removed from the memory block manager - */ - void memoryBlocksRemoved(IMemoryBlock[] memory); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockManager.java deleted file mode 100644 index 3c572aae5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IMemoryBlockManager.java +++ /dev/null @@ -1,97 +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.core; - -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IMemoryBlock; -import org.eclipse.debug.core.model.IMemoryBlockRetrieval; - - -/** - * Manages registered memory blocks in the workspace. Clients - * interested in notification of the addition and removal of - * memory blocks may register as a memory block listener with - * the memory block manager. - * @see org.eclipse.debug.core.model.IMemoryBlock - * @see org.eclipse.debug.core.IMemoryBlockListener - * @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 IMemoryBlockManager { - - /** - * Adds the given memory blocks to the memory block manager. - * Registered memory block listeners are notified of the additions. - * Has no effect on memory blocks that are already registered. - * - * @param memoryBlocks memory blocks to add - */ - public void addMemoryBlocks(IMemoryBlock[] memoryBlocks); - - /** - * Removes the given memory blocks from the memory block manager. - * Registered memory block listeners are notified of the removals. - * Has no effect on memory blocks that are not currently registered. - * - * @param memoryBlocks memory blocks to remove - */ - public void removeMemoryBlocks(IMemoryBlock[] memoryBlocks); - - /** - * Registers the given listener for memory block addition and - * removal notification. Has no effect if an identical listener - * is already registered. - * - * @param listener the listener to add - */ - public void addListener(IMemoryBlockListener listener); - - /** - * Unregisters the given listener for memory block addition and - * removal notification. Has no effect if an identical listener - * is not already registered. - * - * @param listener the listener to remove - */ - public void removeListener(IMemoryBlockListener listener); - - /** - * Returns all registered memory blocks. - * - * @return all registered memory blocks - */ - public IMemoryBlock[] getMemoryBlocks(); - - /** - * Returns all registered memory blocks associated with the - * given debug target. That is, all registered memory blocks - * whose getDebugTarget() method returns the - * specified debug target. - * - * @param debugTarget target for which memory blocks have been requested - * @return all registered memory blocks associated with the given debug - * target - */ - public IMemoryBlock[] getMemoryBlocks(IDebugTarget debugTarget); - - /** - * Returns all registered memory blocks that originated from the - * given memory retrieval source. - * - * @param source source for which memory blocks have been requested - * @return all registered memory blocks that originated from the - * given memory retrieval source - */ - public IMemoryBlock[] getMemoryBlocks(IMemoryBlockRetrieval source); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java deleted file mode 100644 index 802ffc917..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java +++ /dev/null @@ -1,66 +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.core; - -import java.util.Map; - -import org.eclipse.debug.core.model.IProcess; - -/** - * A process factory is used to override default process (IProcess) - * creation by the debug plug-in, and can be contributed via plug-in XML. When a - * new process is created via DebugPlugin.newProcess(..), the - * launch configuration associated with the specified launch is consulted for - * a process factory attribute (DebugPlugin.ATTR_PROCESS_FACTORY_ID). If - * present, the associated process factory is consulted to create a process for - * the launch. If not present a default process implementation is created and - * returned by the debug plug-in. - *

- * Following is example plug-in XML that contributes a process factory. - *

- * <extension point="org.eclipse.debug.core.processFactories">
- *   <processFactory
- *           id="com.example.ExampleIdentifier"
- *           class="com.example.ExampleProcessFactory">
- *   </processFactory>
- * </extension>
- * 
- * The attributes are specified as follows: - *
    - *
  • id - a unique identifier for this extension point
  • - *
  • class - the fully qualified name of a class the implements - * IProcessFactory
  • - *
- *

- *

- * Clients contributing a process factory are intended to implement this interface. - *

- * @since 3.0 - */ - -public interface IProcessFactory { - - /** - * Creates and returns a new process representing the given - * java.lang.Process. A streams proxy is created - * for the I/O streams in the system process. The process - * is added to the given launch, and the process is initialized - * with the given attribute map. - * - * @param launch the launch the process is contained in - * @param process the system process to wrap - * @param label the label assigned to the process - * @param attributes initial values for the attribute map - * @return the process - * @see IProcess - */ - public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java deleted file mode 100644 index 851a4c80b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IRequest.java +++ /dev/null @@ -1,84 +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.core; - -import org.eclipse.core.runtime.IStatus; - -/** - * Common base interface for an asynchronously processed request. A request may succeed, - * fail or be canceled as indicated by the request's status. When a request is complete - * the client fulfilling the request must call done() on the request whether - * the operation succeeds, fails, or is canceled. - *

- * Specific requests (sub types of this interface) often include data pertaining to - * the request and usually contain results of the request. - *

- *

- * Clients are expected to poll a request (using isCanceled) - * periodically and abort at their earliest convenience calling done(). - * A request can be canceled by the originator of the request or a client - * fulfilling a request. - *

- *

- * Clients that invoke request handlers may implement this interface. - *

- * @since 3.3 - */ -public interface IRequest { - - /** - * Sets the status for this request indicating whether this request - * succeeded, failed, or was canceled. When a request fails, the status - * indicates why the request failed. A null status is considered - * to be successful. Only clients fulfilling a request should call this - * method. Clients making a request are not intended to call this method. - * - * @param status request status or null - */ - public void setStatus(IStatus status); - - /** - * Returns the status of this request, or null. - * - * @return request status - null is equivalent - * to an OK status - */ - public IStatus getStatus(); - - /** - * Indicates this request is complete. Clients must call this method - * whether the request succeeds, fails, or is cancelled to indicate that - * processing is complete. Only clients fulfilling a request should call this - * method. Clients making a request are not intended to call this method. - */ - public void done(); - - /** - * Cancels this request. A request may be canceled by the originator of request - * or a client fulfilling a request. Optionally a canceled status may be set on - * this request with more details. A client fulfilling a request must still call - * done() to indicate the request is complete. - */ - public void cancel(); - - /** - * Returns whether this request has been canceled. - *

- * Clients fulfilling a request are expected to poll a request (using isCanceled) - * periodically and abort at their earliest convenience calling done(). - * A request can be canceled by the originator of the request or a processor fulfilling a - * request. - *

- * @return whether this request has been canceled - */ - public boolean isCanceled(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IStatusHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IStatusHandler.java deleted file mode 100644 index 571b06408..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IStatusHandler.java +++ /dev/null @@ -1,78 +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.core; - - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; - -/** - * A status handler registers to handle a specific status - error - * or otherwise. Provides a mechanism for separating core (headless) - * function from UI interaction. The debug plug-in provides a - * status handlers extension point, against which handlers can - * register for specific status codes - identified by plug-in - * identifier and plug-in specific status code. The interaction between - * an object requiring a status handler (source), and the status handler - * is defined by the source and handler. - *

- * For example, a launch configuration delegate might encounter a timeout - * while launching an application. In this case the delegate could abort - * or, via the use of a status handler, prompt the user to continue. This - * allows the launcher to be implemented in a plug-in that does not require - * UI support, and allows another (UI) plug-in to register a handler. - *

- *

- * A status handler extension is defined in plugin.xml. - * Following is an example definition of a status handler extension. - *

- * <extension point="org.eclipse.debug.core.statusHandlers">
- *   <statusHandler 
- *      id="com.example.ExampleIdentifier"
- *      class="com.example.ExampleStatusHandler"
- *      plugin="com.example.ExamplePluginId"
- *      code="123">
- *   </statusHandler>
- * </extension>
- * 
- * The attributes are specified as follows: - *
    - *
  • id specifies a unique identifier for this status handler.
  • - *
  • class specifies the fully qualified name of the Java class - * that implements IStatusHandler.
  • - *
  • plugin plug-in identifier that corresponds to the - * plug-in of the status this handler is registered for (i.e. - * IStatus.getPlugin()).
  • - *
  • code specifies the status code this handler - * is registered for.
  • - *
- *

- *

- * Clients may implement this interface. - *

- * @see DebugPlugin#getStatusHandler(IStatus) - * @since 2.0 - */ - -public interface IStatusHandler { - - /** - * Notifies this status handler that the given status has been - * generated by the specified source object and requires resolution. - * - * @param status the status to handle - * @param source the object delegating to this status handler - * the given status - * @return an object representing the resolution of the status - * @exception CoreException if unable to resolve the status - */ - public Object handleStatus(IStatus status, Object source) throws CoreException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java deleted file mode 100644 index a074c89f8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IStreamListener.java +++ /dev/null @@ -1,33 +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.core; - - -import org.eclipse.debug.core.model.IStreamMonitor; - -/** - * A stream listener is notified of changes - * to a stream monitor. - *

- * Clients may implement this interface. - *

- * @see IStreamMonitor - */ -public interface IStreamListener { - /** - * Notifies this listener that text has been appended to - * the given stream monitor. - * - * @param text the appended text - * @param monitor the stream monitor to which text was appended - */ - public void streamAppended(String text, IStreamMonitor monitor); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java deleted file mode 100644 index 2ce48cca6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java +++ /dev/null @@ -1,594 +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 - * Pawel Piech - Bug 82003: The IDisconnect implementation by Launch module is too restrictive. - *******************************************************************************/ -package org.eclipse.debug.core; - - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.PlatformObject; -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.ISourceLocator; -import org.eclipse.debug.internal.core.DebugCoreMessages; -import org.eclipse.debug.internal.core.LaunchManager; - -/** - * A launch is the result of launching a debug session - * and/or one or more system processes. This class provides - * a public implementation of ILaunch for client - * use. - *

- * Clients may instantiate this class. Clients may subclass this class. - *

- * @see ILaunch - * @see ILaunchManager - */ - -public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILaunchListener, ILaunchConfigurationListener, IDebugEventSetListener { - - /** - * The debug targets associated with this - * launch (the primary target is the first one - * in this collection), or empty if - * there are no debug targets. - */ - private List fTargets= new ArrayList(); - - /** - * The configuration that was launched, or null. - */ - private ILaunchConfiguration fConfiguration= null; - - /** - * The system processes associated with - * this launch, or empty if none. - */ - private List fProcesses= new ArrayList(); - - /** - * The source locator to use in the debug session - * or null if not supported. - */ - private ISourceLocator fLocator= null; - - /** - * The mode this launch was launched in. - */ - private String fMode; - - /** - * Table of client defined attributes - */ - private HashMap fAttributes; - - /** - * Flag indicating that change notification should - * be suppressed. true until this - * launch has been initialized. - */ - private boolean fSuppressChange = true; - - /** - * Constructs a launch with the specified attributes. - * - * @param launchConfiguration the configuration that was launched - * @param mode the mode of this launch - run or debug (constants - * defined by ILaunchManager) - * @param locator the source locator to use for this debug session, or - * null if not supported - */ - public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) { - fConfiguration = launchConfiguration; - setSourceLocator(locator); - fMode = mode; - fSuppressChange = false; - getLaunchManager().addLaunchListener(this); - getLaunchManager().addLaunchConfigurationListener(this); - } - - /** - * Registers debug event listener. - */ - private void addEventListener() { - DebugPlugin.getDefault().addDebugEventListener(this); - } - - /** - * Removes debug event listener. - */ - private void removeEventListener() { - DebugPlugin.getDefault().removeDebugEventListener(this); - } - - /** - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() { - List processes = getProcesses0(); - for (int i = 0; i < processes.size(); i++) { - IProcess process = (IProcess)processes.get(i); - if (process.canTerminate()) { - return true; - } - } - List targets = getDebugTargets0(); - for (int i = 0; i < targets.size(); i++) { - IDebugTarget target = (IDebugTarget)targets.get(i); - if (target.canTerminate() || target.canDisconnect()) { - return true; - } - } - return false; - } - - /** - * @see ILaunch#getChildren() - */ - public Object[] getChildren() { - ArrayList children = new ArrayList(getDebugTargets0()); - children.addAll(getProcesses0()); - return children.toArray(); - } - - /** - * @see ILaunch#getDebugTarget() - */ - public IDebugTarget getDebugTarget() { - if (!getDebugTargets0().isEmpty()) { - return (IDebugTarget)getDebugTargets0().get(0); - } - return null; - } - - /** - * @see ILaunch#getProcesses() - */ - public IProcess[] getProcesses() { - return (IProcess[])getProcesses0().toArray(new IProcess[getProcesses0().size()]); - } - - /** - * Returns the processes associated with this - * launch, in its internal form - a list. - * - * @return list of processes - */ - protected List getProcesses0() { - return fProcesses; - } - - /** - * @see ILaunch#getSourceLocator() - */ - public ISourceLocator getSourceLocator() { - return fLocator; - } - - /** - * @see ILaunch#setSourceLocator(ISourceLocator) - */ - public void setSourceLocator(ISourceLocator sourceLocator) { - fLocator = sourceLocator; - } - - /** - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() { - if (getProcesses0().isEmpty() && getDebugTargets0().isEmpty()) { - return false; - } - - Iterator processes = getProcesses0().iterator(); - while (processes.hasNext()) { - IProcess process = (IProcess)processes.next(); - if (!process.isTerminated()) { - return false; - } - } - - Iterator targets = getDebugTargets0().iterator(); - while (targets.hasNext()) { - IDebugTarget target = (IDebugTarget)targets.next(); - if (!(target.isTerminated() || target.isDisconnected())) { - return false; - } - } - - return true; - } - - /** - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException { - MultiStatus status= - new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugCoreMessages.Launch_terminate_failed, null); - //stop targets first to free up and sockets, etc held by the target - // terminate or disconnect debug target if it is still alive - IDebugTarget[] targets = getDebugTargets(); - for (int i = 0; i < targets.length; i++) { - IDebugTarget target= targets[i]; - if (target != null) { - if (target.canTerminate()) { - try { - target.terminate(); - } catch (DebugException e) { - status.merge(e.getStatus()); - } - } else { - if (target.canDisconnect()) { - try { - target.disconnect(); - } catch (DebugException de) { - status.merge(de.getStatus()); - } - } - } - } - } - //second kill the underlying process - // terminate the system processes - IProcess[] processes = getProcesses(); - for (int i = 0; i < processes.length; i++) { - IProcess process = processes[i]; - if (process.canTerminate()) { - try { - process.terminate(); - } catch (DebugException e) { - status.merge(e.getStatus()); - } - } - } - if (status.isOK()) { - return; - } - IStatus[] children= status.getChildren(); - if (children.length == 1) { - throw new DebugException(children[0]); - } - throw new DebugException(status); - } - - /** - * @see ILaunch#getLaunchMode() - */ - public String getLaunchMode() { - return fMode; - } - - /** - * @see ILaunch#getLaunchConfiguration() - */ - public ILaunchConfiguration getLaunchConfiguration() { - return fConfiguration; - } - - /** - * @see ILaunch#setAttribute(String, String) - */ - public void setAttribute(String key, String value) { - if (fAttributes == null) { - fAttributes = new HashMap(5); - } - fAttributes.put(key, value); - } - - /** - * @see ILaunch#getAttribute(String) - */ - public String getAttribute(String key) { - if (fAttributes == null) { - return null; - } - return (String)fAttributes.get(key); - } - - /** - * @see ILaunch#getDebugTargets() - */ - public IDebugTarget[] getDebugTargets() { - return (IDebugTarget[])fTargets.toArray(new IDebugTarget[fTargets.size()]); - } - - /** - * Returns the debug targets associated with this - * launch, in its internal form - a list - * - * @return list of debug targets - */ - protected List getDebugTargets0() { - return fTargets; - } - - /** - * @see ILaunch#addDebugTarget(IDebugTarget) - */ - public void addDebugTarget(IDebugTarget target) { - if (target != null) { - if (!getDebugTargets0().contains(target)) { - addEventListener(); - getDebugTargets0().add(target); - fireChanged(); - } - } - } - - /** - * @see ILaunch#removeDebugTarget(IDebugTarget) - */ - public void removeDebugTarget(IDebugTarget target) { - if (target != null) { - if (getDebugTargets0().remove(target)) { - fireChanged(); - } - } - } - - /** - * @see ILaunch#addProcess(IProcess) - */ - public void addProcess(IProcess process) { - if (process != null) { - if (!getProcesses0().contains(process)) { - addEventListener(); - getProcesses0().add(process); - fireChanged(); - } - } - } - - /** - * @see ILaunch#removeProcess(IProcess) - */ - public void removeProcess(IProcess process) { - if (process != null) { - if (getProcesses0().remove(process)) { - fireChanged(); - } - } - } - - /** - * Adds the given processes to this launch. - * - * @param processes processes to add - */ - protected void addProcesses(IProcess[] processes) { - if (processes != null) { - for (int i = 0; i < processes.length; i++) { - addProcess(processes[i]); - fireChanged(); - } - } - } - - /** - * Notifies listeners that this launch has changed. - * Has no effect of this launch has not yet been - * properly created/initialized. - */ - protected void fireChanged() { - if (!fSuppressChange) { - ((LaunchManager)getLaunchManager()).fireUpdate(this, LaunchManager.CHANGED); - ((LaunchManager)getLaunchManager()).fireUpdate(new ILaunch[] {this}, LaunchManager.CHANGED); - } - } - - /** - * Notifies listeners that this launch has terminated. - * Has no effect of this launch has not yet been - * properly created/initialized. - */ - protected void fireTerminate() { - if (!fSuppressChange) { - ((LaunchManager)getLaunchManager()).fireUpdate(this, LaunchManager.TERMINATE); - ((LaunchManager)getLaunchManager()).fireUpdate(new ILaunch[] {this}, LaunchManager.TERMINATE); - } - removeEventListener(); - } - - /** - * @see ILaunch#hasChildren() - */ - public boolean hasChildren() { - return getProcesses0().size() > 0 || (getDebugTargets0().size() > 0); - } - - /** - * Returns whether any processes or targets can be disconnected. - * Ones that are already terminated or disconnected are ignored. - * - * @see org.eclipse.debug.core.model.IDisconnect#canDisconnect() - */ - public boolean canDisconnect() { - List processes = getProcesses0(); - for (int i = 0; i < processes.size(); i++) { - if (processes.get(i) instanceof IDisconnect) { - IDisconnect process = (IDisconnect)processes.get(i); - if (process.canDisconnect()) { - return true; - } - } - } - List targets = getDebugTargets0(); - for (int i = 0; i < targets.size(); i++) { - if ( ((IDebugTarget)targets.get(i)).canDisconnect() ) { - return true; - } - } - return false; - } - - /** - * @see org.eclipse.debug.core.model.IDisconnect#disconnect() - */ - public void disconnect() throws DebugException { - List processes = getProcesses0(); - for (int i = 0; i < processes.size(); i++) { - if (processes.get(i) instanceof IDisconnect) { - IDisconnect disconnect = (IDisconnect)processes.get(i); - if (disconnect.canDisconnect()) { - disconnect.disconnect(); - } - } - } - List targets = getDebugTargets0(); - for (int i = 0; i < targets.size(); i++) { - IDebugTarget debugTarget = (IDebugTarget)targets.get(i); - if (debugTarget.canDisconnect()) { - debugTarget.disconnect(); - } - } - } - - /** - * Returns whether all of the contained targets and processes are - * disconnected. Processes that don't support disconnecting are not - * counted. - * - * @see org.eclipse.debug.core.model.IDisconnect#isDisconnected() - */ - public boolean isDisconnected() { - List processes = getProcesses0(); - for (int i = 0; i < processes.size(); i++) { - if (processes.get(i) instanceof IDisconnect) { - IDisconnect process = (IDisconnect)processes.get(i); - if (!process.isDisconnected()) { - return false; - } - } - } - List targets = getDebugTargets0(); - for (int i = 0; i < targets.size(); i++) { - if ( !((IDebugTarget)targets.get(i)).isDisconnected() ) { - return false; - } - } - // only return true if there are processes or targets that are disconnected - return hasChildren(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch) - */ - public void launchRemoved(ILaunch launch) { - if (this.equals(launch)) { - removeEventListener(); - getLaunchManager().removeLaunchListener(this); - getLaunchManager().removeLaunchConfigurationListener(this); - } - } - - /** - * Returns the launch manager. - * - * @return the launch manager. - */ - protected ILaunchManager getLaunchManager() { - return DebugPlugin.getDefault().getLaunchManager(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch) - */ - public void launchAdded(ILaunch launch) { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch) - */ - public void launchChanged(ILaunch launch) { - } - - /* (non-Javadoc) - * - * If the launch configuration this launch is associated with is - * moved, update the underlying handle to the new location. - * - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationAdded(ILaunchConfiguration configuration) { - ILaunchConfiguration from = getLaunchManager().getMovedFrom(configuration); - if (from != null && from.equals(getLaunchConfiguration())) { - fConfiguration = configuration; - fireChanged(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationChanged(ILaunchConfiguration configuration) {} - - /* (non-Javadoc) - * - * Update the launch configuration associated with this launch if the - * underlying configuration is deleted. - * - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - if (configuration.equals(getLaunchConfiguration())) { - if (getLaunchManager().getMovedTo(configuration) == null) { - fConfiguration = null; - fireChanged(); - } - } - } - - /* (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.getKind() == DebugEvent.TERMINATE) { - Object object = event.getSource(); - ILaunch launch = null; - if (object instanceof IProcess) { - launch = ((IProcess)object).getLaunch(); - } else if (object instanceof IDebugTarget) { - launch = ((IDebugTarget)object).getLaunch(); - } - if (this.equals(launch)) { - if (isTerminated()) { - fireTerminate(); - } - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - if (adapter.equals(ILaunch.class)) { - return this; - } - //CONTEXTLAUNCHING - if(adapter.equals(ILaunchConfiguration.class)) { - return getLaunchConfiguration(); - } - return super.getAdapter(adapter); - } - - - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java deleted file mode 100644 index 2c516a2a7..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java +++ /dev/null @@ -1,293 +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.core; - -import java.io.IOException; -import java.io.StringReader; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.IStringVariableManager; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.debug.internal.core.DebugCoreMessages; -import org.eclipse.debug.internal.core.IMementoConstants; -import org.eclipse.debug.internal.core.ResourceFactory; -import org.eclipse.debug.internal.core.XMLMemento; - -import com.ibm.icu.text.MessageFormat; - -/** - * Utilities for launch configurations that persist, restore, and refresh - * collections of resources. - * - * @since 3.6 - * @noextend This class is not intended to be subclassed by clients. - * @noinstantiate This class is not intended to be instantiated by clients. - */ -public class RefreshUtil { - - /** - * String attribute identifying a scope of resources that should be - * refreshed - for example, after an external tool is run. The value is either - * a resource memento constant by this class, a resource memento created - * via {@link RefreshUtil#toMemento(IResource[])}, null, indicating no - * refresh. - */ - public static final String ATTR_REFRESH_SCOPE = DebugPlugin.getUniqueIdentifier() + ".ATTR_REFRESH_SCOPE"; //$NON-NLS-1$ - - /** - * Boolean attribute indicating if a refresh scope is recursive. Default - * value is true. When a refresh is recursive, resources are - * refreshed to an infinite depth, otherwise they are refreshed to a depth - * of one. - */ - public static final String ATTR_REFRESH_RECURSIVE = DebugPlugin.getUniqueIdentifier() + ".ATTR_REFRESH_RECURSIVE"; //$NON-NLS-1$ - - /** - * Resource memento referring to the selected resource's project. - * Only works when the debug user interface is running. - * - * @see #toResources(String) - */ - public static final String MEMENTO_SELECTED_PROJECT = "${project}"; //$NON-NLS-1$ - - /** - * Resource memento referring to the selected resource's container. - * Only works when the debug user interface is running. - * - * @see #toResources(String) - */ - public static final String MEMENTO_SELECTED_CONTAINER = "${container}"; //$NON-NLS-1$ - - /** - * Resource memento referring to the selected resource. - * Only works when the debug user interface is running. - * - * @see #toResources(String) - */ - public static final String MEMENTO_SELECTED_RESOURCE = "${resource}"; //$NON-NLS-1$ - - /** - * Resource memento referring to the workspace root. - * - * @see #toResources(String) - */ - public static final String MEMENTO_WORKSPACE = "${workspace}"; //$NON-NLS-1$ - - /** - * Indicates no working set has been selected (for backwards compatibility). - * The new format uses an empty working set - */ - - private static final String NO_WORKING_SET = "NONE"; //$NON-NLS-1$ - - /** - * Refreshes the resources as specified by the given launch configuration. - * - * @param resources - * resources to refresh - * @param depth one of {@link IResource#DEPTH_INFINITE}, {@link IResource#DEPTH_ONE}, - * or {@link IResource#DEPTH_ZERO} - * @param monitor - * progress monitor which may be null - * @throws CoreException - * if an exception occurs while refreshing resources - */ - public static void refreshResources(IResource[] resources, int depth, IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - if (resources == null || resources.length == 0) { - return; - } - if (monitor.isCanceled()) { - return; - } - monitor.beginTask(DebugCoreMessages.RefreshingResources, resources.length); - MultiStatus status = new MultiStatus(DebugPlugin.getUniqueIdentifier(), 0, DebugCoreMessages.RefreshingResourcesError, null); - for (int i = 0; i < resources.length; i++) { - if (monitor.isCanceled()) - break; - if (resources[i] != null && resources[i].isAccessible()) { - try { - resources[i].refreshLocal(depth, null); - } catch (CoreException e) { - status.merge(e.getStatus()); - } - } - monitor.worked(1); - } - monitor.done(); - if (!status.isOK()) { - throw new CoreException(status); - } - } - - /** - * Returns a collection of resources referred to by the specified - * memento generated via {@link #toMemento(IResource[])}. - * - * @param memento - * resource memento generated by this manager - * @return collection of resources referred to by the memento - * @throws CoreException - * if unable to resolve a set of resources - */ - public static IResource[] toResources(String memento) throws CoreException { - if (memento.startsWith("${resource:")) { //$NON-NLS-1$ - // This is an old format that is replaced with 'working_set' - String pathString = memento.substring(11, memento.length() - 1); - Path path = new Path(pathString); - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path); - if (resource == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - IStatus.ERROR, MessageFormat.format(DebugCoreMessages.RefreshUtil_1, - new String[] { pathString }), null)); - } - return new IResource[] { resource }; - } else if (memento.startsWith("${working_set:")) { //$NON-NLS-1$ - String ws = memento.substring(14, memento.length() - 1); - return getResources(ws); - } else if (memento.equals(MEMENTO_WORKSPACE)) { - return new IResource[] { ResourcesPlugin.getWorkspace().getRoot() }; - } else { - // result the selected resource for backwards compatibility - IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); - IResource resource = null; - try { - String pathString = manager.performStringSubstitution("${selected_resource_path}"); //$NON-NLS-1$ - resource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(pathString)); - } catch (CoreException e) { - // unable to resolve a resource - } - if (resource == null) { - // empty selection - return new IResource[]{}; - } else { - if (memento.equals(MEMENTO_SELECTED_RESOURCE)) { - return new IResource[] { resource }; - } else if (memento.equals(MEMENTO_SELECTED_CONTAINER)) { - return new IResource[] {resource.getParent()}; - } else if (memento.equals(MEMENTO_SELECTED_PROJECT)) { - return new IResource[] {resource.getProject()}; - } - } - } - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.RefreshUtil_0, new String[]{memento}))); - } - - /** - * Returns a memento for a collection of resources that can be restored - * via {@link #toResources(String)}. - * - * @param resources resources to create a memento for - * @return memento for the given resources - */ - public static String toMemento(IResource[] resources) { - XMLMemento memento = XMLMemento.createWriteRoot("resources"); //$NON-NLS-1$ - for (int i = 0; i < resources.length; i++) { - final XMLMemento itemMemento = memento.createChild(IMementoConstants.MEMENTO_ITEM); - ResourceFactory.saveState(itemMemento, resources[i]); - } - StringWriter writer = new StringWriter(); - try { - memento.save(writer); - } catch (IOException e) { - DebugPlugin.log(e); - } - StringBuffer buf = new StringBuffer(); - buf.append("${working_set:"); //$NON-NLS-1$ - buf.append(writer.toString()); - buf.append("}"); //$NON-NLS-1$ - return buf.toString(); - } - - /** - * Restores a collection of resources from a working set memento, for backwards - * compatibility. - * - * @param wsMemento working set memento - * @return resource collection, possibly empty - */ - private static IResource[] getResources(String wsMemento) { - - if (NO_WORKING_SET.equals(wsMemento)) { - return null; - } - - List resourcesList = new ArrayList(); - StringReader reader = new StringReader(wsMemento); - - XMLMemento memento = null; - try { - memento = XMLMemento.createReadRoot(reader); - } catch (Exception e) { - DebugPlugin.log(e); - return null; - } - - XMLMemento[] mementos = memento - .getChildren(IMementoConstants.MEMENTO_ITEM); - for (int i = 0; i < mementos.length; i++) { - resourcesList.add(ResourceFactory.createElement(mementos[i])); - } - - return (IResource[]) resourcesList.toArray(new IResource[resourcesList.size()]); - - } - - /** - * 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); - } - - /** - * Refreshes the resources as specified by the given launch configuration via its - * {@link RefreshUtil#ATTR_REFRESH_SCOPE} and {@link #ATTR_REFRESH_RECURSIVE} attributes. - * - * @param configuration launch configuration - * @param monitor progress monitor which may be null - * @throws CoreException - * if an exception occurs while refreshing resources or accessing launch - * configuration attributes - */ - public static void refreshResources(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException { - String scope = configuration.getAttribute(ATTR_REFRESH_SCOPE, (String) null); - if (scope != null) { - IResource[] resources = toResources(scope); - if (resources != null && resources.length > 0) { - int depth = IResource.DEPTH_ONE; - if (isRefreshRecursive(configuration)) { - depth = IResource.DEPTH_INFINITE; - } - refreshResources(resources, depth, monitor); - } - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java deleted file mode 100644 index 1dc6b994b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java +++ /dev/null @@ -1,407 +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.core.commands; - -import java.util.LinkedHashSet; - -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.IJobChangeEvent; -import org.eclipse.core.runtime.jobs.IJobChangeListener; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IRequest; -import org.eclipse.debug.internal.core.DebugOptions; - -/** - * Abstract implementation of a debug command handler. Handles {@link IDebugCommandRequest} - * and {@link IEnabledStateRequest} updates asynchronously using jobs. - *

- * Clients may subclass this class. - *

- * @since 3.6 - */ -public abstract class AbstractDebugCommand implements IDebugCommandHandler { - - /** - * Job to update enabled state of action. - */ - private class UpdateJob extends Job implements IJobChangeListener { - - /** - * The request to update - */ - private IEnabledStateRequest request; - - /** - * Whether this job has been run - */ - private boolean run = false; - - /** - * Creates a new job to update the specified request - * - * @param stateRequest - */ - UpdateJob(IEnabledStateRequest stateRequest) { - super(getEnabledStateTaskName()); - request = stateRequest; - setSystem(true); - setRule(getEnabledStateSchedulingRule(request)); - getJobManager().addJobChangeListener(this); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - protected IStatus run(IProgressMonitor monitor) { - run = true; - if (DebugOptions.DEBUG_COMMANDS) { - System.out.print("can execute command: " + AbstractDebugCommand.this); //$NON-NLS-1$ - } - if (monitor.isCanceled()) { - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> *CANCELED* <<"); //$NON-NLS-1$ - } - request.cancel(); - } - Object[] elements = request.getElements(); - Object[] targets = new Object[elements.length]; - if (!request.isCanceled()) { - for (int i = 0; i < elements.length; i++) { - targets[i] = getTarget(elements[i]); - if (targets[i] == null) { - request.setEnabled(false); - request.cancel(); - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> false (no adapter)"); //$NON-NLS-1$ - } - } - } - if (monitor.isCanceled()) { - request.cancel(); - } - } - if (!request.isCanceled()) { - targets = coalesce(targets); - monitor.beginTask(getEnabledStateTaskName(), targets.length); - try { - boolean executable = isExecutable(targets, monitor, request); - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> " + executable); //$NON-NLS-1$ - } - request.setEnabled(executable); - } catch (CoreException e) { - request.setStatus(e.getStatus()); - request.setEnabled(false); - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> ABORTED"); //$NON-NLS-1$ - System.out.println("\t" + e.getStatus().getMessage()); //$NON-NLS-1$ - } - } - } - monitor.setCanceled(request.isCanceled()); - request.done(); - monitor.done(); - return Status.OK_STATUS; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object) - */ - public boolean belongsTo(Object family) { - Object myFamily = getEnabledStateJobFamily(request); - if (myFamily != null) { - return myFamily.equals(family); - } - return false; - } - - public void aboutToRun(IJobChangeEvent event) { - } - - public void awake(IJobChangeEvent event) { - } - - public void done(IJobChangeEvent event) { - if (event.getJob() == this) { - if (!run) { - request.cancel(); - request.done(); - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println(" >> *CANCELED* <<" + AbstractDebugCommand.this); //$NON-NLS-1$ - } - } - getJobManager().removeJobChangeListener(this); - } - } - - public void running(IJobChangeEvent event) { - } - - public void scheduled(IJobChangeEvent event) { - } - - public void sleeping(IJobChangeEvent event) { - } - - } - - /** - * Scheduling rule to serialize commands on an object - */ - private 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; - } - - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandHandler#execute(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - public boolean execute(final IDebugCommandRequest request) { - Job job = new Job(getExecuteTaskName()) { - protected IStatus run(IProgressMonitor monitor) { - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println("execute: " + AbstractDebugCommand.this); //$NON-NLS-1$ - } - Object[] elements = request.getElements(); - Object[] targets = new Object[elements.length]; - for (int i = 0; i < elements.length; i++) { - targets[i]= getTarget(elements[i]); - } - targets = coalesce(targets); - monitor.beginTask(getExecuteTaskName(), targets.length); - try { - doExecute(targets, monitor, request); - } catch (CoreException e) { - request.setStatus(e.getStatus()); - if (DebugOptions.DEBUG_COMMANDS) { - System.out.println("\t" + e.getStatus().getMessage()); //$NON-NLS-1$ - } - } - request.done(); - monitor.setCanceled(request.isCanceled()); - monitor.done(); - return Status.OK_STATUS; - } - public boolean belongsTo(Object family) { - Object jobFamily = getExecuteJobFamily(request); - if (jobFamily != null) { - return jobFamily.equals(family); - } - return false; - } - }; - job.setSystem(true); - job.setRule(getExecuteSchedulingRule(request)); - job.schedule(); - return isRemainEnabled(request); - } - - /** - * Returns whether this command should remain enabled after starting execution of the specified request. - * - * @param request the request being executed - * @return whether to remain enabled while executing the request - */ - protected boolean isRemainEnabled(IDebugCommandRequest request) { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandHandler#canExecute(org.eclipse.debug.core.commands.IEnabledStateRequest) - */ - public void canExecute(final IEnabledStateRequest request) { - Job job = new UpdateJob(request); - job.schedule(); - } - - /** - * Returns the name to use for a job and progress monitor task names when performing - * an {@link IEnabledStateRequest}. - * - * @return task name - */ - protected String getEnabledStateTaskName() { - // this is a system job name and does not need to be NLS'd - return "Check Debug Command"; //$NON-NLS-1$ - } - - /** - * Returns the name to use for jobs and progress monitor task names when executing - * an {@link IDebugCommandRequest}. - * - * @return task name - */ - protected String getExecuteTaskName() { - // this is a system job name and does not need to be NLS'd - return "Execute Debug Command"; //$NON-NLS-1$ - } - - /** - * Executes this command synchronously on the specified targets, reporting progress. This method - * is called by a job. If an exception is thrown, the calling job will set the associated status - * on the request object. The calling job also calls #done() on the request object after this method - * is called, and sets a cancel status on the progress monitor if the request is canceled. - *

- * Handlers must override this method. - *

- * @param targets objects to perform this command on - * @param monitor progress monitor - * @param request can be used to cancel this command - * @exception CoreException if this handler fails to perform the request - */ - protected abstract void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException; - - /** - * Returns whether this command is executable on the specified targets, reporting progress. This method - * is called by a job. If an exception is thrown, the calling job will set the associated status - * on the request object and report that this command is not enabled. The calling job also calls #done() - * on the request object after this method is called, and sets a cancel status on the progress monitor if - * the request is canceled. Enabled state is set to false if the request is canceled. - *

- * Handlers must override this method. - *

- * @param targets objects to check command enabled state for - * @param monitor progress monitor - * @param request can be used to cancel this update request - * @return whether this command can be executed for the given targets - */ - protected abstract boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) throws CoreException; - - /** - * Returns the appropriate target for this command handler for the given object. - * This method is called to map each element in a command request to the target - * object that is used in {@link #doExecute(Object[], IProgressMonitor, IRequest)} - * and {@link #isExecutable(Object[], IProgressMonitor, IEnabledStateRequest)}. - * The target may be the element itself, or some other object. Allows for redirection. - *

- * Clients must override this method. - *

- * @param element element from a {@link IDebugCommandRequest} - * @return associated target object for execution or enabled state update. Cannot return null. - */ - protected abstract Object getTarget(Object element); - - /** - * Convenience method to return an adapter of the specified type for the given object or null - * if none. - * - * @param element element to retrieve adapter for - * @param type adapter type - * @return adapter or null - */ - protected Object getAdapter(Object element, Class type) { - return DebugPlugin.getAdapter(element, type); - } - - /** - * Returns a scheduling rule for this command's {@link IEnabledStateRequest} update job - * or null if none. By default a rule is created to serialize - * jobs on the first element in the request. - *

- * Clients may override this method as required. - *

- * @param request request that a scheduling rule is required for - * @return scheduling rule or null - */ - protected ISchedulingRule getEnabledStateSchedulingRule(IDebugCommandRequest request) { - return new SerialPerObjectRule(request.getElements()[0]); - } - - /** - * Returns a scheduling rule for this command's {@link IDebugCommandRequest} execute job - * or null if none. By default, execution jobs have no scheduling rule. - *

- * Clients may override this method as required. - *

- * @param request request that a scheduling rule is required for - * @return scheduling rule or null - */ - protected ISchedulingRule getExecuteSchedulingRule(IDebugCommandRequest request) { - return null; - } - - /** - * Returns the job family for the this command's {@link IEnabledStateRequest} update job - * or null if none. The default implementation returns null. - *

- * Clients may override this method as required. - *

- * @param request request the job family is required for - * @return job family object or null if none - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return null; - } - - /** - * Returns the job family for the this command's {@link IDebugCommandRequest} execute job - * or null if none. The default implementation returns null. - *

- * Clients may override this method as required. - *

- * @param request request the job family is required for - * @return job family object or null if none - */ - protected Object getExecuteJobFamily(IDebugCommandRequest request) { - return null; - } - - /** - * Returns an array of objects with duplicates removed, if any. - * - * @param objects array of objects - * @return array of object in same order with duplicates removed, if any. - */ - private Object[] coalesce(Object[] objects) { - if (objects.length == 1) { - return objects; - } else { - LinkedHashSet set = new LinkedHashSet(objects.length); - for (int i = 0; i < objects.length; i++) { - set.add(objects[i]); - } - return set.toArray(); - } - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandHandler.java deleted file mode 100644 index fae4ef9af..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandHandler.java +++ /dev/null @@ -1,82 +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.core.commands; - - - -/** - * Handles a command for a debugger. Specific command handlers extend this interface. - *

- * The debug platform provides actions for common debug commands that operate against - * these handler interfaces. For example, the platform provides a terminate action that - * operates on the active debug context (selected element in the debug view). The action - * delegates to the active context's {@link ITerminateHandler} implementation to update - * its enabled state and execute the command. Debug model elements may implement supported - * command handler interfaces directly or provide them as adapters. The debug platform - * provides implementations of handlers for standard debug models. - *

- * @see org.eclipse.core.runtime.IAdaptable - * @see IDisconnectHandler - * @see IDropToFrameHandler - * @see IResumeHandler - * @see IStepFiltersHandler - * @see IStepIntoHandler - * @see IStepOverHandler - * @see IStepReturnHandler - * @see ISuspendHandler - * @see ITerminateHandler - * @since 3.3 - */ -public interface IDebugCommandHandler { - - /** - * Determines whether this handler can execute on the elements specified - * in the given request by reporting enabled state to the request. - *

- * Implementations must be non-blocking and may respond asynchronously to the - * given request. Errors can reported by setting an appropriate status - * on the given request. A request can be canceled by this handler or caller. - * A null status is equivalent to an OK status. - * When a request succeeds, fails, or is canceled, implementations must call - * done() on the given request. - *

- *

- * Clients are expected to poll the request (using isCanceled) - * periodically and abort at their earliest convenience calling done() - * on the request. - *

- * @param request specifies elements to operate on and collects enabled state - */ - public void canExecute(IEnabledStateRequest request); - - /** - * Executes this command on the elements specified in the given request - * reporting status to the given request and returns whether this handler should - * remain enabled while the command is executing. - *

- * Implementations must be non-blocking and may respond asynchronously to the - * given request. Errors can reported by setting an appropriate status - * on the given request. A request can be canceled by this handler or the caller. - * A null status is equivalent to an OK status. When a request is - * complete, has encountered an error, or canceled, implementations must call - * done() on the given collector. - *

- *

- * Handlers are expected to poll the request (using isCanceled) - * periodically and abort at their earliest convenience calling done() - * on the request. - *

- * @param request specifies elements to operate on and collects execution status - * @return whether this handler remains enabled while command is executing - */ - public boolean execute(IDebugCommandRequest request); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandRequest.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandRequest.java deleted file mode 100644 index b72100554..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDebugCommandRequest.java +++ /dev/null @@ -1,31 +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.core.commands; - -import org.eclipse.debug.core.IRequest; - -/** - * A request to execute a command on specific elements. A debug command request is - * passed to a {@link IDebugCommandHandler} when a command is invoked. - *

- * Clients that invoke command handlers may implement this interface. - *

- * @since 3.3 - */ -public interface IDebugCommandRequest extends IRequest { - - /** - * Returns the elements to execute a command on. - * - * @return elements to execute a command on - */ - public Object[] getElements(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDisconnectHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDisconnectHandler.java deleted file mode 100644 index 99b9bd885..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDisconnectHandler.java +++ /dev/null @@ -1,28 +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.core.commands; - -/** - * A disconnect handler disconnects the debug user interface from - * a debug session. Typically a disconnect handler is supported by remote - * debuggers allowing the debug user interface to disconnect and the - * remote process to continue. - *

- * Clients may implement this interface. The debug platform provides a - * disconnect action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the disconnect handler registered - * as an adapter on objects that implement {@link org.eclipse.debug.core.model.IDisconnect}. - *

- * @since 3.3 - */ -public interface IDisconnectHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDropToFrameHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDropToFrameHandler.java deleted file mode 100644 index d600c0942..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IDropToFrameHandler.java +++ /dev/null @@ -1,27 +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.core.commands; - -/** - * A drop to frame handler typically resets a program's instruction pointer - * to the first executable line of code associated with a stack frame. - *

- * Clients may implement this interface. The debug platform provides a - * drop to frame action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the drop to frame handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.IDropToFrame}. - *

- * @since 3.3 - */ -public interface IDropToFrameHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IEnabledStateRequest.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IEnabledStateRequest.java deleted file mode 100644 index ee3e5b50f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IEnabledStateRequest.java +++ /dev/null @@ -1,32 +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.core.commands; - - - -/** - * A request to update the enabled state of a command. A enabled state request - * is passed to a {@link IDebugCommandHandler} to update the enabled state of - * the handler. - *

- * Clients than invoke command handlers may implement this interface. - *

- * @since 3.3 - */ -public interface IEnabledStateRequest extends IDebugCommandRequest { - - /** - * Sets the enabled state of a command handler. - * - * @param result whether enabled - */ - public void setEnabled(boolean result); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IRestartHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IRestartHandler.java deleted file mode 100644 index 0969d70b3..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IRestartHandler.java +++ /dev/null @@ -1,27 +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.core.commands; - -/** - * A restart command allows the debugger to quickly restart the current debug - * session without terminating and re-launching. - *

- * Clients may implement this interface. The debug platform provides a - * restart action that delegates to this handler interface. Platform does not - * provide a default implementation of this handler, so to enable this action - * the debugger implementation must provide one. - *

- * - * @since 3.6 - */ -public interface IRestartHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IResumeHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IResumeHandler.java deleted file mode 100644 index 6df44ef54..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IResumeHandler.java +++ /dev/null @@ -1,26 +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.core.commands; - -/** - * A resume handler typically resumes execution of a suspended thread or target. - *

- * Clients may implement this interface. The debug platform provides a - * resume action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the resume handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.ISuspendResume}. - *

- * @since 3.3 - */ -public interface IResumeHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepFiltersHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepFiltersHandler.java deleted file mode 100644 index 5d0b7391d..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepFiltersHandler.java +++ /dev/null @@ -1,31 +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.core.commands; - -import org.eclipse.debug.core.DebugPlugin; - -/** - * A step filters handler typically toggles the use of step filters - * in a debug session based on the user preference setting. To determine if step filters - * should be enabled use the method isUseStepFilters() in - * {@link DebugPlugin}. - *

- * Clients may implement this interface. The debug platform provides a - * toggle step filters action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the step filters handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.IStepFilters}. - *

- * @since 3.3 - */ -public interface IStepFiltersHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepIntoHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepIntoHandler.java deleted file mode 100644 index 96a38cb9e..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepIntoHandler.java +++ /dev/null @@ -1,27 +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.core.commands; - -/** - * A step into handler typically steps into the next instruction to - * be executed. - *

- * Clients may implement this interface. The debug platform provides a - * step into action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the step into handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.IStep}. - *

- * @since 3.3 - */ -public interface IStepIntoHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepOverHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepOverHandler.java deleted file mode 100644 index 14e3b0e3a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepOverHandler.java +++ /dev/null @@ -1,27 +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.core.commands; - -/** - * A step over handler typically steps over the next instruction or line - * of code to be executed. - *

- * Clients may implement this interface. The debug platform provides a - * step over action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the step over handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.IStep}. - *

- * @since 3.3 - */ -public interface IStepOverHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepReturnHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepReturnHandler.java deleted file mode 100644 index 01a8edafc..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/IStepReturnHandler.java +++ /dev/null @@ -1,27 +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.core.commands; - -/** - * A step return handler typically steps out of the current method or function - * that the debugger is suspended in. - *

- * Clients may implement this interface. The debug platform provides a - * step return action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the step return handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.IStep}. - *

- * @since 3.3 - */ -public interface IStepReturnHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ISuspendHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ISuspendHandler.java deleted file mode 100644 index 39dc939ad..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ISuspendHandler.java +++ /dev/null @@ -1,26 +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.core.commands; - -/** - * A suspend handler typically suspends an executing thread or target. - *

- * Clients may implement this interface. The debug platform provides a - * suspend action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the suspend handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.ISuspendResume}. - *

- * @since 3.3 - */ -public interface ISuspendHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ITerminateHandler.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ITerminateHandler.java deleted file mode 100644 index db2600893..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/ITerminateHandler.java +++ /dev/null @@ -1,26 +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.core.commands; - -/** - * A terminate handler typically terminates an executing thread or target. - *

- * Clients may implement this interface. The debug platform provides a - * terminate action that delegates to this handler interface. As well, the - * debug platform provides an implementation of the terminate handler registered - * as an adapter on objects that implement - * {@link org.eclipse.debug.core.model.ITerminate}. - *

- * @since 3.3 - */ -public interface ITerminateHandler extends IDebugCommandHandler { - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/package.html deleted file mode 100644 index 5bae793de..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/commands/package.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - -Debug Commands - - - - -

Provides a set of interfaces for common debug commands.

- -

Package Specification

- -

This package provides a set interfaces for common debug commands. A debug command - represent a debugger function that can be enabled or disabled and executed. - The debug platform provides actions corresponding to the common debug commands. - The actions delegate to the command handler interfaces to determine enabled - state and execute.

-

A debugger implementation can provide its own implementation of a command by - implementing a command handler interface directly, or by registering an adapter - that implements the command handler interface. The debug platform's actions - update enabled state and execute based on the active debug context. The debug - platform provides implementations of handlers for the common debug commands - for debuggers that are an implementation of the standard debug model. For example, - the debug platform registers an IStepOverHandler adapter for implementations - of IStep.

- - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java deleted file mode 100644 index 3fd04ff38..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java +++ /dev/null @@ -1,341 +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.core.model; - - -import java.util.Map; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceRuleFactory; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.internal.core.DebugCoreMessages; - -/** - * Abstract implementation of a breakpoint. This class is - * intended to be subclassed by implementations - * of breakpoints. - * - * @see IBreakpoint - * @since 2.0 - */ - -public abstract class Breakpoint extends PlatformObject implements IBreakpoint { - - static { - // making sure that the BreakpointManager is correctly initialized - // before any breakpoint marker related operation (see bug 54993) - DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(); - } - - /** - * Underlying marker. - */ - private IMarker fMarker= null; - - /** - * @see IBreakpoint#setMarker(IMarker) - */ - public void setMarker(IMarker marker) throws CoreException { - fMarker= marker; - } - - /** - * @see Object#equals(Object) - */ - public boolean equals(Object item) { - if (item instanceof IBreakpoint) { - return getMarker().equals(((IBreakpoint)item).getMarker()); - } - return false; - } - - /** - * @see Object#hashCode() - */ - public int hashCode() { - return getMarker().hashCode(); - } - - /** - * @see IBreakpoint#setEnabled(boolean) - */ - public void setEnabled(boolean enabled) throws CoreException { - if (enabled != isEnabled()) { - setAttribute(ENABLED, enabled); - } - } - - /** - * @see IBreakpoint#isEnabled() - */ - public boolean isEnabled() throws CoreException { - return getMarker().getAttribute(ENABLED, false); - } - - /** - * @see IBreakpoint#isRegistered() - */ - public boolean isRegistered() throws CoreException { - IMarker marker= getMarker(); - return marker.exists() && marker.getAttribute(REGISTERED, true); - } - - /** - * @see IBreakpoint#setRegistered(boolean) - */ - public void setRegistered(boolean registered) throws CoreException { - if (isRegistered() != registered) { - setAttribute(REGISTERED, registered); - IBreakpointManager mgr = DebugPlugin.getDefault().getBreakpointManager(); - if (registered) { - mgr.addBreakpoint(this); - } else { - mgr.removeBreakpoint(this, false); - } - } - } - - /** - * @see IBreakpoint#delete() - */ - public void delete() throws CoreException { - DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(this, false); - getMarker().delete(); - } - - /** - * @see IBreakpoint#getMarker() - */ - public IMarker getMarker() { - return fMarker; - } - - /** - * @see IBreakpoint#isPersisted() - */ - public boolean isPersisted() throws CoreException { - return getMarker().getAttribute(PERSISTED, true); - } - - /** - * @see IBreakpoint#setPersisted(boolean) - */ - public void setPersisted(boolean persisted) throws CoreException { - if (isPersisted() != persisted) { - setAttributes(new String[] {PERSISTED, IMarker.TRANSIENT}, new Object[] {Boolean.valueOf(persisted), Boolean.valueOf(!persisted)}); - } - } - - /** - * Convenience method to set the given boolean attribute of - * this breakpoint's underlying marker in a workspace - * runnable. Setting marker attributes in a workspace runnable - * prevents deadlock. - * - * @param attributeName attribute name - * @param value attribute value - * @exception CoreException is setting the attribute fails - * @see IMarker#setAttribute(java.lang.String, boolean) - */ - protected void setAttribute(final String attributeName, final boolean value) throws CoreException { - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IWorkspaceRunnable runnable= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - ensureMarker().setAttribute(attributeName, value); - } - }; - - workspace.run(runnable, getMarkerRule(), 0, null); - } - - /** - * Convenience method to set the given integer attribute of - * this breakpoint's underlying marker in a workspace - * runnable. Setting marker attributes in a workspace runnable - * prevents deadlock. - * - * @param attributeName attribute name - * @param value attribute value - * @exception CoreException is setting the attribute fails - * @see IMarker#setAttribute(java.lang.String, int) - */ - protected void setAttribute(final String attributeName, final int value) throws CoreException { - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IWorkspaceRunnable runnable= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - ensureMarker().setAttribute(attributeName, value); - } - }; - - workspace.run(runnable, getMarkerRule(), 0, null); - } - - /** - * Convenience method to set the given attribute of - * this breakpoint's underlying marker in a workspace - * runnable. Setting marker attributes in a workspace runnable - * prevents deadlock. - * - * @param attributeName attribute name - * @param value attribute value - * @exception CoreException is setting the attribute fails - * @see IMarker#setAttribute(java.lang.String, java.lang.Object) - */ - protected void setAttribute(final String attributeName, final Object value) throws CoreException { - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IWorkspaceRunnable runnable= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - ensureMarker().setAttribute(attributeName, value); - } - }; - - workspace.run(runnable, getMarkerRule(), 0, null); - } - - /** - * Convenience method to set the given attributes of - * this breakpoint's underlying marker in a workspace - * runnable. Setting marker attributes in a workspace runnable - * prevents deadlock. - * - * @param attributeNames attribute names - * @param values attribute values - * @exception CoreException is setting the attributes fails - * @see IMarker#setAttributes(java.lang.String[], java.lang.Object[]) - */ - protected void setAttributes(final String[] attributeNames, final Object[] values) throws CoreException { - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IWorkspaceRunnable runnable= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - ensureMarker().setAttributes(attributeNames, values); - } - }; - - workspace.run(runnable, getMarkerRule(), IWorkspace.AVOID_UPDATE, null); - } - - /** - * Convenience method to set the attributes of - * this breakpoint's underlying marker in a workspace - * runnable. Setting marker attributes in a workspace runnable - * prevents deadlock. - * - * @param attributes attribute map - * @exception CoreException is setting the attributes fails - * @see IMarker#setAttributes(java.util.Map) - */ - protected void setAttributes(final Map attributes) throws CoreException{ - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IWorkspaceRunnable runnable= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - ensureMarker().setAttributes(attributes); - } - }; - - workspace.run(runnable, getMarkerRule(), IWorkspace.AVOID_UPDATE, null); - } - - /** - * Returns the marker associated with this breakpoint. - * - * @return breakpoint marker - * @exception DebugException if no marker is associated with - * this breakpoint or the associated marker does not exist - */ - protected IMarker ensureMarker() throws DebugException { - IMarker m = getMarker(); - if (m == null || !m.exists()) { - throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, - DebugCoreMessages.Breakpoint_no_associated_marker, null)); - } - return m; - } - - /** - * Returns whether this breakpoint has an associated marker that exists. - * - * @return returns whether this breakpoint has an associated marker that exists - * @since 2.1 - */ - protected boolean markerExists() { - IMarker m = getMarker(); - return (m != null && m.exists()); - } - - /** - * Returns a scheduling rule to use when modifying markers on the given resource, - * possibly null. - * - * @param resource a resource on which a marker will be created, modified, or deleted - * @return a scheduling rule to use when modifying markers on the given resource - * possibly null - * @since 3.1 - */ - protected ISchedulingRule getMarkerRule(IResource resource) { - ISchedulingRule rule = null; - if (resource != null) { - IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory(); - rule = ruleFactory.markerRule(resource); - } - return rule; - } - - /** - * Returns a scheduling rule to use when modifying or deleting this breakpoint's marker, - * possibly null. This method is only valid when this breakpoint's - * marker has already been created. When creating a marker on a specific resource, - * use getMarkerRule(IResource) instead. - * - * @return a scheduling rule to use when modifying or deleting this breakpoint's marker - * @since 3.1 - */ - protected ISchedulingRule getMarkerRule() { - ISchedulingRule rule = null; - IMarker marker = getMarker(); - if (marker != null) { - IResource resource = marker.getResource(); - if (resource != null) { - IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory(); - rule = ruleFactory.markerRule(resource); - } - } - return rule; - } - - /** - * Execute the given workspace runnable with the scheduling rule to use when running the operation. - * - * @param rule the rule to use when running the operation - * @param wr the runnable operation - * @throws DebugException If a core exception occurs performing the operation - * @since 3.1 - */ - protected void run(ISchedulingRule rule, IWorkspaceRunnable wr) throws DebugException { - try { - ResourcesPlugin.getWorkspace().run(wr, rule, 0, null); - } catch (CoreException e) { - throw new DebugException(e.getStatus()); - } - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java deleted file mode 100644 index 2d139433f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java +++ /dev/null @@ -1,168 +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.core.model; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -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.ILaunchConfiguration; - -/** - * Implementation of common function for debug elements. - *

- * Clients may subclass this class. - *

- * @since 3.1 - */ -public abstract class DebugElement extends PlatformObject implements IDebugElement { - - private IDebugTarget fTarget; - - /** - * Constructs a debug element referring to an artifact in the given - * debug target. - * - * @param target debug target containing this element - */ - public DebugElement(IDebugTarget target) { - fTarget = target; - } - - /* (non-Javadoc) - * - * Debug target implementation should override this method. - * - * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() - */ - public IDebugTarget getDebugTarget() { - return fTarget; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() - */ - public ILaunch getLaunch() { - return getDebugTarget().getLaunch(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - if (adapter == IDebugElement.class) { - return this; - } - - // a debug target may not implement IStepFilters - if (adapter == IStepFilters.class) { - if (getDebugTarget() instanceof IStepFilters) - return getDebugTarget(); - } - if (adapter == IDebugTarget.class) { - return getDebugTarget(); - } - if (adapter == ILaunch.class) { - return getLaunch(); - } - if (adapter == IProcess.class) { - return getDebugTarget().getProcess(); - } - //CONTEXTLAUNCHING - if(adapter == ILaunchConfiguration.class) { - return getLaunch().getLaunchConfiguration(); - } - return super.getAdapter(adapter); - } - - /** - * Fires a debug event. - * - * @param event debug event to fire - */ - public void fireEvent(DebugEvent event) { - DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event}); - } - - /** - * Fires a change event for this debug element - * with the specified detail code. - * - * @param detail detail code for the change event, - * such as DebugEvent.STATE or DebugEvent.CONTENT - */ - public void fireChangeEvent(int detail) { - fireEvent(new DebugEvent(this, DebugEvent.CHANGE, detail)); - } - - /** - * Fires a creation event for this debug element. - */ - public void fireCreationEvent() { - fireEvent(new DebugEvent(this, DebugEvent.CREATE)); - } - - /** - * Fires a resume for this debug element with - * the specified detail code. - * - * @param detail detail code for the resume event, such - * as DebugEvent.STEP_OVER - */ - public void fireResumeEvent(int detail) { - fireEvent(new DebugEvent(this, DebugEvent.RESUME, detail)); - } - - /** - * Fires a suspend event for this debug element with - * the specified detail code. - * - * @param detail detail code for the suspend event, such - * as DebugEvent.BREAKPOINT - */ - public void fireSuspendEvent(int detail) { - fireEvent(new DebugEvent(this, DebugEvent.SUSPEND, detail)); - } - - /** - * Fires a terminate event for this debug element. - */ - public void fireTerminateEvent() { - fireEvent(new DebugEvent(this, DebugEvent.TERMINATE)); - } - - /** - * Throws a debug exception with a status code of TARGET_REQUEST_FAILED. - * - * @param message exception message - * @param e underlying exception or null - * @throws DebugException - */ - protected void requestFailed(String message, Throwable e) throws DebugException { - throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.TARGET_REQUEST_FAILED, message, e)); - } - - /** - * Throws a debug exception with a status code of NOT_SUPPORTED. - * - * @param message exception message - * @param e underlying exception or null - * @throws DebugException - */ - protected void notSupported(String message, Throwable e) throws DebugException { - throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.NOT_SUPPORTED, message, e)); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java deleted file mode 100644 index d25865518..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpoint.java +++ /dev/null @@ -1,222 +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.core.model; - - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugPlugin; - -/** - * A breakpoint is capable of suspending the execution of a - * program at a specific location when a program is running - * in debug mode. Each breakpoint has an associated marker which - * stores and persists all attributes associated with a breakpoint. - *

- * A breakpoint is defined in two parts: - *

    - *
  1. By an extension of kind "org.eclipse.debug.core.breakpoints"
  2. - *
  3. By a marker definition that corresponds to the above breakpoint extension
  4. - *
- *

- * For example, following is a definition of corresponding breakpoint - * and breakpoint marker definitions. Note that the markerType - * attribute defined by the breakpoint extension corresponds to the - * type of the marker definition. - *

- * <extension point="org.eclipse.debug.core.breakpoints">
- *   <breakpoint 
- *      id="com.example.Breakpoint"
- *      class="com.example.Breakpoint"
- *      markerType="com.example.BreakpointMarker">
- *   </breakpoint>
- * </extension>
- * <extension point="org.eclipse.core.resources.markers">
- *   <marker 
- *      id="com.example.BreakpointMarker"
- *      super type="org.eclipse.debug.core.breakpointMarker"
- *      attribute name ="exampleAttribute">
- *   </marker>
- * </extension>
- * 
- *

- * The breakpoint manager instantiates persisted breakpoints by - * traversing all markers that are a subtype of - * "org.eclipse.debug.core.breakpointMarker", and - * instantiating the class defined by the class attribute - * on the associated breakpoint extension. The method setMarker - * is then called to associate a marker with the breakpoint. - *

- *

- * Breakpoints may or may not be registered with the breakpoint manager, and - * are persisted and restored as such. Since marker definitions only allow - * all or none of a specific marker type to be persisted, breakpoints define - * a PERSISTED attribute for selective persistence of breakpoints - * of the same type. - *

- * - * @since 2.0 - */ - -public interface IBreakpoint extends IAdaptable { - - /** - * Root breakpoint marker type - * (value "org.eclipse.debug.core.breakpointMarker"). - */ - public static final String BREAKPOINT_MARKER = DebugPlugin.getUniqueIdentifier() + ".breakpointMarker"; //$NON-NLS-1$ - - /** - * Line breakpoint marker type - * (value "org.eclipse.debug.core.lineBreakpoint"). - */ - public static final String LINE_BREAKPOINT_MARKER = DebugPlugin.getUniqueIdentifier() + ".lineBreakpointMarker"; //$NON-NLS-1$ - - /** - * Enabled breakpoint marker attribute (value "org.eclipse.debug.core.enabled"). - * The attribute is a boolean corresponding to the - * enabled state of a breakpoint. - * - * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean) - */ - public static final String ENABLED= "org.eclipse.debug.core.enabled"; //$NON-NLS-1$ - - /** - * Debug model identifier breakpoint marker attribute (value "org.eclipse.debug.core.id"). - * The attribute is a String corresponding to the - * identifier of the debug model a breakpoint is associated with. - */ - public static final String ID= "org.eclipse.debug.core.id"; //$NON-NLS-1$ - - /** - * Registered breakpoint marker attribute (value "org.eclipse.debug.core.registered"). - * The attribute is a boolean corresponding to - * whether a breakpoint has been registered with the breakpoint manager. - * - * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean) - */ - public static final String REGISTERED= "org.eclipse.debug.core.registered"; //$NON-NLS-1$ - - /** - * Persisted breakpoint marker attribute (value "org.eclipse.debug.core.persisted"). - * The attribute is a boolean corresponding to - * whether a breakpoint is to be persisted across workspace - * invocations. - * - * @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean) - */ - public static final String PERSISTED= "org.eclipse.debug.core.persisted"; //$NON-NLS-1$ - - /** - * Deletes this breakpoint's underlying marker, and removes - * this breakpoint from the breakpoint manager. - * - * @exception CoreException if unable to delete this breakpoint's - * underlying marker - */ - public void delete() throws CoreException; - - /** - * Returns the marker associated with this breakpoint, or - * null if no marker is associated with this breakpoint. - * - * @return associated marker, or null if there is - * no associated marker. - */ - public IMarker getMarker(); - /** - * Sets the marker associated with this breakpoint. This method is - * called once at breakpoint creation. - * - * @param marker the marker to associate with this breakpoint - * @exception CoreException if an error occurs accessing the marker - */ - public void setMarker(IMarker marker) throws CoreException; - /** - * Returns the identifier of the debug model this breakpoint is - * associated with. - * - * @return the identifier of the debug model this breakpoint is - * associated with - */ - public String getModelIdentifier(); - /** - * Returns whether this breakpoint is enabled - * - * @return whether this breakpoint is enabled - * @exception CoreException if unable to access the associated - * attribute from this breakpoint's underlying marker - */ - public boolean isEnabled() throws CoreException; - /** - * Sets the enabled state of this breakpoint. This has no effect - * if the current enabled state is the same as specified by the - * enabled parameter. - * - * @param enabled whether this breakpoint should be enabled - * @exception CoreException if unable to set the associated attribute on - * this breakpoint's underlying marker. - */ - public void setEnabled(boolean enabled) throws CoreException; - - /** - * Returns whether this breakpoint is currently registered with - * the breakpoint manager. - * - * @return whether this breakpoint is currently registered with - * the breakpoint manager - * @exception CoreException if unable to access the associated - * attribute on this breakpoint's underlying marker - */ - public boolean isRegistered() throws CoreException; - - /** - * Sets whether this breakpoint is currently registered with the - * breakpoint manager. - * - * @param registered whether this breakpoint is registered with the - * breakpoint manager - * @exception CoreException if unable to set the associated attribute - * on this breakpoint's underlying marker. - */ - public void setRegistered(boolean registered) throws CoreException; - - /** - * Returns whether this breakpoint is to be persisted across - * workspace invocations, or when a project is closed and re-opened. - * Since marker definitions only allow all/none of a specific type - * of marker to be persisted (rather than selected markers of a - * specific type), breakpoints define this functionality. - * - * @return whether this breakpoint is to be persisted - * @exception CoreException if unable to access the associated attribute - * on this breakpoint's underlying marker - */ - public boolean isPersisted() throws CoreException; - - /** - * Sets whether this breakpoint is to be persisted across - * workspace invocations, or when a project is closed and re-opened. - * Has no effect if this breakpoint's marker definition is defined as not - * persisted. Sets the underlying TRANSIENT attribute on this - * breakpoint's marker to true. - * - * @param registered whether this breakpoint is to be persisted across - * workspace invocations - * @exception CoreException if unable to set the associated attribute on - * this breakpoint's underlying marker. - */ - public void setPersisted(boolean registered) throws CoreException; - -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java deleted file mode 100644 index cbafd8933..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java +++ /dev/null @@ -1,70 +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.core.model; - -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.IBreakpointManager; - -/** - * This interface defines a breakpoint import participant. - *

- * Participants are used during a breakpoint import operation - * to specify how breakpoints of the associated marker type should be compared - * and how the breakpoint should be validated once it is decided it will be imported. - *

- *

- * A breakpoint import participant it contributed via the - * org.eclipse.debug.core.breakpointImportParticipants extension point. - *

- *

- * Following is an example of a breakpoint participant extension: - *

- *
- * 
- *  
- *  
- * 
- * 
- *

- * Clients may implement this interface. - *

- * - * @see IBreakpointManager - * @since 3.5 - */ -public interface IBreakpointImportParticipant { - - /** - * Determines if the given attributes match the given breakpoint. - * - * @param attributes the map of raw breakpoint attributes read from the import memento - * @param breakpoint the current breakpoint context in the import operation - * @return true if the breakpoint matches the given attributes, false otherwise - * @throws CoreException if an exception occurs - */ - public boolean matches(Map attributes, IBreakpoint breakpoint) throws CoreException; - - /** - * Verifies the state of the breakpoint once it has been imported. This method can be used to correct - * attributes of the imported breakpoint once it has been imported. - * - * For example: updating line number information or character ranges to ensure the marker appears correctly - * - * @param breakpoint the breakpoint to be verified - * @throws CoreException if an exception occurs - */ - public void verify(IBreakpoint breakpoint) throws CoreException; - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.java deleted file mode 100644 index a6defd6c5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugElement.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.core.model; - - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.ILaunch; - -/** - * A debug element represents an artifact in a program being - * debugged. - *

- * Some methods on debug elements require communication - * with the target program. Such methods may throw a DebugException - * with a status code of TARGET_REQUEST_FAILED - * when unable to complete a request due to a failure on the target. - * Methods that require communication with the target program or require - * the target to be in a specific state (for example, suspended), are declared - * as such. - *

- *

- * Debug elements are language independent. However, language specific - * features can be made available via the adapter mechanism provided by - * IAdaptable, or by extending the debug element interfaces. - * A debug model is responsible for declaring any special adapters - * its debug elements implement. - *

- *

- * Clients may implement this interface. - *

- */ -public interface IDebugElement extends IAdaptable { - - /** - * Returns the unique identifier of the plug-in - * this debug element originated from. - * - * @return the plug-in identifier - */ - public String getModelIdentifier(); - /** - * Returns the debug target this element is contained in. - * - * @return the debug target this element is contained in - */ - public IDebugTarget getDebugTarget(); - /** - * Returns the launch this element is contained in. - * - * @return the launch this element is contained in - */ - public ILaunch getLaunch(); -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugModelProvider.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugModelProvider.java deleted file mode 100644 index 49fd1777a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugModelProvider.java +++ /dev/null @@ -1,35 +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.core.model; - -/** - * A debug model provider provides debug model identifiers. - * This interface is used as an adapter to determine what - * debug models are associated with an adaptable object. - * Generally, when debugging one language, only one debug - * model is associated with a debug element. However, - * a debug model that provides cross language debugging - * may represent several debug models. - *

- * Clients are intended to implement this interface. - *

- * @since 3.0 - */ -public interface IDebugModelProvider { - - /** - * Returns a collection of debug model identifiers. - * - * @return a collection of debug model identifiers - */ - public String[] getModelIdentifiers(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.java deleted file mode 100644 index 35c21b6bc..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDebugTarget.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.core.model; - - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.IBreakpointListener; - -/** - * A debug target is a debuggable execution context. For example, a debug target - * may represent a debuggable process or a virtual machine. A debug target is the root - * of the debug element hierarchy. A debug target contains threads. Minimally, a debug - * target supports the following: - *
    - *
  • terminate - *
  • suspend/resume - *
  • breakpoints - *
  • disconnect - *
- *

- * Generally, launching a debug session results in the creation of a - * debug target. Launching is a client responsibility, as is debug target - * creation. - *

- * Clients may implement this interface. - *

- * @see ITerminate - * @see ISuspendResume - * @see IBreakpointListener - * @see IDisconnect - * @see IMemoryBlockRetrieval - * @see org.eclipse.debug.core.ILaunch - */ -public interface IDebugTarget extends IDebugElement, ITerminate, ISuspendResume, IBreakpointListener, IDisconnect, IMemoryBlockRetrieval { - /** - * Returns the system process associated with this debug target. - * - * @return the system process associated with this debug target - */ - public IProcess getProcess(); - /** - * Returns the threads contained in this debug target. An - * empty collection is returned if this debug target contains - * no threads. - * - * @return a collection of threads - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
- * @since 2.0 - */ - public IThread[] getThreads() throws DebugException; - - /** - * Returns whether this debug target currently contains any threads. - * - * @return whether this debug target currently contains any threads - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
- * @since 2.0 - */ - public boolean hasThreads() throws DebugException; - - /** - * Returns the name of this debug target. Name format is debug model - * specific, and should be specified by a debug model. - * - * @return this target's name - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
- */ - public String getName() throws DebugException; - - /** - * Returns whether this target can install the given breakpoint. - * - * @param breakpoint breakpoing to consider - * @return whether this target can install the given breakpoint - */ - public boolean supportsBreakpoint(IBreakpoint breakpoint); -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java deleted file mode 100644 index c0cf267d5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDisconnect.java +++ /dev/null @@ -1,50 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * The ability to end a debug session with a target program - * and allow the target to continue running. - *

- * Clients may implement this interface. - *

- * @see IDebugTarget - */ -public interface IDisconnect { - /** - * Returns whether this element can currently disconnect. - * - * @return whether this element can currently disconnect - */ - public boolean canDisconnect(); - /** - * Disconnects this element from its target. Generally, disconnecting - * ends a debug session with a debug target, but allows the target - * program to continue running. - * - * @exception DebugException on failure. Reasons include:
    - *
  • TARGET_REQUEST_FAILED - The request failed in the target - *
  • NOT_SUPPORTED - The capability is not supported by the target - *
- */ - public void disconnect() throws DebugException; - /** - * Returns whether this element is disconnected. - * - * @return whether this element is disconnected - */ - public boolean isDisconnected(); -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java deleted file mode 100644 index 79229afd4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IDropToFrame.java +++ /dev/null @@ -1,43 +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.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to drop to frame. Drop to frame - * generally means popping a selected stack frame (and all frames above it) from - * the execution stack and then stepping back into the frame. - * - * @since 3.1 - */ -public interface IDropToFrame { - - /** - * Returns whether this element can currently perform a drop to frame. - * @return whether this element can currently perform a drop to frame - */ - public boolean canDropToFrame(); - - /** - * Performs a drop to frame on this element. Implementations must generate - * events such that debug clients can update appropriately, such as corresponding - * RESUME and SUSPEND events, or a single CHANGE - * event when the drop is complete. Implementations should implement drop to frame - * in a non-blocking fashion. - * - * @throws DebugException on failure. Reasons include:
    - *
  • TARGET_REQUEST_FAILED - The request failed in the target
  • - *
  • NOT_SUPPORTED - The capability is not supported by the target
  • - *
- */ - public void dropToFrame() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IErrorReportingExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IErrorReportingExpression.java deleted file mode 100644 index 3ba24d400..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IErrorReportingExpression.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.core.model; - -/** - * An expression that can report errors which occurred during the - * expression's evaluation. - * - * @since 3.0 - */ -public interface IErrorReportingExpression extends IExpression { - /** - * Returns whether this expression has errors to report. An expression - * can have errors if errors were generated the last time its value was - * computed - * - * @return whether this expression's result has errors - */ - public boolean hasErrors(); - /** - * Returns this expression's error messages, if any. An expression can - * have errors if errors were generated the last time its value was - * computed. - * - * @return this expression's error messages - */ - public String[] getErrorMessages(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java deleted file mode 100644 index 31c4f25d7..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java +++ /dev/null @@ -1,67 +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.core.model; - - -/** - * An expression is a snippet of code that can be evaluated - * to produce a value. When and how an expression is evaluated - * is implementation specific. The context/binding required to - * evaluate an expression varies by debug model, and by - * user intent. Furthermore, an expression may need to be evaluated - * at a specific location in a program (for example, at a - * breakpoint/line where certain variables referenced in the - * expression are visible/allocated). A user may want to - * evaluate an expression once to produce a value that can - * be inspected iteratively, or they may wish to evaluate an - * expression iteratively producing new values each time - * (i.e. as in a watch list). - *

- * Clients are intended to implement this interface. - *

- * @since 2.0 - */ -public interface IExpression extends IDebugElement { - - /** - * Returns this expression's snippet of code. - * - * @return the expression - */ - public abstract String getExpressionText(); - - /** - * Returns the current value of this expression or - * null if this expression does not - * currently have a value. - * - * @return value or null - */ - public abstract IValue getValue(); - - /** - * Returns the debug target this expression is associated - * with, or null if this expression is not - * associated with a debug target. - * - * @return debug target or null - * @see IDebugElement#getDebugTarget() - */ - public abstract IDebugTarget getDebugTarget(); - - /** - * Notifies this expression that it has been removed - * from the expression manager. Any required clean up - * is be performed such that this expression can be - * garbage collected. - */ - public abstract void dispose(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFilteredStep.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFilteredStep.java deleted file mode 100644 index 24e375c12..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFilteredStep.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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to perform a filtered step. Implementations must be non- - * blocking. Filter implementation is debug model specific and may not be - * supported by all debug models. - *

- * Clients may implement this interface. - *

- * @since 2.1 - * @deprecated clients should implement IStepFilters instead - */ -public interface IFilteredStep extends IStep { - /** - * Returns whether this element can currently perform a filtered step into. - * - * @return whether this element can currently perform a filtered step into - */ - public boolean canStepWithFilters(); - /** - * Steps into the current statement, generating RESUME - * and SUSPEND events for the associated thread, applying step - * filters, as applicable for the associated thread. Can only be called when - * the associated thread is suspended. Implementations must implement - * stepping as non- blocking. - * - * @exception DebugException on failure. Reasons include:
    - *
  • TARGET_REQUEST_FAILED - The request failed in the target
  • - *
  • NOT_SUPPORTED - The capability is not supported by the target
  • - *
- */ - public void stepWithFilters() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFlushableStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFlushableStreamMonitor.java deleted file mode 100644 index 463faa3ff..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFlushableStreamMonitor.java +++ /dev/null @@ -1,50 +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.core.model; - - - -/** - * A stream monitor who's contents can be flushed. As well, a client may - * turn buffering on/off in a flushable stream monitor. - *

- * Clients may implement this interface. - *

- * @since 2.1 - */ -public interface IFlushableStreamMonitor extends IStreamMonitor { - - /** - * Empties the contents of this stream monitor's underlying buffer. - */ - public void flushContents(); - - /** - * Sets whether the contents of this monitor's underlying stream should be - * buffered. When false, contents appended to this stream monitor - * are not stored in a buffer, and are thus not available from - * getContents(). Registered listeners are notified of appended - * text, and must buffer the contents if desired. - * - * @param buffer whether the contents of this monitor's underlying stream - * should be buffered - */ - public void setBuffered(boolean buffer); - - /** - * Returns whether the contents of this monitor's underlying stream is - * buffered. - * - * @return whether the contents of this monitor's underlying stream is - * buffered - */ - public boolean isBuffered(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IIndexedValue.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IIndexedValue.java deleted file mode 100644 index 0b66289af..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IIndexedValue.java +++ /dev/null @@ -1,71 +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.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * A value containing an indexed collection of variables - for example, - * an array. - *

- * The indexed collection value has been added to the debug model to support - * automatic partitioning of large arrays in the debug UI. Clients are not required - * to implement this interface for values representing indexed collections, - * however, doing so will provide enhanced display options in the debug UI. - *

- *

- * Clients may implement this interface. - *

- * @since 3.0 - */ -public interface IIndexedValue extends IValue { - - /** - * Returns the variable at the given offset in this collection. - * The offset is zero based. - * @param offset zero based offset into this collection - * @return returns the variable in this collection at the given - * offset - * @throws DebugException if unable to retrieve the variable at the - * given offset - */ - public IVariable getVariable(int offset) throws DebugException; - - /** - * Returns a subset of the elements in this collection of variables as - * specified by the given offset and length. - * - * @param offset beginning offset of the subset of elements to return - * @param length the number of elements to return - * @return a subset of the elements in this collection of variables as - * specified by the given offset and length - * @throws DebugException if unable to retrieve the variables - */ - public IVariable[] getVariables(int offset, int length) throws DebugException; - - /** - * Returns the number of entries in this indexed collection. - * - * @return the number of entries in this indexed collection - * @throws DebugException if unable to determine the number - * of entries in this collection - */ - public int getSize() throws DebugException; - - /** - * Returns the index of the first variable contained in this value. - * Generally, indexed values are zero based, but this allows for - * an arbitrary base offset. - * - * @return the index of the first variable contained in this value - */ - public int getInitialOffset(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java deleted file mode 100644 index 7484f8d19..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate.java +++ /dev/null @@ -1,54 +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.core.model; - - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; - -/** - * A launch configuration delegate performs launching for a - * specific type of launch configuration. A launch configuration - * delegate is defined by the delegate attribute - * of a launchConfigurationType extension. - *

- * This interface is intended to be implemented by clients. - *

- * @see org.eclipse.debug.core.ILaunchConfigurationType - * @see ILaunchConfiguration - * @since 2.0 - */ -public interface ILaunchConfigurationDelegate { - - /** - * Launches the given configuration in the specified mode, contributing - * debug targets and/or processes to the given launch object. The - * launch object has already been registered with the launch manager. - * - * @param configuration the configuration to launch - * @param mode the mode in which to launch, one of the mode constants - * defined by ILaunchManager - - * RUN_MODE or DEBUG_MODE. - * @param monitor progress monitor, or null progress monitor, or null. A cancelable progress - * monitor is provided by the Job framework. It should be noted that the setCanceled(boolean) method should - * never be called on the provided monitor or the monitor passed to any delegates from this method; due to a - * limitation in the progress monitor framework using the setCanceled method can cause entire workspace batch - * jobs to be canceled, as the canceled flag is propagated up the top-level parent monitor. - * The provided monitor is not guaranteed to have been started. - * @param launch the launch object to contribute processes and debug - * targets to - * @exception CoreException if launching fails - */ - public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException; - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate2.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate2.java deleted file mode 100644 index 422124f0a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILaunchConfigurationDelegate2.java +++ /dev/null @@ -1,106 +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.core.model; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; - -/** - * Optional enhancements to the launch configuration delegate interface. - * Allows launch delegates to abort a launch, build relevant projects in - * the workspace before a launch, and create the launch object to be used - * in a launch. - *

- * Clients implementing ILaunchConfigurationDelegate may also - * implement this interface. - *

- * @since 3.0 - */ -public interface ILaunchConfigurationDelegate2 extends ILaunchConfigurationDelegate { - - /** - * Returns a launch object to use when launching the given launch - * configuration in the given mode, or null if a new default - * launch object should be created by the debug platform. If a launch object - * is returned, its launch mode must match that of the mode specified in - * this method call. - * - * @param configuration the configuration being launched - * @param mode the mode the configuration is being launched in - * @return a launch object or null - * @throws CoreException if unable to launch - */ - public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException; - - /** - * Optionally performs any required building before launching the given - * configuration in the specified mode, and returns whether the debug platform - * should perform an incremental workspace build before the launch continues. - * If false is returned the launch will proceed without further - * building, and if true is returned an incremental build will - * be performed on the workspace before launching. - *

- * This method is only called if the launch is invoked with flag indicating - * building should take place before the launch. This is done via the - * method - * ILaunchConfiguration.launch(String mode, IProgressMonitor monitor, boolean build). - *

- * @param configuration the configuration being launched - * @param mode the mode the configuration is being launched in - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return whether the debug platform should perform an incremental workspace - * build before the launch - * @throws CoreException if an exception occurs while building - */ - public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException; - - /** - * Returns whether a launch should proceed. This method is called after - * preLaunchCheck() and buildForLaunch() providing - * a final chance for this launch delegate to abort a launch if required. - * For example, a delegate could cancel a launch if it discovered compilation - * errors that would prevent the launch from succeeding. - * - * @param configuration the configuration being launched - * @param mode launch mode - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return whether the launch should proceed - * @throws CoreException if an exception occurs during final checks - */ - public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException; - - /** - * Returns whether a launch should proceed. This method is called first - * in the launch sequence providing an opportunity for this launch delegate - * to abort the launch. - * - * @param configuration configuration being launched - * @param mode launch mode - * @param monitor progress monitor, or null. A cancelable progress monitor is provided by the Job - * framework. It should be noted that the setCanceled(boolean) method should never be called on the provided - * monitor or the monitor passed to any delegates from this method; due to a limitation in the progress monitor - * framework using the setCanceled method can cause entire workspace batch jobs to be canceled, as the canceled flag - * is propagated up the top-level parent monitor. The provided monitor is not guaranteed to have been started. - * @return whether the launch should proceed - * @throws CoreException if an exception occurs while performing pre-launch checks - */ - public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java deleted file mode 100644 index 9b7b4cf0c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILineBreakpoint.java +++ /dev/null @@ -1,50 +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.core.model; - - -import org.eclipse.core.runtime.CoreException; - -/** - * A breakpoint that can be located at a specific line of source code. - */ -public interface ILineBreakpoint extends IBreakpoint { - -/** - * Returns the line number in the original source that corresponds - * to the location of this breakpoint, or -1 if the attribute is not - * present. - * - * @return this breakpoint's line number, or -1 if unknown - * @exception CoreException if a CoreException is thrown - * while accessing the underlying IMarker.LINE_NUMBER marker attribute - */ -public int getLineNumber() throws CoreException; -/** - * Returns starting source index in the original source that corresponds - * to the location of this breakpoint, or -1 if the attribute is not present. - * - * @return this breakpoint's char start value, or -1 if unknown - * @exception CoreException if a CoreException is thrown - * while accessing the underlying IMarker.CHAR_START marker attribute - */ -public int getCharStart() throws CoreException; -/** - * Returns ending source index in the original source that corresponds - * to the location of this breakpoint, or -1 if the attribute is not present. - * - * @return this breakpoint's char end value, or -1 if unknown - * @exception CoreException if a CoreException is thrown - * while accessing the underlying IMarker.CHAR_END marker attribute - */ -public int getCharEnd() throws CoreException; -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate.java deleted file mode 100644 index 50865a79e..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate.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.core.model; - -import org.eclipse.core.runtime.CoreException; - -/** - * A delegate that provides a value representing the logical structure of a raw - * implementation value from a debug model. Associated with a logical structure - * type extension. - *

- * Clients contributing logical structure types should implement this - * interface. - *

- * @since 3.0 - * @see org.eclipse.debug.core.ILogicalStructureType - */ -public interface ILogicalStructureTypeDelegate { - - /** - * Returns whether this structure type can provide a logical structure for - * the given value. - * - * @param value value for which a logical structure is being requested - * @return whether this structure type can provide a logical structure for - * the given value - */ - public boolean providesLogicalStructure(IValue value); - - /** - * Returns a value representing a logical structure of the given value. - * - * @param value value for which a logical structure is being requested - * @return value representing logical structure - * @throws CoreException if an exception occurs generating a logical - * structure - */ - public IValue getLogicalStructure(IValue value) throws CoreException; - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate2.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate2.java deleted file mode 100644 index ff5f4e8b8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ILogicalStructureTypeDelegate2.java +++ /dev/null @@ -1,46 +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.core.model; - - -/** - * Optional extension to ILogicalStructureTypeDelegate that allows - * a logical structure type delegate to provide a description for a value. - * This allows a logical structure type to provide logical structures and - * descriptions for more than one type of value. - *

- * If a logical structure type delegate implements this interface, it will - * be consulted for a description rather than using the description attribute - * provided in plug-in XML. - *

- *

- * Clients contributing logical structure types can implement this - * interface. - *

- * @since 3.1 - * @see org.eclipse.debug.core.ILogicalStructureType - */ -public interface ILogicalStructureTypeDelegate2 { - - /** - * Returns a simple description of the logical structure provided by this - * structure type delegate, for the given value. - * Cannot return null. This method is only called if this - * logical structure type delegate returns true for - * providesLogicalStructure(IValue). - * - * @param value a value a description is requested for - * @return a simple description of the logical structure provided by this - * structure type delegate, for the given value - */ - public String getDescription(IValue value); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java deleted file mode 100644 index 7740c8adc..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlock.java +++ /dev/null @@ -1,84 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A contiguous segment of memory in an execution context. - * A memory block is represented by a starting memory address - * and a length. Not all debug architectures support the retrieval - * of memory blocks. - *

- * Clients may implement this interface. - *

- * @see IMemoryBlockRetrieval - * @since 2.0 - */ -public interface IMemoryBlock extends IDebugElement { - - /** - * Returns the start address of this memory block. - * - * @return the start address of this memory block - */ - public long getStartAddress(); - - /** - * Returns the length of this memory block in bytes. - * - * @return the length of this memory block in bytes - */ - public long getLength(); - - /** - * Returns the values of the bytes currently contained - * in this this memory block. - * - * @return the values of the bytes currently contained - * in this this memory block - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
  • - *
- */ - public byte[] getBytes() throws DebugException; - - /** - * Returns whether this memory block supports value modification - * - * @return whether this memory block supports value modification - */ - public boolean supportsValueModification(); - - /** - * Sets the value of the bytes in this memory block at the specified - * offset within this memory block to the specified bytes. - * The offset is zero based. - * - * @param offset the offset at which to set the new values - * @param bytes the new values - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
  • - *
  • This memory block does not support value modification
  • - *
  • The specified offset is greater than or equal to the length - * of this memory block, or the number of bytes specified goes - * beyond the end of this memory block (index of out of range)
  • - *
- */ - public void setValue(long offset, byte[] bytes) throws DebugException; - -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockExtension.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockExtension.java deleted file mode 100644 index cb4134807..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockExtension.java +++ /dev/null @@ -1,243 +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.core.model; - -import java.math.BigInteger; - -import org.eclipse.debug.core.DebugException; - -/** - * Extensions to {@link org.eclipse.debug.core.model.IMemoryBlock}. Allows - * for bytes to be accessed in a larger address space, and for state information - * to be provided for each byte. - *

- * Clients may optionally implement this interface when providing implementations of - * {@link org.eclipse.debug.core.model.IMemoryBlock}. - *

- * @since 3.1 - * @see org.eclipse.debug.core.model.MemoryByte - */ -public interface IMemoryBlockExtension extends IMemoryBlock { - - /** - * Returns the expression used to create this memory block. An expression can - * be used as name for a memory block and typically represents an expression - * used to compute a base address for a memory block. - * - * @return the expression used to create this memory block - */ - public String getExpression(); - - /** - * Returns the base address of this memory block as a big integer. The - * address is in terms of addressable units. - * - * @return the base address of this memory block - * @throws DebugException if unable to retrieve the base address - */ - public BigInteger getBigBaseAddress() throws DebugException; - - /** - * Returns the hard start address of this memory block as a big integer, or - * null if none. A null start address indicates that - * memory may be retrieved at any address less than this memory block's base - * address. - * - * @return the hard start address of this memory block or null - * @throws DebugException if unable to retrieve the start address of this memory block. - */ - public BigInteger getMemoryBlockStartAddress() throws DebugException; - - /** - * Returns the hard end address of this memory block as a big integer, or - * null if none. A null end address indicates that - * memory may be retrieved from any positive offset relative to the base address - * of this memory block. - * - * @return the hard end address of this memory block or null - * @throws DebugException if unable to retrieve the end address of this memory block. - */ - public BigInteger getMemoryBlockEndAddress() throws DebugException; - - /** - * Returns the length of this memory block, or -1 if unbounded. - * Returns "end address - start address" for a memory block with a fixed - * length (i.e. when both start and end address are known). - * Returns -1 for an unbounded memory block (i.e. when start or end address is - * null). - * - * @return length of this memory block or -1 if unbounded - * @throws DebugException if unable to retrieve the length of this memory block. - */ - public BigInteger getBigLength() throws DebugException; - - /** - * Returns the address size of this memory block in number of bytes. The address - * size indicates the number of bytes used to construct an address. - * - * @return address size in number of bytes - * @throws DebugException if unable to retrieve the address size - */ - public int getAddressSize() throws DebugException; - - /** - * Returns whether the base address of this memory block can be modified. - * - * @return whether the base address of this memory block can be modified - * @throws DebugException is unable to determine if base address modification is supported - */ - public boolean supportBaseAddressModification() throws DebugException; - - /** - * Returns whether this memory block manages the change state of its bytes. - *

- * If a memory block manages changes the memory block is responsible for - * setting the CHANGED state of its MemoryByte's - * returned from getBytesFromAddress and - * getBytesFromOffset. The changed state of a byte should - * be updated each time a thread suspends in a memory block's target. - *

- * @return whether this memory block manages the change state of its bytes - */ - public boolean supportsChangeManagement(); - - /** - * Sets the base address of this memory block to the given address. - * - * @param address new base address - * @throws DebugException if unable to modify the base address, or modification - * of the base address fails - */ - public void setBaseAddress(BigInteger address) throws DebugException; - - /** - * Returns bytes from this memory block based on the base address and - * addressable size of this memory block. - *

- * A memory block may be asked to retrieve bytes beyond it's start - * or end address. If a memory block is unable to retrieve memory outside - * these boundaries, implementations should return memory bytes with - * the READABLE bit turned off for each byte outside - * the of the accessible range. An exception should not be thrown in this - * case. - *

- * @param unitOffset zero based offset into this memory block at which to start - * retrieving bytes in terms of addressable units. Client should retrieve - * memory starting from "base address + offset". - * @param addressableUnits the number of addressable units to retrieve - * @return an array of bytes from this memory block based on the given offset - * and number of units. The size of the array returned must to be equal to - * units * getAddressableSize(). - * @throws DebugException if unable to retrieve the specified bytes due to - * a failure communicating with the target - * @see MemoryByte - */ - public MemoryByte[] getBytesFromOffset(BigInteger unitOffset, long addressableUnits) throws DebugException; - - /** - * Returns bytes from this memory block based on the given address and the - * addressable size of this memory block. - *

- * A memory block may be asked to retrieve bytes beyond it's start - * or end address. If a memory block is unable to retrieve memory outside - * these boundaries, implementations should return memory bytes with - * the READABLE bit turned off for each byte outside - * the of the accessible range. An exception should not be thrown in this - * case. - *

- * @param address address at which to begin retrieving bytes in terms - * of addressable units - * @param units is the number of addressable units of memory to retrieve - * @return an array of bytes from this memory block based on the given address - * and number of units. The size of the array returned must to be equal to - * units * getAddressableSize(). - * @throws DebugException if unable to retrieve the specified bytes due to - * a failure communicating with the target - * @see MemoryByte - */ - public MemoryByte[] getBytesFromAddress(BigInteger address, long units) throws DebugException; - - /** - * Sets bytes in this memory block at the specified offset within this memory block to - * the specified bytes. The offset is zero based. After successfully modifying the - * specified bytes, a debug event should be fired with a kind of CHANGE. - * - * @param offset the zero based offset at which to set the new value. Modify - * the memory starting from base address + offset. - * @param bytes replacement bytes - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
  • - *
  • This memory block does not support value modification
  • - *
  • The specified offset is greater than or equal to the length - * of this memory block, or the number of bytes specified goes - * beyond the end of this memory block (index of out of range)
  • - *
- * @see org.eclipse.debug.core.DebugEvent - */ - public void setValue(BigInteger offset, byte[] bytes) throws DebugException; - - /** - * Connects the given client to this memory block. Allows a memory block - * to know when it is being monitored. Has no effect if an identical - * client is already connected. - *

- * Memory blocks supporting change management may selectively turn off - * change management when no clients are connected, for reasons of - * efficiency. Clients that require access to change state information - * are required to connect to a memory block before change information - * is considered to be valid. - *

- * @param client the client to connect - */ - public void connect(Object client); - - /** - * Disconnects the given client from this memory block. Has no effect if - * an identical client is not already connected. - * - * @param client the client to disconnect - */ - public void disconnect(Object client); - - /** - * Returns the possibly empty list of clients currently connected to this - * memory block. - * - * @return the possibly empty list of clients currently connected to this - * memory block - */ - public Object[] getConnections(); - - /** - * Dispose this memory block. Connected clients are disconnected. - * @throws DebugException if the memory block cannot be disposed. - */ - public void dispose() throws DebugException; - - /** - * Returns the origin of this memory block. - * - * @return the origin of this memory block - */ - public IMemoryBlockRetrieval getMemoryBlockRetrieval(); - - /** - * Returns this memory block's addressable size in number of bytes. The addressable size - * of memory block indicates the minimum number of bytes that can be retrieved as - * a single unit. - * - * @return this memory block's addressable size - * @throws DebugException if the addressable size cannot be obtained. - */ - public int getAddressableSize() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.java deleted file mode 100644 index 925366297..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrieval.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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * Supports the retrieval of arbitrary blocks of memory. - * - * @see IMemoryBlock - * @since 2.0 - */ -public interface IMemoryBlockRetrieval { - - /** - * Returns whether this debug target supports the retrieval - * of memory blocks. - * - * @return whether this debug target supports the retrieval - * of memory blocks - */ - public boolean supportsStorageRetrieval(); - - /** - * Returns a memory block that starts at the specified - * memory address, with the specified length. - * - * @param startAddress starting address - * @param length length of the memory block in bytes - * @return a memory block that starts at the specified - * memory address, with the specified length - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
  • - *
  • This debug target does not support memory block retrieval
  • - *
  • The specified address and length are not within valid - * ranges
  • - *
- */ - public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException; -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrievalExtension.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrievalExtension.java deleted file mode 100644 index f6aea1b55..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IMemoryBlockRetrievalExtension.java +++ /dev/null @@ -1,36 +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.core.model; - -import org.eclipse.debug.core.DebugException; - - -/** - * Extended capabilities for memory block retrieval. Supports the retrieval - * of memory blocks based on an expression and context. - * - * @since 3.1 - */ -public interface IMemoryBlockRetrievalExtension extends IMemoryBlockRetrieval { - - /** - * Retrieves and returns a memory block. - * - * @param expression expression to be evaluated to an address - * @param context context for evaluating the expression. This is typically - * a debug element. - * @return a memory block based on the given expression and context - * @throws DebugException if unable to retrieve the specified memory - */ - - public IMemoryBlockExtension getExtendedMemoryBlock(String expression, Object context) throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IPersistableSourceLocator.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IPersistableSourceLocator.java deleted file mode 100644 index 8433aa8d4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IPersistableSourceLocator.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.core.model; - - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; - -/** - * A source locator that can be persisted and restored, - * to be used with a specific launch configuration. - * The debug plug-in defines a source locator extension - * point for persistable source locators. - *

- * A source locator extension is defined in plugin.xml. - * Following is an example definition of a source locator extension. - *

- * <extension point="org.eclipse.debug.core.sourceLocators">
- *   <sourceLocator 
- *      id="com.example.ExampleIdentifier"
- *      class="com.example.ExampleSourceLocator"
- *      name="Example Source Locator">
- *   </sourceLocator>
- * </extension>
- * 
- * The attributes are specified as follows: - *
    - *
  • id specifies a unique identifier for this source locator.
  • - *
  • class specifies the fully qualified name of the Java class - * that implements IPersistableSourceLocator.
  • - *
  • name a human readable name, describing the type of - * this source locator.
  • - *
- *

- *

- * Clients may implement this interface. - *

- * @see org.eclipse.debug.core.ILaunch - * @see IStackFrame - * @since 2.0 - */ -public interface IPersistableSourceLocator extends ISourceLocator { - - /** - * Returns a memento that can be used to reconstruct - * this source locator - * - * @return a memento that can be used to reconstruct - * this source locator - * @exception CoreException if unable to construct a memento - */ - public String getMemento() throws CoreException; - - /** - * Initializes this source locator based on the given - * memento. - * - * @param memento a memento to initialize this source locator - * @exception CoreException on failure to initialize - */ - public void initializeFromMemento(String memento) throws CoreException; - - /** - * Initializes this source locator to perform default - * source lookup for the given launch configuration. - * - * @param configuration launch configuration this source locator - * will be performing source lookup for - * @exception CoreException on failure to initialize - */ - public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException; - -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java deleted file mode 100644 index 7ce2452b4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java +++ /dev/null @@ -1,105 +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.core.model; - - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; - -/** - * A process represents a program running in normal (non-debug) mode. - * Processes support setting and getting of client defined attributes. - * This way, clients can annotate a process with any extra information - * important to them. For example, classpath annotations, or command - * line arguments used to launch the process may be important to a client. - *

- * Clients may implement this interface, however, the debug plug-in - * provides an implementation of this interface for a - * java.lang.Process. - *

- * @see org.eclipse.debug.core.DebugPlugin#newProcess(ILaunch, Process, String) - */ -public interface IProcess extends IAdaptable, ITerminate { - - /** - * Attribute key for a common, optional, process property. The value of this - * attribute is the command line a process was launched with. - * - * @since 2.1 - */ - public final static String ATTR_CMDLINE= DebugPlugin.getUniqueIdentifier() + ".ATTR_CMDLINE"; //$NON-NLS-1$ - - /** - * Attribute key for a common, optional, process property. The value of this - * attribute is an identifier for the type of this process. Process types - * are client defined - whoever creates a process may define its type. For - * example, a process type could be "java", "javadoc", or "ant". - * - * @since 2.1 - */ - public final static String ATTR_PROCESS_TYPE = DebugPlugin.getUniqueIdentifier() + ".ATTR_PROCESS_TYPE"; //$NON-NLS-1$ - - /** - * Attribute key for a common, optional, process property. The value of this - * attribute specifies an alternate dynamic label for a process, displayed by - * the console. - * - * @since 3.0 - */ - public final static String ATTR_PROCESS_LABEL = DebugPlugin.getUniqueIdentifier() + ".ATTR_PROCESS_LABEL"; //$NON-NLS-1$ - - /** - * Returns a human-readable label for this process. - * - * @return a label for this process - */ - public String getLabel(); - /** - * Returns the launch this element originated from. - * - * @return the launch this process is contained in - */ - public ILaunch getLaunch(); - /** - * Returns a proxy to the standard input, output, and error streams - * for this process, or null if not supported. - * - * @return a streams proxy, or null if not supported - */ - public IStreamsProxy getStreamsProxy(); - - /** - * Sets the value of a client defined attribute. - * - * @param key the attribute key - * @param value the attribute value - */ - public void setAttribute(String key, String value); - - /** - * Returns the value of a client defined attribute. - * - * @param key the attribute key - * @return value the String attribute value, or null if undefined - */ - public String getAttribute(String key); - - /** - * Returns the exit value of this process. Conventionally, 0 indicates - * normal termination. - * - * @return the exit value of this process - * @exception DebugException if this process has not yet terminated - */ - public int getExitValue() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java deleted file mode 100644 index d3bd7390c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegister.java +++ /dev/null @@ -1,39 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A register is a special kind of variable that is contained - * in a register group. Each register has a name and a value. - * Not all debug architectures provide access to registers. - *

- * Clients may implement this interface. - *

- * @since 2.0 - */ -public interface IRegister extends IVariable { - - /** - * Returns the register group this register is contained in. - * - * @return the register group this register is contained in - * @exception DebugException if this method fails. Reasons include: - *
  • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
  • - */ - public IRegisterGroup getRegisterGroup() throws DebugException; - -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java deleted file mode 100644 index 528df358f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IRegisterGroup.java +++ /dev/null @@ -1,64 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A register group is a group of registers that are - * assigned to a stack frame. Some debug architectures - * provide access to registers, and registers are often - * grouped logically. For example, a floating point - * register group. - *

    - * Clients may implement this interface. - *

    - * @since 2.0 - */ -public interface IRegisterGroup extends IDebugElement { - - - /** - * Returns the name of this register group. - * - * @return this register group's name - * @exception DebugException if this method fails. Reasons include: - *
    • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
    • - */ - public String getName() throws DebugException; - - /** - * Returns the registers in this register group. - * - * @return the registers in this register group - * @exception DebugException if this method fails. Reasons include: - *
      • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
      • - */ - public IRegister[] getRegisters() throws DebugException; - - /** - * Returns whether this register group currently contains any registers. - * - * @return whether this register group currently contains any registers - * @exception DebugException if this method fails. Reasons include: - *
        • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
        • - */ - public boolean hasRegisters() throws DebugException; - -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java deleted file mode 100644 index e78a7f893..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISourceLocator.java +++ /dev/null @@ -1,67 +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.core.model; - - -import org.eclipse.debug.core.model.IStackFrame; - -/** - * A source locator locates source elements for stack frames. A launch (optionally) - * specifies a source locator which is - * used to locate source for that debug session. If a launch does not - * provide a source locator, source cannot be displayed. - * Abstraction of source lookup allows clients to hide implementation - * details of source location and representation. - *

          - * Generally, an implementor of a debug model will also implement launch configuration types, - * delegates, and source locators that work together as a whole. That is, the implementation - * of a source locator will have knowledge of how to locate a source element - * for a stack frame. For example, a Java stack frame could define API which - * specifies a source file name. A Java source locator would use this information - * to locate the associated file in the workspace. - *

          - *

          - * Source is displayed by the debug UI plug-in. The debug UI uses a source locator - * to resolve an object representing the source for a stack frame, and then uses - * a debug model presentation to determine the editor and editor input to use to - * display the actual source in an editor. - *

          - *

          - * Clients may implement this interface. - *

          - * @see org.eclipse.debug.core.ILaunch - * @see org.eclipse.debug.core.model.IStackFrame - * @see org.eclipse.debug.core.model.IPersistableSourceLocator - */ -public interface ISourceLocator { - - /** - * Returns a source element that corresponds to the given stack frame, or - * null if a source element could not be located. The object returned - * by this method will be used by the debug UI plug-in to display source. - * The debug UI uses the debug model presentation associated - * with the given stack frame's debug model to translate a source object into an - * {editor input, editor id} pair in which to display source. - *

          - * For example, a java source locator could return an object representing a - * compilation unit or class file. The java debug model presentation would - * then be responsible for providing an editor input and editor id for each - * compilation unit and class file such that the debug UI could display source. - *

          - * - * @param stackFrame the stack frame for which to locate source - * @return an object representing a source element. - */ - public Object getSourceElement(IStackFrame stackFrame); - -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java deleted file mode 100644 index 72ee242e1..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStackFrame.java +++ /dev/null @@ -1,182 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A stack frame represents an execution context in a suspended thread. - * A stack frame contains variables representing visible locals and arguments at - * the current execution location. Minimally, a stack frame supports - * the following: - *
            - *
          • suspend/resume (convenience to resume this stack frame's thread) - *
          • stepping - *
          • termination (convenience to terminate this stack frame's thread or debug target) - *
          - *

          - * A debug model implementation may choose to re-use or discard - * stack frames on iterative thread suspensions. Clients - * cannot assume that stack frames are identical or equal across - * iterative thread suspensions and must check for equality on iterative - * suspensions if they wish to re-use the objects. - *

          - *

          - * A debug model implementation that preserves equality - * across iterative suspensions may display more desirable behavior in - * some clients. For example, if stack frames are preserved - * while stepping, a UI client would be able to update the UI incrementally, - * rather than collapse and redraw the entire list. - *

          - *

          - * Clients may implement this interface. - *

          - * @see IStep - * @see ISuspendResume - * @see ITerminate - */ -public interface IStackFrame extends IDebugElement, IStep, ISuspendResume, ITerminate { - /** - * Returns the thread this stack frame is contained in. - * - * @return thread - * @since 2.0 - */ - public IThread getThread(); - /** - * Returns the visible variables in this stack frame. An empty - * collection is returned if there are no visible variables. - * - * @return collection of visible variables - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public IVariable[] getVariables() throws DebugException; - - /** - * Returns whether this stack frame currently contains any visible variables. - * - * @return whether this stack frame currently contains any visible variables - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public boolean hasVariables() throws DebugException; - - /** - * Returns the line number of the instruction pointer in - * this stack frame that corresponds to a line in an associated source - * element, or -1 if line number information - * is unavailable. - * - * @return line number of instruction pointer in this stack frame, or - * -1 if line number information is unavailable - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - */ - public int getLineNumber() throws DebugException; - - /** - * Returns the index of the first character in the associated source - * element that corresponds to the current location of the instruction pointer - * in this stack frame, or -1 if the information is unavailable. - *

          - * If a debug model supports expression level stepping, the start/end - * character ranges are used to highlight the expression within a line - * that is being executed. - *

          - * @return index of the first character in the associated source - * element that corresponds to the current location of the instruction pointer - * in this stack frame, or -1 if the information is unavailable - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public int getCharStart() throws DebugException; - - /** - * Returns the index of the last character in the associated source - * element that corresponds to the current location of the instruction pointer - * in this stack frame, or -1 if the information is unavailable. - *

          - * If a debug model supports expression level stepping, the start/end - * character ranges are used to highlight the expression within a line - * that is being executed. - *

          - * @return index of the last character in the associated source - * element that corresponds to the current location of the instruction pointer - * in this stack frame, or -1 if the information is unavailable - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public int getCharEnd() throws DebugException; - - /** - * Returns the name of this stack frame. Name format is debug model - * specific, and should be specified by a debug model. - * - * @return this frame's name - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - */ - public String getName() throws DebugException; - - /** - * Returns the register groups assigned to this stack frame, - * or an empty collection if no register groups are assigned - * to this stack frame. - * - * @return the register groups assigned to this stack frame - * or an empty collection if no register groups are assigned - * to this stack frame - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public IRegisterGroup[] getRegisterGroups() throws DebugException; - - /** - * Returns whether this stack frame contains any register groups. - * - * @return whether this stack frame contains any visible register groups - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public boolean hasRegisterGroups() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java deleted file mode 100644 index 009aaad14..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStep.java +++ /dev/null @@ -1,96 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to step into, over, and return - * from the current execution location. Implementations - * must be non-blocking. - *

          - * Implementations should honor step filter settings in their - * associated debug target, as defined by IStepFilters. - *

          - *

          - * Clients may implement this interface. - *

          - * @see org.eclipse.debug.core.model.IStepFilters - */ -public interface IStep { - /** - * Returns whether this element can currently perform a step into. - * - * @return whether this element can currently perform a step into - */ - public boolean canStepInto(); - /** - * Returns whether this element can currently perform a step over. - * - * @return whether this element can currently perform a step over - */ - public boolean canStepOver(); - /** - * Returns whether this element can currently perform a step return. - * - * @return whether this element can currently perform a step return - */ - public boolean canStepReturn(); - /** - * Returns whether this element is currently stepping. - *

          - * For example, a thread is considered to be stepping - * after the stepOver call until the step over is completed, - * a breakpoint is reached, an exception is thrown, or the thread or debug target is - * terminated. - *

          - * - * @return whether this element is currently stepping - */ - public boolean isStepping(); - /** - * Steps into the current statement, generating RESUME - * and SUSPEND events for the associated thread. Can only be called - * when the associated thread is suspended. Implementations must implement - * stepping as non-blocking. - * - * @exception DebugException on failure. Reasons include:
            - *
          • TARGET_REQUEST_FAILED - The request failed in the target
          • - *
          • NOT_SUPPORTED - The capability is not supported by the target
          • - *
          - */ - public void stepInto() throws DebugException; - /** - * Steps over the current statement, generating RESUME - * and SUSPEND events for the associated thread. Can only be called - * when the associated thread is suspended. Implementations must implement - * stepping as non-blocking. - * - * @exception DebugException on failure. Reasons include:
            - *
          • TARGET_REQUEST_FAILED - The request failed in the target
          • - *
          • NOT_SUPPORTED - The capability is not supported by the target
          • - *
          - */ - public void stepOver() throws DebugException; - /** - * Steps to the next return statement in the current scope, - * generating RESUME and SUSPEND events for - * the associated thread. Can only be called when the associated thread is suspended. - * Implementations must implement stepping as non-blocking. - * - * @exception DebugException on failure. Reasons include:
            - *
          • TARGET_REQUEST_FAILED - The request failed in the target
          • - *
          • NOT_SUPPORTED - The capability is not supported by the target
          • - *
          - */ - public void stepReturn() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStepFilters.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStepFilters.java deleted file mode 100644 index 1e11c956c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStepFilters.java +++ /dev/null @@ -1,64 +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.core.model; - -/** - * Support for step filters for a debug target. A debug target - * that supports step filters should implement this interface. - * Step filters can be toggled on/off for a debug target via - * this interface. When a step method is called (see - * IStep), the step implementation must respect - * the state of the step filters as defined by this interface. - * This allows step filters to be toggled on/off for - * all stepping operations (in, over, return). - *

          - * Step filter management is debug model specific - this interface - * is used only to turn them on/off. - *

          - *

          - * In 2.1, the IFilteredStep interface was used - * to implement step filtering. The IFilteredStep - * interface is now deprecated, and this interface should be used - * in its place to allow filters to be applied to any step - * function. - *

          - *

          - * Clients may implement this interface. Debug targets that support - * step filters should implement this interface. - *

          - * @see org.eclipse.debug.core.model.IStep - * @since 3.0 - */ -public interface IStepFilters { - - /** - * Returns whether this debug target supports step filters. - * - * @return whether this debug target supports step filters - */ - public boolean supportsStepFilters(); - - /** - * Returns whether step filters are currently enabled in this - * debug target. - * - * @return whether step filters are currently enabled in this - * debug target - */ - public boolean isStepFiltersEnabled(); - - /** - * Sets whether step filters are enabled in this debug target. - * - * @param enabled whether step filters are enabled in this debug target - */ - public void setStepFiltersEnabled(boolean enabled); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java deleted file mode 100644 index fdabfb2d7..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamMonitor.java +++ /dev/null @@ -1,50 +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.core.model; - - -import org.eclipse.debug.core.IStreamListener; - -/** - * A stream monitor manages the contents of the stream a process - * is writing to, and notifies registered listeners of changes in - * the stream. - *

          - * Clients may implement this interface. Generally, a client that - * provides an implementation of the IStreamsProxy - * interface must also provide an implementation of this interface. - *

          - * @see org.eclipse.debug.core.model.IStreamsProxy - * @see org.eclipse.debug.core.model.IFlushableStreamMonitor - */ -public interface IStreamMonitor { - /** - * Adds the given listener to this stream monitor's registered listeners. - * Has no effect if an identical listener is already registered. - * - * @param listener the listener to add - */ - public void addListener(IStreamListener listener); - /** - * Returns the entire current contents of the stream. An empty - * String is returned if the stream is empty. - * - * @return the stream contents as a String - */ - public String getContents(); - /** - * Removes the given listener from this stream monitor's registered listeners. - * Has no effect if the listener is not already registered. - * - * @param listener the listener to remove - */ - public void removeListener(IStreamListener listener); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.java deleted file mode 100644 index 120e5e831..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy.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.core.model; - - -import java.io.IOException; - -/** - * A streams proxy acts as proxy between the streams of a - * process and interested clients. This abstraction allows - * implementations of IProcess to handle I/O related - * to the standard input, output, and error streams associated - * with a process. - *

          - * Clients implementing the IProcess interface must also - * provide an implementation of this interface. - *

          - * @see IProcess - */ -public interface IStreamsProxy { - /** - * Returns a monitor for the error stream of this proxy's process, - * or null if not supported. - * The monitor is connected to the error stream of the - * associated process. - * - * @return an error stream monitor, or null if none - */ - public IStreamMonitor getErrorStreamMonitor(); - /** - * Returns a monitor for the output stream of this proxy's process, - * or null if not supported. - * The monitor is connected to the output stream of the - * associated process. - * - * @return an output stream monitor, or null if none - */ - public IStreamMonitor getOutputStreamMonitor(); - /** - * Writes the given text to the output stream connected to the - * standard input stream of this proxy's process. - * - * @param input the text to be written - * @exception IOException when an error occurs writing to the - * underlying OutputStream. - * - */ - public void write(String input) throws IOException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.java deleted file mode 100644 index d0294dbb9..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IStreamsProxy2.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.core.model; - -import java.io.IOException; - -/** - * Extension to a streams proxy that allows closing of the output stream - * connected to the standard input stream of a proxy's process. - *

          - * Clients should implement this interface, in addition to - * IStreamsProxy, if interested closing the standard - * input stream. - *

          - * @since 3.1 - */ -public interface IStreamsProxy2 extends IStreamsProxy { - - /** - * Closes the output stream connected to the standard input stream - * of this proxy's process. - * - * @throws IOException if unable to close the stream - */ - public void closeInputStream() throws IOException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.java deleted file mode 100644 index 9ffe269e1..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ISuspendResume.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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to suspend and resume a thread - * or debug target. - *

          - * Clients may implement this interface. - *

          - */ -public interface ISuspendResume { - /** - * Returns whether this element can currently be resumed. - * - * @return whether this element can currently be resumed - */ - public boolean canResume(); - /** - * Returns whether this element can currently be suspended. - * - * @return whether this element can currently be suspended - */ - public boolean canSuspend(); - /** - * Returns whether this element is currently suspended. - * - * @return whether this element is currently suspended - */ - public boolean isSuspended(); - /** - * Causes this element to resume its execution, generating a RESUME event. - * Has no effect on an element that is not suspended. This call is non-blocking. - * - * @exception DebugException on failure. Reasons include:
            - *
          • TARGET_REQUEST_FAILED - The request failed in the target - *
          • NOT_SUPPORTED - The capability is not supported by the target - *
          - */ - public void resume() throws DebugException; - /** - * Causes this element to suspend its execution, generating a SUSPEND event. - * Has no effect on an already suspended element. - * Implementations may be blocking or non-blocking. - * - * @exception DebugException on failure. Reasons include:
            - *
          • TARGET_REQUEST_FAILED - The request failed in the target - *
          • NOT_SUPPORTED - The capability is not supported by the target - *
          - */ - public void suspend() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.java deleted file mode 100644 index 0c376aa75..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/ITerminate.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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to terminate an execution - * context - for example, a thread, debug target or process. - *

          - * Clients may implement this interface. - *

          - */ -public interface ITerminate { - /** - * Returns whether this element can be terminated. - * - * @return whether this element can be terminated - */ - public boolean canTerminate(); - /** - * Returns whether this element is terminated. - * - * @return whether this element is terminated - */ - public boolean isTerminated(); - /** - * Causes this element to terminate, generating a TERMINATE event. - * Implementations may be blocking or non-blocking. - * - * @exception DebugException on failure. Reasons include:
            - *
          • TARGET_REQUEST_FAILED - The request failed in the target - *
          • NOT_SUPPORTED - The capability is not supported by the target - *
          - */ - public void terminate() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java deleted file mode 100644 index 54f56679b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IThread.java +++ /dev/null @@ -1,111 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A thread is a sequential flow of execution in a debug target. - * A thread contains stack frames. Stack frames are only available when the - * thread is suspended, and are returned in top-down order. - * Minimally, a thread supports the following: - *
            - *
          • suspend/resume - *
          • stepping - *
          • terminate - *
          - *

          - * Clients may implement this interface. - *

          - * @see ISuspendResume - * @see IStep - * @see ITerminate - * @see IStackFrame - */ - -public interface IThread extends IDebugElement, ISuspendResume, IStep, ITerminate { - /** - * Returns the stack frames contained in this thread. An - * empty collection is returned if this thread contains - * no stack frames, or is not currently suspended. Stack frames - * are returned in top down order. - * - * @return a collection of stack frames - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public IStackFrame[] getStackFrames() throws DebugException; - - /** - * Returns whether this thread currently contains any stack - * frames. - * - * @return whether this thread currently contains any stack frames - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - *
          - * @since 2.0 - */ - public boolean hasStackFrames() throws DebugException; - - /** - * Returns the priority of this thread. The meaning of this - * number is operating-system dependent. - * - * @return thread priority - * @exception DebugException if this method fails. Reasons include: - *
          • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
          • - */ - public int getPriority() throws DebugException; - /** - * Returns the top stack frame or null if there is - * currently no top stack frame. - * - * @return the top stack frame, or null if none - * @exception DebugException if this method fails. Reasons include: - *
            • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
            • - */ - public IStackFrame getTopStackFrame() throws DebugException; - /** - * Returns the name of this thread. Name format is debug model - * specific, and should be specified by a debug model. - * - * @return this thread's name - * @exception DebugException if this method fails. Reasons include: - *
              • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
              • - */ - public String getName() throws DebugException; - - /** - * Returns the breakpoints that caused this thread to suspend, - * or an empty collection if this thread is not suspended or - * was not suspended by a breakpoint. Usually a single breakpoint - * will be returned, but this collection can contain more than - * one breakpoint if two breakpoints are at the same location in - * a program. - * - * @return the collection of breakpoints that caused this thread to suspend - */ - public IBreakpoint[] getBreakpoints(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java deleted file mode 100644 index 89652fe42..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValue.java +++ /dev/null @@ -1,104 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A value represents the value of a variable. - * A value representing a complex data structure contains variables. - *

                - * An implementation may choose to re-use or discard - * values on iterative thread suspensions. Clients - * cannot assume that values are identical or equal across - * iterative thread suspensions and must check for equality on iterative - * suspensions if they wish to re-use the objects. - *

                - *

                - * An implementation that preserves equality - * across iterative suspensions may display more desirable behavior in - * some clients. For example, if variables are preserved - * while stepping, a UI client would be able to update the UI incrementally, - * rather than collapse and redraw the entire list or tree. - *

                - *

                - * Clients may implement this interface. - *

                - * @see IVariable - */ - - -public interface IValue extends IDebugElement { - - /** - * Returns a description of the type of data this value contains - * or references. - * - * @return the name of this value's reference type - * @exception DebugException if this method fails. Reasons include: - *
                • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                • - */ - public String getReferenceTypeName() throws DebugException; - - /** - * Returns this value as a String. - * - * @return a String representation of this value - * @exception DebugException if this method fails. Reasons include: - *
                  • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                  • - */ - public String getValueString() throws DebugException; - - /** - * Returns whether this value is currently allocated. - *

                    - * For example, if this value represents - * an object that has been garbage collected, false is returned. - *

                    - * @return whether this value is currently allocated - * @exception DebugException if this method fails. Reasons include: - *
                    • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                    • - */ - public boolean isAllocated() throws DebugException; - /** - * Returns the visible variables in this value. An empty - * collection is returned if there are no visible variables. - * - * @return an array of visible variables - * @exception DebugException if this method fails. Reasons include: - *
                      • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                      • - *
                      - * @since 2.0 - */ - public IVariable[] getVariables() throws DebugException; - - /** - * Returns whether this value currently contains any visible variables. - * - * @return whether this value currently contains any visible variables - * @exception DebugException if this method fails. Reasons include: - *
                      • Failure communicating with the debug target. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                      • - *
                      - * @since 2.0 - */ - public boolean hasVariables() throws DebugException; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java deleted file mode 100644 index b4266017c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IValueModification.java +++ /dev/null @@ -1,85 +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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * Provides the ability to modify the value of a variable in - * a target. - *

                      - * Clients may implement this interface. - *

                      - * @see IVariable - */ -public interface IValueModification { - - /** - * Attempts to set the value of this variable to the - * value of the given expression. - * - * @param expression an expression to generate a new value - * @exception DebugException on failure. Reasons include:
                        - *
                      • TARGET_REQUEST_FAILED - The request failed in the target - *
                      • NOT_SUPPORTED - The capability is not supported by the target - *
                      - */ - public void setValue(String expression) throws DebugException; - - /** - * Sets the value of this variable to the given value. - * - * @param value a new value - * @exception DebugException on failure. Reasons include:
                        - *
                      • TARGET_REQUEST_FAILED - The request failed in the target - *
                      • NOT_SUPPORTED - The capability is not supported by the target - *
                      - * @since 2.0 - */ - public void setValue(IValue value) throws DebugException; - - /** - * Returns whether this variable supports value modification. - * - * @return whether this variable supports value modification - */ - public boolean supportsValueModification(); - - /** - * Returns whether the given expression is valid to be used in - * setting a new value for this variable. - * - * @param expression an expression to generate a new value - * @return whether the expression is valid - * @exception DebugException on failure. Reasons include:
                        - *
                      • TARGET_REQUEST_FAILED - The request failed in the target - *
                      • NOT_SUPPORTED - The capability is not supported by the target - *
                      - */ - public boolean verifyValue(String expression) throws DebugException; - - /** - * Returns whether the given value can be used as - * a new value for this variable. - * - * @param value a new value - * @return whether the value is valid - * @exception DebugException on failure. Reasons include:
                        - *
                      • TARGET_REQUEST_FAILED - The request failed in the target - *
                      • NOT_SUPPORTED - The capability is not supported by the target - *
                      - * @since 2.0 - */ - public boolean verifyValue(IValue value) throws DebugException; -} - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.java deleted file mode 100644 index f199c0539..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IVariable.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.core.model; - - -import org.eclipse.debug.core.DebugException; - -/** - * A variable represents a visible data structure in a stack frame - * or value. - * Each variable has a value which may in turn contain more variables. - * A variable may support value modification. - *

                      - * An implementation may choose to re-use or discard - * variables on iterative thread suspensions. Clients - * cannot assume that variables are identical or equal across - * iterative thread suspensions and must check for equality on iterative - * suspensions if they wish to re-use the objects. - *

                      - *

                      - * An implementation that preserves equality - * across iterative suspensions may display more desirable behavior in - * some clients. For example, if variables are preserved - * while stepping, a UI client would be able to update the UI incrementally, - * rather than collapse and redraw the entire list or tree. - *

                      - *

                      - * Clients may implement this interface. - *

                      - * @see IValue - * @see IStackFrame - * @see IValueModification - */ -public interface IVariable extends IDebugElement, IValueModification { - /** - * Returns the value of this variable. - * - * @return this variable's value - * @exception DebugException if this method fails. Reasons include: - *
                      • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                      • - */ - public IValue getValue() throws DebugException; - /** - * Returns the name of this variable. Name format is debug model - * specific, and should be specified by a debug model. - * - * @return this variable's name - * @exception DebugException if this method fails. Reasons include: - *
                        • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                        • - */ - public String getName() throws DebugException; - /** - * Returns a description of the type of data this variable is - * declared to reference. Note that the declared type of a - * variable and the concrete type of its value are not necessarily - * the same. - * - * @return the declared type of this variable - * @exception DebugException if this method fails. Reasons include: - *
                          • Failure communicating with the VM. The DebugException's - * status code contains the underlying exception responsible for - * the failure.
                          • - */ - public String getReferenceTypeName() throws DebugException; - - /** - * Returns whether this variable's value has changed since the last suspend event. - * Implementations may choose whether the last suspend event is the last suspend - * event in this variable's debug target, or within the thread(s) in which this variable - * is visible. - *

                            - * Implementations that choose not to implement this function should always - * return false. - *

                            - * - * @return whether this variable's value has changed since the last suspend event - * @exception DebugException if an exception occurs determining if this variable's - * value has changed since the last suspend event - */ - public boolean hasValueChanged() throws DebugException; - - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpression.java deleted file mode 100644 index db4617353..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpression.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 - *******************************************************************************/ -package org.eclipse.debug.core.model; - -/** - * A watch expression is an expression that is evaluated in the context - * of a specific stack frame, thread, debug target, process, or launch. - * Generally, a watch expression is a snippet of code that is evaluated - * each time a debug target suspends, or when a user provides a context - * for an evaluation by selecting a debug target or thread. An expression - * updates its value when it is provided with a context in which it - * can perform an evaluation. - *

                            - * An implementation is provided by the debug platform. Clients that support watch expressions - * should contribute and implement a watch expression delegate. Watch - * expressions can be created via the IExpressionManager. - *

                            - * @see org.eclipse.debug.core.model.IWatchExpressionDelegate - * @see org.eclipse.debug.core.IExpressionManager - * @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 IWatchExpression extends IErrorReportingExpression { - - /** - * Updates this watch expression's value based on the current evaluation - * context. This watch expression fires a debug change event when the - * evaluation is complete. A watch expression can be asked to - * evaluate even when it is disabled. Note that implementations should - * generally be asynchronous to avoid blocking the calling thread. - */ - public void evaluate(); - /** - * Sets the context for this watch expression, or null if none. - * If the given context is valid for this expression, this expression may - * update its value. When the value update is complete, a debug change event is - * fired. When null is specified as a context, this expression - * may choose to retain its previous value. - *

                            - * The context is usually one of (but not limited to): - *

                              - *
                            • a debug target (IDebugTarget)
                            • - *
                            • a thread (IThread)
                            • - *
                            • a stack frame (IStackFrame)
                            • - *
                            - *

                            - * - * @param context context in which to update this expression's value, or - * null if none - */ - public void setExpressionContext(IDebugElement context); - /** - * Sets this watch expression's snippet of code. This method - * causes the new snippet to be evaluated immediately in - * the expression's last context. - * - * @param expressionText the snippet which will be evaluated - */ - public void setExpressionText(String expressionText); - /** - * Returns whether the result of this watch expression is pending. - * An expression is pending if an evaluation has been requested, but - * the value has not yet been returned. - * - * @return whether this expression's result is pending - */ - public boolean isPending(); - /** - * Returns whether this expression is enabled. An enabled expression will - * update its value. A disabled expression will not. - * - * @return whether this expression is enabled - */ - public boolean isEnabled(); - /** - * Sets this expression's enabled state. This method - * causes the new snippet to be evaluated immediately in - * the expression's last context. - * - * @param enabled whether this expression should be enabled - */ - public void setEnabled(boolean enabled); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionDelegate.java deleted file mode 100644 index ec662ecc1..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionDelegate.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.core.model; - -/** - * A delegate which computes the value of a watch expression - * when provided a context. Watch delegates are provided on a - * per debug model basis. Watch expressions query the appropriate - * delegate based on the debug model of the context element. - * Plug-ins that wish to contribute watch expression delegates may do so using the - * org.eclipse.debug.core.watchExpressionDelegates - * extension point. - *

                            - * For example, the following is the definition of a watch expression - * delegate for the com.example.foo plug-in: - *

                            - * <extension point="org.eclipse.debug.core.watchExpressionDelegates">
                            - *   <watchExpressionDelegate
                            - *     debugModel="org.eclipse.jdt.debug"
                            - *     delegateClass="org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate"/>
                            - *  </extension>
                            - * 
                            - *

                            - * Clients are intended to implement this interface. - *

                            - * @see org.eclipse.debug.core.model.IWatchExpression - * @see org.eclipse.debug.core.model.IWatchExpressionListener - * - * @since 3.0 - */ -public interface IWatchExpressionDelegate { - - /** - * Evaluates the given expression in the given context asynchronously and - * notifies the given listener when the evaluation finishes. - * - * @param expression the expression to evaluate - * @param context the context for the evaluation - * @param listener the listener to notify when the evaluation completes - */ - public void evaluateExpression(String expression, IDebugElement context, IWatchExpressionListener listener); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionListener.java deleted file mode 100644 index 34007a9ec..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionListener.java +++ /dev/null @@ -1,31 +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.core.model; - -/** - * A watch expression listener is notified when an - * org.eclipse.debug.core.model.IWatchExpressionDelegate - * completes an evaluation. - * - * @see org.eclipse.debug.core.model.IWatchExpressionDelegate - * @see org.eclipse.debug.core.model.IWatchExpressionResult - * @since 3.0 - */ -public interface IWatchExpressionListener { - - /** - * Notifies the listener that an evaluation has completed. - * - * @param result the result of the evaluation - */ - public void watchEvaluationFinished(IWatchExpressionResult result); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionResult.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionResult.java deleted file mode 100644 index 26bfd7728..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchExpressionResult.java +++ /dev/null @@ -1,76 +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.core.model; - -import org.eclipse.debug.core.DebugException; - -/** - * The result of an evaluation performed by an - * org.eclipse.debug.core.model.IWatchExpressionDelegate. - * A watch expression reports the value of the evaluation - * and any errors or exceptions that occurred. - *

                            - * Clients may implement this interface. - *

                            - * @see org.eclipse.debug.core.model.IWatchExpressionDelegate - * @since 3.0 - */ -public interface IWatchExpressionResult { - /** - * Returns the value representing the result of the - * evaluation, or null if the - * associated evaluation failed. If - * the associated evaluation failed, there will - * be problems, or an exception in this result. - * - * @return the resulting value, possibly - * null - */ - public IValue getValue(); - - /** - * Returns whether the evaluation had any problems - * or if an exception occurred while performing the - * evaluation. - * - * @return whether there were any problems. - * @see #getErrorMessages() - * @see #getException() - */ - public boolean hasErrors(); - - /** - * Returns an array of problem messages. Each message describes a problem that - * occurred while compiling the snippet. - * - * @return evaluation error messages, or an empty array if no errors occurred - */ - public String[] getErrorMessages(); - - /** - * Returns the expression that was evaluated. - * - * @return The string expression. - */ - public String getExpressionText(); - - /** - * Returns any exception that occurred while performing the evaluation - * or null if an exception did not occur. - * The exception will be a debug exception or a debug exception - * that wrappers a debug model specific exception that indicates a problem communicating - * with the target or with actually performing some action in the target. - * - * @return The exception that occurred during the evaluation - * @see org.eclipse.debug.core.DebugException - */ - public DebugException getException(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchpoint.java deleted file mode 100644 index bb356fe9f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IWatchpoint.java +++ /dev/null @@ -1,83 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2004, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core.model; - - -import org.eclipse.core.runtime.CoreException; - -/** - * A breakpoint that suspends when an associated variable is - * read or written. - *

                            - * Clients may implement this interface. Clients are not required to - * implement this interface to implement watchpoints, but those that do inherit - * default rendering of images for watchpoints from the debug platform's - * default label provider and actions to toggle access and modification - * properties of a watchpoint. - *

                            - * @since 3.1 - */ -public interface IWatchpoint extends IBreakpoint { - /** - * Returns whether this watchpoint will suspend execution when its associated - * variable is accessed (read). - * - * @return whether this is an access watchpoint - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public boolean isAccess() throws CoreException; - /** - * Sets whether this breakpoint will suspend execution when its associated - * variable is accessed. - * - * @param access whether to suspend on access - * @exception CoreException if unable to set the property on this breakpoint's - * underlying marker or if the capability is not supported - */ - public void setAccess(boolean access) throws CoreException; - /** - * Returns whether this watchpoint will suspend execution when its associated - * variable is written. - * - * @return whether this is a modification watchpoint - * @exception CoreException if unable to access the property - * on this breakpoint's underlying marker - */ - public boolean isModification() throws CoreException; - /** - * Sets whether this breakpoint will suspend execution when its associated - * variable is modified. - * - * @param modification whether to suspend on modification - * @exception CoreException if unable to set the property on - * this breakpoint's underlying marker or if the capability is not supported - */ - public void setModification(boolean modification) throws CoreException; - /** - * Returns whether this breakpoints supports the capability to suspend - * when an associated variable is read. - * - * @return whether this breakpoints supports the capability to suspend - * when an associated variable is read - */ - public boolean supportsAccess(); - /** - * Returns whether this breakpoints supports the ability to suspend - * when an associated variable is written. - * - * @return whether this breakpoints supports the ability to suspend - * when an associated variable is written - */ - public boolean supportsModification(); - -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java deleted file mode 100644 index cf91b20cc..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java +++ /dev/null @@ -1,432 +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 - * Mike Morearty - Bug 255310: Launching only gets the progress bar to 91% - *******************************************************************************/ -package org.eclipse.debug.core.model; - -import com.ibm.icu.text.MessageFormat; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.IncrementalProjectBuilder; -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.OperationCanceledException; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubMonitor; -import org.eclipse.core.runtime.SubProgressMonitor; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.internal.core.DebugCoreMessages; -import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; - -/** - * Default implementation of a launch configuration delegate. Provides - * convenience methods for computing the build order of projects, - * building projects, and searching for errors in the workspace. The - * default pre-launch check prompts the user to launch in debug mode - * if breakpoints are present in the workspace. - *

                            - * Clients implementing launch configuration delegates should subclass - * this class. - *

                            - * @since 3.0 - */ -public abstract class LaunchConfigurationDelegate implements ILaunchConfigurationDelegate2 { - - /** - * Constant to define debug.core for the status codes - * - * @since 3.2 - */ - private static final String DEBUG_CORE = "org.eclipse.debug.core"; //$NON-NLS-1$ - - /** - * Constant to define debug.ui for the status codes - * - * @since 3.2 - */ - private static final String DEBUG_UI = "org.eclipse.debug.ui"; //$NON-NLS-1$ - - /** - * Status code for which a UI prompter is registered. - */ - protected static final IStatus promptStatus = new Status(IStatus.INFO, DEBUG_UI, 200, IInternalDebugCoreConstants.EMPTY_STRING, null); - - /** - * Status code for which a prompter is registered to ask the user if they - * want to launch in debug mode when breakpoints are present. - */ - protected static final IStatus switchToDebugPromptStatus = new Status(IStatus.INFO, DEBUG_CORE, 201, IInternalDebugCoreConstants.EMPTY_STRING, null); - - /** - * Status code for which a prompter is registered to ask the user if the - * want to continue launch despite existing compile errors - */ - protected static final IStatus complileErrorPromptStatus = new Status(IStatus.INFO, DEBUG_CORE, 202, IInternalDebugCoreConstants.EMPTY_STRING, null); - - /** - * Status code for which a prompter will ask the user to save any/all of the dirty editors which have only to do - * with this launch (scoping them to the current launch/build) - * - * @since 3.2 - */ - protected static final IStatus saveScopedDirtyEditors = new Status(IStatus.INFO, DEBUG_CORE, 222, IInternalDebugCoreConstants.EMPTY_STRING, null); - - /** - * Status code for which a prompter is registered to ask the user if the - * want to continue launch despite existing compile errors in specific - * projects. This enhances the 'compileErrorPromptStatus' by specifying - * which projects the errors exist in. - * - * @since 3.1 - */ - protected static final IStatus complileErrorProjectPromptStatus = new Status(IStatus.INFO, DEBUG_CORE, 203, IInternalDebugCoreConstants.EMPTY_STRING, null); - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String) - */ - public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - if (monitor != null) { - monitor.beginTask("", 1); //$NON-NLS-1$ - } - try { - IProject[] projects = getBuildOrder(configuration, mode); - if (projects == null) { - return true; - } - buildProjects(projects, new SubProgressMonitor(monitor, 1)); - return false; - } finally { - if (monitor != null) { - monitor.done(); - } - } - } - - /** - * Returns the projects to build before launching the given launch configuration - * or null if the entire workspace should be built incrementally. - * Subclasses should override as required. - * - * @param configuration the configuration being launched - * @param mode launch mode - * @return projects to build, in build order, or null - * @throws CoreException if an exception occurs - */ - protected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException { - return null; - } - - /** - * Returns the set of projects to use when searching for errors or null - * if no search is to be done. - * - * @param configuration the configuration being launched - * @param mode launch mode - * @return a list of projects or null - * @throws CoreException if an exception occurs - */ - protected IProject[] getProjectsForProblemSearch(ILaunchConfiguration configuration, String mode) throws CoreException { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#finalLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - monitor.beginTask("", 1); //$NON-NLS-1$ - try { - IProject[] projects = getProjectsForProblemSearch(configuration, mode); - if (projects == null) { - return true; //continue launch - } - boolean continueLaunch = true; - - monitor.subTask(DebugCoreMessages.LaunchConfigurationDelegate_6); - List errors = new ArrayList(); - for (int i = 0; i < projects.length; i++) { - monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchConfigurationDelegate_7, new String[]{projects[i].getName()})); - if (existsProblems(projects[i])) { - errors.add(projects[i]); - } - } - if (!errors.isEmpty()) { - errors.add(0, configuration); - IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); - if (prompter != null) { - continueLaunch = ((Boolean) prompter.handleStatus(complileErrorProjectPromptStatus, errors)).booleanValue(); - } - } - - return continueLaunch; - } finally { - monitor.done(); - } - } - - /* (non-Javadoc) - * - * If launching in run mode, and the configuration supports debug mode, check - * if there are any breakpoints in the workspace, and ask the user if they'd - * rather launch in debug mode. - *

                            - * Since 3.2, this check also performs saving of resources before launching. - *

                            - * - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - if (!saveBeforeLaunch(configuration, mode, monitor)) { - return false; - } - if (mode.equals(ILaunchManager.RUN_MODE) && configuration.supportsMode(ILaunchManager.DEBUG_MODE)) { - IBreakpoint[] breakpoints= getBreakpoints(configuration); - if (breakpoints == null) { - return true; - } - for (int i = 0; i < breakpoints.length; i++) { - if (breakpoints[i].isEnabled()) { - IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); - if (prompter != null) { - boolean launchInDebugModeInstead = ((Boolean)prompter.handleStatus(switchToDebugPromptStatus, configuration)).booleanValue(); - if (launchInDebugModeInstead) { - return false; //kill this launch - } - } - // if no user prompt, or user says to continue (no need to check other breakpoints) - return true; - } - } - } - // no enabled breakpoints... continue launch - return true; - } - - /** - * Performs the scoped saving of resources before launching and returns whether - * the launch should continue. By default, only resources contained within the projects - * which are part of the build scope are considered. - *

                            - * Subclasses may override this method if required. - *

                            - * - * @param configuration the configuration being launched - * @param mode the launch mode - * @param monitor progress monitor - * @return whether the launch should continue - * @throws CoreException if an exception occurs during the save - * @since 3.2 - */ - protected boolean saveBeforeLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - monitor.beginTask("", 1); //$NON-NLS-1$ - try { - IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus); - if(prompter != null) { - //do save here and remove saving from DebugUIPlugin to avoid it 'trumping' this save - IProject[] buildOrder = getBuildOrder(configuration, mode); - if(!((Boolean)prompter.handleStatus(saveScopedDirtyEditors, new Object[]{configuration, buildOrder})).booleanValue()) { - return false; - } - } - return true; - } finally { - monitor.done(); - } - } - - /** - * Returns the breakpoint collection that is relevant for this launch delegate. - * By default this is all the breakpoints registered with the Debug breakpoint manager. - * - * @param configuration the configuration to get associated breakpoints for - * @since 3.1 - * @return the breakpoints that are relevant for this launch delegate - */ - protected IBreakpoint[] getBreakpoints(ILaunchConfiguration configuration) { - IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager(); - if (!breakpointManager.isEnabled()) { - // no need to check breakpoints individually. - return null; - } - return breakpointManager.getBreakpoints(); - } - - /** - * Returns an array of projects in their suggested build order - * containing all of the projects specified by baseProjects - * and all of their referenced projects. - * - * @param baseProjects a collection of projects - * @return an array of projects in their suggested build order - * containing all of the projects specified by baseProjects - * @throws CoreException if an error occurs while computing referenced - * projects - */ - protected IProject[] computeReferencedBuildOrder(IProject[] baseProjects) throws CoreException { - HashSet unorderedProjects = new HashSet(); - for(int i = 0; i< baseProjects.length; i++) { - unorderedProjects.add(baseProjects[i]); - addReferencedProjects(baseProjects[i], unorderedProjects); - } - IProject[] projectSet = (IProject[]) unorderedProjects.toArray(new IProject[unorderedProjects.size()]); - return computeBuildOrder(projectSet); - } - - - /** - * Adds all projects referenced by project to the given - * set. - * - * @param project project - * @param references set to which referenced projects are added - * @throws CoreException if an error occurs while computing referenced - * projects - */ - protected void addReferencedProjects(IProject project, Set references) throws CoreException{ - if (project.isOpen()) { - IProject[] projects = project.getReferencedProjects(); - for (int i = 0; i < projects.length; i++) { - IProject refProject= projects[i]; - if (refProject.exists() && !references.contains(refProject)) { - references.add(refProject); - addReferencedProjects(refProject, references); - } - } - } - } - - /** - * Returns a list of projects in their suggested build order from the - * given unordered list of projects. - * - * @param projects the list of projects to sort into build order - * @return a new array containing all projects from projects sorted - * according to their build order. - */ - protected IProject[] computeBuildOrder(IProject[] projects) { - String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder(); - if (orderedNames != null) { - List orderedProjects = new ArrayList(projects.length); - //Projects may not be in the build order but should be built if selected - List unorderedProjects = new ArrayList(projects.length); - for(int i = 0; i < projects.length; ++i) { - unorderedProjects.add(projects[i]); - } - - for (int i = 0; i < orderedNames.length; i++) { - String projectName = orderedNames[i]; - for (Iterator iterator = unorderedProjects.iterator(); iterator.hasNext(); ) { - IProject project = (IProject)iterator.next(); - if (project.getName().equals(projectName)) { - orderedProjects.add(project); - iterator.remove(); - break; - } - } - } - //Add anything not specified before we return - orderedProjects.addAll(unorderedProjects); - return (IProject[]) orderedProjects.toArray(new IProject[orderedProjects.size()]); - } - - // Computing build order returned null, try the project prerequisite order - IWorkspace.ProjectOrder po = ResourcesPlugin.getWorkspace().computeProjectOrder(projects); - return po.projects; - } - - /** - * Returns whether the given project contains any problem markers of the - * specified severity. - * - * @param proj the project to search - * @return whether the given project contains any problems that should - * stop it from launching - * @throws CoreException if an error occurs while searching for - * problem markers - */ - protected boolean existsProblems(IProject proj) throws CoreException { - IMarker[] markers = proj.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); - if (markers.length > 0) { - for (int i = 0; i < markers.length; i++) { - if (isLaunchProblem(markers[i])) { - return true; - } - } - } - return false; - } - - /** - * Returns whether the given problem should potentially abort the launch. - * By default if the problem has an error severity, the problem is considered - * a potential launch problem. Subclasses may override to specialize error - * detection. - * - * @param problemMarker candidate problem - * @return whether the given problem should potentially abort the launch - * @throws CoreException if any exceptions occur while accessing marker attributes - */ - protected boolean isLaunchProblem(IMarker problemMarker) throws CoreException { - Integer severity = (Integer)problemMarker.getAttribute(IMarker.SEVERITY); - if (severity != null) { - return severity.intValue() >= IMarker.SEVERITY_ERROR; - } - - return false; - } - - /** - * Performs an incremental build on each of the given projects. - * - * @param projects projects to build - * @param monitor progress monitor - * @throws CoreException if an exception occurs while building - */ - protected void buildProjects(final IProject[] projects, IProgressMonitor monitor) throws CoreException { - IWorkspaceRunnable build = new IWorkspaceRunnable(){ - public void run(IProgressMonitor pm) throws CoreException { - SubMonitor localmonitor = SubMonitor.convert(pm, DebugCoreMessages.LaunchConfigurationDelegate_scoped_incremental_build, projects.length); - try { - for (int i = 0; i < projects.length; i++ ) { - if (localmonitor.isCanceled()) { - throw new OperationCanceledException(); - } - projects[i].build(IncrementalProjectBuilder.INCREMENTAL_BUILD, localmonitor.newChild(1)); - } - } finally { - localmonitor.done(); - } - } - }; - ResourcesPlugin.getWorkspace().run(build, monitor); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java deleted file mode 100644 index 94f04baa8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java +++ /dev/null @@ -1,62 +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.core.model; - - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.runtime.CoreException; - - -/** - * Abstract implementation of a line breakpoint. This class is - * intended to be subclassed by debug model specific implementations - * of line breakpoints. - * - * @see ILineBreakpoint - */ - -public abstract class LineBreakpoint extends Breakpoint implements ILineBreakpoint { - - - /** - * @see ILineBreakpoint#getLineNumber() - */ - public int getLineNumber() throws CoreException { - IMarker m = getMarker(); - if (m != null) { - return m.getAttribute(IMarker.LINE_NUMBER, -1); - } - return -1; - } - - /** - * @see ILineBreakpoint#getCharStart() - */ - public int getCharStart() throws CoreException { - IMarker m = getMarker(); - if (m != null) { - return m.getAttribute(IMarker.CHAR_START, -1); - } - return -1; - } - - /** - * @see ILineBreakpoint#getCharEnd() - */ - public int getCharEnd() throws CoreException { - IMarker m = getMarker(); - if (m != null) { - return m.getAttribute(IMarker.CHAR_END, -1); - } - return -1; - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java deleted file mode 100644 index 6498ec379..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/MemoryByte.java +++ /dev/null @@ -1,283 +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.core.model; - - -/** - * A byte of memory in a memory block. Each byte of memory has a value and - * attributes indicating if the byte is read-only, valid, or if its value has - * changed. - *

                            - * Clients may instantiate this class. Clients may subclass this class to - * add other attributes to a memory byte, as required. - *

                            - * @since 3.1 - * @see org.eclipse.debug.core.model.IMemoryBlockExtension - */ -public class MemoryByte { - - /** - * Bit mask used to indicate a byte is writable. - */ - public static final byte WRITABLE = 0x01; - - /** - * Bit mask used to indicate a byte is readable. - * A memory byte is readable when its value and attributes are retrievable. - * Otherwise, a byte is considered non-readable. - */ - public static final byte READABLE = 0x02; - - /** - * Bit mask used to indicate a byte has changed since the last - * suspend event. - * - * @see org.eclipse.debug.core.DebugEvent#SUSPEND - */ - public static final byte CHANGED = 0x04; - - /** - * Bit mask used to indicate a memory byte has history to - * determine if its value has changed. When a memory byte's - * history is unknown, the change state has no meaning. - */ - public static final byte HISTORY_KNOWN = 0x08; - - /** - * Bit mask used to indicate a this byte of memory - * is big endian. If this byte of memory is little endian, - * turn this bit mask to off. - */ - public static final byte BIG_ENDIAN = 0x10; - - /** - * Bit mask used to indicate that the endianess of this byte - * of memory is known. When a memory byte's endianess is - * unknown, the endianess of this byte has no meaning. - */ - public static final byte ENDIANESS_KNOWN = 0x20; - - /** - * Value of this byte. - */ - protected byte value; - - /** - * Attribute flags. - *

                            - * To specify READABLE: flags |= MemoryByte.READABLE; - * To specify WRITABLE: flags |= MemoryByte.WRITABLE; - *

                            - */ - protected byte flags; - - /** - * Constructs a readable, writable memory byte without a change history, - * and a value of 0. The byte's endianess is known and is little endian - * by default. - */ - public MemoryByte() { - this((byte)0, (byte)(WRITABLE | READABLE | ENDIANESS_KNOWN)); - } - - /** - * Constructs a readable, writable memory byte without a change history, - * with the given value. The byte's endianess is known and is little endian - * by default. - * - * @param byteValue value of this memory byte - * - */ - public MemoryByte(byte byteValue) { - this(byteValue, (byte)(WRITABLE | READABLE | ENDIANESS_KNOWN)); - } - - /** - * Constructs a memory byte with the given value and attributes. - * - * @param byteValue value of this memory byte - * @param byteFlags attributes of the byte specified as a bit mask - */ - public MemoryByte(byte byteValue, byte byteFlags) { - value = byteValue; - flags = byteFlags; - } - - /** - * Returns this memory byte's attribute as a bit mask. - * - * @return this memory byte's attribute as a bit mask - */ - public byte getFlags() { - return flags; - } - /** - * Sets this memory byte's attributes based on the given bit mask. - * - * @param flags bit mask of attributes - */ - public void setFlags(byte flags) { - this.flags = flags; - } - - /** - * Returns the value of this memory byte. - * - * @return the value of this memory byte - */ - public byte getValue() { - return value; - } - - /** - * Sets the value of this memory byte. - * - * @param value the new value of this memory byte - */ - public void setValue(byte value) { - this.value = value; - } - - /** - * Sets whether this memory byte is readable. A memory byte - * is considered readable when its value and attributes are - * retrievable. - * - * @param readable whether this memory byte is readable - */ - public void setReadable(boolean readable) { - flags |= MemoryByte.READABLE; - if (!readable) - flags ^= MemoryByte.READABLE; - } - - /** - * Returns whether this memory byte is readable. A memory byte - * is considered readable when its value and attributes are - * retrievable. - * - * @return whether this memory byte is readable - */ - public boolean isReadable() { - return ((flags & MemoryByte.READABLE) == MemoryByte.READABLE); - } - - /** - * Sets whether this memory byte is writable. - * - * @param writable whether this memory byte is writable. - */ - public void setWritable(boolean writable) { - flags |= MemoryByte.WRITABLE; - if (!writable) - flags ^= MemoryByte.WRITABLE; - } - - /** - * Returns whether this memory byte is writable. - * - * @return whether this memory byte is writable - */ - public boolean isWritable() { - return ((flags & MemoryByte.WRITABLE) == MemoryByte.WRITABLE); - } - - /** - * Sets whether this memory byte has changed. - * - * @param changed whether this memory byte has changed - */ - public void setChanged(boolean changed) { - flags |= MemoryByte.CHANGED; - if (!changed) - flags ^= MemoryByte.CHANGED; - } - - /** - * Returns whether this memory byte has changed. - * - * @return whether this memory byte has changed - */ - public boolean isChanged() { - return ((flags & MemoryByte.CHANGED) == MemoryByte.CHANGED); - } - - /** - * Sets whether the history of this byte is known. When history - * is unknown, the change state of a memory byte has no meaning. - * - * @param known whether the change state of this byte is known - */ - public void setHistoryKnown(boolean known) { - flags |= MemoryByte.HISTORY_KNOWN; - if (!known) - flags ^= MemoryByte.HISTORY_KNOWN; - } - - /** - * Returns whether the history of this byte is known. When history - * is unknown, the change state of a memory byte has no meaning. - * - * @return whether the change state of this byte is known - */ - public boolean isHistoryKnown() { - return ((flags & MemoryByte.HISTORY_KNOWN) == MemoryByte.HISTORY_KNOWN); - } - - /** - * Sets whether this byte of memory is big endian. - * - * @param isBigEndian whether the byte of memory is big endian. - */ - public void setBigEndian(boolean isBigEndian) - { - flags |= MemoryByte.BIG_ENDIAN; - if (!isBigEndian) - flags ^= MemoryByte.BIG_ENDIAN; - } - - /** - * Returns whether this byte of memory is big endian. - * - * @return whether the byte of memory is big endian. - */ - public boolean isBigEndian() - { - return ((flags & MemoryByte.BIG_ENDIAN) == MemoryByte.BIG_ENDIAN); - } - - /** - * Sets whether the endianess of this byte of memory is known. - * If the endianess is unknown, the endianess of this byte - * has no meaning. - * - * @param isEndianessKnown whether the endianess of this byte is known. - */ - public void setEndianessKnown(boolean isEndianessKnown) - { - flags |= MemoryByte.ENDIANESS_KNOWN; - if (!isEndianessKnown) - flags ^= MemoryByte.ENDIANESS_KNOWN; - } - - /** - * Returns whether the endianess of this byte of memory is known. - * If the endianess is unknown, the endianess of this byte - * has no meaning. - * - * @return whether the endianess of this byte of memory is known. - */ - public boolean isEndianessKnown() - { - return ((flags & MemoryByte.ENDIANESS_KNOWN) == MemoryByte.ENDIANESS_KNOWN); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java deleted file mode 100644 index 1a8b8fe25..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java +++ /dev/null @@ -1,459 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core.model; - - -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -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.ILaunchConfiguration; -import org.eclipse.debug.internal.core.DebugCoreMessages; -import org.eclipse.debug.internal.core.NullStreamsProxy; -import org.eclipse.debug.internal.core.StreamsProxy; - - -/** - * Standard implementation of an IProcess that wrappers a system - * process (java.lang.Process). - *

                            - * Clients may subclass this class. Clients that need to replace the implementation - * of a streams proxy associated with an IProcess should subclass this - * class. Generally clients should not instantiate this class directly, but should - * instead call DebugPlugin.newProcess(...), which can delegate to an - * IProcessFactory if one is referenced by the associated launch configuration. - *

                            - * @see org.eclipse.debug.core.model.IProcess - * @see org.eclipse.debug.core.IProcessFactory - * @since 3.0 - */ -public class RuntimeProcess extends PlatformObject implements IProcess { - - private static final int MAX_WAIT_FOR_DEATH_ATTEMPTS = 10; - private static final int TIME_TO_WAIT_FOR_THREAD_DEATH = 500; // ms - - /** - * The launch this process is contained in - */ - private ILaunch fLaunch; - - /** - * The system process represented by this IProcess - */ - private Process fProcess; - - /** - * This process's exit value - */ - private int fExitValue; - - /** - * The monitor which listens for this runtime process' system process - * to terminate. - */ - private ProcessMonitorThread fMonitor; - - /** - * The streams proxy for this process - */ - private IStreamsProxy fStreamsProxy; - - /** - * The name of the process - */ - private String fName; - - /** - * Whether this process has been terminated - */ - private boolean fTerminated; - - /** - * Table of client defined attributes - */ - private Map fAttributes; - - /** - * Whether output from the process should be captured or swallowed - */ - private boolean fCaptureOutput = true; - - /** - * Constructs a RuntimeProcess on the given system process - * with the given name, adding this process to the given - * launch. - * - * @param launch the parent launch of this process - * @param process underlying system process - * @param name the label used for this process - * @param attributes map of attributes used to initialize the attributes - * of this process, or null if none - */ - public RuntimeProcess(ILaunch launch, Process process, String name, Map attributes) { - setLaunch(launch); - initializeAttributes(attributes); - fProcess= process; - fName= name; - fTerminated= true; - try { - fExitValue = process.exitValue(); - } catch (IllegalThreadStateException e) { - fTerminated= false; - } - - String captureOutput = launch.getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT); - fCaptureOutput = !("false".equals(captureOutput)); //$NON-NLS-1$ - - fStreamsProxy= createStreamsProxy(); - fMonitor = new ProcessMonitorThread(this); - fMonitor.start(); - launch.addProcess(this); - fireCreationEvent(); - } - - /** - * Initialize the attributes of this process to those in the given map. - * - * @param attributes attribute map or null if none - */ - private void initializeAttributes(Map attributes) { - if (attributes != null) { - Iterator keys = attributes.keySet().iterator(); - while (keys.hasNext()) { - String key = (String)keys.next(); - setAttribute(key, (String)attributes.get(key)); - } - } - } - - /** - * @see ITerminate#canTerminate() - */ - public synchronized boolean canTerminate() { - return !fTerminated; - } - - /** - * @see IProcess#getLabel() - */ - public String getLabel() { - return fName; - } - - /** - * Sets the launch this process is contained in - * - * @param launch the launch this process is contained in - */ - protected void setLaunch(ILaunch launch) { - fLaunch = launch; - } - - /** - * @see IProcess#getLaunch() - */ - public ILaunch getLaunch() { - return fLaunch; - } - - /** - * Returns the underlying system process associated with this process. - * - * @return system process - */ - protected Process getSystemProcess() { - return fProcess; - } - - /** - * @see ITerminate#isTerminated() - */ - public synchronized boolean isTerminated() { - return fTerminated; - } - - /** - * @see ITerminate#terminate() - */ - public void terminate() throws DebugException { - if (!isTerminated()) { - if (fStreamsProxy instanceof StreamsProxy) { - ((StreamsProxy)fStreamsProxy).kill(); - } - Process process = getSystemProcess(); - if (process != null) { - process.destroy(); - } - int attempts = 0; - while (attempts < MAX_WAIT_FOR_DEATH_ATTEMPTS) { - try { - process = getSystemProcess(); - if (process != null) { - fExitValue = process.exitValue(); // throws exception if process not exited - } - return; - } catch (IllegalThreadStateException ie) { - } - try { - Thread.sleep(TIME_TO_WAIT_FOR_THREAD_DEATH); - } catch (InterruptedException e) { - } - attempts++; - } - // clean-up - if (fMonitor != null) { - fMonitor.killThread(); - fMonitor = null; - } - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.RuntimeProcess_terminate_failed, null); - throw new DebugException(status); - } - } - - /** - * Notification that the system process associated with this process - * has terminated. - */ - protected void terminated() { - if (fStreamsProxy instanceof StreamsProxy) { - ((StreamsProxy)fStreamsProxy).close(); - } - - - // Avoid calling IProcess.exitValue() inside a sync section (Bug 311813). - int exitValue = -1; - boolean running = false; - try { - exitValue = fProcess.exitValue(); - } catch (IllegalThreadStateException ie) { - running = true; - } - - synchronized (this) { - fTerminated= true; - if (!running) { - fExitValue = exitValue; - } - fProcess= null; - } - fireTerminateEvent(); - } - - /** - * @see IProcess#getStreamsProxy() - */ - public IStreamsProxy getStreamsProxy() { - if (!fCaptureOutput) { - return null; - } - return fStreamsProxy; - } - - /** - * Creates and returns the streams proxy associated with this process. - * - * @return streams proxy - */ - protected IStreamsProxy createStreamsProxy() { - if (!fCaptureOutput) { - return new NullStreamsProxy(getSystemProcess()); - } - String encoding = getLaunch().getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING); - return new StreamsProxy(getSystemProcess(), encoding); - } - - /** - * Fires a creation event. - */ - protected void fireCreationEvent() { - fireEvent(new DebugEvent(this, DebugEvent.CREATE)); - } - - /** - * Fires the given debug event. - * - * @param event debug event to fire - */ - protected void fireEvent(DebugEvent event) { - DebugPlugin manager= DebugPlugin.getDefault(); - if (manager != null) { - manager.fireDebugEventSet(new DebugEvent[]{event}); - } - } - - /** - * Fires a terminate event. - */ - protected void fireTerminateEvent() { - fireEvent(new DebugEvent(this, DebugEvent.TERMINATE)); - } - - /** - * Fires a change event. - */ - protected void fireChangeEvent() { - fireEvent(new DebugEvent(this, DebugEvent.CHANGE)); - } - - /** - * @see IProcess#setAttribute(String, String) - */ - public void setAttribute(String key, String value) { - if (fAttributes == null) { - fAttributes = new HashMap(5); - } - Object origVal = fAttributes.get(key); - if (origVal != null && origVal.equals(value)) { - return; //nothing changed. - } - - fAttributes.put(key, value); - fireChangeEvent(); - } - - /** - * @see IProcess#getAttribute(String) - */ - public String getAttribute(String key) { - if (fAttributes == null) { - return null; - } - return (String)fAttributes.get(key); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - if (adapter.equals(IProcess.class)) { - return this; - } - if (adapter.equals(IDebugTarget.class)) { - ILaunch launch = getLaunch(); - IDebugTarget[] targets = launch.getDebugTargets(); - for (int i = 0; i < targets.length; i++) { - if (this.equals(targets[i].getProcess())) { - return targets[i]; - } - } - return null; - } - if (adapter.equals(ILaunch.class)) { - return getLaunch(); - } - //CONTEXTLAUNCHING - if(adapter.equals(ILaunchConfiguration.class)) { - return getLaunch().getLaunchConfiguration(); - } - return super.getAdapter(adapter); - } - /** - * @see IProcess#getExitValue() - */ - public synchronized int getExitValue() throws DebugException { - if (isTerminated()) { - return fExitValue; - } - throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.RuntimeProcess_Exit_value_not_available_until_process_terminates__1, null)); - } - - /** - * Monitors a system process, waiting for it to terminate, and - * then notifies the associated runtime process. - */ - class ProcessMonitorThread extends Thread { - - /** - * Whether the thread has been told to exit. - */ - protected boolean fExit; - /** - * The underlying java.lang.Process being monitored. - */ - protected Process fOSProcess; - /** - * The IProcess which will be informed when this - * monitor detects that the underlying process has terminated. - */ - protected RuntimeProcess fRuntimeProcess; - - /** - * The Thread which is monitoring the underlying process. - */ - protected Thread fThread; - - /** - * A lock protecting access to fThread. - */ - private final Object fThreadLock = new Object(); - - /** - * @see Thread#run() - */ - public void run() { - synchronized (fThreadLock) { - if (fExit) { - return; - } - fThread = Thread.currentThread(); - } - while (fOSProcess != null) { - try { - fOSProcess.waitFor(); - } catch (InterruptedException ie) { - // clear interrupted state - Thread.interrupted(); - } finally { - fOSProcess = null; - fRuntimeProcess.terminated(); - } - } - fThread = null; - } - - /** - * Creates a new process monitor and starts monitoring the process for - * termination. - * - * @param process process to monitor for termination - */ - public ProcessMonitorThread(RuntimeProcess process) { - super(DebugCoreMessages.ProcessMonitorJob_0); - setDaemon(true); - fRuntimeProcess= process; - fOSProcess= process.getSystemProcess(); - } - - /** - * Kills the monitoring thread. - * - * This method is to be useful for dealing with the error - * case of an underlying process which has not informed this - * monitor of its termination. - */ - protected void killThread() { - synchronized (fThreadLock) { - if (fThread == null) { - fExit = true; - } else { - fThread.interrupt(); - } - } - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html deleted file mode 100644 index 6192e28d6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/package.html +++ /dev/null @@ -1,146 +0,0 @@ - - - - - -Eclipse Debug Platform [org.eclipse.debug.core.model] - - - - -

                            Defines interfaces for debug model elements, source lookup, and launching.

                            - -

                            Package Specification

                            - -

                            This package defines classes and interfaces known as the "debug model" - which support an extensible set of debug architectures and languages. The debug - model is a set of interfaces representing common artifacts in debuggable programs. - The debug plug-in itself does not provide an implementation of a debug model. - It is intended that third parties providing an integrated set of development - tools for a specific language will also implement a debug model for that language, - using an underlying debug architecture of their choice. For example, Java development - tooling provides an implementation of a debug model based on the standard Java - Platform Debug Architecture (JPDA).

                            - -

                            The Debug Model

                            - -

                            A client implements a debug model by -providing an implementation of the interfaces defined in this package. (There is no explicit -extension point that represents a debug model). Each debug model provides one or more -launch configuration types capable of initiating a debug session.

                            - -

                            The common elements defined by the debug model are: - -

                              -
                            • Debug Target - A debug target represents a debuggable program - for example, a virtual - machine or a process.
                            • -
                            • Thread - A debug target may contain one or more threads.
                            • -
                            • Stack Frame - A suspended thread may contain one or more stack frames.
                            • -
                            • Variable - A stack frame may contain variables.
                            • -
                            • Value - Each variable has an associated value, and a value may contain more variables (to - represent complex data structures and objects).
                            • -
                            • Register Group - A stack frame may (optionally) be associated with one or more register - groups.
                            • -
                            • Register - A register group contains one or more registers.
                            • -
                            • Memory Blocks - A debug target may (optionally) support the retrieval of - arbitrary contiguous segments of memory.
                            • -
                            • Breakpoint - Breakpoints suspend the execution of a program.
                            • -
                            • Expression - An expression is a snippet of code that can be evaluated to - produce a value.
                            • -
                            - -

                            A debug model implementation is responsible for firing debug events. A debug event -corresponds to an event in a program being debugged - for example the creation or -termination of a thread.

                            - -

                            Breakpoints

                            - -

                            Breakpoints are used to suspend the execution of a program being debugged. There are -many kinds of breakpoints - line breakpoints, conditional line breakpoints, hit count -breakpoints, exception breakpoints, etc. The kinds of breakpoints supported by each debug -architecture, and the information required to create those breakpoints -is dictated by each debug architecture. The debug platform supports an extensible -set of breakpoint via the breakpoints extension point.

                            - -

                            The debug platform provides a breakpoint manager that maintains the collection - of all registered breakpoints. Clients add and remove breakpoints via this manager. - Breakpoints are implemented by instances of IBreakpoint. Each breakpoint - object has an associated marker, which provides persistence and presentation - in editors. The debug platform defines a generic breakpoint and line breakpoint, - as well as their corresponding marker definitions. Breakpoint creation is a - client responsibility - that is, defining the attributes of a breakpoint and - the resource to associate a breakpoint marker with.

                            - -

                            Breakpoints are persisted via their underlying marker. Breakpoint markers defined - with the persisted attribute as false will not be persisted. Breakpoints - are restored at workspace startup time by the breakpoint manager - that is, - breakpoint objects are created for all persisted markers which are a subtype - of the root breakpoint marker and are added to the breakpoint manager. To allow - for selective persistence of breakpoints (of the same kind), the IBreakpoint - interface and root breakpoint implementation defines a "persisted" - attribute. If this value is set to false, the breakpoint will not be persisted - across workspace invocations.

                            - -

                            As breakpoint markers are modified (created, removed, and changed), resource - deltas are created by the platform. The breakpoint manager translates pertinent - resource deltas into breakpoint change notifications (breakpoint added/removed/changed - messages). Interested listeners may register with the breakpoint manager. The - breakpoint manager only fires change notifications for registered breakpoints. - This simplifies breakpoint processing for clients, as resource delta traversal - and analysis is not required. Debug targets that support breakpoints should - register for breakpoint change notifications.

                            -

                            New Features in the Debug Model, Eclipse 3.0

                            -
                            -

                            Launch Delegate Enhancements
                            -

                            -

                            Lanuch delegates can optionally implement the new interface ILaunchConfigurationDelegate2. - This allows launch delegates to provide a launch object to be used for a launch. - For example, when debugging on a server a delegate could create a new launch - object or may reuse an existing launch object if the server is already running - in debug mode. As well, the inteface provides a mechanism for performing a - scoped build prior to launching (i.e. scoped to the projects in the workspace - pertaining to the launch), and searching for errors in the workspace which - may prevent the launch from succeeding (for example, compilation errors).

                            -

                            -

                            Extensible Watch Expressions

                            -

                            The debug platform provides an implementation of watch expressions. Debug - models can contribute watch expression delegates if they support watch expressions. - When a stack frame is selected, the associated delegate is queried to provide - a value for a watch expression in that context. The debug platform provides - persistence, enabling, disabling, entering, and editing of watch expressions.

                            -

                            Automatic Array Partitioning
                            -

                            -

                            The debug plug-in supports automatic partitioning of indexed collections, - which partitions large arrays into sub-ranges in the variables view. This - is supported with the introduction of a new interface in the debug model representing - an indexed value - IIndexedValue. If a value implements this - interface, the variables view will automatically partition its elements as - required, into sub-ranges

                            -

                            Logical Structure Types
                            -

                            -

                            Often, it is convenient to navigate complex data structures in terms of a - logical structure, rather than an implementation structure. For example, no - matter how a list is implemented (i.e. linked list, collection of arrays, - etc.), it is often convenient to be able to view the list as an ordered collection. - To facilitate the display of logical structures in the variables view, an - extension point has been added (org.eclipse.debug.core.logicalStructureTypes) - allowing debug models to contribute logical structures of its values, where - applicable. Debug models may contribute delegates to translate raw implementation - values into logical values. The variables view will display the logical values, - when the option to display logical structures is turned on. More than one - logical structure can be provided for a single value - the user can choose - which structure to display.

                            -

                            Step Filters
                            -

                            -

                            To support step filters on all stepping functions (into, over, return), a - new interface has been added to the debug platform - IStepFilters - - which can be implemented by debug targets. This interface replaces IFilteredStep, - which is now deprecated. The debugger provides a global toggle that turns - step filters on/off for all stepping functions. Debug targets should implement - this new interface and honor the step filter enablement setting when stepping.

                            -

                            This change maintains binary compatibility with previous releases. However, - targets wishing to leverage the new function must implement the new interface.
                            -

                            -
                            - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html deleted file mode 100644 index 069ad320f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/package.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - -Eclipse Debug Platform - - - - -

                            Provides support for launching programs, breakpoint management, expression management, -and debug events.

                            - -

                            Package Specification

                            - -

                            This package provides classes and interfaces to support facilities common among - many debug architectures: launching programs, breakpoint management, expression - management, and debug events. An extensible set of debug architectures and languages - are supported by the definition of a "debug model" - a set of interfaces - representing common artifacts in debuggable programs, which are defined in org.eclipse.debug.core.model. - The debug plug-in itself does not provide an implementation of a debug model. - It is intended that third parties providing an integrated set of development - tools for a specific language will also implement a debug model for that language, - using an underlying debug architecture of their choice. For example, Java development - tooling provides an implementation of a debug model based on the standard Java - Platform Debug Architecture (JPDA).

                            - -

                            The Managers

                            - -

                            The debug platform defines and provides an implementation of the following managers: -

                              -
                            • Launch Manager - The launch manager maintains the set of registered launches - - that is, a collection of programs that have been launched in debuggable - or non-debuggable (run) mode. Each launch contains its associated debug targets - and system processes. A launch that represents a debuggable program may specify - an associated source locator used to locate source elements associated with - stack frames for a particular debug session. Clients may provide implementations - of source locators, which are generally tied to the manner in which a program - is launched.
                            • -
                            • Breakpoint Manager - The breakpoint manager maintains, persists, and restores the collection - of all registered breakpoints in the workspace. As well, it provides change notification for - breakpoints.
                            • -
                            • Expression Manager - The expression manager maintains a collection of registered expressions. - Expressions are not automatically persisted, but a client could persist its own expressions - if required.
                            • -
                            -

                            - -

                            Launch Configurations

                            - -

                            A launch configuration is a persistable description of how to launch an application. - Each launch configuration is an instance of a type of launch configuration - - for example, a Java Application. The debug plug-in defines a launch configuration - type extension point that clients can contribute to. A launch configuration - is a set of attributes describing how to launch a program. The launching of - an application is performed by an associated implementation of a launch configuration - delegate, contributed by each launch configuration type extension.

                            -

                            A launch configuration may be stored as a file in the worksapce (and shared - in a repository via standard team mechanisms), or may be stored locally, essentially - making the launch configuration private for a single user.

                            -

                            New Features in the Debug Platform, Eclipse 3.0

                            -
                            -

                            Extensible Launch Modes

                            -

                            The debug platform supports an extensible set of launch modes. Prior releases - only supported two launch modes - run and debug. The debug platform defines - an extension point for contributing new launch modes (org.eclipse.debug.core.launchModes), - and contributes three basic launch modes itself: run, debug, and profile. - The launch manager has API to retrieve all launch modes, and a human readable - label for each launch mode.

                            -

                            The debug platform has an extension point to support the contribution of - a launch delegate for a specific launch configuration type and launch mode - - org.eclipse.debug.core.launchDelegates. This allows launch - configurations to be extended by third parties, to support new launch modes. - For example, a client could contribute a launch delegate that launches a Java - Application in profile mode (currently, the SDK does not provide a Java profiler).

                            -

                            For backwards compatibility, the launch delegate supplied by a launch configuration - type extension is used for the launch modes specified by the launch configuration - type. A launch delegate supplied for a specific mode, is used only for that - mode.

                            -

                            Extensible Debug Events

                            -

                            The debug platform supports an extensible set of debug events. A debug event - kind of MODEL_SPECIFIC has been added to indicate an application - specific debug event. When a debug event of kind MODEL_SPECIFIC - is created, the detail code in the event is client defined. The source of - the event (debug element that generated the event) identifies the debug model - from which the event was generated. The debug platform and user interface - ignores model specific debug events.

                            -

                            A data field has been added to debug events to allow clients to store application - specific data in debug events.
                            -

                            -

                            Process Factories
                            -

                            -

                            The debug platform provides an extension point (org.eclipse.debug.core.processFactories) - for contributing process factories. A process factory can be used to override - default process creation for a launch configuration when the debug plug-in - creates a new process. A launch configuration can specify a process factory - to use when creating a process, via the launch configuration attribute - DebugPlugin.ATTR_PROCESS_FACTORY_ID.

                            -

                            Launch Termination Notification
                            -

                            -

                            The debug platform provides a mechanism for launch listeners to be notified - when a launch terminates. A launch is a container of processes and debug targets. - When all of the contained targets and processes terminate, a terminate notification - is sent to those listeners implementing ILaunchesListener2.

                            -

                            Breakpoint Manager Enablement
                            -

                            -

                            The breakpoint manager defines the methods setEnabled(boolean) - and isEnabled(). When the breakpoint manager is disabled, debuggers - should ignore all registered breakpoints. The debug platform also provides - a new listener mechanism, IBreakpointManagerListener which allows - clients to register with the breakpoint manager to be notified when its enablement - changes.

                            -
                            - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java deleted file mode 100644 index 1060e589c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java +++ /dev/null @@ -1,788 +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 - * QNX Software Systems - Mikhail Khodjaiants - Bug 88232 - *******************************************************************************/ -package org.eclipse.debug.core.sourcelookup; - -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.runtime.CoreException; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.SafeRunner; -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.ILaunchConfigurationListener; -import org.eclipse.debug.core.ILaunchListener; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.sourcelookup.containers.DefaultSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -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; - -/** - * Directs source lookup among a collection of source lookup participants, - * and a common collection of source containers. - * Each source lookup participant is a source locator itself, which allows - * more than one source locator to participate in source lookup for a - * launch. Each source lookup participant searches for source in the source - * containers managed by this director, and each participant is notified - * of changes in the source containers (i.e. when the set of source - * containers changes). - *

                            - * When a source director is initialized, it adds it self as a launch listener, - * and automatically disposes itself when its associated launch is removed - * from the launch manager. If a source director is instantiated by a client - * that is not part of a launch, that client is responsible for disposing - * the source director. - *

                            - *

                            - * Clients may subclass this class. - *

                            - * @since 3.0 - * @see org.eclipse.debug.core.model.ISourceLocator - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer - * @see org.eclipse.debug.core.sourcelookup.ISourceContainerType - * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputer - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant - */ -public abstract class AbstractSourceLookupDirector implements ISourceLookupDirector, ILaunchConfigurationListener, ILaunchListener { - - // source locator type identifier - protected String fId; - //ISourceLocatorParticipants that are listening for container changes - protected ArrayList fParticipants = new ArrayList(); - //list of current source containers - protected ISourceContainer[] fSourceContainers = null; - //the launch config associated with this director - protected ILaunchConfiguration fConfig; - //whether duplicates should be searched for or not - protected boolean fDuplicates = false; - // source path computer, or null if default - protected ISourcePathComputer fComputer = null; - /** - * Cache of resolved source elements when duplicates exist. - * Keys are the duplicates, values are the source element to use. - */ - protected Map fResolvedElements = null; - // current participant performing lookup or null - private ISourceLookupParticipant fCurrentParticipant; - - protected static final IStatus fPromptStatus = new Status(IStatus.INFO, "org.eclipse.debug.ui", 200, "", null); //$NON-NLS-1$//$NON-NLS-2$ - protected static final IStatus fResolveDuplicatesStatus = new Status(IStatus.INFO, "org.eclipse.debug.ui", 205, "", null); //$NON-NLS-1$//$NON-NLS-2$ - - // XML nodes & attributes for persistence - protected static final String DIRECTOR_ROOT_NODE = "sourceLookupDirector"; //$NON-NLS-1$ - protected static final String CONTAINERS_NODE = "sourceContainers"; //$NON-NLS-1$ - protected static final String DUPLICATES_ATTR = "duplicates"; //$NON-NLS-1$ - protected static final String CONTAINER_NODE = "container"; //$NON-NLS-1$ - protected static final String CONTAINER_TYPE_ATTR = "typeId"; //$NON-NLS-1$ - protected static final String CONTAINER_MEMENTO_ATTR = "memento"; //$NON-NLS-1$ - - class SourceLookupQuery implements ISafeRunnable { - - private List fSourceElements = new ArrayList(); - private Object fElement = null; - private Throwable fException = null; - - SourceLookupQuery(Object element) { - fElement = element; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - fException = exception; - } - - /** - * Returns any exception that occurred during source lookup. - * - * @return the (any) exception that occured during source lookup - */ - public Throwable getException() { - return fException; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - MultiStatus multiStatus = null; - CoreException single = null; - ISourceLookupParticipant[] participants = getParticipants(); - try { - for(int i=0; i < participants.length; i++) { - setCurrentParticipant(participants[i]); - Object[] sourceArray; - try { - sourceArray = participants[i].findSourceElements(fElement); - if (sourceArray !=null && sourceArray.length > 0) { - if (isFindDuplicates()) { - for(int j=0; jnull - * @throws CoreException - */ - protected void abort(String message, Throwable exception) throws CoreException { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, message, exception); - throw new CoreException(status); - } - - /** - * Constructs source containers from a list of container mementos. - * - * @param list the list of nodes to be parsed - * @exception CoreException if parsing encounters an error - * @return a list of source containers - */ - private List parseSourceContainers(NodeList list) throws CoreException { - List containers = new ArrayList(); - for (int i=0; i < list.getLength(); i++) { - if(!(list.item(i).getNodeType() == Node.ELEMENT_NODE)) - continue; - Element element = (Element)list.item(i); - String typeId = element.getAttribute(CONTAINER_TYPE_ATTR); - if (typeId == null || typeId.equals("")) { //$NON-NLS-1$ - abort(SourceLookupMessages.AbstractSourceLookupDirector_11, null); - } - ISourceContainerType type = DebugPlugin.getDefault().getLaunchManager().getSourceContainerType(typeId); - if(type != null) { - String memento = element.getAttribute(CONTAINER_MEMENTO_ATTR); - if (memento == null || memento.equals("")) { //$NON-NLS-1$ - abort(SourceLookupMessages.AbstractSourceLookupDirector_13, null); - } - ISourceContainer container = type.createSourceContainer(memento); - containers.add(container); - } - else { - abort(MessageFormat.format(SourceLookupMessages.AbstractSourceLookupDirector_12, new String[]{typeId}), null); - } - } - return containers; - } - - /** - * Registers the given source lookup participant. Has no effect if an identical - * participant is already registered. Participants receive notification - * when the source containers associated with this source director change. - * - * @param participant the participant to register - */ - private synchronized void addSourceLookupParticipant(ISourceLookupParticipant participant) { - if (!fParticipants.contains(participant)) { - fParticipants.add(participant); - participant.init(this); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourceContainers() - */ - public synchronized ISourceContainer[] getSourceContainers() { - if (fSourceContainers == null) { - return new ISourceContainer[0]; - } - ISourceContainer[] copy = new ISourceContainer[fSourceContainers.length]; - System.arraycopy(fSourceContainers, 0, copy, 0, fSourceContainers.length); - return copy; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#isFindDuplicates() - */ - public boolean isFindDuplicates() { - return fDuplicates; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#setFindDuplicates(boolean) - */ - public void setFindDuplicates(boolean duplicates) { - fDuplicates = duplicates; - } - - /** - * Removes the given participant from the list of registered participants. - * Has no effect if an identical participant is not already registered. - * - * @param participant the participant to remove - */ - private synchronized void removeSourceLookupParticipant(ISourceLookupParticipant participant) { - if (fParticipants.remove(participant)) { - participant.dispose(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationAdded(ILaunchConfiguration configuration) { - ILaunchConfiguration from = DebugPlugin.getDefault().getLaunchManager().getMovedFrom(configuration); - if (from != null && from.equals(getLaunchConfiguration())) { - fConfig = configuration; - } - } - - /* (non-Javadoc) - * - * Updates source containers in response to changes in underlying launch - * configuration. Only responds to changes in non-working copies. - * - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationChanged(ILaunchConfiguration configuration) { - if (fConfig == null || configuration.isWorkingCopy()) { - return; - } - if(fConfig.equals(configuration)) { - try{ - String locatorMemento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO,(String)null); - if (locatorMemento == null) { - initializeDefaults(configuration); - } else { - initializeFromMemento(locatorMemento, configuration); - } - } catch (CoreException e){ - } - } - } - - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - if (configuration.equals(getLaunchConfiguration())) { - if (DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration) == null) { - fConfig = null; - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento() - */ - public synchronized String getMemento() throws CoreException { - Document doc = DebugPlugin.newDocument(); - Element rootNode = doc.createElement(DIRECTOR_ROOT_NODE); - doc.appendChild(rootNode); - - Element pathNode = doc.createElement(CONTAINERS_NODE); - if(fDuplicates) { - pathNode.setAttribute(DUPLICATES_ATTR, "true"); //$NON-NLS-1$ - } else { - pathNode.setAttribute(DUPLICATES_ATTR, "false"); //$NON-NLS-1$ - } - rootNode.appendChild(pathNode); - if(fSourceContainers !=null){ - for(int i=0; i - * Subclasses should override this method as appropriate. For example, - * to prompt the user to choose a source element. - *

                            - * @param element the debug artifact for which source is being searched for - * @param sources the source elements found for the given element - * @return a single source element for the given element - */ - public Object resolveSourceElement(Object element, List sources) { - // check the duplicates cache first - Iterator duplicates = sources.iterator(); - while (duplicates.hasNext()) { - Object dup = duplicates.next(); - Object resolved = getCachedElement(dup); - if (resolved != null) { - return resolved; - } - } - // consult a status handler - IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(fPromptStatus); - if (prompter != null) { - try { - Object result = prompter.handleStatus(fResolveDuplicatesStatus, new Object[]{element, sources}); - if (result != null) { - cacheResolvedElement(sources, result); - return result; - } - } catch (CoreException e) { - } - } - return sources.get(0); - } - - /** - * Checks if the object being added to the list of sources is a duplicate of what's already in the list - * @param sourceToAdd the new source file to be added - * @param sources the list that the source will be compared against - * @return true if it is already in the list, false if it is a new object - */ - private boolean checkDuplicate(Object sourceToAdd, List sources){ - if(sources.size() == 0) - return false; - Iterator iterator = sources.iterator(); - while(iterator.hasNext()) - if(iterator.next().equals(sourceToAdd)) - return true; - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2#initializeFromMemento(java.lang.String, org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeFromMemento(String memento, ILaunchConfiguration configuration) throws CoreException { - dispose(); - setLaunchConfiguration(configuration); - doInitializeFromMemento(memento, false); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeDefaults(ILaunchConfiguration configuration) throws CoreException { - dispose(); - setLaunchConfiguration(configuration); - setSourceContainers(new ISourceContainer[]{new DefaultSourceContainer()}); - initializeParticipants(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getLaunchConfiguration() - */ - public ILaunchConfiguration getLaunchConfiguration() { - return fConfig; - } - - /** - * Sets the launch configuration associated with this source lookup - * director. If the given configuration is a working copy, this director - * will respond to changes the working copy. If the given configuration - * is a persisted launch configuration, this director will respond to changes - * in the persisted launch configuration. - * - * @param configuration launch configuration to associate with this - * source lookup director, or null if none - */ - protected void setLaunchConfiguration(ILaunchConfiguration configuration) { - fConfig = configuration; - ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); - launchManager.addLaunchConfigurationListener(this); - launchManager.addLaunchListener(this); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch) - */ - public void launchAdded(ILaunch launch) { - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch) - */ - public void launchChanged(ILaunch launch) { - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch) - */ - public void launchRemoved(ILaunch launch) { - if (this.equals(launch.getSourceLocator())) { - dispose(); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getParticipants() - */ - public synchronized ISourceLookupParticipant[] getParticipants() { - return (ISourceLookupParticipant[]) fParticipants.toArray(new ISourceLookupParticipant[fParticipants.size()]); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.core.sourcelookup.ISourceContainerType) - */ - public boolean supportsSourceContainerType(ISourceContainerType type) { - return true; - } - - /** - * Caches the resolved source element to use when one of the following - * duplicates is found. - * - * @param duplicates duplicates source elements - * @param sourceElement chosen source element to use in place of the - * duplicates - */ - protected void cacheResolvedElement(List duplicates, Object sourceElement) { - if (fResolvedElements == null) { - fResolvedElements = new HashMap(10); - } - Iterator iterator = duplicates.iterator(); - while (iterator.hasNext()) { - Object dup = iterator.next(); - fResolvedElements.put(dup, sourceElement); - } - - } - - /** - * Returns the cached source element to use when the given duplicate - * is encountered. - * - * @param duplicate duplicates source element - * @return element to use in the duplicate's place - */ - protected Object getCachedElement(Object duplicate) { - if (fResolvedElements != null) { - return fResolvedElements.get(duplicate); - } - return null; - } - - /** - * Clears any cached source element associated with the given duplicate - * is source element. - * - * @param duplicate duplicate source element to cache resolved results - * for - */ - protected void clearCachedElement(Object duplicate) { - if (fResolvedElements != null) { - fResolvedElements.remove(duplicate); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#clearSourceElements(java.lang.Object) - */ - public void clearSourceElements(Object element) { - List list = doSourceLookup(element); - if (list.size() > 0) { - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - clearCachedElement(iterator.next()); - } - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#addParticipants(org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant[]) - */ - public void addParticipants(ISourceLookupParticipant[] participants) { - for (int i = 0; i < participants.length; i++) { - ISourceLookupParticipant participant = participants[i]; - addSourceLookupParticipant(participant); - participant.sourceContainersChanged(this); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#removeParticipants(org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant[]) - */ - public void removeParticipants(ISourceLookupParticipant[] participants) { - for (int i = 0; i < participants.length; i++) { - removeSourceLookupParticipant(participants[i]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getId() - */ - public String getId() { - return fId; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourcePathComputer() - */ - public ISourcePathComputer getSourcePathComputer() { - if (fComputer == null && getLaunchConfiguration() != null) { - try { - return DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(getLaunchConfiguration()); - } catch (CoreException e) { - } - } - return fComputer; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#setSourcePathComputer(org.eclipse.debug.core.sourcelookup.ISourcePathComputer) - */ - public void setSourcePathComputer(ISourcePathComputer computer) { - fComputer = computer; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#findSourceElements(java.lang.Object) - */ - public Object[] findSourceElements(Object object) throws CoreException { - SourceLookupQuery query = new SourceLookupQuery(object); - SafeRunner.run(query); - List sources = query.getSourceElements(); - Throwable exception = query.getException(); - query.dispose(); - if (exception != null && sources.isEmpty()) { - if (exception instanceof CoreException) { - throw (CoreException)exception; - } - abort(SourceLookupMessages.AbstractSourceLookupDirector_10, exception); - } - return sources.toArray(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourceElement(java.lang.Object) - */ - public Object getSourceElement(Object element) { - List sources = doSourceLookup(element); - if(sources.size() == 1) { - return sources.get(0); - } else if(sources.size() > 1) { - return resolveSourceElement(element, sources); - } else { - return null; - } - } - - /** - * Sets the current participant or null if none. - * - * @param participant active participant or null - */ - private void setCurrentParticipant(ISourceLookupParticipant participant) { - fCurrentParticipant = participant; - } - - /** - * Returns the participant currently looking up source or null - * if none. - * - * @return the participant currently looking up source or null - * if none - * @since 3.5 - */ - public ISourceLookupParticipant getCurrentParticipant() { - return fCurrentParticipant; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java deleted file mode 100644 index 3640d76e2..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java +++ /dev/null @@ -1,167 +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.core.sourcelookup; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; - - -/** - * Common super class for implementations of source lookup participants. - *

                            - * Clients implementing source lookup participants should subclass this class. - *

                            - * @since 3.0 - */ -public abstract class AbstractSourceLookupParticipant implements ISourceLookupParticipant { - - private ISourceLookupDirector fDirector; - - protected static final Object[] EMPTY = new Object[0]; - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector) - */ - public void init(ISourceLookupDirector director) { - fDirector = director; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#dispose() - */ - public void dispose() { - fDirector = null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#findSourceElements(java.lang.Object) - */ - public Object[] findSourceElements(Object object) throws CoreException { - List results = null; - CoreException single = null; - MultiStatus multiStatus = null; - if (isFindDuplicates()) { - results = new ArrayList(); - } - String name = getSourceName(object); - if (name != null) { - ISourceContainer[] containers = getSourceContainers(); - for (int i = 0; i < containers.length; i++) { - try { - ISourceContainer container = getDelegateContainer(containers[i]); - if (container != null) { - Object[] objects = container.findSourceElements(name); - if (objects.length > 0) { - //it will only not be null when we care about duplicates - //saves the computation in isFindDuplicates() - if (results != null) { - for (int j = 0; j < objects.length; j++) { - results.add(objects[j]); - } - } else { - if (objects.length == 1) { - return objects; - } - return new Object[]{objects[0]}; - } - } - } - } catch (CoreException e) { - if (single == null) { - single = e; - } else if (multiStatus == null) { - multiStatus = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, new IStatus[]{single.getStatus()}, SourceLookupMessages.Source_Lookup_Error, null); - multiStatus.add(e.getStatus()); - } else { - multiStatus.add(e.getStatus()); - } - } - } - } - if (results == null) { - if (multiStatus != null) { - throw new CoreException(multiStatus); - } else if (single != null) { - throw single; - } - return EMPTY; - } - return results.toArray(); - } - - /** - * Returns the source container to search in place of the given source - * container, or null if the given source container is not - * to be searched. The default implementation does not translate source - * containers. Subclasses should override if required. - * - * @param container the source container about to be searched (proxy) - * @return the source container to be searched (delegate), or null - * if the source container should not be searched - */ - protected ISourceContainer getDelegateContainer(ISourceContainer container) { - return container; - } - - /** - * Returns the source lookup director this participant is registered with - * or null if none. - * - * @return the source lookup director this participant is registered with - * or null if none - */ - protected ISourceLookupDirector getDirector() { - return fDirector; - } - - /** - * Returns whether this participant's source lookup director is configured - * to search for duplicate source elements. - * - * @return whether this participant's source lookup director is configured - * to search for duplicate source elements - * @since 3.5 - */ - public boolean isFindDuplicates() { - ISourceLookupDirector director = getDirector(); - if (director != null) { - return director.isFindDuplicates(); - } - return false; - } - - /** - * Returns the source containers currently registered with this participant's - * source lookup director. - * - * @return the source containers currently registered with this participant's - * source lookup director - */ - protected ISourceContainer[] getSourceContainers() { - ISourceLookupDirector director = getDirector(); - if (director != null) { - return director.getSourceContainers(); - } - return new ISourceContainer[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#sourceContainersChanged(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector) - */ - public void sourceContainersChanged(ISourceLookupDirector director) { - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/IPersistableSourceLocator2.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/IPersistableSourceLocator2.java deleted file mode 100644 index f30b9712b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/IPersistableSourceLocator2.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.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.IPersistableSourceLocator; - -/** - * Extensions to the IPersistableSourceLocator interface. - *

                            - * Clients may optionally implement this interface when implementing an - * {@link org.eclipse.debug.core.model.IPersistableSourceLocator}. - *

                            - * @see org.eclipse.debug.core.model.IPersistableSourceLocator - * @since 3.0 - */ -public interface IPersistableSourceLocator2 extends IPersistableSourceLocator { - - /** - * Initializes this source locator based on the given - * memento, for the given launch configuration. This method - * is called instead of initializeFrom(String memento) - * defined in IPersistableSourceLocator when a source - * locator implements this interface. - * - * @param memento a memento to initialize this source locator - * @param configuration the launch configuration this source locator is - * being created for - * @exception CoreException on failure to initialize - */ - public void initializeFromMemento(String memento, ILaunchConfiguration configuration) throws CoreException; - - /** - * Disposes this source locator. This method is called when a source - * locator's associated launch is removed from the launch manager. - */ - public void dispose(); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainer.java deleted file mode 100644 index ed721bd58..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainer.java +++ /dev/null @@ -1,108 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; - -/** - * A source container is a container of source code. A source container is - * capable of searching for source elements by name. For example, a source - * container may be a project or a directory capable of searching for files - * by name. A source container may be a composite container - i.e. contain - * other source containers. - *

                            - * When a source container is created and added to a source director, the - * source container's dispose() method is called when the - * source director is disposed. Clients creating source containers for other - * purposes must dispose of containers themselves. - *

                            - *

                            - * Clients may implement this interface. - *

                            - * @see ISourceLookupParticipant - * @see ISourceContainerType - * @since 3.0 - */ -public interface ISourceContainer extends IAdaptable { - - /** - * Notification this source container has been added to the given - * source lookup director. - * - * @param director the director this container has been added to - */ - public void init(ISourceLookupDirector director); - - /** - * Returns a collection of source elements in this container corresponding to the - * given name. Returns an empty collection if no source elements are found. - * This source container's source lookup director specifies if duplicate - * source elements should be searched for, via isFindDuplicates(). - * When false the returned collection should contain at most one - * source element. If this is a composite container, the containers contained - * by this container are also searched. - *

                            - * The format of the given name is implementation specific but generally conforms - * to the format of a file name. If a source container does not recognize the - * name format provided, an empty collection should be returned. A source container - * may or may not require names to be fully qualified (i.e. be qualified with directory - * names). - *

                            - * @param name the name of the source element to search for - * @return a collection of source elements corresponding to the given name - * @exception CoreException if an exception occurs while searching for source elements - */ - public Object[] findSourceElements(String name) throws CoreException; - - /** - * The name of this source container that can be used for presentation purposes. - * For example, the name of a project. - * - * @return the name of this source container - */ - public String getName(); - - /** - * Returns the source containers this container is composed of. An empty - * collection is returned if this container is not a composite container. - * For example, a workspace source container may be composed of project source - * containers. - * - * @return the source containers this container is composed of, possibly - * an empty collection - * @exception CoreException if unable to retrieve source containers - */ - public ISourceContainer[] getSourceContainers() throws CoreException; - - /** - * Returns whether this container is a composite container. A composite - * container is composed of other source containers. For example, a workspace - * source container may be composed of project source containers. - * - * @return whether this container is a composite container - */ - public boolean isComposite(); - - /** - * Returns this container's type. - * - * @return this container's type - */ - public ISourceContainerType getType(); - - /** - * Disposes this source container. This method is called when the source - * director associated with this source container is disposed. - */ - public void dispose(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerType.java deleted file mode 100644 index 0204389e6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerType.java +++ /dev/null @@ -1,75 +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.core.sourcelookup; - - - -/** - * A source container type represents a kind of container of source code. - * For example, a source container type may be a project or a directory. A specific - * project or directory is represented by an instance of a source container type, - * which is called a source container (ISourceContainer). - *

                            - * A source container type is contributed via the sourceContainerTypes - * extension point, providing a delegate to the work specific to the contributed - * type. Following is an example contribution. - *

                            - * <extension point="org.eclipse.debug.core.sourceContainerTypes">
                            - * 	<sourceContainerType
                            - * 		name="Project"
                            - * 		class="org.eclipse.debug.internal.core.sourcelookup.containers.ProjectSourceContainerType"
                            - * 		id="org.eclipse.debug.core.containerType.project"
                            - * 		description="A project in the workspace">
                            - * 	</sourceContainerType>
                            - * </extension>
                            - * 
                            - *

                            - *

                            - * Clients contributing a source container type implement - * {@link org.eclipse.debug.core.sourcelookup.ISourceContainerTypeDelegate}. - *

                            - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer - * @see org.eclipse.debug.core.sourcelookup.ISourceContainerTypeDelegate - * @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 ISourceContainerType extends ISourceContainerTypeDelegate { - - /** - * Returns the name of this source container type that can be used for - * presentation purposes. For example, Working Set or - * Project. The value returned is - * identical to the name specified in plugin.xml by the name - * attribute. - * - * @return the name of this source container type - */ - public String getName(); - - /** - * Returns the unique identifier associated with this source container type. - * The value returned is identical to the identifier specified in plugin.xml by - * the id attribute. - * - * @return the unique identifier associated with this source container type - */ - public String getId(); - - /** - * Returns a short description of this source container type that can be used - * for presentation purposes, or null if none. - * - * @return a short description of this source container type, or null - */ - public String getDescription(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerTypeDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerTypeDelegate.java deleted file mode 100644 index d8c944891..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceContainerTypeDelegate.java +++ /dev/null @@ -1,55 +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.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; - -/** - * A source container type delegate represents a kind of container of source code. - * For example, a source container type may be a project or a directory. A specific - * project or directory is represented by an instance of a source container type, - * which is called a source container (ISourceContainer). - *

                            - * A source container type delegate is contributed via the - * sourceContainerTypes extension point. - *

                            - *

                            - * Clients may implement this interface. - *

                            - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer - * @see org.eclipse.debug.core.sourcelookup.ISourceContainerType - * @since 3.0 - */ -public interface ISourceContainerTypeDelegate { - - /** - * Creates and returns a new source container of this type - * corresponding to the given memento. - * - * @param memento a memento for a source container of this source container type - * @return a source container corresponding to the given memento - * @exception CoreException if unable to construct a source container based - * on the given memento - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException; - - /** - * Constructs and returns a memento for the given source container. A memento - * can be used to reconstruct a source container. - * - * @param container The container for which a memento should be created. The - * container must of this source container type. - * @return a memento for the source container - * @exception CoreException if unable to create a memento - */ - public String getMemento(ISourceContainer container) throws CoreException; - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupDirector.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupDirector.java deleted file mode 100644 index 5eb45964a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupDirector.java +++ /dev/null @@ -1,182 +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.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; - -/** - * A source lookup director directs the source lookup process - * among a set of participants and source containers. - *

                            - * Clients may implement this interface. An abstract implementation - * is provided by AbstractSourceLookupDirector, which - * clients should subclass. - *

                            - * @since 3.0 - */ -public interface ISourceLookupDirector extends IPersistableSourceLocator2 { - - /** - * Returns the launch configuration associated with this source - * lookup director, or null if none. - * - * @return the launch configuration associated with this source - * lookup director, or null if none - */ - public ILaunchConfiguration getLaunchConfiguration(); - - /** - * Returns the source lookup participants currently registered with - * this director, possibly an empty collection. - * - * @return the source lookup participants currently registered with - * this director, possibly an empty collection - */ - public ISourceLookupParticipant[] getParticipants(); - - /** - * Returns the source containers currently registered with this - * director, possibly an empty collection. - * - * @return the source containers currently registered with this - * director, possibly an empty collection - */ - public ISourceContainer[] getSourceContainers(); - - /** - * Sets the source containers this source lookup director - * should search when looking for source, possibly an empty collection. - * - * @param containers the source containers this source lookup director - * should search when looking for source, possibly an empty collection - */ - public void setSourceContainers(ISourceContainer[] containers); - - /** - * Returns whether to search exhaustively for all source elements - * with the same name in all registered source containers, or - * whether to stop searching when the first source element matching - * the required name is found. - * - * @return whether to search exhaustively for all source elements - * with the same name - */ - public boolean isFindDuplicates(); - - /** - * Sets whether to search exhaustively for all source elements - * with the same name in all registered source containers, or - * whether to stop searching when the first source element matching - * the required name is found. - * - * @param findDuplicates whether to search exhaustively for all source elements - * with the same name - */ - public void setFindDuplicates(boolean findDuplicates); - - /** - * Notifies this source lookup director that it should initialize - * its set of source lookup participants. - */ - public void initializeParticipants(); - - /** - * Returns whether this source director supports the given type - * of source location. - * - * @param type source container type - * @return whether this source director supports the given type - * of source location - */ - public boolean supportsSourceContainerType(ISourceContainerType type); - - /** - * Clears any source lookup results associated with the given - * debug artifact, such that a subsequent lookup will force a new search - * to be performed. - * - * @param element debug artifact to clear source lookup results for - */ - public void clearSourceElements(Object element); - - /** - * Adds the given source lookup participants to this director. - * - * @param participants participants to add - */ - public void addParticipants(ISourceLookupParticipant[] participants); - - /** - * Removes the given source lookup participants from this director. - * - * @param participants participants to remove - */ - public void removeParticipants(ISourceLookupParticipant[] participants); - - /** - * Returns the identifier of this type of source locator. - * - * @return the identifier of this type of source locator - */ - public String getId(); - - /** - * Returns the source path computer to use with this source lookup - * director, possibly null. By default, the source path - * computer returned is the one associated with this director's launch - * configuration's type. However, the source path computer can be specified - * programmatically by calling setSourcePathComputer(...). - * - * @return the source path computer to use with this source lookup - * director, possibly null - */ - public ISourcePathComputer getSourcePathComputer(); - - /** - * Sets the source path computer for this source lookup director. - * This method can be used to override the default source path computer - * for a launch configuration type. When null is specified - * the default source path computer will be used (i.e. the one associated - * with this director's launch configuration's type). - * - * @param computer source path computer or null - */ - public void setSourcePathComputer(ISourcePathComputer computer); - - /** - * Returns a collection of source elements corresponding to the given debug - * artifact (for example, a stack frame or breakpoint). Returns an empty - * collection if no source elements are found. - * This participant's source lookup director specifies if duplicate - * source elements should be searched for, via isFindDuplicates(). - * When false the returned collection should contain at most one - * source element. - * - * @param object the debug artifact for which source needs to be found (e.g., stack frame) - * @return a collection of source elements corresponding to the given - * debug artifact, possibly empty - * @exception CoreException if an exception occurs while searching for source - */ - public Object[] findSourceElements(Object object) throws CoreException; - - /** - * Returns a source element that corresponds to the given debug artifact, or - * null if a source element could not be located. This is a - * generalization of getSourceElement(IStackFrame) to allow - * source to be found for other types of elements. - * - * @param element the debug artifact for which to locate source - * @return an object representing a source element. - */ - public Object getSourceElement(Object element); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java deleted file mode 100644 index b47d086c1..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourceLookupParticipant.java +++ /dev/null @@ -1,90 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; - -/** - * A source lookup participant participates in source lookup by searching an ordered - * list of source containers for source elements corresponding to a debug artifact. - * For example, a participant may be asked to find source corresponding to a stack - * frame or breakpoint. An implementation of a source lookup participant is debug - * model specific, since it must convert the debug model artifact (stack frame, - * breakpoint, etc.), into a source name that can be recognized by a source container - * (ISourceContainer), to search for source elements. Source containers - * are generally debug model independent, whereas source lookup participants are - * debug model specific. - *

                            - * Clients may implement this interface. An abstract implementation is - * provided by AbstractSourceLookupParticipant, which clients - * should subclass. - *

                            - * @since 3.0 - */ -public interface ISourceLookupParticipant { - - /** - * Notification this participant has been added to the specified - * source lookup director. - * - * @param director the source lookup director that this participant - * has been added to - */ - public void init(ISourceLookupDirector director); - - /** - * Returns a collection of source elements corresponding to the given debug - * artifact (for example, a stack frame or breakpoint). Returns an empty - * collection if no source elements are found. - * This participant's source lookup director specifies if duplicate - * source elements should be searched for, via isFindDuplicates(). - * When false the returned collection should contain at most one - * source element. - *

                            - * If the given debug artifact is not recognized by this participant, an empty - * collection is returned. Otherwise, this participant generates a source name - * from the given artifact and performs a search for associated source elements - * in its source containers. - *

                            - * @param object the debug artifact for which source needs to be found (e.g., stack frame) - * @return a collection of source elements corresponding to the given - * debug artifact, possibly empty - * @exception CoreException if an exception occurs while searching for source - */ - public Object[] findSourceElements(Object object) throws CoreException; - - /** - * Returns the source file name associated with the given debug artifact that - * source needs to be found for, or null if none. - * - * @param object the debug artifact for which source needs to be found (e.g., stack frame) - * @return the source file name associated with the given debug artifact, - * or null if none. - * @throws CoreException if unable to determine a source file name - */ - public String getSourceName(Object object) throws CoreException; - - /** - * Disposes this source lookup participant. This method is called when - * the source lookup director associated with this participant is - * disposed. - */ - public void dispose(); - - /** - * Notification that the source lookup containers in the given source - * lookup director have changed. - * - * @param director source lookup director that is directing this - * participant - */ - public void sourceContainersChanged(ISourceLookupDirector director); -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputer.java deleted file mode 100644 index 3e9558979..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputer.java +++ /dev/null @@ -1,65 +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.core.sourcelookup; - -import org.eclipse.debug.core.DebugPlugin; - -/** - * A source path computer computes the default source lookup path (set of source - * containers that should be considered) for a launch configuration. - *

                            - * A source path computer is contributed in plug-in XML via the - * sourcePathComputers extension point, that provides a delegate - * to compute the path specific to a launch configuration. Following - * is an example contribution. - *

                            - * <extension point="org.eclipse.debug.core.sourcePathComputers">
                            - *    	<sourcePathComputer
                            - *    		id="org.eclipse.example.exampleSourcePathComputer"
                            - *    		class="org.eclipse.example.SourcePathComputer">
                            - *    	</sourcePathComputer>
                            - * </extension>
                            - * 
                            - *

                            - *

                            - * A source path computer can be associated with a launch configuration type - * via the sourcePathComputerId attribute of a launch configuration - * type extension. As well, a launch configuration can specify its own - * source path computer to use via the ATTR_SOURCE_PATH_COMPUTER_ID - * attribute. - *

                            - *

                            - * Clients contributing a source path computer provide an implementation of - * {@link org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate}. - *

                            - * @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 ISourcePathComputer extends ISourcePathComputerDelegate { - - /** - * Launch configuration attribute to specify a source path computer - * that should be used for a launch configuration. The value is an identifier - * of a source path computer extension, or unspecified (null), if the - * default source path computer should be used. A default source path computer - * can be associated with a launch configuration type. - */ - public static final String ATTR_SOURCE_PATH_COMPUTER_ID = DebugPlugin.getUniqueIdentifier() + ".SOURCE_PATH_COMPUTER_ID"; //$NON-NLS-1$ - - /** - * Returns the unique identifier for this source path computer. - * - * @return the unique identifier for this source path computer - */ - public String getId(); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputerDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputerDelegate.java deleted file mode 100644 index 9d5506190..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/ISourcePathComputerDelegate.java +++ /dev/null @@ -1,49 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunchConfiguration; - -/** - * A source path computer delegate computes the default source lookup path - * (set of source containers that should be considered) for a launch - * configuration. - *

                            - * A source path computer is contributed in plug-in XML via the - * sourcePathComputers extension point, providing a delegate - * to compute the default source lookup path specific to a launch - * configuration. - *

                            - *

                            - * Clients may implement this interface. - *

                            - * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputer - * @since 3.0 - */ -public interface ISourcePathComputerDelegate { - - /** - * Returns a default collection source containers to be considered for the - * given launch configuration. The collection returned represents the default - * source lookup path for the given configuration. - * - * @param configuration the launch configuration for which a default source lookup path - * is to be computed - * @param monitor a progress monitor to be used in case of long operations - * @return a default collection source containers to be considered for the - * given launch configuration - * @exception CoreException if unable to compute a default source lookup path - */ - public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException; - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainer.java deleted file mode 100644 index cab9d8854..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainer.java +++ /dev/null @@ -1,139 +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.core.sourcelookup.containers; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant; -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.core.sourcelookup.ISourceLookupParticipant; - -/** - * Common function for source containers. - *

                            - * Clients implementing source containers should subclass this class. - *

                            - * @since 3.0 - */ -public abstract class AbstractSourceContainer extends PlatformObject implements ISourceContainer { - - public static final Object[] EMPTY = new Object[0]; - - private ISourceLookupDirector fDirector; - - /** - * Throws an error exception with the given message and underlying exception. - * - * @param message error message - * @param exception underlying exception, or null - * @throws CoreException - */ - protected void abort(String message, Throwable exception) throws CoreException { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, message, exception); - throw new CoreException(status); - } - - /** - * Throws a warning exception with the given message and underlying exception. - * - * @param message error message - * @param exception underlying exception, or null - * @throws CoreException - * @since 3.3 - */ - protected void warn(String message, Throwable exception) throws CoreException { - IStatus status = new Status(IStatus.WARNING, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, message, exception); - throw new CoreException(status); - } - - /* (non-Javadoc) - * - * By default, do nothing. Subclasses should override as required. - * - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose() - */ - public void dispose() { - fDirector = null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getSourceContainers() - */ - public ISourceContainer[] getSourceContainers() throws CoreException { - return new ISourceContainer[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite() - */ - public boolean isComposite() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector) - */ - public void init(ISourceLookupDirector director) { - fDirector = director; - } - - /** - * Returns the source lookup director this source container registered - * in, or null if none. - * - * @return the source lookup director this source container registered - * in, or null if none - */ - protected ISourceLookupDirector getDirector() { - return fDirector; - } - - /** - * Returns whether this container's source should search for duplicate source - * elements. Since 3.5, the current participant is consulted to determine if - * duplicates should be found. Fall back to querying the source lookup director - * if the participant is not an {@link AbstractSourceLookupParticipant}. - * - * @return whether to search for duplicate source elements - */ - protected boolean isFindDuplicates() { - ISourceLookupDirector director = getDirector(); - if (director != null) { - if (director instanceof AbstractSourceLookupDirector) { - AbstractSourceLookupDirector asld = (AbstractSourceLookupDirector) director; - ISourceLookupParticipant participant = asld.getCurrentParticipant(); - if (participant instanceof AbstractSourceLookupParticipant ) { - AbstractSourceLookupParticipant aslp = (AbstractSourceLookupParticipant) participant; - return aslp.isFindDuplicates(); - } - } - return director.isFindDuplicates(); - } - return false; - } - - /** - * Returns the source container type identified by the given id, - * or null if none. - * - * @param id source container type identifier - * @return source container type or null - */ - protected ISourceContainerType getSourceContainerType(String id) { - return DebugPlugin.getDefault().getLaunchManager().getSourceContainerType(id); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainerTypeDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainerTypeDelegate.java deleted file mode 100644 index cffc4dabe..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainerTypeDelegate.java +++ /dev/null @@ -1,73 +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.core.sourcelookup.containers; - -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.sourcelookup.ISourceContainerTypeDelegate; -import org.w3c.dom.Document; -import org.w3c.dom.Element; - -/** - * Common function for source container type delegates. - *

                            - * Clients implementing source container delegates should subclass this class. - *

                            - * @since 3.0 - */ -public abstract class AbstractSourceContainerTypeDelegate implements ISourceContainerTypeDelegate { - - /** - * Throws an exception with the given message and underlying exception. - * - * @param message error message - * @param exception underlying exception, or null - * @throws CoreException - */ - protected void abort(String message, Throwable exception) throws CoreException { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, message, exception); - throw new CoreException(status); - } - - /** - * Creates and returns a new XML document. - * - * @return a new XML document - * @throws CoreException if unable to create a new document - */ - protected Document newDocument()throws CoreException { - return DebugPlugin.newDocument(); - } - - /** - * Returns the given XML document as a string. - * - * @param document document to serialize - * @return the given XML document as a string - * @throws CoreException if unable to serialize the document - */ - protected String serializeDocument(Document document) throws CoreException { - return DebugPlugin.serializeDocument(document); - } - - /** - * Parses the given XML document, returning its root element. - * - * @param document XML document as a string - * @return the document's root element - * @throws CoreException if unable to parse the document - */ - protected Element parseDocument(String document) throws CoreException { - return DebugPlugin.parseDocument(document); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java deleted file mode 100644 index 3120a01d5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.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.core.sourcelookup.containers; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; -import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector; - -/** - * Archive source container for an archive in the workspace. Returns instances - * of ZipEntryStorage as source elements. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class ArchiveSourceContainer extends AbstractSourceContainer { - - private IFile fFile; - private boolean fDetectRoot; - private ExternalArchiveSourceContainer fDelegateContainer; - - /** - * Unique identifier for the archive source container type - * (value org.eclipse.debug.core.containerType.archive). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.archive"; //$NON-NLS-1$ - - /** - * Creates an archive source container on the given file. - * - * @param archive archive in the workspace - * @param detectRootPath whether a root path should be detected. When - * true, searching is performed relative to a root path - * within the archive based on fully qualified file names. The root - * path is automatically determined when the first successful search - * is performed. For example, when searching for a file named - * a/b/c.d, and an entry in the archive named - * r/a/b/c.d exists, the root path is set to r. - * From that point on, searching is performed relative to r. - * When false, searching is performed by - * matching file names as suffixes to the entries in the archive. - */ - public ArchiveSourceContainer(IFile archive, boolean detectRootPath) { - fFile = archive; - fDetectRoot = detectRootPath; - if (archive.exists() && archive.getLocation() != null) { - fDelegateContainer = new ExternalArchiveSourceContainer(archive.getLocation().toOSString(), detectRootPath); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName() - */ - public String getName() { - return fFile.getName(); - } - - /** - * Returns the associated file in the workspace. - * - * @return associated file in the workspace - */ - public IFile getFile() { - return fFile; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType() - */ - public ISourceContainerType getType() { - return getSourceContainerType(TYPE_ID); - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return obj instanceof ArchiveSourceContainer && - ((ArchiveSourceContainer)obj).getName().equals(getName()); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getName().hashCode(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ - public Object[] findSourceElements(String name) throws CoreException { - ExternalArchiveSourceContainer container = getDelegateContainer(); - if (container != null) { - return container.findSourceElements(name); - } - return EMPTY; - } - - /** - * Returns the underlying external archive source container. - * - * @return underlying external archive source container - * @since 3.0.1.1 - */ - private ExternalArchiveSourceContainer getDelegateContainer() { - return fDelegateContainer; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector) - */ - public void init(ISourceLookupDirector director) { - super.init(director); - if (fDelegateContainer != null) { - fDelegateContainer.init(director); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose() - */ - public void dispose() { - super.dispose(); - if (fDelegateContainer != null) { - fDelegateContainer.dispose(); - } - } - - /** - * Returns whether root paths are automatically detected in this - * archive source container. - * - * @return whether root paths are automatically detected in this - * archive source container - * @since 3.0.1.1 - */ - public boolean isDetectRoot() { - return fDetectRoot; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java deleted file mode 100644 index ca07e6ad7..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java +++ /dev/null @@ -1,151 +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.core.sourcelookup.containers; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; - -/** - * A source container of source containers. - *

                            - * Clients implementing composite source containers should subclass - * this class. - *

                            - * @since 3.0 - */ -public abstract class CompositeSourceContainer extends AbstractSourceContainer { - - private ISourceContainer[] fContainers; - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite() - */ - public boolean isComposite() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ - public Object[] findSourceElements(String name) throws CoreException { - return findSourceElements(name, getSourceContainers()); - } - - /** - * Returns a collection of source elements in the given containers corresponding to - * the given name. Returns an empty collection if no source elements are found. - * This source container's source lookup director specifies if duplicate - * source elements should be searched for, via isFindDuplicates(). - * When false the returned collection should contain at most one - * source element. If this is a composite container, the containers contained - * by this container are also searched. - *

                            - * The format of the given name is implementation specific but generally conforms - * to the format of a file name. If a source container does not recognize the - * name format provided, an empty collection should be returned. A source container - * may or may not require names to be fully qualified (i.e. be qualified with directory - * names). - *

                            - * @param name the name of the source element to search for - * @param containers the containers to search - * @return a collection of source elements corresponding to the given name - * @exception CoreException if an exception occurs while searching for source elements - */ - protected Object[] findSourceElements(String name, ISourceContainer[] containers) throws CoreException { - List results = null; - CoreException single = null; - MultiStatus multiStatus = null; - if (isFindDuplicates()) { - results = new ArrayList(); - } - for (int i = 0; i < containers.length; i++) { - ISourceContainer container = containers[i]; - try { - Object[] objects = container.findSourceElements(name); - if (objects.length > 0) { - //it will only not be null when we care about duplicates - //saves the computation in isFindDuplicates() - if (results != null) { - for (int j = 0; j < objects.length; j++) { - results.add(objects[j]); - } - } else { - if (objects.length == 1) { - return objects; - } - return new Object[]{objects[0]}; - } - } - } catch (CoreException e) { - if (single == null) { - single = e; - } else if (multiStatus == null) { - multiStatus = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, new IStatus[]{single.getStatus()}, SourceLookupMessages.Source_Lookup_Error, null); - multiStatus.add(e.getStatus()); - } else { - multiStatus.add(e.getStatus()); - } - } - } - if (results == null) { - if (multiStatus != null) { - throw new CoreException(multiStatus); - } else if (single != null) { - throw single; - } - return EMPTY; - } - return results.toArray(); - } - - /** - * Creates the source containers in this composite container. - * Subclasses should override this methods. - * - * @throws CoreException if unable to create the containers - */ - protected abstract ISourceContainer[] createSourceContainers() throws CoreException; - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getSourceContainers() - */ - public synchronized ISourceContainer[] getSourceContainers() throws CoreException { - if (fContainers == null) { - fContainers = createSourceContainers(); - for (int i = 0; i < fContainers.length; i++) { - ISourceContainer container = fContainers[i]; - container.init(getDirector()); - } - } - return fContainers; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose() - */ - public void dispose() { - super.dispose(); - if (fContainers != null) { - for (int i = 0; i < fContainers.length; i++) { - ISourceContainer container = fContainers[i]; - container.dispose(); - } - } - fContainers = null; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java deleted file mode 100644 index fc9ea661b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java +++ /dev/null @@ -1,209 +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 - * QNX Software Systems - Mikhail Khodjaiants - Bug 80857 - *******************************************************************************/ -package org.eclipse.debug.core.sourcelookup.containers; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileStore; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -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.debug.core.sourcelookup.ISourceContainer; - -/** - * A source container for a container in the workspace. Source elements are searched - * for within this container and optionally nested containers. - *

                            - * Names specified in findSourceElements method can - * be simple or qualified. When a name is qualified, a file will - * be searched for relative to this container, and optionally - * nested containers. - *

                            - * @since 3.2 - * @noextend This class is not intended to be subclassed by clients. - */ -public abstract class ContainerSourceContainer extends CompositeSourceContainer { - - private IContainer fContainer = null; - private boolean fSubfolders = false; - - private URI fRootURI = null; - private IFileStore fRootFile = null; - private IWorkspaceRoot fRoot = null; - - /** - * Constructs a source container on the given workspace container. - * - * @param container the container to search for source in - * @param subfolders whether nested folders should be searched - * for source elements - */ - public ContainerSourceContainer(IContainer container, boolean subfolders) { - fContainer = container; - fSubfolders = subfolders; - fRootURI = fContainer.getLocationURI(); - if (fRootURI != null) { - try { - fRootFile = EFS.getStore(fRootURI); - } catch (CoreException e) { - } - fRoot = ResourcesPlugin.getWorkspace().getRoot(); - } - } - - /** - * Returns the workspace container this source container is - * rooted at. - * - * @return the workspace container this source container is - * rooted at - */ - public IContainer getContainer() { - return fContainer; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ - public Object[] findSourceElements(String name) throws CoreException { - ArrayList sources = new ArrayList(); - - // An IllegalArgumentException is thrown from the "getFile" method - // if the path created by appending the file name to the container - // path doesn't conform with Eclipse resource restrictions. - // To prevent the interruption of the search procedure we check - // if the path is valid before passing it to "getFile". - if ( validateFile(name) ) { - IFile file = fContainer.getFile(new Path(name)); - if (file.exists()) { - sources.add(file); - } else { - // See bug 82627 - perform case insensitive source lookup - if (fRootURI == null) { - return EMPTY; - } - // See bug 98090 - we need to handle relative path names - IFileStore target = fRootFile.getFileStore(new Path(name)); - if (target.fetchInfo().exists()) { - // We no longer have to account for bug 95832, and URIs take care - // of canonical paths (fix to bug 95679 was removed). - IFile[] files = fRoot.findFilesForLocationURI(target.toURI()); - if (isFindDuplicates() && files.length > 1) { - for (int i = 0; i < files.length; i++) { - sources.add(files[i]); - } - } else if (files.length > 0) { - sources.add(files[0]); - } - } - } - } - - //check sub-folders - if ((isFindDuplicates() && fSubfolders) || (sources.isEmpty() && fSubfolders)) { - ISourceContainer[] containers = getSourceContainers(); - for (int i=0; i < containers.length; i++) { - Object[] objects = containers[i].findSourceElements(name); - if (objects == null || objects.length == 0) { - continue; - } - if (isFindDuplicates()) { - for(int j=0; j < objects.length; j++) - sources.add(objects[j]); - } else { - sources.add(objects[0]); - break; - } - } - } - - if(sources.isEmpty()) - return EMPTY; - return sources.toArray(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#getName() - */ - public String getName() { - return getContainer().getName(); - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (obj != null && obj instanceof ContainerSourceContainer) { - ContainerSourceContainer loc = (ContainerSourceContainer) obj; - return loc.getContainer().equals(getContainer()); - } - return false; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getContainer().hashCode(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#isComposite() - */ - public boolean isComposite() { - return fSubfolders; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ - protected ISourceContainer[] createSourceContainers() throws CoreException { - if(fSubfolders) { - IResource[] resources = getContainer().members(); - List list = new ArrayList(resources.length); - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - if (resource.getType() == IResource.FOLDER) { - list.add(new FolderSourceContainer((IFolder)resource, fSubfolders)); - } - } - ISourceContainer[] containers = (ISourceContainer[]) list.toArray(new ISourceContainer[list.size()]); - for (int i = 0; i < containers.length; i++) { - ISourceContainer container = containers[i]; - container.init(getDirector()); - } - return containers; - } - return new ISourceContainer[0]; - } - - /** - * Validates the given string as a path for a file in this container. - * - * @param name path name - */ - private boolean validateFile(String name) { - IContainer container = getContainer(); - IPath path = container.getFullPath().append(name); - return ResourcesPlugin.getWorkspace().validatePath(path.toOSString(), IResource.FILE).isOK(); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DefaultSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DefaultSourceContainer.java deleted file mode 100644 index 957655ad0..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DefaultSourceContainer.java +++ /dev/null @@ -1,118 +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.core.sourcelookup.containers; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -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.core.sourcelookup.ISourcePathComputer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; - -/** - * A source container that computer the default source lookup path - * for a launch configuration on each launch using a launch configuration's - * associated source path computer. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class DefaultSourceContainer extends CompositeSourceContainer { - - /** - * Unique identifier for the default source container type - * (value org.eclipse.debug.core.containerType.default). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.default"; //$NON-NLS-1$ - - /** - * Constructs a default source container. - */ - public DefaultSourceContainer() { - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return obj instanceof DefaultSourceContainer; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getClass().hashCode(); - } - - /** - * Returns the launch configuration for which a default source lookup - * path will be computed, or null if none. - * - * @return the launch configuration for which a default source lookup - * path will be computed, or null - */ - protected ILaunchConfiguration getLaunchConfiguration() { - ISourceLookupDirector director = getDirector(); - if (director != null) { - return director.getLaunchConfiguration(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType() - */ - public ISourceContainerType getType() { - return getSourceContainerType(TYPE_ID); - } - - /** - * Returns the source path computer to use, or null - * if none. - * - * @return the source path computer to use, or null - * if none - */ - private ISourcePathComputer getSourcePathComputer() { - ISourceLookupDirector director = getDirector(); - if (director != null) { - return director.getSourcePathComputer(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName() - */ - public String getName() { - return SourceLookupMessages.DefaultSourceContainer_0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ - protected ISourceContainer[] createSourceContainers() throws CoreException { - ISourcePathComputer sourcePathComputer = getSourcePathComputer(); - if (sourcePathComputer != null) { - ILaunchConfiguration config= getLaunchConfiguration(); - if (config != null) { - return sourcePathComputer.computeSourceContainers(config, null); - } - } - - return new ISourceContainer[0]; - } -} \ No newline at end of file diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java deleted file mode 100644 index 311dba478..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java +++ /dev/null @@ -1,179 +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.core.sourcelookup.containers; - -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; - -/** - * A directory in the local file system. Source elements returned - * from findSourceElements(...) are instances - * of LocalFileStorage. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ - -public class DirectorySourceContainer extends CompositeSourceContainer { - - // root directory - private File fDirectory; - // whether to search sub-folders - private boolean fSubfolders = false; - /** - * Unique identifier for the directory source container type - * (value org.eclipse.debug.core.containerType.directory). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.directory"; //$NON-NLS-1$ - - /** - * Constructs an external folder container for the - * directory identified by the given path. - * - * @param dirPath path to a directory in the local file system - * @param subfolders whether folders within the root directory - * should be searched for source elements - */ - public DirectorySourceContainer(IPath dirPath, boolean subfolders) { - this(dirPath.toFile(), subfolders); - } - - /** - * Constructs an external folder container for the - * directory identified by the given file. - * - * @param dir a directory in the local file system - * @param subfolders whether folders within the root directory - * should be searched for source elements - */ - public DirectorySourceContainer(File dir, boolean subfolders) { - fDirectory = dir; - fSubfolders = subfolders; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName() - */ - public String getName() { - return fDirectory.getName(); - } - - /** - * Returns the root directory in the local file system associated - * with this source container. - * - * @return the root directory in the local file system associated - * with this source container - */ - public File getDirectory() { - return fDirectory; - } - - /* (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.ISourceContainer#findSourceElements(java.lang.String) - */ - public Object[] findSourceElements(String name) throws CoreException { - ArrayList sources = new ArrayList(); - File directory = getDirectory(); - File file = new File(directory, name); - if (file.exists() && file.isFile()) { - sources.add(new LocalFileStorage(file)); - } - - //check sub-folders - if ((isFindDuplicates() && fSubfolders) || (sources.isEmpty() && fSubfolders)) { - ISourceContainer[] containers = getSourceContainers(); - for (int i=0; i < containers.length; i++) { - Object[] objects = containers[i].findSourceElements(name); - if (objects == null || objects.length == 0) { - continue; - } - if (isFindDuplicates()) { - for(int j=0; j < objects.length; j++) - sources.add(objects[j]); - } else { - sources.add(objects[0]); - break; - } - } - } - - if(sources.isEmpty()) - return EMPTY; - return sources.toArray(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite() - */ - public boolean isComposite() { - return fSubfolders; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (obj instanceof DirectorySourceContainer) { - DirectorySourceContainer container = (DirectorySourceContainer) obj; - return container.getDirectory().equals(getDirectory()); - } - return false; - } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getDirectory().hashCode(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ - protected ISourceContainer[] createSourceContainers() throws CoreException { - if (isComposite()) { - String[] files = fDirectory.list(); - if (files != null) { - List dirs = new ArrayList(); - for (int i = 0; i < files.length; i++) { - String name = files[i]; - File file = new File(getDirectory(), name); - if (file.exists() && file.isDirectory()) { - dirs.add(new DirectorySourceContainer(file, true)); - } - } - ISourceContainer[] containers = (ISourceContainer[]) dirs.toArray(new ISourceContainer[dirs.size()]); - for (int i = 0; i < containers.length; i++) { - ISourceContainer container = containers[i]; - container.init(getDirector()); - } - return containers; - } - } - return new ISourceContainer[0]; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java deleted file mode 100644 index d1bb037e9..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java +++ /dev/null @@ -1,276 +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.core.sourcelookup.containers; - -import java.io.File; -import java.io.IOException; -import com.ibm.icu.text.MessageFormat; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -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.sourcelookup.ISourceContainerType; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupUtils; - -/** - * An archive in the local file system. Returns instances - * of ZipEntryStorage as source elements. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class ExternalArchiveSourceContainer extends AbstractSourceContainer { - - private boolean fDetectRoots = false; - private Set fPotentialRoots = null; - private List fRoots = new ArrayList(); - private String fArchivePath = null; - /** - * Unique identifier for the external archive source container type - * (value org.eclipse.debug.core.containerType.externalArchive). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.externalArchive"; //$NON-NLS-1$ - - /** - * Creates an archive source container on the archive at the - * specified location in the local file system. - * - * @param archivePath path to the archive in the local file system - * @param detectRootPaths whether root container paths should be detected. When - * true, searching is performed relative to a root path - * within the archive based on fully qualified file names. A root - * path is automatically determined for when the first - * successful search is performed. For example, when searching for a file - * named a/b/c.d, and an entry in the archive named - * r/a/b/c.d exists, a root path is set to r. - * When searching for an unqualified file name, root containers are not - * considered. - * When false, searching is performed by - * matching file names as suffixes to the entries in the archive. - */ - public ExternalArchiveSourceContainer(String archivePath, boolean detectRootPaths) { - fArchivePath = archivePath; - fDetectRoots = detectRootPaths; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String) - */ - public Object[] findSourceElements(String name) throws CoreException { - name = name.replace('\\', '/'); - ZipFile file = getArchive(); - // NOTE: archive can be closed between get (above) and synchronized block (below) - synchronized (file) { - boolean isQualfied = name.indexOf('/') > 0; - if (fDetectRoots && isQualfied) { - ZipEntry entry = searchRoots(file, name); - if (entry != null) { - return new Object[]{new ZipEntryStorage(file, entry)}; - } - } else { - // try exact match - ZipEntry entry = null; - try { - entry = file.getEntry(name); - } catch (IllegalStateException e) { - // archive was closed between retrieving and locking - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - e.getMessage(), e)); - } - if (entry != null) { - // can't be any duplicates if there is an exact match - return new Object[]{new ZipEntryStorage(file, entry)}; - } - // search - Enumeration entries = file.entries(); - List matches = null; - while (entries.hasMoreElements()) { - entry = (ZipEntry)entries.nextElement(); - String entryName = entry.getName(); - if (entryName.endsWith(name)) { - if (isQualfied || entryName.length() == name.length() || entryName.charAt(entryName.length() - name.length() - 1) == '/') { - if (isFindDuplicates()) { - if (matches == null) { - matches = new ArrayList(); - } - matches.add(new ZipEntryStorage(file, entry)); - } else { - return new Object[]{new ZipEntryStorage(file, entry)}; - } - } - } - } - if (matches != null) { - return matches.toArray(); - } - } - } - return EMPTY; - } - - /** - * Returns the root path in this archive for the given file name, based - * on its type, or null if none. Detects a root if a root has - * not yet been detected for the given file type. - * - * @param file zip file to search in - * @param name file name - * @exception CoreException if an exception occurs while detecting the root - */ - private ZipEntry searchRoots(ZipFile file, String name) throws CoreException { - if (fPotentialRoots == null) { - fPotentialRoots = new HashSet(); - fPotentialRoots.add(""); //$NON-NLS-1$ - // all potential roots are the directories - try { - Enumeration entries = file.entries(); - while (entries.hasMoreElements()) { - ZipEntry entry = (ZipEntry) entries.nextElement(); - if (entry.isDirectory()) { - fPotentialRoots.add(entry.getName()); - } else { - String entryName = entry.getName(); - int index = entryName.lastIndexOf("/"); //$NON-NLS-1$ - while (index > 0) { - if (fPotentialRoots.add(entryName.substring(0, index + 1))) { - entryName = entryName.substring(0, index); - index = entryName.lastIndexOf("/"); //$NON-NLS-1$ - } else { - break; - } - } - } - } - } catch (IllegalStateException e) { - // archive was closed between retrieving and locking - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - e.getMessage(), e)); - } - } - int i = 0; - while (i < fRoots.size()) { - String root = (String) fRoots.get(i); - ZipEntry entry = file.getEntry(root+name); - if (entry != null) { - return entry; - } - i++; - } - if (!fPotentialRoots.isEmpty()) { - Iterator roots = fPotentialRoots.iterator(); - String root = null; - ZipEntry entry = null; - while (roots.hasNext()) { - root = (String) roots.next(); - entry = file.getEntry(root+name); - if (entry != null) { - break; - } - } - if (entry != null) { - if (root != null) { - fRoots.add(root); - fPotentialRoots.remove(root); - // remove any roots that begin with the new root, as roots cannot be nested - Iterator rs = fPotentialRoots.iterator(); - while (rs.hasNext()) { - String r = (String) rs.next(); - if (r.startsWith(root)) { - rs.remove(); - } - } - } - return entry; - } - } - return null; - } - - /** - * Returns the archive to search in. - * - * @throws CoreException if unable to access the archive - */ - private ZipFile getArchive() throws CoreException { - try { - return SourceLookupUtils.getZipFile(fArchivePath); - } catch (IOException e) { - File file = new File(fArchivePath); - if (file.exists()) { - abort(MessageFormat.format(SourceLookupMessages.ExternalArchiveSourceContainer_2, new String[]{fArchivePath}), e); - } else { - warn(MessageFormat.format(SourceLookupMessages.ExternalArchiveSourceContainer_1, new String[]{fArchivePath}), e); - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName() - */ - public String getName() { - return fArchivePath; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType() - */ - public ISourceContainerType getType() { - return getSourceContainerType(TYPE_ID); - } - - /** - * Returns whether root paths are automatically detected in this - * archive source container. - * - * @return whether root paths are automatically detected in this - * archive source container - */ - public boolean isDetectRoot() { - return fDetectRoots; - } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return obj instanceof ExternalArchiveSourceContainer && - ((ExternalArchiveSourceContainer)obj).getName().equals(getName()); - } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getName().hashCode(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose() - */ - public void dispose() { - super.dispose(); - if (fPotentialRoots != null) { - fPotentialRoots.clear(); - } - fRoots.clear(); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/FolderSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/FolderSourceContainer.java deleted file mode 100644 index d43b9e289..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/FolderSourceContainer.java +++ /dev/null @@ -1,51 +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.core.sourcelookup.containers; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; - -/** - * A folder in the workspace. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class FolderSourceContainer extends ContainerSourceContainer { - - /** - * Unique identifier for the folder source container type - * (value org.eclipse.debug.core.containerType.folder). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.folder"; //$NON-NLS-1$ - - - /** - * Constructs a source container on the given folder. - * - * @param folder the folder to search for source in - * @param subfolders whether to search nested folders - */ - public FolderSourceContainer(IContainer folder, boolean subfolders) { - super(folder, subfolders); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType() - */ - public ISourceContainerType getType() { - return getSourceContainerType(TYPE_ID); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/LocalFileStorage.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/LocalFileStorage.java deleted file mode 100644 index 454c06a54..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/LocalFileStorage.java +++ /dev/null @@ -1,123 +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.core.sourcelookup.containers; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; - -/** - * Implementation of storage for a local file - * (java.io.File). - *

                            - * This class may be instantiated. - *

                            - * @see IStorage - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class LocalFileStorage extends PlatformObject implements IStorage { - - /** - * The file this storage refers to. - */ - private File fFile; - - /** - * Constructs and returns storage for the given file. - * - * @param file a local file - */ - public LocalFileStorage(File file){ - setFile(file); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getContents() - */ - public InputStream getContents() throws CoreException { - try { - return new FileInputStream(getFile()); - } catch (IOException e){ - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, SourceLookupMessages.LocalFileStorage_0, e)); - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getFullPath() - */ - public IPath getFullPath() { - try { - return new Path(getFile().getCanonicalPath()); - } catch (IOException e) { - DebugPlugin.log(e); - return null; - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getName() - */ - public String getName() { - return getFile().getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - /** - * Sets the file associated with this storage - * - * @param file a local file - */ - private void setFile(File file) { - fFile = file; - } - - /** - * Returns the file associated with this storage - * - * @return file - */ - public File getFile() { - return fFile; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object object) { - return object instanceof LocalFileStorage && - getFile().equals(((LocalFileStorage)object).getFile()); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getFile().hashCode(); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java deleted file mode 100644 index be8f9ddb3..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java +++ /dev/null @@ -1,128 +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 - * Mikhail Khodjaiants, QNX - Bug 110227: Possible infinite loop in ProjectSourceContainer - *******************************************************************************/ -package org.eclipse.debug.core.sourcelookup.containers; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; - -/** - * A project in the workspace. Source is searched for in the root project - * folder and all folders within the project recursively. Optionally, - * referenced projects may be searched as well. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class ProjectSourceContainer extends ContainerSourceContainer { - - boolean fReferencedProjects=false; - /** - * Unique identifier for the project source container type - * (value org.eclipse.debug.core.containerType.project). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.project"; //$NON-NLS-1$ - - /** - * Constructs a project source container. - * - * @param project the project to search for source in - * @param referenced whether referenced projects should be considered - */ - public ProjectSourceContainer(IProject project, boolean referenced) { - super(project, true); - fReferencedProjects = referenced; - } - - /** - * Returns whether referenced projects are considered. - * - * @return whether referenced projects are considered - */ - public boolean isSearchReferencedProjects() { - return fReferencedProjects; - } - - /** - * Returns the project this source container references. - * - * @return the project this source container references - */ - public IProject getProject() { - return (IProject) getContainer(); - } - - /* (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.ISourceContainer#isComposite() - */ - public boolean isComposite() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers() - */ - protected ISourceContainer[] createSourceContainers() throws CoreException { - if (getProject().isOpen()) { - if (isSearchReferencedProjects()) { - IProject project = getProject(); - IProject[] projects = getAllReferencedProjects(project); - ISourceContainer[] folders = super.createSourceContainers(); - List all = new ArrayList(folders.length + projects.length); - for (int i = 0; i < folders.length; i++) { - all.add(folders[i]); - } - for (int i = 0; i < projects.length; i++) { - if (project.exists() && project.isOpen()) { - ProjectSourceContainer container = new ProjectSourceContainer(projects[i], false); - container.init(getDirector()); - all.add(container); - } - } - return (ISourceContainer[]) all.toArray(new ISourceContainer[all.size()]); - } - return super.createSourceContainers(); - } - return new ISourceContainer[0]; - } - - private IProject[] getAllReferencedProjects(IProject project) throws CoreException { - Set all = new HashSet(); - getAllReferencedProjects(all, project); - return (IProject[]) all.toArray(new IProject[all.size()]); - } - - private void getAllReferencedProjects(Set all, IProject project) throws CoreException { - IProject[] refs = project.getReferencedProjects(); - for (int i = 0; i < refs.length; i++) { - if (!all.contains(refs[i]) && refs[i].exists() && refs[i].isOpen()) { - all.add(refs[i]); - getAllReferencedProjects(all, refs[i]); - } - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/WorkspaceSourceContainer.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/WorkspaceSourceContainer.java deleted file mode 100644 index 9bed84fb7..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/WorkspaceSourceContainer.java +++ /dev/null @@ -1,82 +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.core.sourcelookup.containers; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; - -/** - * All projects in the workspace. - *

                            - * Clients may instantiate this class. - *

                            - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class WorkspaceSourceContainer extends CompositeSourceContainer { - - /** - * Unique identifier for the workspace source container type - * (value org.eclipse.debug.core.containerType.workspace). - */ - public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.workspace"; //$NON-NLS-1$ - - public WorkspaceSourceContainer() { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName() - */ - public String getName() { - return SourceLookupMessages.WorkspaceSourceContainer_0; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return obj instanceof WorkspaceSourceContainer; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return ResourcesPlugin.getWorkspace().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 { - IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); - ISourceContainer[] containers = new ISourceContainer[projects.length]; - for (int i = 0; i < projects.length; i++) { - ISourceContainer container = new ProjectSourceContainer(projects[i], false); - container.init(getDirector()); - containers[i] = container; - } - return containers; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ZipEntryStorage.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ZipEntryStorage.java deleted file mode 100644 index 205d91566..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ZipEntryStorage.java +++ /dev/null @@ -1,152 +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.core.sourcelookup.containers; - - -import java.io.IOException; -import java.io.InputStream; -import java.util.zip.ZipEntry; -import java.util.zip.ZipFile; - -import org.eclipse.core.resources.IStorage; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; - -/** - * Storage implementation for zip entries. - *

                            - * This class may be instantiated. - *

                            - * @see IStorage - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class ZipEntryStorage extends PlatformObject implements IStorage { - - /** - * Zip file associated with zip entry - */ - private ZipFile fArchive; - - /** - * Zip entry - */ - private ZipEntry fZipEntry; - - /** - * Constructs a new storage implementation for the - * given zip entry in the specified zip file - * - * @param archive zip file - * @param entry zip entry - */ - public ZipEntryStorage(ZipFile archive, ZipEntry entry) { - setArchive(archive); - setZipEntry(entry); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getContents() - */ - public InputStream getContents() throws CoreException { - try { - return getArchive().getInputStream(getZipEntry()); - } catch (IOException e) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, SourceLookupMessages.ZipEntryStorage_0, e)); - } - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getFullPath() - */ - public IPath getFullPath() { - return new Path(getArchive().getName()).append(getZipEntry().getName()); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#getName() - */ - public String getName() { - int index = getZipEntry().getName().lastIndexOf('\\'); - if (index == -1) { - index = getZipEntry().getName().lastIndexOf('/'); - } - if (index == -1) { - return getZipEntry().getName(); - } - return getZipEntry().getName().substring(index + 1); - } - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IStorage#isReadOnly() - */ - public boolean isReadOnly() { - return true; - } - - /** - * Sets the archive containing the zip entry. - * - * @param archive a zip file - */ - private void setArchive(ZipFile archive) { - fArchive = archive; - } - - /** - * Returns the archive containing the zip entry. - * - * @return zip file - */ - public ZipFile getArchive() { - return fArchive; - } - - /** - * Sets the entry that contains the source. - * - * @param entry the entry that contains the source - */ - private void setZipEntry(ZipEntry entry) { - fZipEntry = entry; - } - - /** - * Returns the entry that contains the source - * - * @return zip entry - */ - public ZipEntry getZipEntry() { - return fZipEntry; - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object object) { - return object instanceof ZipEntryStorage && - getArchive().equals(((ZipEntryStorage)object).getArchive()) && - getZipEntry().getName().equals(((ZipEntryStorage)object).getZipEntry().getName()); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getZipEntry().getName().hashCode(); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/package.html deleted file mode 100644 index 7125fb5a2..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/package.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -Eclipse Debug Platform - - - - -

                            Provides implementations of common source containers supporting source lookup.

                            - -

                            Package Specification

                            - -

                            This package provides implementations of common source containers, such as - archives, folders, and projects.

                            - -
                             
                            - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/package.html b/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/package.html deleted file mode 100644 index 8866be6cc..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -Eclipse Debug Platform - - - - -

                            Provides support for source lookup.

                            - -

                            Package Specification

                            - -

                            This package provides classes and interfaces to support source lookup. A source - lookup director is a persistable source locator that directs source lookup among - a collection of source lookup participants and a collection of source containers. - Each source lookup participant is a source locator itself, which allows more - than one source locator to participate in source lookup for a launch. Each source - lookup participant searches for source in the source containers managed by its - director, and each participant is notified of changes in the set of source containers - being searched.

                            -

                            A source lookup participant participates in source lookup by searching an ordered - list of source containers for source elements corresponding to a debug artifact. - For example, a participant may be asked to find source corresponding to a stack - frame or breakpoint. An implementation of a source lookup participant is debug - model specific, since it must convert the debug model artifact (stack frame, - breakpoint, etc.), into a source name that can be recognized by a source container, - to search for source elements. Source containers are generally debug model independent, - whereas source lookup participants are debug model specific.

                            - -
                             
                            - - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointImportParticipantDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointImportParticipantDelegate.java deleted file mode 100644 index 6bd2824e2..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointImportParticipantDelegate.java +++ /dev/null @@ -1,76 +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.core; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.debug.core.model.IBreakpointImportParticipant; - -/** - * Proxy to a breakpointImportParticipant extension. - * Client can contribute participant through the breakpointImportParticipant extension point - * - * Example contribution: - *
                            - * 
                            -      
                            -      
                            -   
                            - * 
                            - * - * @noextend This class is not intended to be subclassed by clients. - * @noinstantiate This class is not intended to be instantiated by clients. - * - * @since 3.5 - */ -public class BreakpointImportParticipantDelegate { - - /** - * The configuration element for this delegate - */ - private IConfigurationElement fElement = null; - private IBreakpointImportParticipant fParticipant = null; - - /** - * Constructor - * @param element the element this proxy is created on - */ - public BreakpointImportParticipantDelegate(IConfigurationElement element) { - fElement = element; - } - - /** - * Returns the {@link IBreakpointImportParticipant} delegate or null of there was - * a problem loading the delegate - * - * @return the {@link IBreakpointImportParticipant} or null - * @throws CoreException - */ - public IBreakpointImportParticipant getDelegate() throws CoreException { - if(fParticipant == null) { - fParticipant = (IBreakpointImportParticipant) fElement.createExecutableExtension(IConfigurationElementConstants.PARTICIPANT); - } - return fParticipant; - } - - /** - * Returns the marker type this participant is registered for. - * - * @return the marker type this participant is registered for - * @throws CoreException - */ - public String getType() throws CoreException { - return fElement.getAttribute(IConfigurationElementConstants.TYPE); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java deleted file mode 100644 index a369fad3e..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java +++ /dev/null @@ -1,1192 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.util.ArrayList; -import java.util.Enumeration; -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.Vector; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -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.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointListener; -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.debug.core.model.IBreakpointImportParticipant; - -import com.ibm.icu.text.MessageFormat; - -/** - * The breakpoint manager manages all registered breakpoints - * for the debug plug-in. It is instantiated by the debug plug-in at startup. - * - * @see IBreakpointManager - */ -public class BreakpointManager implements IBreakpointManager, IResourceChangeListener { - - /** - * Constants for breakpoint add/remove/change updates - */ - private final static int ADDED = 0; - private final static int REMOVED = 1; - private final static int CHANGED = 2; - - /** - * A collection of breakpoints registered with this manager. - */ - private Vector fBreakpoints= null; - - /** - * Map of breakpoint import participants. - * Map has the form: - *
                            Map(String - markerid, List of {@link IBreakpointImportParticipantDelegate})
                            - */ - private HashMap fImportParticipants = null; - - /** - * A system default import participant that performs legacy comparison support - * when no participants are provided for a given type. - * - * @since 3.5 - */ - private IBreakpointImportParticipant fDefaultParticipant = null; - - /** - * A collection of breakpoint markers that have received a POST_CHANGE notification - * that they have changed before a POST_BUILD notification of add. This allows us - * to tell if a marker has been created & changed since the breakpoint has been - * registered (see bug 138473). - */ - private Set fPostChangMarkersChanged = new HashSet(); - - /** - * A collection of breakpoint markers that have received a POST_BUILD notification - * of being added. - */ - private Set fPostBuildMarkersAdded = new HashSet(); - - /** - * Collection of breakpoints being added currently. Used to - * suppress change notification of "REGISTERED" attribute when - * being added. - */ - private List fSuppressChange = new ArrayList(); - - /** - * A table of breakpoint extension points, keyed by - * marker type - * key: a marker type - * value: the breakpoint extension which corresponds to that marker type - */ - private HashMap fBreakpointExtensions; - - /** - * Collection of markers that associates markers to breakpoints - * key: a marker - * value: the breakpoint which contains that marker - */ - private HashMap fMarkersToBreakpoints; - - /** - * Collection of breakpoint listeners. - */ - private ListenerList fBreakpointListeners= new ListenerList(); - - /** - * Collection of (plural) breakpoint listeners. - */ - private ListenerList fBreakpointsListeners= new ListenerList(); - - /** - * Singleton resource delta visitor which handles marker - * additions, changes, and removals. - */ - private static BreakpointManagerVisitor fgVisitor; - - /** - * Collection of breakpoint manager listeners which are - * notified when this manager's state changes. - */ - private ListenerList fBreakpointManagerListeners= new ListenerList(); - - /** - * Listens to POST_CHANGE notifications of breakpoint markers to detect when - * a breakpoint is added & changed before the POST_BUILD add notification is - * sent. - */ - class PostChangeListener implements IResourceChangeListener { - - private PostChangeVisitor fVisitor = new PostChangeVisitor(); - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta= event.getDelta(); - if (delta != null) { - try { - delta.accept(fVisitor); - } catch (CoreException ce) { - DebugPlugin.log(ce); - } - } - } - - } - - /** - * Default implementation of a breakpoint import participant - * - * @since 3.5 - */ - class DefaultImportParticipant implements IBreakpointImportParticipant { - - public boolean matches(Map attributes, IBreakpoint breakpoint) throws CoreException { - //perform legacy comparison - IMarker marker = breakpoint.getMarker(); - String type = (String) attributes.get("type"); //$NON-NLS-1$ - Integer line = (Integer) attributes.get(IMarker.LINE_NUMBER); - Object localline = marker.getAttribute(IMarker.LINE_NUMBER); - String localtype = marker.getType(); - if (type.equals(localtype)) { - if(line != null && line.equals(localline)) { - return true; - } - else if(line == null) { - return true; - } - } - return false; - } - public void verify(IBreakpoint breakpoint) throws CoreException {} - } - - /** - * The listener - */ - private PostChangeListener fPostChangeListener = new PostChangeListener(); - - class PostChangeVisitor implements IResourceDeltaVisitor { - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta) - */ - public boolean visit(IResourceDelta delta) throws CoreException { - if (delta == null) { - return false; - } - IMarkerDelta[] markerDeltas= delta.getMarkerDeltas(); - for (int i= 0; i < markerDeltas.length; i++) { - IMarkerDelta markerDelta= markerDeltas[i]; - if (markerDelta.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) { - switch (markerDelta.getKind()) { - case IResourceDelta.ADDED : - break; - case IResourceDelta.REMOVED : - break; - case IResourceDelta.CHANGED : - IMarker marker = markerDelta.getMarker(); - synchronized (fPostChangMarkersChanged) { - if (!fPostBuildMarkersAdded.contains(marker)) { - fPostChangMarkersChanged.add(marker); - } - } - break; - } - } - } - return true; - } - - } - - /** - * Constructs a new breakpoint manager. - */ - public BreakpointManager() { - fMarkersToBreakpoints= new HashMap(10); - fBreakpointExtensions= new HashMap(15); - } - - /** - * Loads all the breakpoints on the given resource. - * - * @param resource the resource which contains the breakpoints - * @param notify whether to notify of the breakpoint additions - */ - private void loadBreakpoints(IResource resource, boolean notify) throws CoreException { - initBreakpointExtensions(); - IMarker[] markers= getPersistedMarkers(resource); - List added = new ArrayList(); - for (int i = 0; i < markers.length; i++) { - IMarker marker= markers[i]; - try { - IBreakpoint breakpoint = createBreakpoint(marker); - synchronized (fPostChangMarkersChanged) { - fPostBuildMarkersAdded.add(marker); - } - if (breakpoint.isRegistered()) { - added.add(breakpoint); - } - } catch (DebugException e) { - DebugPlugin.log(e); - } - } - addBreakpoints((IBreakpoint[])added.toArray(new IBreakpoint[added.size()]), notify); - } - - /** - * Returns the persisted markers associated with the given resource. - * - * Delete any invalid breakpoint markers. This is done at startup rather - * than shutdown, since the changes made at shutdown are not persisted as - * the workspace state has already been saved. See bug 7683. - * - * Since the TRANSIENT marker attribute/feature has been added, - * we no longer have to manually delete non-persisted markers - the platform - * does this for us (at shutdown, transient markers are not saved). However, - * the code is still present to delete non-persisted markers from old - * workspaces. - */ - protected IMarker[] getPersistedMarkers(IResource resource) throws CoreException { - IMarker[] markers= resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE); - final List delete = new ArrayList(); - List persisted= new ArrayList(); - for (int i = 0; i < markers.length; i++) { - IMarker marker= markers[i]; - // ensure the marker has a valid model identifier attribute - // and delete the breakpoint if not - String modelId = marker.getAttribute(IBreakpoint.ID, null); - if (modelId == null) { - // marker with old/invalid format - delete - delete.add(marker); - } else if (!marker.getAttribute(IBreakpoint.PERSISTED, true)) { - // the breakpoint is marked as not to be persisted, - // schedule for deletion - delete.add(marker); - } else { - persisted.add(marker); - } - } - // delete any markers that are not to be restored - if (!delete.isEmpty()) { - final IMarker[] delMarkers = (IMarker[])delete.toArray(new IMarker[delete.size()]); - IWorkspaceRunnable wr = new IWorkspaceRunnable() { - public void run(IProgressMonitor pm) throws CoreException { - for (int i = 0; i < delMarkers.length; i++) { - IMarker marker = delMarkers[i]; - marker.delete(); - } - } - }; - new BreakpointManagerJob(wr).schedule(); - } - return (IMarker[])persisted.toArray(new IMarker[persisted.size()]); - } - - /** - * Removes this manager as a resource change listener - * and removes all breakpoint listeners. - */ - public void shutdown() { - getWorkspace().removeResourceChangeListener(this); - getWorkspace().removeResourceChangeListener(fPostChangeListener); - fBreakpointListeners = null; - fBreakpointsListeners = null; - fBreakpointManagerListeners = null; - if(fImportParticipants != null) { - fImportParticipants.clear(); - fImportParticipants = null; - fDefaultParticipant = null; - } - } - - /** - * Find the defined breakpoint extensions and cache them for use in recreating - * breakpoints from markers. - */ - private void initBreakpointExtensions() { - IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_BREAKPOINTS); - IConfigurationElement[] elements = ep.getConfigurationElements(); - for (int i= 0; i < elements.length; i++) { - String markerType = elements[i].getAttribute(IConfigurationElementConstants.MARKER_TYPE); - String className = elements[i].getAttribute(IConfigurationElementConstants.CLASS); - if (markerType == null) { - DebugPlugin.log(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "Breakpoint extension " + elements[i].getDeclaringExtension().getUniqueIdentifier() + " missing required attribute: markerType", null)); //$NON-NLS-1$ //$NON-NLS-2$ - } else if (className == null){ - DebugPlugin.log(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "Breakpoint extension " + elements[i].getDeclaringExtension().getUniqueIdentifier() + " missing required attribute: class", null)); //$NON-NLS-1$ //$NON-NLS-2$ - } else { - fBreakpointExtensions.put(markerType, elements[i]); - } - } - } - - /** - * Convenience method to get the workspace - */ - private IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); - } - - /** - * @see IBreakpointManager#getBreakpoint(IMarker) - */ - public IBreakpoint getBreakpoint(IMarker marker) { - // ensure that breakpoints are initialized - getBreakpoints0(); - return (IBreakpoint)fMarkersToBreakpoints.get(marker); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#getBreakpoints() - */ - public IBreakpoint[] getBreakpoints() { - IBreakpoint[] temp = new IBreakpoint[0]; - Vector breakpoints = getBreakpoints0(); - synchronized (breakpoints) { - temp = new IBreakpoint[breakpoints.size()]; - breakpoints.copyInto(temp); - } - return temp; - } - - /** - * The BreakpointManager waits to load the breakpoints - * of the workspace until a request is made to retrieve the - * breakpoints. - */ - private synchronized Vector getBreakpoints0() { - if (fBreakpoints == null) { - initializeBreakpoints(); - } - return fBreakpoints; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#getBreakpoints(java.lang.String) - */ - public IBreakpoint[] getBreakpoints(String modelIdentifier) { - Vector allBreakpoints= getBreakpoints0(); - synchronized (allBreakpoints) { - ArrayList temp = new ArrayList(allBreakpoints.size()); - Iterator breakpoints= allBreakpoints.iterator(); - while (breakpoints.hasNext()) { - IBreakpoint breakpoint= (IBreakpoint) breakpoints.next(); - String id= breakpoint.getModelIdentifier(); - if (id != null && id.equals(modelIdentifier)) { - temp.add(breakpoint); - } - } - return (IBreakpoint[]) temp.toArray(new IBreakpoint[temp.size()]); - } - } - - /** - * Loads the list of breakpoints from the breakpoint markers in the - * workspace. Start listening to resource deltas. - */ - private void initializeBreakpoints() { - setBreakpoints(new Vector(10)); - try { - loadBreakpoints(getWorkspace().getRoot(), false); - getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD); - getWorkspace().addResourceChangeListener(fPostChangeListener, IResourceChangeEvent.POST_CHANGE); - } catch (CoreException ce) { - DebugPlugin.log(ce); - setBreakpoints(new Vector(0)); - } - } - - /** - * @see IBreakpointManager#isRegistered(IBreakpoint) - */ - public boolean isRegistered(IBreakpoint breakpoint) { - return getBreakpoints0().contains(breakpoint); - } - - - /** - * @see IBreakpointManager#removeBreakpoint(IBreakpoint, boolean) - */ - public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException { - removeBreakpoints(new IBreakpoint[]{breakpoint}, delete); - } - - /** - * @see IBreakpointManager#removeBreakpoints(IBreakpoint[], boolean) - */ - public void removeBreakpoints(IBreakpoint[] breakpoints, final boolean delete) throws CoreException { - final List remove = new ArrayList(breakpoints.length); - for (int i = 0; i < breakpoints.length; i++) { - IBreakpoint breakpoint = breakpoints[i]; - if (getBreakpoints0().contains(breakpoint)) { - remove.add(breakpoint); - } - } - if (!remove.isEmpty()) { - Iterator iter = remove.iterator(); - while (iter.hasNext()) { - IBreakpoint breakpoint = (IBreakpoint)iter.next(); - getBreakpoints0().remove(breakpoint); - fMarkersToBreakpoints.remove(breakpoint.getMarker()); - } - fireUpdate(remove, null, REMOVED); - IWorkspaceRunnable r = new IWorkspaceRunnable() { - public void run(IProgressMonitor montitor) throws CoreException { - Iterator innerIter = remove.iterator(); - while (innerIter.hasNext()) { - IBreakpoint breakpoint = (IBreakpoint)innerIter.next(); - if (delete) { - breakpoint.delete(); - } else { - // if the breakpoint is being removed from the manager - // because the project is closing, the breakpoint should - // remain as registered, otherwise, the breakpoint should - // be marked as unregistered - IMarker marker = breakpoint.getMarker(); - if (marker.exists()) { - IProject project = breakpoint.getMarker().getResource().getProject(); - if (project == null || project.isOpen()) { - breakpoint.setRegistered(false); - } - } - } - } - } - }; - getWorkspace().run(r, null, 0, null); - } - } - - /** - * Create a breakpoint for the given marker. The created breakpoint - * is of the type specified in the breakpoint extension associated - * with the given marker type. - * - * @param marker marker to create a breakpoint for - * @return a breakpoint on this marker - * @exception DebugException if breakpoint creation fails. Reasons for - * failure include: - *
                              - *
                            1. The breakpoint manager cannot determine what kind of breakpoint - * to instantiate for the given marker type
                            2. - *
                            3. A lower level exception occurred while accessing the given marker
                            4. - *
                            - */ - public IBreakpoint createBreakpoint(IMarker marker) throws DebugException { - IBreakpoint breakpoint= (IBreakpoint) fMarkersToBreakpoints.get(marker); - if (breakpoint != null) { - return breakpoint; - } - try { - IConfigurationElement config = (IConfigurationElement)fBreakpointExtensions.get(marker.getType()); - if (config == null) { - throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.CONFIGURATION_INVALID, MessageFormat.format(DebugCoreMessages.BreakpointManager_Missing_breakpoint_definition, new String[] {marker.getType()}), null)); - } - Object object = config.createExecutableExtension(IConfigurationElementConstants.CLASS); - if (object instanceof IBreakpoint) { - breakpoint = (IBreakpoint)object; - breakpoint.setMarker(marker); - } else { - DebugPlugin.log(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "Breakpoint extension " + config.getDeclaringExtension().getUniqueIdentifier() + " missing required attribute: class", null)); //$NON-NLS-1$ //$NON-NLS-2$ - } - return breakpoint; - } catch (CoreException e) { - throw new DebugException(e.getStatus()); - } - } - - /** - * @see IBreakpointManager#addBreakpoint(IBreakpoint) - */ - public void addBreakpoint(IBreakpoint breakpoint) throws CoreException { - addBreakpoints(new IBreakpoint[]{breakpoint}); - } - - /** - * @see IBreakpointManager#addBreakpoints(IBreakpoint[]) - */ - public void addBreakpoints(IBreakpoint[] breakpoints) throws CoreException { - addBreakpoints(breakpoints, true); - } - - /** - * Registers the given breakpoints and notifies listeners if specified. - * - * @param breakpoints the breakpoints to register - * @param notify whether to notify listeners of the add - * @param loading whether the given breakpoints are being automatically loaded - * from previously persisted markers - */ - private void addBreakpoints(IBreakpoint[] breakpoints, boolean notify) throws CoreException { - List added = new ArrayList(breakpoints.length); - final List update = new ArrayList(); - for (int i = 0; i < breakpoints.length; i++) { - IBreakpoint breakpoint = breakpoints[i]; - if (!getBreakpoints0().contains(breakpoint)) { - verifyBreakpoint(breakpoint); - if (breakpoint.isRegistered()) { - // If notify == false, the breakpoints are just being added at startup - added.add(breakpoint); - getBreakpoints0().add(breakpoint); - fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint); - } else { - // need to update the 'registered' and/or 'group' attributes - update.add(breakpoint); - } - } - } - if (notify) { - fireUpdate(added, null, ADDED); - } - if (!update.isEmpty()) { - IWorkspaceRunnable r = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - Iterator iter = update.iterator(); - while (iter.hasNext()) { - IBreakpoint breakpoint = (IBreakpoint)iter.next(); - getBreakpoints0().add(breakpoint); - breakpoint.setRegistered(true); - fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint); - } - } - }; - // Need to suppress change notification, since this is really - // an add notification - fSuppressChange.addAll(update); - getWorkspace().run(r, null, 0, null); - fSuppressChange.removeAll(update); - if (notify) { - fireUpdate(update, null, ADDED); - } - } - } - - /** - * Returns whether change notification is to be suppressed for the given breakpoint. - * Used when adding breakpoints and changing the "REGISTERED" attribute. - * - * @param breakpoint - * @return boolean whether change notification is suppressed - */ - protected boolean isChangeSuppressed(IBreakpoint breakpoint) { - return fSuppressChange.contains(breakpoint); - } - - /** - * @see IBreakpointManager#fireBreakpointChanged(IBreakpoint) - */ - public void fireBreakpointChanged(IBreakpoint breakpoint) { - if (getBreakpoints0().contains(breakpoint)) { - List changed = new ArrayList(); - changed.add(breakpoint); - fireUpdate(changed, null, CHANGED); - } - } - - /** - * Verifies that the breakpoint marker has the minimal required attributes, - * and throws a debug exception if not. - */ - private void verifyBreakpoint(IBreakpoint breakpoint) throws DebugException { - try { - String id= breakpoint.getModelIdentifier(); - if (id == null) { - throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.CONFIGURATION_INVALID, DebugCoreMessages.BreakpointManager_Missing_model_identifier, null)); - } - } catch (CoreException e) { - throw new DebugException(e.getStatus()); - } - } - - /** - * A resource has changed. Traverses the delta for breakpoint changes. - * - * @param event resource change event - */ - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta= event.getDelta(); - if (delta != null) { - try { - if (fgVisitor == null) { - fgVisitor= new BreakpointManagerVisitor(); - } - delta.accept(fgVisitor); - fgVisitor.update(); - } catch (CoreException ce) { - DebugPlugin.log(ce); - } - } - } - - /** - * Visitor for handling resource deltas - */ - class BreakpointManagerVisitor implements IResourceDeltaVisitor { - /** - * Moved markers - */ - private List fMoved = new ArrayList(); - /** - * Removed breakpoints - */ - private List fRemoved = new ArrayList(); - /** - * Changed breakpoints and associated marker deltas - */ - private List fChanged = new ArrayList(); - private List fChangedDeltas = new ArrayList(); - - /** - * Resets the visitor for a delta traversal - empties - * collections of removed/changed breakpoints. - */ - protected void reset() { - fMoved.clear(); - fRemoved.clear(); - fChanged.clear(); - fChangedDeltas.clear(); - } - - /** - * Performs updates on accumulated changes, and fires change notification after - * a traversal. Accumulated updates are reset. - */ - public void update() { - if (!fMoved.isEmpty()) { - // delete moved markers - IWorkspaceRunnable wRunnable= new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - IMarker[] markers = (IMarker[])fMoved.toArray(new IMarker[fMoved.size()]); - for (int i = 0; i < markers.length; i++) { - markers[i].delete(); - } - } - }; - try { - getWorkspace().run(wRunnable, null, 0, null); - } catch (CoreException e) { - } - } - if (!fRemoved.isEmpty()) { - try { - removeBreakpoints((IBreakpoint[])fRemoved.toArray(new IBreakpoint[fRemoved.size()]), false); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - if (!fChanged.isEmpty()) { - fireUpdate(fChanged, fChangedDeltas, CHANGED); - } - reset(); - } - - /** - * @see IResourceDeltaVisitor#visit(IResourceDelta) - */ - public boolean visit(IResourceDelta delta) { - if (delta == null) { - return false; - } - if (0 != (delta.getFlags() & IResourceDelta.OPEN) && 0 == (delta.getFlags() & IResourceDelta.MOVED_FROM)) { - handleProjectResourceOpenStateChange(delta.getResource()); - return false; - } - IMarkerDelta[] markerDeltas= delta.getMarkerDeltas(); - for (int i= 0; i < markerDeltas.length; i++) { - IMarkerDelta markerDelta= markerDeltas[i]; - if (markerDelta.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) { - switch (markerDelta.getKind()) { - case IResourceDelta.ADDED : - handleAddBreakpoint(delta, markerDelta.getMarker(), markerDelta); - break; - case IResourceDelta.REMOVED : - handleRemoveBreakpoint(markerDelta.getMarker()); - break; - case IResourceDelta.CHANGED : - handleChangeBreakpoint(markerDelta.getMarker(), markerDelta); - break; - } - } - } - - return true; - } - - /** - * Wrapper for handling adds - */ - protected void handleAddBreakpoint(IResourceDelta rDelta, IMarker marker, IMarkerDelta mDelta) { - if (0 != (rDelta.getFlags() & IResourceDelta.MOVED_FROM)) { - // This breakpoint has actually been moved - already removed - // from the Breakpoint manager during the remove callback. - // Schedule the marker associated with the new resource for deletion. - if (getBreakpoint(marker) == null) { - fMoved.add(marker); - } - } else { - // check if the an add & change have be combined into one add notification - synchronized (fPostChangMarkersChanged) { - if (fPostChangMarkersChanged.contains(marker)) { - handleChangeBreakpoint(marker, mDelta); - fPostChangMarkersChanged.remove(marker); - } - fPostBuildMarkersAdded.add(marker); - } - } - } - - /** - * Wrapper for handling removes - */ - protected void handleRemoveBreakpoint(IMarker marker) { - synchronized (fPostChangMarkersChanged) { - fPostChangMarkersChanged.remove(marker); - fPostBuildMarkersAdded.remove(marker); - } - IBreakpoint breakpoint= getBreakpoint(marker); - if (breakpoint != null) { - fRemoved.add(breakpoint); - } - } - - /** - * Wrapper for handling changes - */ - protected void handleChangeBreakpoint(IMarker marker, IMarkerDelta delta) { - IBreakpoint breakpoint= getBreakpoint(marker); - if (breakpoint != null && isRegistered(breakpoint) && !isChangeSuppressed(breakpoint)) { - fChanged.add(breakpoint); - fChangedDeltas.add(delta); - } - } - - /** - * A project has been opened or closed. Updates the breakpoints for - * that project - */ - private void handleProjectResourceOpenStateChange(final IResource project) { - if (!project.isAccessible()) { - //closed - Enumeration breakpoints= ((Vector)getBreakpoints0().clone()).elements(); - while (breakpoints.hasMoreElements()) { - IBreakpoint breakpoint= (IBreakpoint) breakpoints.nextElement(); - IResource markerResource= breakpoint.getMarker().getResource(); - if (project.getFullPath().isPrefixOf(markerResource.getFullPath())) { - fRemoved.add(breakpoint); - } - } - return; - } - try { - loadBreakpoints(project, true); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - } - - /** - * @see IBreakpointManager#addBreakpointListener(IBreakpointListener) - */ - public void addBreakpointListener(IBreakpointListener listener) { - fBreakpointListeners.add(listener); - } - - /** - * @see IBreakpointManager#removeBreakpointListener(IBreakpointListener) - */ - public void removeBreakpointListener(IBreakpointListener listener) { - fBreakpointListeners.remove(listener); - } - - /** - * Notifies listeners of the adds/removes/changes - * - * @param breakpoints associated breakpoints - * @param deltas or null - * @param update type of change - */ - private void fireUpdate(List breakpoints, List deltas, int update) { - if (breakpoints.isEmpty()) { - return; - } - IBreakpoint[] bpArray = (IBreakpoint[])breakpoints.toArray(new IBreakpoint[breakpoints.size()]); - IMarkerDelta[] deltaArray = new IMarkerDelta[bpArray.length]; - if (deltas != null) { - deltaArray = (IMarkerDelta[])deltas.toArray(deltaArray); - } - // single listeners - getBreakpointNotifier().notify(bpArray, deltaArray, update); - - // plural listeners - getBreakpointsNotifier().notify(bpArray, deltaArray, update); - } - - protected void setBreakpoints(Vector breakpoints) { - fBreakpoints = breakpoints; - } - - /** - * @see IBreakpointManager#hasBreakpoints() - */ - public boolean hasBreakpoints() { - return !getBreakpoints0().isEmpty(); - } - - /** - * @see org.eclipse.debug.core.IBreakpointManager#addBreakpointListener(org.eclipse.debug.core.IBreakpointsListener) - */ - public void addBreakpointListener(IBreakpointsListener listener) { - fBreakpointsListeners.add(listener); - } - - /** - * @see org.eclipse.debug.core.IBreakpointManager#removeBreakpointListener(org.eclipse.debug.core.IBreakpointsListener) - */ - public void removeBreakpointListener(IBreakpointsListener listener) { - fBreakpointsListeners.remove(listener); - } - - private BreakpointNotifier getBreakpointNotifier() { - return new BreakpointNotifier(); - } - - /** - * Notifies breakpoint listener (single breakpoint) in a safe runnable to - * handle exceptions. - */ - class BreakpointNotifier implements ISafeRunnable { - - private IBreakpointListener fListener; - private int fType; - private IMarkerDelta fDelta; - private IBreakpoint fBreakpoint; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during breakpoint change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.breakpointAdded(fBreakpoint); - break; - case REMOVED: - fListener.breakpointRemoved(fBreakpoint, fDelta); - break; - case CHANGED: - fListener.breakpointChanged(fBreakpoint, fDelta); - break; - } - } - - /** - * Notifies the listeners of the add/change/remove - * - * @param breakpoints the breakpoints that changed - * @param deltas the deltas associated with the change - * @param update the type of change - */ - public void notify(IBreakpoint[] breakpoints, IMarkerDelta[] deltas, int update) { - fType = update; - Object[] copiedListeners= fBreakpointListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IBreakpointListener)copiedListeners[i]; - for (int j = 0; j < breakpoints.length; j++) { - fBreakpoint = breakpoints[j]; - fDelta = deltas[j]; - SafeRunner.run(this); - } - } - fListener = null; - fDelta = null; - fBreakpoint = null; - } - } - - private BreakpointsNotifier getBreakpointsNotifier() { - return new BreakpointsNotifier(); - } - - /** - * Notifies breakpoint listener (multiple breakpoints) in a safe runnable to - * handle exceptions. - */ - class BreakpointsNotifier implements ISafeRunnable { - - private IBreakpointsListener fListener; - private int fType; - private IMarkerDelta[] fDeltas; - private IBreakpoint[] fNotifierBreakpoints; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during breakpoint change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.breakpointsAdded(fNotifierBreakpoints); - break; - case REMOVED: - fListener.breakpointsRemoved(fNotifierBreakpoints, fDeltas); - break; - case CHANGED: - fListener.breakpointsChanged(fNotifierBreakpoints, fDeltas); - break; - } - } - - /** - * Notifies the listeners of the adds/changes/removes - * - * @param breakpoints the breakpoints that changed - * @param deltas the deltas associated with the changed breakpoints - * @param update the type of change - */ - public void notify(IBreakpoint[] breakpoints, IMarkerDelta[] deltas, int update) { - fType = update; - fNotifierBreakpoints = breakpoints; - fDeltas = deltas; - Object[] copiedListeners = fBreakpointsListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IBreakpointsListener)copiedListeners[i]; - SafeRunner.run(this); - } - fDeltas = null; - fNotifierBreakpoints = null; - fListener = null; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#isEnabled() - */ - public boolean isEnabled() { - return Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, true, null); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#setEnabled(boolean) - */ - public void setEnabled(final boolean enabled) { - if (isEnabled() != enabled) { - Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, enabled, null); - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - IBreakpoint[] breakpoints = getBreakpoints(); - for (int i = 0; i < breakpoints.length; i++) { - IBreakpoint breakpoint = breakpoints[i]; - // Touch the marker (but don't actually change anything) so that the icon in - // the editor ruler will be updated (editors listen to marker changes). - breakpoint.getMarker().setAttribute(IBreakpoint.ENABLED, breakpoint.isEnabled()); - } - } - }; - try { - ResourcesPlugin.getWorkspace().run(runnable, null, IWorkspace.AVOID_UPDATE ,null); - } catch (CoreException e) { - DebugPlugin.log(e); - } - new BreakpointManagerNotifier().notify(enabled); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#addBreakpointManagerListener(org.eclipse.debug.core.IBreakpointManagerListener) - */ - public void addBreakpointManagerListener(IBreakpointManagerListener listener) { - fBreakpointManagerListeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#removeBreakpointManagerListener(org.eclipse.debug.core.IBreakpointManagerListener) - */ - public void removeBreakpointManagerListener(IBreakpointManagerListener listener) { - fBreakpointManagerListeners.remove(listener); - } - - /** - * Notifies breakpoint manager listeners in a safe runnable to - * handle exceptions. - */ - class BreakpointManagerNotifier implements ISafeRunnable { - - private IBreakpointManagerListener fListener; - private boolean fManagerEnabled; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during breakpoint change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - fListener.breakpointManagerEnablementChanged(fManagerEnabled); - } - - /** - * Notifies the listeners of the enabled state change - * - * @param enabled whether the manager is enabled - */ - public void notify(boolean enabled) { - fManagerEnabled= enabled; - Object[] copiedListeners = fBreakpointManagerListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IBreakpointManagerListener)copiedListeners[i]; - SafeRunner.run(this); - } - fListener = null; - } - } - - class BreakpointManagerJob extends Job { - - private final IWorkspaceRunnable fRunnable; - - public BreakpointManagerJob (IWorkspaceRunnable wRunnable) { - super("breakpoint manager job"); //$NON-NLS-1$ - fRunnable= wRunnable; - setSystem(true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - protected IStatus run(IProgressMonitor monitor) { - try { - getWorkspace().run(fRunnable, null, 0, null); - } catch (CoreException ce) { - DebugPlugin.log(ce); - } - return new Status(IStatus.OK, DebugPlugin.getUniqueIdentifier(), IStatus.OK, "", null); //$NON-NLS-1$ - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#getTypeName(org.eclipse.debug.core.model.IBreakpoint) - */ - public String getTypeName(IBreakpoint breakpoint) { - String typeName= null; - IMarker marker = breakpoint.getMarker(); - if (marker != null) { - try { - IConfigurationElement element = (IConfigurationElement) fBreakpointExtensions.get(marker.getType()); - if (element != null) { - typeName= element.getAttribute(IConfigurationElementConstants.NAME); - } - } - catch (CoreException e) {} - } - return typeName; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointManager#getImportParticipants(java.lang.String) - */ - public IBreakpointImportParticipant[] getImportParticipants(String markertype) throws CoreException { - initializeImportParticipants(); - ArrayList list = (ArrayList) fImportParticipants.get(markertype); - if(list == null) { - return new IBreakpointImportParticipant[] {fDefaultParticipant}; - } - IBreakpointImportParticipant[] participants = new IBreakpointImportParticipant[list.size()]; - BreakpointImportParticipantDelegate delegate = null; - for(int i = 0; i < list.size(); i++) { - delegate = (BreakpointImportParticipantDelegate) list.get(i); - participants[i] = delegate.getDelegate(); - } - if(participants.length == 0) { - return new IBreakpointImportParticipant[] {fDefaultParticipant}; - } - return participants; - } - - /** - * Initializes the cache of breakpoint import participants. Does no work if the cache - * has already been initialized - */ - private synchronized void initializeImportParticipants() { - if(fImportParticipants == null) { - fImportParticipants = new HashMap(); - fDefaultParticipant = new DefaultImportParticipant(); - IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_BREAKPOINT_IMPORT_PARTICIPANTS); - IConfigurationElement[] elements = ep.getConfigurationElements(); - String type = null; - ArrayList list = null; - for(int i = 0; i < elements.length; i++) { - type = elements[i].getAttribute(IConfigurationElementConstants.TYPE); - if(type != null) { - list = (ArrayList) fImportParticipants.get(type); - if(list == null) { - list = new ArrayList(); - fImportParticipants.put(type, list); - } - list.add(new BreakpointImportParticipantDelegate(elements[i])); - } - } - } - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java deleted file mode 100644 index 452c06345..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.java +++ /dev/null @@ -1,141 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - -import org.eclipse.osgi.util.NLS; - -public class DebugCoreMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.debug.internal.core.DebugCoreMessages";//$NON-NLS-1$ - - public static String Breakpoint_no_associated_marker; - public static String BreakpointManager_Missing_breakpoint_definition; - public static String BreakpointManager_Missing_model_identifier; - public static String DebugEvent_illegal_detail; - public static String DebugEvent_illegal_kind; - - public static String DebugPlugin_0; - public static String DebugPlugin_1; - public static String DebugPlugin_2; - public static String DebugPlugin_3; - public static String DebugPlugin_4; - public static String DebugPlugin_5; - public static String DebugPlugin_6; - public static String DebugPlugin_7; - public static String DebugPlugin_8; - public static String DebugPlugin_Eclipse_runtime_does_not_support_working_directory_2; - - public static String EnvironmentVariableResolver_0; - - public static String LaunchConfiguration_0; - public static String LaunchConfiguration_11; - public static String LaunchConfiguration_13; - public static String LaunchConfiguration_14; - public static String LaunchConfiguration_16; - public static String LaunchConfiguration_17; - public static String LaunchConfiguration_18; - public static String LaunchConfiguration_19; - public static String LaunchConfiguration_2; - public static String LaunchConfiguration_3; - public static String LaunchConfiguration_4; - public static String LaunchConfiguration_5; - public static String LaunchConfiguration_6; - public static String LaunchConfiguration_7; - public static String LaunchConfiguration_8; - public static String LaunchConfiguration_9; - public static String LaunchConfigurationInfo_35; - public static String LaunchConfigurationType_0; - - public static String LaunchConfigurationType_1; - - public static String LaunchConfigurationType_2; - - public static String LaunchConfigurationType_7; - - public static String LaunchConfigurationWorkingCopy_0; - public static String LaunchConfigurationWorkingCopy_1; - public static String LaunchConfigurationWorkingCopy_2; - public static String LaunchConfigurationWorkingCopy_3; - - public static String LaunchDelegate_0; - public static String LaunchDelegate_1; - public static String LaunchDelegate_2; - public static String LaunchDelegate_3; - public static String LaunchManager_26; - public static String LaunchManager_27; - public static String LaunchManager_28; - public static String LaunchManager_29; - public static String LaunchManager_31; - - public static String LaunchMode_1; - - public static String LogicalStructureProvider_0; - - public static String LogicalStructureProvider_1; - - public static String LogicalStructureType_1; - public static String SystemPropertyResolver_0; - public static String InputStreamMonitor_label; - public static String Launch_terminate_failed; - public static String LaunchConfiguration_Failed_to_delete_launch_configuration__1; - public static String LaunchConfigurationDelegate_6; - public static String LaunchConfigurationDelegate_7; - - public static String LaunchConfigurationDelegate_scoped_incremental_build; - public static String LaunchConfigurationInfo_Attribute__0__is_not_of_type_boolean__3; - public static String LaunchConfigurationInfo_Attribute__0__is_not_of_type_int__2; - public static String LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_lang_String__1; - public static String LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_List__1; - public static String LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1; - public static String LaunchConfigurationInfo_Invalid_launch_configuration_XML__10; - public static String LaunchConfigurationInfo_missing_type; - public static String LaunchConfigurationInfo_36; - public static String LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1; - - public static String LaunchConfigurationWorkingCopy_4; - public static String LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2; - public static String LaunchConfigurationWorkingCopy_5; - - public static String LaunchConfigurationWorkingCopy_6; - - public static String LaunchConfigurationWorkingCopy_7; - - public static String LaunchConfigurationWorkingCopy_8; - public static String LaunchManager__0__occurred_while_reading_launch_configuration_file__1___1; - public static String LaunchManager_Invalid_launch_configuration_index__18; - public static String LaunchManager_does_not_exist; - - public static String LaunchManager_does_not_exist_no_store_found; - - public static String LaunchManager_invalid_config_name; - - public static String LaunchManager_invalid_config_name_char; - public static String LaunchManager_Source_locator_does_not_exist___0__13; - public static String LogicalStructureType_0; - public static String OutputStreamMonitor_label; - public static String ProcessMonitorJob_0; - public static String RuntimeProcess_terminate_failed; - public static String RuntimeProcess_Exit_value_not_available_until_process_terminates__1; - public static String WatchExpression_0; - public static String NullStreamsProxy_0; - - public static String RefreshingResources; - public static String RefreshingResourcesError; - - public static String RefreshUtil_0; - - public static String RefreshUtil_1; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, DebugCoreMessages.class); - } - public static String LaunchMode_0; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties deleted file mode 100644 index 1b96d0c4e..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugCoreMessages.properties +++ /dev/null @@ -1,112 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2010 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -Breakpoint_no_associated_marker=Breakpoint does not have an associated marker. -BreakpointManager_Missing_breakpoint_definition=Missing breakpoint definition for marker type {0} -BreakpointManager_Missing_model_identifier=Breakpoint missing debug model identifier -DebugEvent_illegal_detail=detail is not one of the allowed constants, see IDebugEventConstants -DebugEvent_illegal_kind=kind is not one of the allowed constants, see IDebugEventConstants -DebugPlugin_Eclipse_runtime_does_not_support_working_directory_2=Eclipse runtime does not support working directory -DebugPlugin_1=Debug Event Dispatch -DebugPlugin_0=Exception occurred executing command line. -DebugPlugin_2=Internal message logged from Debug Core: {0} -DebugPlugin_3=Error logged from Debug Core: -DebugPlugin_4=Invalid process factory extension contributed by {0}; id: {1} -DebugPlugin_5=Invalid status handler extension: {0} -DebugPlugin_6=An exception occurred in asynchronous runnable. -DebugPlugin_7=An exception occurred while filtering debug events. -DebugPlugin_8=An exception occurred while dispatching debug events. -EnvironmentVariableResolver_0=Environment variable not specified -SystemPropertyResolver_0=System property not specified -InputStreamMonitor_label=Input Stream Monitor -Launch_terminate_failed=Terminate failed -LaunchConfiguration_Failed_to_delete_launch_configuration__1=Failed to delete launch configuration. -LaunchConfiguration_9=Preparing launch delegate... -LaunchConfiguration_8=Performing pre-launch check... -LaunchConfiguration_7=Build before launch - -LaunchConfiguration_6=Performing required build... -LaunchConfiguration_5=Performing incremental workspace build... -LaunchConfiguration_4=Performing final launch validation... -LaunchConfiguration_3=Initializing source locator... -LaunchConfiguration_2=Launching delegate... -LaunchConfiguration_0=Launch configuration has corrupt resource mapping attributes -LaunchConfiguration_11=No launch delegate found - launch canceled -LaunchConfiguration_13=Duplicate launcher detected - launch canceled -LaunchConfiguration_14=Incompatible launch mode: expecting {0} instead of {1} -LaunchConfiguration_16=Exception occurred creating launch configuration memento -LaunchConfiguration_17=Exception occurred parsing memento -LaunchConfiguration_18=Invalid launch configuration memento: missing path attribute -LaunchConfiguration_19=Invalid launch configuration memento: missing local attribute -LaunchConfigurationDelegate_6=Searching for errors -LaunchConfigurationDelegate_7=Searching for errors in {0} -LaunchConfigurationDelegate_scoped_incremental_build=Scoped incremental build before launch... -LaunchConfigurationInfo_Attribute__0__is_not_of_type_boolean__3=Attribute {0} is not of type boolean. -LaunchConfigurationInfo_Attribute__0__is_not_of_type_int__2=Attribute {0} is not of type int. -LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_lang_String__1=Attribute {0} is not of type java.lang.String. -LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_List__1=Attribute {0} is not of type java.util.List. -LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1=Attribute {0} is not of type java.util.Map. -LaunchConfigurationInfo_Invalid_launch_configuration_XML__10=Invalid launch configuration XML. -LaunchConfigurationInfo_missing_type=Launch configuration type id \"{0}\" does not exist.\nPossible causes:\n\tMissing specification of a launch type (missing plug-in)\n\tIncorrect launch configuration XML -LaunchConfigurationInfo_36=A null key has been specified for an attribute in this launch configuration -LaunchConfigurationInfo_35=Attribute {0} is not of type java.util.Set. -LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1={0} occurred generating launch configuration XML. -LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2=Specified container for launch configuration does not exist -LaunchConfigurationWorkingCopy_5=Unable to save launch configuration. -LaunchConfigurationWorkingCopy_0=Saving launch configuration [{0}]: -LaunchConfigurationWorkingCopy_1=Writing local file -LaunchConfigurationWorkingCopy_2=Creating new file {0}.launch in workspace -LaunchConfigurationWorkingCopy_3=Setting contents of {0}.launch -LaunchConfigurationWorkingCopy_4=Unable to obtain storage to write launch configuration -LaunchConfigurationWorkingCopy_6=Template cannot be a working copy. -LaunchConfigurationWorkingCopy_7=Templates cannot be nested -LaunchConfigurationWorkingCopy_8=Specified configuration is not a template -LaunchManager__0__occurred_while_reading_launch_configuration_file__1___1={0} occurred while reading launch configuration file: {1}. -LaunchManager_Invalid_launch_configuration_index__18=Invalid launch configuration index. -LaunchManager_does_not_exist=Launch configuration {0} at {1} does not exist. -LaunchManager_does_not_exist_no_store_found=Launch configuration {0} does not exist -LaunchManager_Source_locator_does_not_exist___0__13=Source locator does not exist: {0} -LaunchManager_26=Import failed -LaunchManager_27=Failed to import {0}. -LaunchManager_28=Importing {0} -LaunchManager_29=Importing launch configurations - -# This describes the name of a single launch configuration -# {0} is the base name of the configuration -# {1} is the numerical modifier for the name -# For example if we have a config named 'test' and we created a new one from test -# we would get 'test (1)', where test is the basename, and 1 is the numerical modifier -LaunchManager_31={0} ({1}) -LaunchManager_invalid_config_name=''{0}'' is an invalid configuration name -LaunchManager_invalid_config_name_char=''{0}'' is an invalid character in a configuration name -LaunchDelegate_0=No description provided. -LaunchDelegate_1={0} Launcher -LaunchDelegate_2={0} launcher -LaunchDelegate_3=Launch delegate for {0} does not implement required interface ILaunchConfigurationDelegate. -LaunchMode_0={0} As -LaunchMode_1=Required attribute {0} missing for launchMode extension. -LogicalStructureType_0= -LogicalStructureType_1=Required attribute {0} missing for logicalStructureType extension. -LogicalStructureProvider_0=Required attribute modelIdentifier missing for logicalStructureType extension. -LogicalStructureProvider_1=Required attribute class missing for logicalStructureType extension. -OutputStreamMonitor_label=Output Stream Monitor -ProcessMonitorJob_0=Process monitor -RuntimeProcess_terminate_failed=Terminate failed -RuntimeProcess_Exit_value_not_available_until_process_terminates__1=Exit value not available until process terminates. -LaunchConfigurationType_0=Error retrieving template -LaunchConfigurationType_1=Error setting template -LaunchConfigurationType_2=Local configuration cannot be nested in a directory. -LaunchConfigurationType_7=Launch mode not supported: {0} -WatchExpression_0=(Watch expressions not supported) -NullStreamsProxy_0=Null Stream Monitor -RefreshingResources=Refresh resources... -RefreshingResourcesError=Exception(s) occurred during refresh. -RefreshUtil_0=Unable to restore resource memento: {0} -RefreshUtil_1=Refresh scope refers to non-existent resource {0} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java deleted file mode 100644 index 2345f0556..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.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.core; - -import org.eclipse.core.runtime.Platform; - -/** - * Access to debug options. - * - * @since 3.3 - */ -public class DebugOptions { - - // debug option flags - public static boolean DEBUG = false; - public static boolean DEBUG_COMMANDS = false; - public static boolean DEBUG_EVENTS = false; - - public static void initDebugOptions() { - DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.debug.core/debug")); //$NON-NLS-1$//$NON-NLS-2$ - DEBUG_COMMANDS = DEBUG && "true".equals( //$NON-NLS-1$ - Platform.getDebugOption("org.eclipse.debug.core/debug/commands")); //$NON-NLS-1$ - DEBUG_EVENTS = DEBUG && "true".equals( //$NON-NLS-1$ - Platform.getDebugOption("org.eclipse.debug.core/debug/events")); //$NON-NLS-1$ - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java deleted file mode 100644 index 9e2896927..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java +++ /dev/null @@ -1,36 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2006, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.debug.core.DebugPlugin; - -/** - * Initializes preferences for debug.core - * - * @since 3.3 - */ -public class DebugPreferenceInitializer extends AbstractPreferenceInitializer { - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - public void initializeDefaultPreferences() { - // Step filter preferences - Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), StepFilterManager.PREF_USE_STEP_FILTERS, false); - //launch configurations preferences - Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true); - Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, true); - Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, true); - Preferences.savePreferences(DebugPlugin.getUniqueIdentifier()); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java deleted file mode 100644 index b3f1f6c8a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.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.core; - -import java.util.Iterator; -import java.util.Map; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.osgi.service.environment.Constants; - -/** - * Resolves the value of environment variables. - */ -public class EnvironmentVariableResolver 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 { - if (argument == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), IStatus.ERROR, DebugCoreMessages.EnvironmentVariableResolver_0, null)); - } - Map map= DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved(); - String value= (String) map.get(argument); - if (value == null && Platform.getOS().equals(Constants.OS_WIN32)) { - // On Win32, env variables are case insensitive, so we search the map - // for matches manually. - Iterator iter = map.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry= ((Map.Entry) iter.next()); - String key= (String) entry.getKey(); - if (key.equalsIgnoreCase(argument)) { - return (String) entry.getValue(); - } - } - } - return value; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java deleted file mode 100644 index 17d3b6106..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java +++ /dev/null @@ -1,674 +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.core; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Vector; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -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.PlatformObject; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IExpressionListener; -import org.eclipse.debug.core.IExpressionManager; -import org.eclipse.debug.core.IExpressionsListener; -import org.eclipse.debug.core.model.IExpression; -import org.eclipse.debug.core.model.IWatchExpression; -import org.eclipse.debug.core.model.IWatchExpressionDelegate; -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 expression manager manages all registered expressions - * for the debug plug-in. It is instantiated by the debug plug-in - * at startup. - * - * @see IExpressionManager - */ -public class ExpressionManager extends PlatformObject implements IExpressionManager { - - /** - * Ordered collection of registered expressions. - */ - private Vector fExpressions = null; - - /** - * List of expression listeners - */ - private ListenerList fListeners = null; - - /** - * List of expressions listeners (plural) - */ - private ListenerList fExpressionsListeners = null; - - /** - * Mapping of debug model identifiers (String) to - * expression delegate extensions (IConfigurationElement) - */ - private Map fWatchExpressionDelegates= new HashMap(); - - // Constants for add/remove/change/insert/move notification - private static final int ADDED = 1; - private static final int CHANGED = 2; - private static final int REMOVED = 3; - private static final int INSERTED = 4; - private static final int MOVED = 5; - - // Preference for persisted watch expressions - private static final String PREF_WATCH_EXPRESSIONS= "prefWatchExpressions"; //$NON-NLS-1$ - // Persisted watch expression XML tags - private static final String WATCH_EXPRESSIONS_TAG= "watchExpressions"; //$NON-NLS-1$ - private static final String EXPRESSION_TAG= "expression"; //$NON-NLS-1$ - private static final String TEXT_TAG= "text"; //$NON-NLS-1$ - private static final String ENABLED_TAG= "enabled"; //$NON-NLS-1$ - // XML values - private static final String TRUE_VALUE= "true"; //$NON-NLS-1$ - private static final String FALSE_VALUE= "false"; //$NON-NLS-1$ - - public ExpressionManager() { - loadPersistedExpressions(); - loadWatchExpressionDelegates(); - } - - /** - * Loads the mapping of debug models to watch expression delegates - * from the org.eclipse.debug.core.watchExpressionDelegates - * extension point. - */ - private void loadWatchExpressionDelegates() { - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), "watchExpressionDelegates"); //$NON-NLS-1$ - IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements(); - for (int i = 0; i < configurationElements.length; i++) { - IConfigurationElement element = configurationElements[i]; - if (element.getName().equals("watchExpressionDelegate")) { //$NON-NLS-1$ - String debugModel = element.getAttribute("debugModel"); //$NON-NLS-1$ - if (debugModel == null || debugModel.length() == 0) { - continue; - } - fWatchExpressionDelegates.put(debugModel, element); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#newWatchExpressionDelegate(java.lang.String) - */ - public IWatchExpressionDelegate newWatchExpressionDelegate(String debugModel) { - try { - IConfigurationElement element= (IConfigurationElement) fWatchExpressionDelegates.get(debugModel); - if (element != null) { - return (IWatchExpressionDelegate) element.createExecutableExtension(IConfigurationElementConstants.DELEGATE_CLASS); - } - return null; - } catch (CoreException e) { - DebugPlugin.log(e); - return null; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#hasWatchExpressionDelegate(java.lang.String) - */ - public boolean hasWatchExpressionDelegate(String id) { - IConfigurationElement element= (IConfigurationElement) fWatchExpressionDelegates.get(id); - return element != null; - } - - /** - * Loads any persisted watch expressions from the preferences. - * NOTE: It's important that no setter methods are called on - * the watchpoints which will fire change events as this - * will cause an infinite loop (see Bug 27281). - */ - private void loadPersistedExpressions() { - String expressionsString = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_WATCH_EXPRESSIONS, IInternalDebugCoreConstants.EMPTY_STRING, null); - if (expressionsString.length() == 0) { - return; - } - Element root; - try { - root = DebugPlugin.parseDocument(expressionsString); - } catch (CoreException e) { - DebugPlugin.logMessage("An exception occurred while loading watch expressions.", e); //$NON-NLS-1$ - return; - } - if (!root.getNodeName().equals(WATCH_EXPRESSIONS_TAG)) { - DebugPlugin.logMessage("Invalid format encountered while loading watch expressions.", null); //$NON-NLS-1$ - return; - } - NodeList list= root.getChildNodes(); - 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(EXPRESSION_TAG)) { - DebugPlugin.logMessage(MessageFormat.format("Invalid XML element encountered while loading watch expressions: {0}", new String[] {node.getNodeName()}), null); //$NON-NLS-1$ - continue; - } - String expressionText= element.getAttribute(TEXT_TAG); - if (expressionText.length() > 0) { - boolean enabled= TRUE_VALUE.equals(element.getAttribute(ENABLED_TAG)); - IWatchExpression expression= newWatchExpression(expressionText, enabled); - if (fExpressions == null) { - fExpressions= new Vector(list.getLength()); - } - fExpressions.add(expression); - } else { - DebugPlugin.logMessage("Invalid expression entry encountered while loading watch expressions. Expression text is empty.", null); //$NON-NLS-1$ - } - } - } - } - - /** - * Creates a new watch expression with the given expression - * and the given enablement; - * - * @param expressionText the text of the expression to be evaluated - * @param enabled whether or not the new expression should be enabled - * @return the new watch expression - */ - private IWatchExpression newWatchExpression(String expressionText, boolean enabled) { - return new WatchExpression(expressionText, enabled); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#newWatchExpression(java.lang.String) - */ - public IWatchExpression newWatchExpression(String expressionText) { - return new WatchExpression(expressionText); - } - - /** - * Persists this manager's watch expressions as XML in the - * preference store. - */ - public void storeWatchExpressions() { - String expressionString = IInternalDebugCoreConstants.EMPTY_STRING; - try { - expressionString= getWatchExpressionsAsXML(); - } catch (IOException e) { - DebugPlugin.log(e); - } catch (ParserConfigurationException e) { - DebugPlugin.log(e); - } catch (TransformerException e) { - DebugPlugin.log(e); - } - Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_WATCH_EXPRESSIONS, expressionString, null); - } - - /** - * Returns this manager's watch expressions as XML. - * @return this manager's watch expressions as XML - * @throws IOException if an exception occurs while creating - * the XML document. - * @throws ParserConfigurationException if an exception occurs while creating - * the XML document. - * @throws TransformerException if an exception occurs while creating - * the XML document. - */ - private String getWatchExpressionsAsXML() throws IOException, ParserConfigurationException, TransformerException { - IExpression[] expressions= getExpressions(); - Document document= LaunchManager.getDocument(); - Element rootElement= document.createElement(WATCH_EXPRESSIONS_TAG); - document.appendChild(rootElement); - for (int i = 0; i < expressions.length; i++) { - IExpression expression= expressions[i]; - if (expression instanceof IWatchExpression) { - Element element= document.createElement(EXPRESSION_TAG); - element.setAttribute(TEXT_TAG, expression.getExpressionText()); - element.setAttribute(ENABLED_TAG, ((IWatchExpression) expression).isEnabled() ? TRUE_VALUE : FALSE_VALUE); - rootElement.appendChild(element); - } - } - return LaunchManager.serializeDocument(document); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpression(org.eclipse.debug.core.model.IExpression) - */ - public void addExpression(IExpression expression) { - addExpressions(new IExpression[]{expression}); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpressions(org.eclipse.debug.core.model.IExpression[]) - */ - public void addExpressions(IExpression[] expressions) { - if (fExpressions == null) { - fExpressions = new Vector(expressions.length); - } - boolean addedWatchExpression= false; - List added = new ArrayList(expressions.length); - for (int i = 0; i < expressions.length; i++) { - IExpression expression = expressions[i]; - if (fExpressions.indexOf(expression) == -1) { - added.add(expression); - fExpressions.add(expression); - if (expression instanceof IWatchExpression) { - addedWatchExpression= true; - } - } - } - if (!added.isEmpty()) { - fireUpdate((IExpression[])added.toArray(new IExpression[added.size()]), ADDED); - } - if (addedWatchExpression) { - storeWatchExpressions(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#getExpressions() - */ - public IExpression[] getExpressions() { - if (fExpressions == null) { - return new IExpression[0]; - } - IExpression[] temp= new IExpression[fExpressions.size()]; - fExpressions.copyInto(temp); - return temp; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#getExpressions(java.lang.String) - */ - public IExpression[] getExpressions(String modelIdentifier) { - if (fExpressions == null) { - return new IExpression[0]; - } - ArrayList temp= new ArrayList(fExpressions.size()); - Iterator iter= fExpressions.iterator(); - while (iter.hasNext()) { - IExpression expression= (IExpression) iter.next(); - String id= expression.getModelIdentifier(); - if (id != null && id.equals(modelIdentifier)) { - temp.add(expression); - } - } - return (IExpression[]) temp.toArray(new IExpression[temp.size()]); - } - - /** - * Adds the given expressions to the collection of registered expressions - * in the workspace and notifies all registered listeners. The expressions - * are inserted in the same order as the passed array at the index of the - * specified expressions (before or after it depending on the boolean argument). - * If no valid insertion location could be found, the expressions are added - * to the end of the collection. Has no effect on expressions already registered. - * - * @param expressions expressions to insert into the collection - * @param insertionLocation the expression at the location where expressions will be inserted - * @param insertBefore whether to insert the expressions before or after the given insertion location - * @since 3.4 - */ - public void insertExpressions(IExpression[] expressions, IExpression insertionLocation, boolean insertBefore){ - if (fExpressions == null) { - addExpressions(expressions); - return; - } - - int insertionIndex = fExpressions.indexOf(insertionLocation); - if (insertionIndex < 0){ - addExpressions(expressions); - return; - } - if (!insertBefore){ - insertionIndex++; - } - boolean addedWatchExpression = false; - List added = new ArrayList(expressions.length); - for (int i = 0; i < expressions.length; i++) { - IExpression expression = expressions[i]; - if (fExpressions.indexOf(expression) == -1) { - //Insert in the same order as the array is passed - fExpressions.add(insertionIndex+added.size(), expression); - added.add(expression); - if (expression instanceof IWatchExpression) { - addedWatchExpression= true; - } - } - } - - if (!added.isEmpty()) { - fireUpdate((IExpression[])added.toArray(new IExpression[added.size()]), INSERTED, insertionIndex); - } - if (addedWatchExpression) { - storeWatchExpressions(); - } - } - - /** - * Moves the given expressions from their location in the collection - * of registered expressions in the workspace to the specified insertion - * location. Notifies all registered listeners. This method has no effect - * if an expression does not exist in the collection or if no valid insertion - * location could be determined. - * - * @param expressions expressions to move - * @param insertionLocation the expression at the location to insert the moved expressions - * @param insertBefore whether to insert the moved expressions before or after the given insertion location - * @since 3.4 - */ - public void moveExpressions(IExpression[] expressions, IExpression insertionLocation, boolean insertBefore){ - if (fExpressions == null){ - return; - } - int insertionIndex = fExpressions.indexOf(insertionLocation); - if (insertionIndex < 0){ - return; - } - if (!insertBefore){ - insertionIndex++; - } - - List movedExpressions = new ArrayList(expressions.length); - for (int i = 0; i < expressions.length; i++) { - int removeIndex = fExpressions.indexOf(expressions[i]); - if (removeIndex >= 0){ - movedExpressions.add(expressions[i]); - if (removeIndex < insertionIndex){ - insertionIndex--; - } - fExpressions.remove(removeIndex); - } - } - IExpression[] movedExpressionsArray = (IExpression[])movedExpressions.toArray(new IExpression[movedExpressions.size()]); - for (int i = 0; i < movedExpressionsArray.length; i++) { - // Insert the expressions in the same order as the passed array - fExpressions.add(insertionIndex+i,movedExpressionsArray[i]); - } - - if (!movedExpressions.isEmpty()) { - fireUpdate(movedExpressionsArray, MOVED, insertionIndex); - storeWatchExpressions(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpression(org.eclipse.debug.core.model.IExpression) - */ - public void removeExpression(IExpression expression) { - removeExpressions(new IExpression[] {expression}); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpressions(org.eclipse.debug.core.model.IExpression[]) - */ - public void removeExpressions(IExpression[] expressions) { - if (fExpressions == null) { - return; - } - List removed = new ArrayList(expressions.length); - for (int i = 0; i < expressions.length; i++) { - IExpression expression = expressions[i]; - if (fExpressions.remove(expression)) { - removed.add(expression); - expression.dispose(); - } - } - if (!removed.isEmpty()) { - fireUpdate((IExpression[])removed.toArray(new IExpression[removed.size()]), REMOVED); - storeWatchExpressions(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpressionListener(org.eclipse.debug.core.IExpressionListener) - */ - public void addExpressionListener(IExpressionListener listener) { - if (fListeners == null) { - fListeners = new ListenerList(); - } - fListeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpressionListener(org.eclipse.debug.core.IExpressionListener) - */ - public void removeExpressionListener(IExpressionListener listener) { - if (fListeners == null) { - return; - } - fListeners.remove(listener); - } - - /** - * The given watch expression has changed. Update the persisted - * expressions to store this change as indicated - * - * @param expression the changed expression - * @param persist whether to persist the expressions - */ - protected void watchExpressionChanged(IWatchExpression expression, boolean persist) { - if (fExpressions != null && fExpressions.contains(expression)) { - if (persist) { - storeWatchExpressions(); - } - fireUpdate(new IExpression[]{expression}, CHANGED); - } - } - - /** - * Notifies listeners of the adds/removes/changes - * - * @param expressions expressions that were modified - * @param update update flags - */ - private void fireUpdate(IExpression[] expressions, int update){ - fireUpdate(expressions, update, -1); - } - - /** - * Notifies listeners of the adds/removes/changes/insertions/moves - * - * @param expressions expressions that were modified - * @param update update flags - * @param index index where expressions were inserted/moved to or -1 - */ - private void fireUpdate(IExpression[] expressions, int update, int index){ - // single listeners - getExpressionNotifier().notify(expressions, update); - - // multi listeners - getExpressionsNotifier().notify(expressions, update, index); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#hasExpressions() - */ - public boolean hasExpressions() { - return fExpressions != null && !fExpressions.isEmpty(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#addExpressionListener(org.eclipse.debug.core.IExpressionsListener) - */ - public void addExpressionListener(IExpressionsListener listener) { - if (fExpressionsListeners == null) { - fExpressionsListeners = new ListenerList(); - } - fExpressionsListeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IExpressionManager#removeExpressionListener(org.eclipse.debug.core.IExpressionsListener) - */ - public void removeExpressionListener(IExpressionsListener listener) { - if (fExpressionsListeners == null) { - return; - } - fExpressionsListeners.remove(listener); - } - - private ExpressionNotifier getExpressionNotifier() { - return new ExpressionNotifier(); - } - - /** - * Notifies an expression listener (single expression) in a safe runnable to - * handle exceptions. - */ - class ExpressionNotifier implements ISafeRunnable { - - private IExpressionListener fListener; - private int fType; - private IExpression fExpression; - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during expression change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.expressionAdded(fExpression); - break; - case REMOVED: - fListener.expressionRemoved(fExpression); - break; - case CHANGED: - fListener.expressionChanged(fExpression); - break; - } - } - - /** - * Notifies listeners of the add/change/remove - * - * @param expressions the expressions that have changed - * @param update the type of change - */ - public void notify(IExpression[] expressions, int update) { - if (fListeners != null) { - fType = update; - Object[] copiedListeners= fListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IExpressionListener)copiedListeners[i]; - for (int j = 0; j < expressions.length; j++) { - fExpression = expressions[j]; - SafeRunner.run(this); - } - } - } - fListener = null; - fExpression = null; - } - } - - /** - * Returns the expressions notifier - * @return the expressions notifier - */ - private ExpressionsNotifier getExpressionsNotifier() { - return new ExpressionsNotifier(); - } - - /** - * Notifies an expression listener (multiple expressions) in a safe runnable - * to handle exceptions. - */ - class ExpressionsNotifier implements ISafeRunnable { - - private IExpressionsListener fListener; - private int fType; - private int fIndex; - private IExpression[] fNotifierExpressions; - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during expression change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case MOVED: - // If the listener doesn't know about moves or the insertion location is unknown, do nothing. - if (fIndex >= 0 && fListener instanceof IExpressionsListener2){ - ((IExpressionsListener2)fListener).expressionsMoved(fNotifierExpressions, fIndex); - } - break; - case INSERTED: - // If the listener doesn't know about insertions or the insertion location is unknown, notify of an ADD - if (fIndex >= 0 && fListener instanceof IExpressionsListener2){ - ((IExpressionsListener2)fListener).expressionsInserted(fNotifierExpressions, fIndex); - } else { - fListener.expressionsAdded(fNotifierExpressions); - } - break; - case ADDED: - fListener.expressionsAdded(fNotifierExpressions); - break; - case REMOVED: - fListener.expressionsRemoved(fNotifierExpressions); - break; - case CHANGED: - fListener.expressionsChanged(fNotifierExpressions); - break; - } - } - - /** - * Notifies listeners of the adds/changes/removes - * - * @param expressions the expressions that changed - * @param update the type of change - * @param index the index of the first change - */ - public void notify(IExpression[] expressions, int update, int index) { - if (fExpressionsListeners != null) { - fNotifierExpressions = expressions; - fType = update; - fIndex = index; - Object[] copiedListeners = fExpressionsListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IExpressionsListener)copiedListeners[i]; - SafeRunner.run(this); - } - } - fNotifierExpressions = null; - fListener = null; - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java deleted file mode 100644 index 34dbb7eee..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IConfigurationElementConstants.java +++ /dev/null @@ -1,344 +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.core; - -/** - * This interface provides a repository for the names of IConfigurationElement child node ids. - * @since 3.3 - */ -public interface IConfigurationElementConstants { - - /** - * The id node name for a configuration element. - *

                            Equal to the word: id

                            - */ - public static final String ID = "id"; //$NON-NLS-1$ - - /** - * The name node name for a configuration element. - *

                            Equal to the word: name

                            - */ - public static final String NAME = "name"; //$NON-NLS-1$ - - /** - * The category node name for a configuration element. - *

                            Equal to the word: category

                            - */ - public static final String CATEGORY = "category"; //$NON-NLS-1$ - - /** - * The local node name for a configuration element. - *

                            Equal to the word: local

                            - */ - public static final String LOCAL = "local"; //$NON-NLS-1$ - - /** - * The shortcutId node name for a configuration element. - *

                            Equal to the word: shortcutID

                            - */ - public static final String LAUNCH_SHORTCUT_ID = "shortcutID"; //$NON-NLS-1$ - - /** - * The launchPerspectives node name for a configuration element. - *

                            Equal to the word: launchPerspectives

                            - */ - public static final String LAUNCH_PERSPECTIVES = "launchPerspectives"; //$NON-NLS-1$ - - /** - * The launchPerspective node name for a configuration element. - *

                            Equal to the word: launchPerspective

                            - */ - public static final String LAUNCH_PERSPECTIVE = "launchPerspective"; //$NON-NLS-1$ - - /** - * The markerType node name for a configuration element. - *

                            Equal to the word: markerType

                            - * - * @since 3.4 - */ - public static final String MARKER_TYPE = "markerType"; //$NON-NLS-1$ - - /** - * The delegateClass node name for a configuration element. - *

                            Equal to the word: delegateClass

                            - * - * @since 3.4 - */ - public static final String DELEGATE_CLASS = "delegateClass"; //$NON-NLS-1$ - - /** - * The launchConfiguration node name for a configuration element. - *

                            Equal to the word: launchConfiguration

                            - */ - public static final String LAUNCH_CONFIGURATION = "launchConfiguration"; //$NON-NLS-1$ - - /** - * The launchMode node name for a configuration element. - *

                            Equal to the word: launchMode

                            - */ - public static final String LAUNCH_MODE = "launchMode"; //$NON-NLS-1$ - - /** - * The lastLaunch node name for a configuration element. - *

                            Equal to the word: lastLaunch

                            - */ - public static final String LAST_LAUNCH = "lastLaunch"; //$NON-NLS-1$ - - /** - * The launch node name for a configuration element. - *

                            Equal to the word: launch

                            - */ - public static final String LAUNCH = "launch"; //$NON-NLS-1$ - - /** - * The launch as label node name for a configuration element. - *

                            Equal to the word: launchAsLabel

                            - * - * @since 3.4 - */ - public static final String LAUNCH_AS_LABEL = "launchAsLabel"; //$NON-NLS-1$ - - /** - * The launchHistory node name for a configuration element. - *

                            Equal to the word: launchHistory

                            - */ - public static final String LAUNCH_HISTORY = "launchHistory"; //$NON-NLS-1$ - - /** - * The node name for a launch group configuration element. - *

                            Equal to the word: launchGroup

                            - */ - public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$ - - /** - * The node name for a launch history MRU list configuration element. - *

                            Equal to the word: mruHistory

                            - */ - public static final String MRU_HISTORY = "mruHistory"; //$NON-NLS-1$ - - /** - * The node name for a launch favorites list configuration element. - *

                            Equal to the word: favorites

                            - */ - public static final String FAVORITES = "favorites"; //$NON-NLS-1$ - - /** - * The after node name for a configuration element. - *

                            Equal to the word: after

                            - */ - public static final String AFTER = "after"; //$NON-NLS-1$ - - /** - * The path node name for a configuration element. - *

                            Equal to the word: path

                            - */ - public static final String PATH = "path"; //$NON-NLS-1$ - - /** - * The placement node name for a configuration element. - *

                            Equal to the word: placement

                            - */ - public static final String PLACEMENT = "placement"; //$NON-NLS-1$ - - /** - * The associated launch delegate node name for a configuration element - *

                            Equal to the word: associatedDelegate

                            - */ - public static final String ASSOCIATED_DELEGATE = "associatedDelegate"; //$NON-NLS-1$ - - /** - * The label node name for a configuration element. - *

                            Equal to the word: label

                            - */ - public static final String LABEL = "label"; //$NON-NLS-1$ - - /** - * The description node name for a configuration element. - *

                            Equal to the word: description

                            - */ - public static final String DESCRIPTION = "description"; //$NON-NLS-1$ - - /** - * The helpContextId node name for a configuration element. - *

                            Equal to the word: helpContextId

                            - */ - public static final String HELP_CONTEXT_ID = "helpContextId"; //$NON-NLS-1$ - - /** - * The icon node name for a configuration element. - *

                            Equal to the word: icon

                            - */ - public static final String ICON = "icon"; //$NON-NLS-1$ - - /** - * The public node name for a configuration element - *

                            Equal to the word: public

                            - */ - public static final String PUBLIC = "public"; //$NON-NLS-1$ - - /** - * The perspective node name for a configuration element. - *

                            Equal to the word: perspective

                            - */ - public static final String PERSPECTIVE = "perspective"; //$NON-NLS-1$ - - /** - * The preferredDelegates node name for a configuration element. - *

                            Equal to the word: preferredDelegates

                            - */ - public static final String PREFERRED_DELEGATES = "preferredDelegates"; //$NON-NLS-1$ - - /** - * The modes node name for a configuration element. - *

                            Equal to the word: modes

                            - */ - public static final String MODES = "modes"; //$NON-NLS-1$ - - /** - * The modesCombination node name for a configuration element. - *

                            Equal to the word: modeCombination

                            - */ - public static final String MODE_COMBINATION = "modeCombination"; //$NON-NLS-1$ - - /** - * The mode node name for a configuration element. - *

                            Equal to the word: mode

                            - */ - public static final String MODE = "mode"; //$NON-NLS-1$ - - /** - * The type node name for a configuration element. - *

                            Equal to the word: type

                            - */ - public static final String TYPE = "type"; //$NON-NLS-1$ - - /** - * The typeid node name for a configuration element. - *

                            Equal to the word: typeid

                            - */ - public static final String TYPE_ID = "typeid"; //$NON-NLS-1$ - - /** - * The option node name for a configuration element. - *

                            Equal to the word: options

                            - */ - public static final String OPTIONS = "options"; //$NON-NLS-1$ - - /** - * The delegate node name for a configuration element. - *

                            Equal to the word: delegate

                            - */ - public static final String DELEGATE = "delegate"; //$NON-NLS-1$ - - /** - * The participant node name for a configuration element. - *

                            Equal to the word: participant

                            - */ - public static final String PARTICIPANT = "participant"; //$NON-NLS-1$ - - /** - * The defaultShortcut node name for a configuration element. - *

                            Equal to the word: defaultShortcut

                            - */ - public static final String DEFAULT_LAUNCH_SHORTCUT = "defaultShortcut"; //$NON-NLS-1$ - - /** - * The delegateName node name for a configuration element. - *

                            Equal to the word: delegateName

                            - */ - public static final String DELEGATE_NAME = "delegateName"; //$NON-NLS-1$ - - /** - * The group node name for a configuration element. - *

                            Equal to the word: group

                            - */ - public static final String GROUP = "group"; //$NON-NLS-1$ - - /** - * The class node name for a configuration element. - *

                            Equal to the word: class

                            - */ - public static final String CLASS = "class"; //$NON-NLS-1$ - - /** - * The modelIdentifier node name for a configuration element. - *

                            Equal to the word: modelIdentifier

                            - * - * @since 3.4 - */ - public static final String MODEL_IDENTIFIER = "modelIdentifier"; //$NON-NLS-1$ - - /** - * The configurationTypes node name for a configuration element. - *

                            Equal to the word: configurationType

                            - */ - public static final String CONFIGURATION_TYPES = "configurationType"; //$NON-NLS-1$ - - /** - * The contextLabel node name for a configuration element. - *

                            Equal to the word: contextLabel

                            - */ - public static final String CONTEXT_LABEL = "contextLabel"; //$NON-NLS-1$ - - /** - * The contextualLaunch node name for a configuration element. - *

                            Equal to the word: contextualLaunch

                            - */ - public static final String CONTEXTUAL_LAUNCH = "contextualLaunch"; //$NON-NLS-1$ - - /** - * The sourcePathComputerId node name for a configuration element. - *

                            Equal to the word: sourcePathComputerId

                            - */ - public static final String SOURCE_PATH_COMPUTER = "sourcePathComputerId"; //$NON-NLS-1$ - - /** - * The delegateDescription node name for a configuration element. - *

                            Equal to the word: delegateDescription

                            - */ - public static final String DELEGATE_DESCRIPTION = "delegateDescription"; //$NON-NLS-1$ - - /** - * The sourceLocatorId node name for a configuration element. - *

                            Equal to the word: sourceLocatorId

                            - */ - public static final String SOURCE_LOCATOR = "sourceLocatorId"; //$NON-NLS-1$ - - /** - * The migrationDelegate node name for a configuration element. - *

                            Equal to the word: migrationDelegate

                            - */ - public static final String MIGRATION_DELEGATE = "migrationDelegate"; //$NON-NLS-1$ - - /** - * The memento node name for a configuration element. - *

                            Equal to the word: memento

                            - */ - public static final String MEMENTO = "memento"; //$NON-NLS-1$ - - /** - * The selection node name for a configuration element. - *

                            Equal to the word: selection

                            - */ - public static final String SELECTION = "selection"; //$NON-NLS-1$ - - /** - * The debugContext node name for a configuration element. - *

                            Equal to the word: debugContext

                            - */ - public static final String DEBUG_CONTEXT = "debugContext"; //$NON-NLS-1$ - - /** - * The editorInput node name for a configuration element. - *

                            Equal to the word: editorInput

                            - */ - public static final String EDITOR_INPUT = "editorInput"; //$NON-NLS-1$ -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IExpressionsListener2.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IExpressionsListener2.java deleted file mode 100644 index be3ee7dd8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IExpressionsListener2.java +++ /dev/null @@ -1,45 +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.core; - -import org.eclipse.debug.core.IExpressionsListener; -import org.eclipse.debug.core.model.IExpression; - -/** - * Provides call-back methods for expressions that have been moved or inserted - * @since 3.4 - */ -public interface IExpressionsListener2 extends IExpressionsListener { - - /** - * Fires the model delta necessary to update the viewer after one or more - * expressions have been moved to a different index in the tree. The - * expression array must be in the same order as they were added. The given index - * must take into account the removal of the expressions to be removed. - * Therefore, for each of the expressions being moved with indices lower than the expect - * insertion index, the passed insertion index must be reduced by one. - * - * @param expressions array of expressions to be moved - * @param index the index the expressions will be added to, adjusted for moved expressions - */ - public void expressionsMoved(IExpression[] expressions, int index); - - /** - * Fires the model delta necessary to update the viewer after one or more - * expressions have been inserted into a specific index in the tree. The - * expression array must be in the same order as they were added. - * - * @param expressions array of expressions to be moved - * @param index the index the expressions will be added to - */ - public void expressionsInserted(IExpression[] expressions, int index); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java deleted file mode 100644 index 8fc33db5e..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IInternalDebugCoreConstants.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugPlugin; - -/** - * Contains constants to be used internally in all debug components - * - * @since 3.4 - */ -public interface IInternalDebugCoreConstants { - - /** - * Represents the empty string - */ - public static final String EMPTY_STRING = ""; //$NON-NLS-1$ - - /** - * Boolean preference controlling whether status handler extensions - * are enabled. Default value is true. When disabled - * any call to {@link DebugPlugin#getStatusHandler(IStatus)} will return null. - * - * @since 3.4.2 - */ - public static final String PREF_ENABLE_STATUS_HANDLERS = DebugPlugin.getUniqueIdentifier() + ".PREF_ENABLE_STATUS_HANDLERS"; //$NON-NLS-1$ - - /** - * Persistence of breakpoint manager enabled state. - * - * @since 3.6 - */ - public static final String PREF_BREAKPOINT_MANAGER_ENABLED_STATE = DebugPlugin.getUniqueIdentifier() + ".PREF_BREAKPOINT_MANAGER_ENABLED_STATE"; //$NON-NLS-1$ - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IMementoConstants.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IMementoConstants.java deleted file mode 100644 index ed9f1e870..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/IMementoConstants.java +++ /dev/null @@ -1,32 +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.core; - -public interface IMementoConstants { - // These persistence constant is stored in XML. Do not - // change it. - public static final String TAG_FACTORY_ID = "factoryID"; //$NON-NLS-1$ - - public static final String TAG_EDITOR_STATE = "editorState"; //$NON-NLS-1$ - - public static final String MEMENTO_ITEM = "item"; //$NON-NLS-1$ - - public static final String TAG_EDIT_PAGE_ID = "editPageId"; //$NON-NLS-1$ - - public static final String TAG_NAME = "name"; //$NON-NLS-1$ - - public static final String TAG_LABEL = "label"; //$NON-NLS-1$ - - public static final String TAG_ID = "id"; //$NON-NLS-1$ - - public static final String TAG_LAUNCH_CONFIGURATION_WORKING_SET = "launchConfigurationWorkingSet"; //$NON-NLS-1$ - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java deleted file mode 100644 index 933dabf8d..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java +++ /dev/null @@ -1,176 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.io.IOException; -import java.io.OutputStream; -import java.util.Vector; - -import org.eclipse.debug.core.DebugPlugin; - -/** - * Writes to the input stream of a system process, - * queueing output if the stream is blocked. - * - * The input stream monitor writes to system in via - * an output stream. - */ -public class InputStreamMonitor { - - /** - * The stream which is being written to (connected to system in). - */ - private OutputStream fStream; - /** - * The queue of output. - */ - private Vector fQueue; - /** - * The thread which writes to the stream. - */ - private Thread fThread; - /** - * A lock for ensuring that writes to the queue are contiguous - */ - private Object fLock; - - /** - * Whether the underlying output stream has been closed - */ - private boolean fClosed = false; - - /** - * The encoding of the input stream. - */ - private String fEncoding; - - /** - * Creates an input stream monitor which writes to system in via the given output stream. - * - * @param stream output stream - */ - public InputStreamMonitor(OutputStream stream) { - this(stream, null); - } - - /** - * Creates an input stream monitor which writes to system in via the given output stream. - * - * @param stream output stream - * @param encoding stream encoding or null for system default - */ - public InputStreamMonitor(OutputStream stream, String encoding) { - fStream= stream; - fQueue= new Vector(); - fLock= new Object(); - fEncoding= encoding; - } - - /** - * Appends the given text to the stream, or - * queues the text to be written at a later time - * if the stream is blocked. - * - * @param text text to append - */ - public void write(String text) { - synchronized(fLock) { - fQueue.add(text); - fLock.notifyAll(); - } - } - - /** - * Starts a thread which writes the stream. - */ - public void startMonitoring() { - if (fThread == null) { - fThread= new Thread(new Runnable() { - public void run() { - write(); - } - }, DebugCoreMessages.InputStreamMonitor_label); - fThread.setDaemon(true); - fThread.start(); - } - } - - /** - * Close all communications between this - * monitor and the underlying stream. - */ - public void close() { - if (fThread != null) { - Thread thread= fThread; - fThread= null; - thread.interrupt(); - } - } - - /** - * Continuously writes to the stream. - */ - protected void write() { - while (fThread != null) { - writeNext(); - } - if (!fClosed) { - try { - fStream.close(); - } catch (IOException e) { - DebugPlugin.log(e); - } - } - } - - /** - * Write the text in the queue to the stream. - */ - protected void writeNext() { - while (!fQueue.isEmpty() && !fClosed) { - String text = (String)fQueue.firstElement(); - fQueue.removeElementAt(0); - try { - if (fEncoding != null) - fStream.write(text.getBytes(fEncoding)); - else - fStream.write(text.getBytes()); - fStream.flush(); - } catch (IOException e) { - DebugPlugin.log(e); - } - } - try { - synchronized(fLock) { - fLock.wait(); - } - } catch (InterruptedException e) { - } - } - - /** - * Closes the output stream attached to the standard input stream of this - * monitor's process. - * - * @exception IOException if an exception occurs closing the input stream - */ - public void closeInputStream() throws IOException { - if (!fClosed) { - fClosed = true; - fStream.close(); - } else { - throw new IOException(); - } - - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java deleted file mode 100644 index 3f6e6ae38..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java +++ /dev/null @@ -1,961 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Sascha Radike - bug 56642 - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.io.File; -import java.io.IOException; -import java.io.StringReader; -import java.net.URI; -import java.util.ArrayList; -import java.util.HashSet; -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 javax.xml.transform.TransformerException; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileStore; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubProgressMonitor; -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.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchDelegate; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.core.Launch; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate2; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2; -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; - -import com.ibm.icu.text.MessageFormat; - -/** - * Launch configuration handle. - * - * @see ILaunchConfiguration - */ -public class LaunchConfiguration extends PlatformObject implements ILaunchConfiguration { - - /** - * Launch configuration attribute that specifies the resources paths mapped to it. - * Not all launch configurations will have a mapped resource unless migrated. - * Value is a list of resource paths stored as portable strings, or null - * if none. - * - * @since 3.2 - */ - public static final String ATTR_MAPPED_RESOURCE_PATHS = DebugPlugin.getUniqueIdentifier() + ".MAPPED_RESOURCE_PATHS"; //$NON-NLS-1$ - - /** - * Launch configuration attribute that specifies the resources types mapped to it. - * Not all launch configurations will have a mapped resource unless migrated. - * Value is a list of resource type integers, or null if none. - * - * @since 3.2 - */ - public static final String ATTR_MAPPED_RESOURCE_TYPES = DebugPlugin.getUniqueIdentifier() + ".MAPPED_RESOURCE_TYPES"; //$NON-NLS-1$ - - /** - * The launch modes set on this configuration. - * - * @since 3.3 - */ - public static final String ATTR_LAUNCH_MODES = DebugPlugin.getUniqueIdentifier() + ".LAUNCH_MODES"; //$NON-NLS-1$ - - /** - * Launch configuration attribute storing a list - * of preferred launchers for associated mode sets. - * This attribute is a list of launchers stored by mode set - * and relating to the id of the preferred launcher, which happens to be an ILaunchDelegate - * - * @since 3.3 - */ - public static final String ATTR_PREFERRED_LAUNCHERS = DebugPlugin.getUniqueIdentifier() + ".preferred_launchers"; //$NON-NLS-1$ - - /** - * Status handler to prompt in the UI thread - * - * @since 3.3 - */ - protected static final IStatus promptStatus = new Status(IStatus.INFO, "org.eclipse.debug.ui", 200, "", null); //$NON-NLS-1$//$NON-NLS-2$ - - /** - * Status handler to prompt the user to resolve the missing launch delegate issue - * @since 3.3 - */ - protected static final IStatus delegateNotAvailable = new Status(IStatus.INFO, "org.eclipse.debug.core", 226, "", null); //$NON-NLS-1$ //$NON-NLS-2$ - - /** - * Status handle to prompt the user to resolve duplicate launch delegates being detected - * - * @since 3.3 - */ - protected static final IStatus duplicateDelegates = new Status(IStatus.INFO, "org.eclipse.debug.core", 227, "", null); //$NON-NLS-1$//$NON-NLS-2$ - - /** - * This configuration's name - * @since 3.5 - */ - private String fName; - - /** - * The container this configuration is stored in or null if stored locally - * with workspace metadata. - * @since 3.5 - */ - private IContainer fContainer; - - /** - * Constructs a launch configuration with the given name. The configuration - * is stored in the given container or locally with workspace metadata if - * the specified container is null. - * - * @param name launch configuration name - * @param container parent container or null - * @since 3.5 - */ - protected LaunchConfiguration(String name, IContainer container) { - initialize(); - setName(name); - setContainer(container); - } - - /** - * Initialize any state variables - called first in the constructor. - * Subclasses must override as appropriate. - */ - protected void initialize() { - } - - /** - * Constructs a launch configuration on the given workspace file. - * - * @param file workspace .launch file - * @since 3.5 - */ - protected LaunchConfiguration(IFile file) { - this(getSimpleName(file.getName()), file.getParent()); - } - - /** - * Given a name that ends with .launch, return the simple name of the configuration. - * - * @param fileName - * @return simple name - * @since 3.5 - */ - protected static String getSimpleName(String fileName) { - if (fileName.endsWith(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION)) { - return fileName.substring(0, fileName.length() - ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.length() - 1); - } - return fileName; - } - - /** - * Constructs a launch configuration from the given - * memento. - * - * @param memento launch configuration memento - * @exception CoreException if the memento is invalid or - * an exception occurs reading the memento - */ - protected LaunchConfiguration(String memento) throws CoreException { - 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 localString = root.getAttribute(IConfigurationElementConstants.LOCAL); - String path = root.getAttribute(IConfigurationElementConstants.PATH); - - String message = null; - if (path == null || IInternalDebugCoreConstants.EMPTY_STRING.equals(path)) { - message = DebugCoreMessages.LaunchConfiguration_18; - } else if (localString == null || IInternalDebugCoreConstants.EMPTY_STRING.equals(localString)) { - message = DebugCoreMessages.LaunchConfiguration_19; - } - if (message != null) { - throw new CoreException(newStatus(message, DebugException.INTERNAL_ERROR, null)); - } - - - boolean local = (Boolean.valueOf(localString)).booleanValue(); - IPath iPath = new Path(path); - String name = getSimpleName(iPath.lastSegment()); - IContainer container = null; - if (!local) { - container = ResourcesPlugin.getWorkspace().getRoot().getFile(iPath).getParent(); - } - setName(name); - setContainer(container); - return; - } catch (ParserConfigurationException e) { - ex = e; - } catch (SAXException e) { - ex = e; - } catch (IOException e) { - ex = e; - } - IStatus s = newStatus(DebugCoreMessages.LaunchConfiguration_17, DebugException.INTERNAL_ERROR, ex); - throw new CoreException(s); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#contentsEqual(org.eclipse.debug.core.ILaunchConfiguration) - */ - public boolean contentsEqual(ILaunchConfiguration object) { - try { - if (object instanceof LaunchConfiguration) { - LaunchConfiguration otherConfig = (LaunchConfiguration) object; - return getName().equals(otherConfig.getName()) - && getType().equals(otherConfig.getType()) - && equalOrNull(getContainer(), otherConfig.getContainer()) - && getInfo().equals(otherConfig.getInfo()); - } - return false; - } catch (CoreException ce) { - return false; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#copy(java.lang.String) - */ - public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException { - ILaunchConfigurationWorkingCopy copy = new LaunchConfigurationWorkingCopy(this, name); - return copy; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#delete() - */ - public void delete() throws CoreException { - if (exists()) { - IFile file = getFile(); - if (file == null) { - IFileStore store = getFileStore(); - if (store != null) { - store.delete(EFS.NONE, null); - if ((store.fetchInfo().exists())) { - throw new DebugException( - new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfiguration_Failed_to_delete_launch_configuration__1, null) - ); - } - } - } else { - // Delete the resource using IFile API such that - // resource deltas are fired. - // First do validate edit to ensure the resource is local - if (file.isReadOnly()) { - IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, null); - if (!status.isOK()) { - throw new CoreException(status); - } - } - file.delete(true, null); - } - // update the launch manager cache synchronously - getLaunchManager().launchConfigurationDeleted(this); - } - } - - /** - * Returns whether this configuration is equal to the - * given configuration. Two configurations are equal if - * they are stored in the same location (and neither one - * is a working copy). - * - * @return whether this configuration is equal to the - * given configuration - * @see Object#equals(Object) - */ - public boolean equals(Object object) { - if (object instanceof ILaunchConfiguration) { - if (isWorkingCopy()) { - return this == object; - } - LaunchConfiguration config = (LaunchConfiguration) object; - if (!config.isWorkingCopy()) { - return getName().equals(config.getName()) && - equalOrNull(getContainer(), config.getContainer()); - } - } - return false; - } - - /** - * Returns whether the given objects are equal or both null. - * - * @param o1 - * @param o2 - * @return whether the given objects are equal or both null - * @since 3.5 - */ - protected boolean equalOrNull(Object o1, Object o2) { - if (o1 == null) { - return o2 == null; - } else if (o2 != null) { - return o1.equals(o2); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#exists() - */ - public boolean exists() { - IFile file = getFile(); - if (file != null) { - return file.exists(); - } - try { - IFileStore store = getFileStore(); - if (store != null) { - return store.fetchInfo().exists(); - } - } catch (CoreException e) { - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, boolean) - */ - public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException { - return getInfo().getBooleanAttribute(attributeName, defaultValue); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, int) - */ - public int getAttribute(String attributeName, int defaultValue) throws CoreException { - return getInfo().getIntAttribute(attributeName, defaultValue); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.List) - */ - public List getAttribute(String attributeName, List defaultValue) throws CoreException { - return getInfo().getListAttribute(attributeName, defaultValue); - } - - /** - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Set) - */ - public Set getAttribute(String attributeName, Set defaultValue) throws CoreException { - return getInfo().getSetAttribute(attributeName, defaultValue); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Map) - */ - public Map getAttribute(String attributeName, Map defaultValue) throws CoreException { - return getInfo().getMapAttribute(attributeName, defaultValue); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.lang.String) - */ - public String getAttribute(String attributeName, String defaultValue) throws CoreException { - return getInfo().getStringAttribute(attributeName, defaultValue); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getAttributes() - */ - public Map getAttributes() throws CoreException { - LaunchConfigurationInfo info = getInfo(); - return info.getAttributes(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getCategory() - */ - public String getCategory() throws CoreException { - return getType().getCategory(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getFile() - */ - public IFile getFile() { - IContainer container = getContainer(); - if (container != null) { - return container.getFile(new Path(getFileName())); - } - return null; - } - - /** - * Returns the simple file name of this launch configuration. - * - * @return the simple file name of this launch configuration - for example - * "Abc.launch" - */ - protected String getFileName() { - StringBuffer buf = new StringBuffer(getName()); - buf.append('.'); - buf.append(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION); - return buf.toString(); - } - - /** - * Returns the info object containing the attributes - * of this configuration - * - * @return info for this handle - * @exception CoreException if unable to retrieve the - * info object - */ - protected LaunchConfigurationInfo getInfo() throws CoreException { - return getLaunchManager().getInfo(this); - } - - /** - * Returns the launch manager - * - * @return launch manager - */ - protected LaunchManager getLaunchManager() { - return (LaunchManager)DebugPlugin.getDefault().getLaunchManager(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getLocation() - */ - public IPath getLocation() { - try { - IFileStore store = getFileStore(); - if (store != null) { - File localFile = store.toLocalFile(EFS.NONE, null); - if (localFile != null) { - return new Path(localFile.getAbsolutePath()); - } - } - } catch (CoreException e) { - } - return null; - } - - /** - * Returns the file store this configuration is persisted in or null if - * a file store cannot be derived. The file may or may not exist. If this configuration - * is in a project that is closed or does not exist, null is returned. - * - * @return file store this configuration is persisted in or null - * @throws CoreException - * @since 3.5 - */ - public IFileStore getFileStore() throws CoreException { - if (isLocal()) { - return EFS.getLocalFileSystem().fromLocalFile( - LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.append(getFileName()).toFile()); - } - URI uri = getFile().getLocationURI(); - if (uri != null) { - return EFS.getStore(uri); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getResource() - */ - public IResource[] getMappedResources() throws CoreException { - List paths = getAttribute(ATTR_MAPPED_RESOURCE_PATHS, (List)null); - if (paths == null || paths.size() == 0) { - return null; - } - List types = getAttribute(ATTR_MAPPED_RESOURCE_TYPES, (List)null); - if (types == null || types.size() != paths.size()) { - throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, null)); - } - ArrayList list = new ArrayList(); - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - for(int i = 0; i < paths.size(); i++) { - String pathStr = (String) paths.get(i); - String typeStr= (String) types.get(i); - int type = -1; - try { - type = Integer.decode(typeStr).intValue(); - } catch (NumberFormatException e) { - throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, e)); - } - IPath path = Path.fromPortableString(pathStr); - IResource res = null; - switch (type) { - case IResource.FILE: - res = root.getFile(path); - break; - case IResource.PROJECT: - res = root.getProject(pathStr); - break; - case IResource.FOLDER: - res = root.getFolder(path); - break; - case IResource.ROOT: - res = root; - break; - default: - throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, null)); - } - if(res != null) { - list.add(res); - } - } - if (list.isEmpty()) { - return null; - } - return (IResource[])list.toArray(new IResource[list.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getMemento() - */ - public String getMemento() throws CoreException { - IPath relativePath = null; - IFile file = getFile(); - boolean local = true; - if (file == null) { - relativePath = new Path(getName()); - } else { - local = false; - relativePath = file.getFullPath(); - } - Exception e= null; - try { - Document doc = LaunchManager.getDocument(); - Element node = doc.createElement(IConfigurationElementConstants.LAUNCH_CONFIGURATION); - doc.appendChild(node); - node.setAttribute(IConfigurationElementConstants.LOCAL, (Boolean.valueOf(local)).toString()); - node.setAttribute(IConfigurationElementConstants.PATH, relativePath.toString()); - return LaunchManager.serializeDocument(doc); - } catch (IOException ioe) { - e= ioe; - } catch (ParserConfigurationException pce) { - e= pce; - } catch (TransformerException te) { - e= te; - } - IStatus status = newStatus(DebugCoreMessages.LaunchConfiguration_16, DebugException.INTERNAL_ERROR, e); - throw new CoreException(status); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getName() - */ - public String getName() { - return fName; - } - - /** - * Returns the container this configuration is stored in, or null - * if this configuration is local. - * - * @return the container this configuration is stored in, or null - * if this configuration is local - * @since 3.5 - */ - protected IContainer getContainer() { - return fContainer; - } - - public Set getModes() throws CoreException { - Set options = getAttribute(ATTR_LAUNCH_MODES, (Set)null); - return (options != null ? new HashSet(options) : new HashSet(0)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getType() - */ - public ILaunchConfigurationType getType() throws CoreException { - return getInfo().getType(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#getWorkingCopy() - */ - public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException { - return new LaunchConfigurationWorkingCopy(this); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - IContainer container = getContainer(); - if (container == null) { - return getName().hashCode(); - } else { - return getName().hashCode() + container.hashCode(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#hasAttribute(java.lang.String) - */ - public boolean hasAttribute(String attributeName) throws CoreException { - return getInfo().hasAttribute(attributeName); - } - - /** - * Set the source locator to use with the launch, if specified - * by this configuration. - * - * @param launch the launch on which to set the source locator - */ - protected void initializeSourceLocator(ILaunch launch) throws CoreException { - if (launch.getSourceLocator() == null) { - String type = getAttribute(ATTR_SOURCE_LOCATOR_ID, (String)null); - if (type == null) { - type = getType().getSourceLocatorId(); - } - if (type != null) { - IPersistableSourceLocator locator = getLaunchManager().newSourceLocator(type); - String memento = getAttribute(ATTR_SOURCE_LOCATOR_MEMENTO, (String)null); - if (memento == null) { - locator.initializeDefaults(this); - } else { - if(locator instanceof IPersistableSourceLocator2) - ((IPersistableSourceLocator2)locator).initializeFromMemento(memento, this); - else - locator.initializeFromMemento(memento); - } - launch.setSourceLocator(locator); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isLocal() - */ - public boolean isLocal() { - return getContainer() == null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isMigrationCandidate() - */ - public boolean isMigrationCandidate() throws CoreException { - return ((LaunchConfigurationType)getType()).isMigrationCandidate(this); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isWorkingCopy() - */ - public boolean isWorkingCopy() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ - public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException { - return launch(mode, monitor, false); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean) - */ - public ILaunch launch(String mode, IProgressMonitor monitor, boolean build) throws CoreException { - return launch(mode, monitor, build, true); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean, boolean) - */ - public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - /* Setup progress monitor - * - Prepare delegate (0) - * - Pre-launch check (1) - * - [Build before launch (7)] if build - * - [Incremental build before launch (3)] if build - * - Final launch validation (1) - * - Initialize source locator (1) - * - Launch delegate (10) */ - if (build) { - monitor.beginTask("", 23); //$NON-NLS-1$ - } - else { - monitor.beginTask("", 13); //$NON-NLS-1$ - } - monitor.subTask(DebugCoreMessages.LaunchConfiguration_9); - try { - // bug 28245 - force the delegate to load in case it is interested in launch notifications - Set modes = getModes(); - modes.add(mode); - ILaunchDelegate[] delegates = getType().getDelegates(modes); - ILaunchConfigurationDelegate delegate = null; - if (delegates.length == 1) { - delegate = delegates[0].getDelegate(); - } else if (delegates.length == 0) { - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(promptStatus); - if (handler != null) { - handler.handleStatus(delegateNotAvailable, new Object[] {this, mode}); - } - IStatus status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_11, null); - throw new CoreException(status); - } else { - ILaunchDelegate del = getPreferredDelegate(modes); - if(del == null) { - del = getType().getPreferredDelegate(modes); - } - if(del == null) { - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(promptStatus); - IStatus status = null; - if (handler != null) { - status = (IStatus) handler.handleStatus(duplicateDelegates, new Object[] {this, mode}); - } - if(status != null && status.isOK()) { - del = getPreferredDelegate(modes); - if(del == null) { - del = getType().getPreferredDelegate(modes); - } - if(del != null) { - delegate = del.getDelegate(); - } - else { - status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_13, null); - throw new CoreException(status); - } - } - else { - status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_13, null); - throw new CoreException(status); - } - } - else { - delegate = del.getDelegate(); - } - } - - ILaunchConfigurationDelegate2 delegate2 = null; - if (delegate instanceof ILaunchConfigurationDelegate2) { - delegate2 = (ILaunchConfigurationDelegate2) delegate; - } - // allow the delegate to provide a launch implementation - ILaunch launch = null; - if (delegate2 != null) { - launch = delegate2.getLaunch(this, mode); - } - if (launch == null) { - launch = new Launch(this, mode, null); - } else { - // ensure the launch mode is valid - if (!mode.equals(launch.getLaunchMode())) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, - MessageFormat.format(DebugCoreMessages.LaunchConfiguration_14, new String[]{mode, launch.getLaunchMode()}), null); - throw new CoreException(status); - } - } - launch.setAttribute(DebugPlugin.ATTR_LAUNCH_TIMESTAMP, Long.toString(System.currentTimeMillis())); - boolean captureOutput = getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, true); - if(!captureOutput) { - launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, "false"); //$NON-NLS-1$ - } else { - launch.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, null); - } - launch.setAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, getLaunchManager().getEncoding(this)); - - // perform initial pre-launch sanity checks - monitor.subTask(DebugCoreMessages.LaunchConfiguration_8); - - if (delegate2 != null) { - if (!(delegate2.preLaunchCheck(this, mode, new SubProgressMonitor(monitor, 1)))) { - return launch; - } - } - else { - monitor.worked(1); /* No pre-launch-check */ - } - // perform pre-launch build - if (build) { - IProgressMonitor buildMonitor = new SubProgressMonitor(monitor, 10, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); - buildMonitor.beginTask(DebugCoreMessages.LaunchConfiguration_7, 10); - buildMonitor.subTask(DebugCoreMessages.LaunchConfiguration_6); - if (delegate2 != null) { - build = delegate2.buildForLaunch(this, mode, new SubProgressMonitor(buildMonitor, 7)); - } - if (build) { - buildMonitor.subTask(DebugCoreMessages.LaunchConfiguration_5); - ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(buildMonitor, 3)); - } - else { - buildMonitor.worked(3); /* No incremental build required */ - } - } - // final validation - monitor.subTask(DebugCoreMessages.LaunchConfiguration_4); - if (delegate2 != null) { - if (!(delegate2.finalLaunchCheck(this, mode, new SubProgressMonitor(monitor, 1)))) { - return launch; - } - } - else { - monitor.worked(1); /* No validation */ - } - if (register) { - getLaunchManager().addLaunch(launch); - } - - try { - //initialize the source locator - monitor.subTask(DebugCoreMessages.LaunchConfiguration_3); - initializeSourceLocator(launch); - monitor.worked(1); - - /* Launch the delegate */ - monitor.subTask(DebugCoreMessages.LaunchConfiguration_2); - delegate.launch(this, mode, launch, new SubProgressMonitor(monitor, 10)); - } catch (CoreException e) { - // if there was an exception, and the launch is empty, remove it - if (!launch.hasChildren()) { - getLaunchManager().removeLaunch(launch); - } - throw e; - } catch (RuntimeException e) { - // if there was a runtime exception, and the launch is empty, remove it - if (!launch.hasChildren()) { - getLaunchManager().removeLaunch(launch); - } - throw e; - } - if (monitor.isCanceled()) { - getLaunchManager().removeLaunch(launch); - } - return launch; - } - finally { - monitor.done(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#migrate() - */ - public void migrate() throws CoreException { - ((LaunchConfigurationType)getType()).migrate(this); - } - - /** - * Creates and returns a new error status based on - * the given message, code, and exception. - * - * @param message error message - * @param code error code - * @param e exception or null - * @return status - */ - protected IStatus newStatus(String message, int code, Throwable e) { - return new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), code, message, e); - } - - /** - * Sets the new name for this configuration. - * - * @param name the new name for this configuration - * @since 3.5 - */ - protected void setName(String name) { - fName = name; - } - - /** - * Sets this configurations container or null if stored in the - * local metadata. - * - * @param container or null - * @since 3.5 - */ - protected void setContainer(IContainer container) { - fContainer = container; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#supportsMode(java.lang.String) - */ - public boolean supportsMode(String mode) throws CoreException { - return getType().supportsMode(mode); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfiguration#isReadOnly() - */ - public boolean isReadOnly() { - try { - IFileStore fileStore = getFileStore(); - if (fileStore != null) { - return fileStore.fetchInfo().getAttribute(EFS.ATTRIBUTE_READ_ONLY); - } - } catch (CoreException e) { - } - return true; - } - - /** - * @see org.eclipse.debug.core.ILaunchConfiguration#getPreferredDelegate(java.util.Set) - */ - public ILaunchDelegate getPreferredDelegate(Set modes) throws CoreException { - Map delegates = getAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, (Map)null); - if(delegates != null) { - String id = (String) delegates.get(modes.toString()); - if(id != null) { - return getLaunchManager().getLaunchDelegate(id); - } - } - return null; - } - - /** - * @see java.lang.Object#toString() - */ - public String toString() { - return getName(); - } - -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java deleted file mode 100644 index 810ffeb31..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java +++ /dev/null @@ -1,69 +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.core; - - -import java.util.Comparator; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.debug.core.DebugPlugin; - -/** - * Proxy to a runtime classpath entry resolver extension. - * - * @see IConfigurationElementConstants - */ -public class LaunchConfigurationComparator implements Comparator { - - private IConfigurationElement fConfigurationElement; - - private Comparator fDelegate; - - /** - * Constructs a new resolver on the given configuration element - * - * @param element configuration element - */ - public LaunchConfigurationComparator(IConfigurationElement element) { - fConfigurationElement = element; - } - - /** - * Returns the resolver delegate (and creates if required) - */ - protected Comparator getComparator() { - if (fDelegate == null) { - try { - fDelegate = (Comparator)fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - return fDelegate; - } - - - /** - * @see Comparator#compare(Object, Object) - */ - public int compare(Object o1, Object o2) { - return getComparator().compare(o1, o2); - } - - /** - * @see Object#equals(Object) - */ - public boolean equals(Object obj) { - return getComparator().equals(obj); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java deleted file mode 100644 index 0b9cde3f6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java +++ /dev/null @@ -1,801 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.io.IOException; -import java.util.ArrayList; -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 java.util.TreeMap; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; - -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.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfigurationType; -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 information associated with a launch configuration handle. - */ -public class LaunchConfigurationInfo { - - /** - * Constants for XML element names and attributes - */ - private static final String KEY = "key"; //$NON-NLS-1$ - private static final String VALUE = "value"; //$NON-NLS-1$ - private static final String SET_ENTRY = "setEntry"; //$NON-NLS-1$ - private static final String LAUNCH_CONFIGURATION = "launchConfiguration"; //$NON-NLS-1$ - private static final String MAP_ENTRY = "mapEntry"; //$NON-NLS-1$ - private static final String LIST_ENTRY = "listEntry"; //$NON-NLS-1$ - private static final String SET_ATTRIBUTE = "setAttribute"; //$NON-NLS-1$ - private static final String MAP_ATTRIBUTE = "mapAttribute"; //$NON-NLS-1$ - private static final String LIST_ATTRIBUTE = "listAttribute"; //$NON-NLS-1$ - private static final String BOOLEAN_ATTRIBUTE = "booleanAttribute"; //$NON-NLS-1$ - private static final String INT_ATTRIBUTE = "intAttribute"; //$NON-NLS-1$ - private static final String STRING_ATTRIBUTE = "stringAttribute"; //$NON-NLS-1$ - private static final String TYPE = "type"; //$NON-NLS-1$ - - /** - * This configurations attribute table. Keys are Strings and - * values are one of String, Integer, or - * Boolean. - */ - private TreeMap fAttributes; - - /** - * This launch configuration's type - */ - private ILaunchConfigurationType fType; - - /** - * Whether running on Sun 1.4 VM - see bug 110215 - */ - private static boolean fgIsSun14x = false; - - static { - String vendor = System.getProperty("java.vm.vendor"); //$NON-NLS-1$ - if (vendor.startsWith("Sun Microsystems")) { //$NON-NLS-1$ - String version = System.getProperty("java.vm.version"); //$NON-NLS-1$ - if (version.startsWith("1.4")) { //$NON-NLS-1$ - fgIsSun14x = true; - } - } - } - - /** - * Constructs a new empty info - */ - protected LaunchConfigurationInfo() { - setAttributeTable(new TreeMap()); - } - - /** - * Returns this configuration's attribute table. - * - * @return attribute table - */ - private TreeMap getAttributeTable() { - return fAttributes; - } - - /** - * Sets this configuration's attribute table. - * - * @param table - * attribute table - */ - private void setAttributeTable(TreeMap table) { - fAttributes = table; - } - - /** - * Sets the attributes in this info to those in the given map. - * - * @param map - */ - protected void setAttributes(Map map) { - if (map == null) { - setAttributeTable(new TreeMap()); - return; - } - setAttributeTable(new TreeMap(map)); - } - - /** - * Returns the String attribute with the given key or the - * given default value if undefined. - * - * @return attribute specified by given key or the defaultValue if undefined - * @throws CoreException - * if the attribute with the given key exists but is not a - * String - */ - protected String getStringAttribute(String key, String defaultValue) throws CoreException { - Object attr = getAttributeTable().get(key); - if (attr != null) { - if (attr instanceof String) { - return (String)attr; - } - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_lang_String__1, new String[] {key}), null - ) - ); - } - return defaultValue; - } - - /** - * Returns the int attribute with the given key or the given - * default value if undefined. - * - * @return attribute specified by given key or the defaultValue if undefined - * @throws CoreException - * if the attribute with the given key exists but is not an - * int - */ - protected int getIntAttribute(String key, int defaultValue) throws CoreException { - Object attr = getAttributeTable().get(key); - if (attr != null) { - if (attr instanceof Integer) { - return ((Integer)attr).intValue(); - } - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_int__2, new String[] {key}), null - ) - ); - } - return defaultValue; - } - - /** - * Returns the boolean attribute with the given key or the - * given default value if undefined. - * - * @return attribute specified by given key or the defaultValue if undefined - * @throws CoreException - * if the attribute with the given key exists but is not a - * boolean - */ - protected boolean getBooleanAttribute(String key, boolean defaultValue) throws CoreException { - Object attr = getAttributeTable().get(key); - if (attr != null) { - if (attr instanceof Boolean) { - return ((Boolean)attr).booleanValue(); - } - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_boolean__3, new String[] {key}), null - ) - ); - } - return defaultValue; - } - - /** - * Returns the java.util.List attribute with the given key or - * the given default value if undefined. - * - * @return attribute specified by given key or the defaultValue if undefined - * @throws CoreException - * if the attribute with the given key exists but is not a - * java.util.List - */ - protected List getListAttribute(String key, List defaultValue) throws CoreException { - Object attr = getAttributeTable().get(key); - if (attr != null) { - if (attr instanceof List) { - return (List)attr; - } - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_List__1, new String[] {key}), null - ) - ); - } - return defaultValue; - } - - /** - * Returns the java.util.Set attribute with the given key or - * the given default value if undefined. - * - * @return attribute specified by given key or the defaultValue if undefined - * @throws CoreException - * if the attribute with the given key exists but is not a - * java.util.Set - * - * @since 3.3 - */ - protected Set getSetAttribute(String key, Set defaultValue) throws CoreException { - Object attr = getAttributeTable().get(key); - if (attr != null) { - if (attr instanceof Set) { - return (Set)attr; - } - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, new String[] {key}), null - ) - ); - } - return defaultValue; - } - - /** - * Returns the java.util.Map attribute with the given key or - * the given default value if undefined. - * - * @return attribute specified by given key or the defaultValue if undefined - * @throws CoreException - * if the attribute with the given key exists but is not a - * java.util.Map - */ - protected Map getMapAttribute(String key, Map defaultValue) throws CoreException { - Object attr = getAttributeTable().get(key); - if (attr != null) { - if (attr instanceof Map) { - return (Map)attr; - } - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1, new String[] {key}), null - ) - ); - } - return defaultValue; - } - - /** - * Sets this configuration's type. - * - * @param type - * launch configuration type - */ - protected void setType(ILaunchConfigurationType type) { - fType = type; - } - - /** - * Returns this configuration's type. - * - * @return launch configuration type - */ - protected ILaunchConfigurationType getType() { - return fType; - } - - - /** - * Returns a copy of this info object - * - * @return copy of this info - */ - protected LaunchConfigurationInfo getCopy() { - LaunchConfigurationInfo copy = new LaunchConfigurationInfo(); - copy.setType(getType()); - copy.setAttributeTable(getAttributes()); - return copy; - } - - /** - * Returns a copy of this info's attribute map. - * - * @return a copy of this info's attribute map - */ - protected TreeMap getAttributes() { - return (TreeMap)getAttributeTable().clone(); - } - - /** - * Sets the given attribute to the given value. Only working copy's should - * use this API. - * - * @param key - * attribute key - * @param value - * attribute value - */ - protected void setAttribute(String key, Object value) { - if (value == null) { - getAttributeTable().remove(key); - } else { - getAttributeTable().put(key, value); - } - } - - /** - * Returns the content of this info as XML - * - * @return the content of this info as XML - * @throws CoreException - * if a attribute has been set with a null key - * @throws IOException - * if an exception occurs creating the XML - * @throws ParserConfigurationException - * if an exception occurs creating the XML - * @throws TransformerException - * if an exception occurs creating the XML - */ - protected String getAsXML() throws CoreException, IOException, ParserConfigurationException, TransformerException { - - Document doc = LaunchManager.getDocument(); - Element configRootElement = doc.createElement(LAUNCH_CONFIGURATION); - doc.appendChild(configRootElement); - - configRootElement.setAttribute(TYPE, getType().getIdentifier()); - - Iterator keys = getAttributeTable().keySet().iterator(); - while (keys.hasNext()) { - String key = (String)keys.next(); - if (key == null) { - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationInfo_36, null - ) - ); - } - Object value = getAttributeTable().get(key); - if (value == null) { - continue; - } - Element element = null; - String valueString = null; - if (value instanceof String) { - valueString = (String)value; - element = createKeyValueElement(doc, STRING_ATTRIBUTE, key, valueString); - } else if (value instanceof Integer) { - valueString = ((Integer)value).toString(); - element = createKeyValueElement(doc, INT_ATTRIBUTE, key, valueString); - } else if (value instanceof Boolean) { - valueString = ((Boolean)value).toString(); - element = createKeyValueElement(doc, BOOLEAN_ATTRIBUTE, key, valueString); - } else if (value instanceof List) { - element = createListElement(doc, LIST_ATTRIBUTE, key, (List)value); - } else if (value instanceof Map) { - element = createMapElement(doc, MAP_ATTRIBUTE, key, (Map)value); - } else if(value instanceof Set) { - element = createSetElement(doc, SET_ATTRIBUTE, key, (Set)value); - } - configRootElement.appendChild(element); - } - - return LaunchManager.serializeDocument(doc); - } - - /** - * Helper method that creates a 'key value' element of the specified type - * with the specified attribute values. - */ - protected Element createKeyValueElement(Document doc, String elementType, String key, String value) { - Element element = doc.createElement(elementType); - element.setAttribute(KEY, key); - element.setAttribute(VALUE, value); - return element; - } - - /** - * Creates a new Element for the specified - * java.util.List - * - * @param doc the doc to add the element to - * @param elementType the type of the element - * @param setKey the key for the element - * @param list the list to fill the new element with - * @return the new element - */ - protected Element createListElement(Document doc, String elementType, String listKey, List list) { - Element listElement = doc.createElement(elementType); - listElement.setAttribute(KEY, listKey); - Iterator iterator = list.iterator(); - while (iterator.hasNext()) { - String value = (String) iterator.next(); - Element element = doc.createElement(LIST_ENTRY); - element.setAttribute(VALUE, value); - listElement.appendChild(element); - } - return listElement; - } - - /** - * Creates a new Element for the specified - * java.util.Set - * - * @param doc the doc to add the element to - * @param elementType the type of the element - * @param setKey the key for the element - * @param set the set to fill the new element with - * @return the new element - * - * @since 3.3 - */ - protected Element createSetElement(Document doc, String elementType, String setKey, Set set) { - Element setElement = doc.createElement(elementType); - setElement.setAttribute(KEY, setKey); - // persist in sorted order - List list = new ArrayList(set); - Collections.sort(list); - Element element = null; - for(Iterator iter = list.iterator(); iter.hasNext();) { - element = doc.createElement(SET_ENTRY); - element.setAttribute(VALUE, (String) iter.next()); - setElement.appendChild(element); - } - return setElement; - } - - /** - * Creates a new Element for the specified - * java.util.Map - * - * @param doc the doc to add the element to - * @param elementType the type of the element - * @param setKey the key for the element - * @param map the map to fill the new element with - * @return the new element - * - */ - protected Element createMapElement(Document doc, String elementType, String mapKey, Map map) { - Element mapElement = doc.createElement(elementType); - mapElement.setAttribute(KEY, mapKey); - // persist in sorted order based on keys - List keys = new ArrayList(map.keySet()); - Collections.sort(keys); - Iterator iterator = keys.iterator(); - while (iterator.hasNext()) { - String key = (String) iterator.next(); - String value = (String) map.get(key); - Element element = doc.createElement(MAP_ENTRY); - element.setAttribute(KEY, key); - element.setAttribute(VALUE, value); - mapElement.appendChild(element); - } - return mapElement; - } - - /** - * Initializes the mapping of attributes from the XML file - * @param root the root node from the XML document - * @throws CoreException - */ - protected void initializeFromXML(Element root) throws CoreException { - if (!root.getNodeName().equalsIgnoreCase(LAUNCH_CONFIGURATION)) { - throw getInvalidFormatDebugException(); - } - - // read type - String id = root.getAttribute(TYPE); - if (id == null) { - throw getInvalidFormatDebugException(); - } - - ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(id); - if (type == null) { - String message= MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_missing_type, new Object[]{id}); - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.MISSING_LAUNCH_CONFIGURATION_TYPE, message, null) - ); - } - setType(type); - - NodeList list = root.getChildNodes(); - Node node = null; - Element element = null; - String nodeName = null; - for (int i = 0; i < list.getLength(); ++i) { - node = list.item(i); - short nodeType = node.getNodeType(); - if (nodeType == Node.ELEMENT_NODE) { - element = (Element) node; - nodeName = element.getNodeName(); - if (nodeName.equalsIgnoreCase(STRING_ATTRIBUTE)) { - setStringAttribute(element); - } else if (nodeName.equalsIgnoreCase(INT_ATTRIBUTE)) { - setIntegerAttribute(element); - } else if (nodeName.equalsIgnoreCase(BOOLEAN_ATTRIBUTE)) { - setBooleanAttribute(element); - } else if (nodeName.equalsIgnoreCase(LIST_ATTRIBUTE)) { - setListAttribute(element); - } else if (nodeName.equalsIgnoreCase(MAP_ATTRIBUTE)) { - setMapAttribute(element); - } else if(nodeName.equalsIgnoreCase(SET_ATTRIBUTE)) { - setSetAttribute(element); - } - } - } - } - - /** - * Loads a String from the specified element into the local attribute mapping - * @param element the element to load from - * @throws CoreException - */ - protected void setStringAttribute(Element element) throws CoreException { - setAttribute(getKeyAttribute(element), getValueAttribute(element)); - } - - /** - * Loads an Integer from the specified element into the local attribute mapping - * @param element the element to load from - * @throws CoreException - */ - protected void setIntegerAttribute(Element element) throws CoreException { - setAttribute(getKeyAttribute(element), new Integer(getValueAttribute(element))); - } - - /** - * Loads a Boolean from the specified element into the local attribute mapping - * @param element the element to load from - * @throws CoreException - */ - protected void setBooleanAttribute(Element element) throws CoreException { - setAttribute(getKeyAttribute(element), Boolean.valueOf(getValueAttribute(element))); - } - - /** - * Reads a List attribute from the specified XML node and - * loads it into the mapping of attributes - * - * @param element the element to read the list attribute from - * @throws CoreException if the element has an invalid format - */ - protected void setListAttribute(Element element) throws CoreException { - String listKey = element.getAttribute(KEY); - NodeList nodeList = element.getChildNodes(); - int entryCount = nodeList.getLength(); - List list = new ArrayList(entryCount); - Node node = null; - Element selement = null; - for (int i = 0; i < entryCount; i++) { - node = nodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - selement = (Element) node; - if (!selement.getNodeName().equalsIgnoreCase(LIST_ENTRY)) { - throw getInvalidFormatDebugException(); - } - list.add(getValueAttribute(selement)); - } - } - setAttribute(listKey, list); - } - - /** - * Reads a Set attribute from the specified XML node and - * loads it into the mapping of attributes - * - * @param element the element to read the set attribute from - * @throws CoreException if the element has an invalid format - * - * @since 3.3 - */ - protected void setSetAttribute(Element element) throws CoreException { - String setKey = element.getAttribute(KEY); - NodeList nodeList = element.getChildNodes(); - int entryCount = nodeList.getLength(); - Set set = new HashSet(entryCount); - Node node = null; - Element selement = null; - for(int i = 0; i < entryCount; i++) { - node = nodeList.item(i); - if(node.getNodeType() == Node.ELEMENT_NODE) { - selement = (Element)node; - if(!selement.getNodeName().equalsIgnoreCase(SET_ENTRY)) { - throw getInvalidFormatDebugException(); - } - set.add(getValueAttribute(selement)); - } - } - setAttribute(setKey, set); - } - - /** - * Reads a Map attribute from the specified XML node and - * loads it into the mapping of attributes - * - * @param element the element to read the map attribute from - * @throws CoreException if the element has an invalid format - */ - protected void setMapAttribute(Element element) throws CoreException { - String mapKey = element.getAttribute(KEY); - NodeList nodeList = element.getChildNodes(); - int entryCount = nodeList.getLength(); - Map map = new HashMap(entryCount); - Node node = null; - Element selement = null; - for (int i = 0; i < entryCount; i++) { - node = nodeList.item(i); - if (node.getNodeType() == Node.ELEMENT_NODE) { - selement = (Element) node; - if (!selement.getNodeName().equalsIgnoreCase(MAP_ENTRY)) { - throw getInvalidFormatDebugException(); - } - map.put(getKeyAttribute(selement), getValueAttribute(selement)); - } - } - setAttribute(mapKey, map); - } - - /** - * Returns the String representation of the 'key' attribute from the specified element - * @param element the element to read from - * @return the value - * @throws CoreException - */ - protected String getKeyAttribute(Element element) throws CoreException { - String key = element.getAttribute(KEY); - if (key == null) { - throw getInvalidFormatDebugException(); - } - return key; - } - - /** - * Returns the String representation of the 'value' attribute from the specified element - * @param element the element to read from - * @return the value - * @throws CoreException - */ - protected String getValueAttribute(Element element) throws CoreException { - String value = element.getAttribute(VALUE); - if (value == null) { - throw getInvalidFormatDebugException(); - } - return value; - } - - /** - * Returns an invalid format exception for reuse - * @return an invalid format exception - */ - protected DebugException getInvalidFormatDebugException() { - return - new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationInfo_Invalid_launch_configuration_XML__10, null - ) - ); - } - - /** - * Two LaunchConfigurationInfo objects are equal if and only - * if they have the same type and they have the same set of attributes with - * the same values. - * - * @see Object#equals(Object) - */ - public boolean equals(Object obj) { - - // Make sure it's a LaunchConfigurationInfo object - if (!(obj instanceof LaunchConfigurationInfo)) { - return false; - } - - // Make sure the types are the same - LaunchConfigurationInfo other = (LaunchConfigurationInfo) obj; - if (!fType.getIdentifier().equals(other.getType().getIdentifier())) { - return false; - } - - // Make sure the attributes are the same - return compareAttributes(fAttributes, other.getAttributeTable()); - } - - /** - * Returns whether the two attribute maps are equal, consulting registered - * comparator extensions. - * - * @param map1 attribute map - * @param map2 attribute map - * @return whether the two attribute maps are equal - */ - protected boolean compareAttributes(TreeMap map1, TreeMap map2) { - LaunchManager manager = (LaunchManager)DebugPlugin.getDefault().getLaunchManager(); - if (map1.size() == map2.size()) { - Iterator attributes = map1.keySet().iterator(); - while (attributes.hasNext()) { - String key = (String)attributes.next(); - Object attr1 = map1.get(key); - Object attr2 = map2.get(key); - if (attr2 == null) { - return false; - } - Comparator comp = manager.getComparator(key); - if (comp == null) { - if (fgIsSun14x) { - if(attr2 instanceof String & attr1 instanceof String) { - // this is a hack for bug 110215, on SUN 1.4.x, \r - // is stripped off when the stream is written to the - // DOM - // this is not the case for 1.5.x, so to be safe we - // are stripping \r off all strings before we - // compare for equality - attr1 = ((String)attr1).replaceAll("\\r", ""); //$NON-NLS-1$ //$NON-NLS-2$ - attr2 = ((String)attr2).replaceAll("\\r", ""); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - if (!attr1.equals(attr2)) { - return false; - } - } else { - if (comp.compare(attr1, attr2) != 0) { - return false; - } - } - } - return true; - } - return false; - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return fType.hashCode() + fAttributes.size(); - } - - /** - * Returns if the attribute map contains the specified key - * @param attributeName - * @return true if the attribute map contains the specified key, false otherwise - * - * @since 3.4.0 - */ - protected boolean hasAttribute(String attributeName) { - return fAttributes.containsKey(attributeName); - } - - /** - * Removes the specified attribute from the mapping and returns - * its value, or null if none. Does nothing - * if the attribute name is null - * @param attributeName - * @return attribute value or null - * - * @since 3.4.0 - */ - protected Object removeAttribute(String attributeName) { - if(attributeName != null) { - return fAttributes.remove(attributeName); - } - return null; - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java deleted file mode 100644 index f3d3a555f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java +++ /dev/null @@ -1,516 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.util.Collections; -import java.util.HashMap; -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.resources.IContainer; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchDelegate; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.ILaunchMode; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; - -import com.ibm.icu.text.MessageFormat; - -/** - * A launch configuration type wrappers a configuration - * element for a launchConfigurationType - * extension. - */ -public class LaunchConfigurationType extends PlatformObject implements ILaunchConfigurationType { - - /** - * The configuration element of the extension. - */ - private IConfigurationElement fElement; - - /** - * a listing of modes contributed to this launch configuration type - * - * @since 3.3 - */ - private Set fModes = null; - - /** - * A set of sets containing all of the supported mode combinations of this type - * - * @since 3.3 - */ - private Set fModeCombinations = null; - - /** - * the default source path computer for this config type - * - * @since 3.3 - */ - private ISourcePathComputer fSourcePathComputer = null; - - /** - * Cache for the migration delegate - * - * @since 3.3 - */ - private ILaunchConfigurationMigrationDelegate fMigrationDelegate = null; - - /** - * The source locator id for this config type - */ - private String fSourceLocator = null; - - /** - * The delegates for launch configurations of this type. - * Delegates are instantiated lazily as required. There may - * be different delegates for different modes (since 3.0). - * Map of modes (Set of modes) to list of delegates - */ - private Map fDelegates = null; - - /** - * The source provider cache entry - */ - private LaunchDelegate fSourceProvider = null; - - /** - * A map of preferred launch delegates for mode combinations - * - * @since 3.3 - */ - private Map fPreferredDelegates = null; - - /** - * Constructs a new launch configuration type on the - * given configuration element. - * - * @param element configuration element - */ - protected LaunchConfigurationType(IConfigurationElement element) { - fElement = element; - initializePreferredDelegates(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getAttribute(java.lang.String) - */ - public String getAttribute(String attributeName) { - return fElement.getAttribute(attributeName); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory() - */ - public String getCategory() { - return fElement.getAttribute(IConfigurationElementConstants.CATEGORY); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate() - */ - public ILaunchConfigurationDelegate getDelegate() throws CoreException { - return getDelegate(ILaunchManager.RUN_MODE); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String) - */ - public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException { - Set modes = new HashSet(); - modes.add(mode); - ILaunchDelegate[] delegates = getDelegates(modes); - if (delegates.length > 0) { - return delegates[0].getDelegate(); - } - IStatus status = null; - ILaunchMode launchMode = DebugPlugin.getDefault().getLaunchManager().getLaunchMode(mode); - if (launchMode == null) { - status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, - new String[]{mode})); - } else { - status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7, - new String[]{((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchModeName(mode)})); - } - throw new CoreException(status); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegates(java.util.Set) - */ - public ILaunchDelegate[] getDelegates(Set modes) throws CoreException { - initializeDelegates(); - Set delegates = (Set) fDelegates.get(modes); - if (delegates == null) { - delegates = Collections.EMPTY_SET; - } - return (ILaunchDelegate[]) delegates.toArray(new ILaunchDelegate[delegates.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#setPreferredDelegate(java.util.Set, org.eclipse.debug.core.ILaunchDelegate) - */ - public void setPreferredDelegate(Set modes, ILaunchDelegate delegate) { - if(fPreferredDelegates == null) { - fPreferredDelegates = new HashMap(); - } - if (delegate == null) { - fPreferredDelegates.remove(modes); - } else { - fPreferredDelegates.put(modes, delegate); - } - ((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).persistPreferredLaunchDelegate(this); - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationType#getPreferredDelegate(java.util.Set) - */ - public ILaunchDelegate getPreferredDelegate(Set modes) { - initializePreferredDelegates(); - return (ILaunchDelegate) fPreferredDelegates.get(modes); - } - - /** - * Internal use method to allow access to the listing of preferred delegates. Delegates are stored in the map by their mode set combinations. - *

                            - * preferred delegates are stored as: - *

                            -	 *  Map<modeset, delegate>
                            -	 * 
                            - *

                            - * @return the java.util.Map of preferred delegates or an empty java.util.Map if no preferred delegates are specified, never null - * - * @since 3.3 - */ - public Map getPreferredDelegates() { - initializePreferredDelegates(); - return fPreferredDelegates; - } - - /** - * This method is used to initialize the listing of preferred launch delegates for this type - * - *

                            - * Undecided if this code should live in the launch manager and have it load a listing of all preferred launch - * delegates that each config type could then query as needed when looking for their preferred delegate. - * Seems like it would be alot less work... - *

                            - * @since 3.3 - */ - private synchronized void initializePreferredDelegates() { - if(fPreferredDelegates == null) { - fPreferredDelegates = new HashMap(); - initializeDelegates(); - LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager(); - ILaunchDelegate delegate = null; - Set modes = null; - for(Iterator iter = fDelegates.keySet().iterator(); iter.hasNext();) { - modes = (Set) iter.next(); - delegate = lm.getPreferredDelegate(getIdentifier(), modes); - if(delegate != null) { - fPreferredDelegates.put(modes, delegate); - } - } - } - } - - /** - * Initializes the listing of launch delegates for this type - */ - private synchronized void initializeDelegates() { - if (fDelegates == null) { - // initialize delegate - fDelegates = new Hashtable(); - LaunchDelegate[] launchDelegates = getLaunchDelegateExtensions(); - LaunchDelegate delegate = null; - List modelist = null; - Set modes = null, tmp = null; - for (int i = 0; i < launchDelegates.length; i++) { - delegate = launchDelegates[i]; - modelist = delegate.getModes(); - for(int j = 0; j < modelist.size(); j++) { - //cache the delegate based on its set of modes and delegate - modes = (Set) modelist.get(j); - tmp = (Set) fDelegates.get(modes); - if (tmp == null) { - tmp = new HashSet(); - fDelegates.put(modes, tmp); - } - tmp.add(delegate); - } - } - } - } - - /** - * Returns all launch delegate extensions registered for this configuration type. - * - * @return all launch delegate extensions - */ - private LaunchDelegate[] getLaunchDelegateExtensions() { - return ((LaunchManager) DebugPlugin.getDefault().getLaunchManager()).getLaunchDelegates(getIdentifier()); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier() - */ - public String getIdentifier() { - return fElement.getAttribute(IConfigurationElementConstants.ID); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getName() - */ - public String getName() { - return fElement.getAttribute(IConfigurationElementConstants.NAME); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getPluginId() - */ - public String getPluginIdentifier() { - return fElement.getContributor().getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId() - */ - public String getSourceLocatorId() { - if(fSourceLocator == null) { - fSourceLocator = getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR); - //see if the cached source provider knows about it - if(fSourceProvider != null) { - fSourceLocator = fSourceProvider.getSourceLocatorId(); - } - //if not provided check all the applicable delegates for one and record the delegate if found, - //so it can be reused to try and find the source path computer - if(fSourceLocator == null) { - LaunchDelegate[] delegates = getLaunchDelegateExtensions(); - for(int i = 0; i < delegates.length; i++) { - fSourceLocator = delegates[i].getSourceLocatorId(); - if(fSourceLocator != null) { - fSourceProvider = delegates[i]; - return fSourceLocator; - } - } - fSourceProvider = null; - } - } - return fSourceLocator; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer() - */ - public ISourcePathComputer getSourcePathComputer() { - if(fSourcePathComputer == null) { - //get the id - String id = fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER); - //ask if the source provider knows about it - if(fSourceProvider != null) { - id = fSourceProvider.getSourcePathComputerId(); - } - if(id != null) { - fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id); - } - else { - //if not provided check all the applicable delegates for one and record the delegate if found, - //so it can be reused to try and find the source path computer - LaunchDelegate[] delegates = getLaunchDelegateExtensions(); - for(int i = 0; i < delegates.length; i++) { - id = delegates[i].getSourcePathComputerId(); - if(id != null) { - fSourceProvider = delegates[i]; - fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id); - if(fSourcePathComputer != null) { - return fSourcePathComputer; - } - } - } - fSourceProvider = null; - } - - } - return fSourcePathComputer; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes() - */ - public Set getSupportedModes() { - if(fModes == null) { - fModes = new HashSet(); - LaunchDelegate[] delegates = getLaunchDelegateExtensions(); - List modesets = null; - for(int i= 0; i < delegates.length; i++) { - modesets = delegates[i].getModes(); - for(Iterator iter = modesets.iterator(); iter.hasNext();) { - fModes.addAll((Set) iter.next()); - } - } - } - return fModes; - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModeCombinations() - */ - public Set getSupportedModeCombinations() { - if(fModeCombinations == null) { - initializeDelegates(); - fModeCombinations = new HashSet(); - fModeCombinations = fDelegates.keySet(); - } - //return a clone or bad things happen - HashSet set = new HashSet(); - for(Iterator iter = fModeCombinations.iterator(); iter.hasNext();) { - set.add(new HashSet((Set) iter.next())); - } - return set; - } - - /** - * determines if the specified candidate is suitable for migration by loading its delegate. - * if we initialize the delegate and it has not been provided, return false instead of failing - * @param candidate the candidate to inspect for migration suitability - * @return true if the specified launch configuration is suitable for migration, false otherwise - * @throws CoreException - * - * @since 3.2 - */ - public boolean isMigrationCandidate(ILaunchConfiguration candidate) throws CoreException { - initializeMigrationDelegate(); - if(fMigrationDelegate != null) { - return fMigrationDelegate.isCandidate(candidate); - } - return false; - } - - /** - * This method initializes the migration delegate - * @throws CoreException - */ - private synchronized void initializeMigrationDelegate() throws CoreException { - if(fElement.getAttribute(IConfigurationElementConstants.MIGRATION_DELEGATE) != null && fMigrationDelegate == null) { - fMigrationDelegate = (ILaunchConfigurationMigrationDelegate) fElement.createExecutableExtension(IConfigurationElementConstants.MIGRATION_DELEGATE); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic() - */ - public boolean isPublic() { - String publicString = fElement.getAttribute(IConfigurationElementConstants.PUBLIC); - if (publicString != null) { - if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$ - return false; - } - } - return true; - } - - /** - * Migrates the specified launch configuration by loading its delegate. - * In the event the migration delegate has not been provided do nothing. - * @param candidate the candidate launch configuration to migrate - * @throws CoreException - * - * @since 3.2 - */ - public void migrate(ILaunchConfiguration candidate) throws CoreException { - initializeMigrationDelegate(); - if(fMigrationDelegate != null) { - fMigrationDelegate.migrate(candidate); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String) - */ - public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) throws CoreException { - // validate the configuration name - see bug 275741 - IPath path = new Path(name); - if (container == null) { - // not allowed to nest in sub directory when local - if (path.segmentCount() > 1) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugCoreMessages.LaunchConfigurationType_2)); - } - } - // validate the name (last segment) - try { - DebugPlugin.getDefault().getLaunchManager().isValidLaunchConfigurationName(path.lastSegment()); - } catch (IllegalArgumentException e) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), e.getMessage(), e)); - } - return new LaunchConfigurationWorkingCopy(container, name, this); - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String) - */ - public boolean supportsMode(String mode) { - if(fModeCombinations == null) { - getSupportedModeCombinations(); - } - Set modes = null; - for(Iterator iter = fModeCombinations.iterator(); iter.hasNext();) { - modes = (Set) iter.next(); - if(modes.size() == 1 && modes.contains(mode)) { - return true; - } - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#getContributorName() - */ - public String getContributorName() { - return fElement.getContributor().getName(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationType#supportsModeCombination(java.util.Set) - */ - public boolean supportsModeCombination(Set modes) { - if(fModeCombinations == null) { - getSupportedModeCombinations(); - } - return fModeCombinations.contains(modes); - } - - /** - * Called on preference import to reset preferred delegates. - */ - void resetPreferredDelegates() { - fPreferredDelegates = null; - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java deleted file mode 100644 index fb2820235..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java +++ /dev/null @@ -1,729 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileStore; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -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.NullProgressMonitor; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.SubMonitor; -import org.eclipse.debug.core.DebugException; -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 com.ibm.icu.text.MessageFormat; - -/** - * A working copy launch configuration - */ -public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implements ILaunchConfigurationWorkingCopy { - - /** - * Handle of original launch configuration this - * working copy is based on - */ - private LaunchConfiguration fOriginal; - - /** - * Handle to a parent working copy - * @since 3.3 - */ - private LaunchConfigurationWorkingCopy fParent = null; - - /** - * Working copy of attributes. - */ - private LaunchConfigurationInfo fInfo; - - /** - * Whether this working copy has been modified since - * it was created - */ - private boolean fDirty; - - /** - * Indicates whether this working copy has been explicitly renamed. - */ - private boolean fRenamed; - - /** - * Suppress change notification until created - */ - private boolean fSuppressChange ; - - /** - * Constructs a working copy of the specified launch - * configuration. - * - * @param original launch configuration to make - * a working copy of - * @exception CoreException if unable to initialize this - * working copy's attributes based on the original configuration - */ - protected LaunchConfigurationWorkingCopy(LaunchConfiguration original) throws CoreException { - super(original.getName(), original.getContainer()); - copyFrom(original); - setOriginal(original); - fSuppressChange = false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.LaunchConfiguration#initialize() - */ - protected void initialize() { - fDirty = false; - fRenamed = false; - fSuppressChange = true; - super.initialize(); - } - - /** - * Constructs a working copy of the specified launch configuration as its parent. - * - * @param parent launch configuration to make - * a working copy of - * @exception CoreException if unable to initialize this - * working copy's attributes based on the original configuration - */ - protected LaunchConfigurationWorkingCopy(LaunchConfigurationWorkingCopy parent) throws CoreException { - super(parent.getName(), parent.getContainer()); - copyFrom(parent); - setOriginal((LaunchConfiguration) parent.getOriginal()); - fParent = parent; - fSuppressChange = false; - } - - /** - * Constructs a copy of the specified launch - * configuration, with the given (new) name. - * - * @param original launch configuration to make - * a working copy of - * @param name the new name for the copy of the launch - * configuration - * @exception CoreException if unable to initialize this - * working copy's attributes based on the original configuration - */ - protected LaunchConfigurationWorkingCopy(LaunchConfiguration original, String name) throws CoreException { - super(name, original.getContainer()); - copyFrom(original); - fSuppressChange = false; - } - - /** - * Constructs a new working copy to be created in the specified - * location. - * - * @param container the container that the configuration will be created in - * or null if to be local - * @param name the name of the new launch configuration - * @param type the type of this working copy - */ - protected LaunchConfigurationWorkingCopy(IContainer container, String name, ILaunchConfigurationType type) { - super(name, container); - setInfo(new LaunchConfigurationInfo()); - getInfo().setType(type); - fSuppressChange = false; - } - - /** - * @see ILaunchConfigurationWorkingCopy#isDirty() - */ - public boolean isDirty() { - return fDirty; - } - - /** - * @see ILaunchConfigurationWorkingCopy#doSave() - */ - public synchronized ILaunchConfiguration doSave() throws CoreException { - return doSave(new NullProgressMonitor()); - } - - /** - * Saves with progress. - * - * @param monitor - * @return the saved ILaunchConfiguration - * @throws CoreException - * - * @since 3.3 - */ - public synchronized ILaunchConfiguration doSave(IProgressMonitor monitor) throws CoreException { - SubMonitor lmonitor = SubMonitor.convert(monitor, 1); - try { - if (getParent() != null) { - // save to parent working copy - LaunchConfigurationWorkingCopy wc = (LaunchConfigurationWorkingCopy) getParent(); - if(isMoved()) { - wc.rename(getName()); - wc.setContainer(getContainer()); - } - wc.setAttributes(getInfo().getAttributes()); - updateMonitor(lmonitor, 1); - return wc; - } - else { - boolean useRunnable= true; - if (isLocal()) { - if (isMoved()) { - // If this config was moved from a shared location, saving - // it will delete the original from the workspace. Use runnable. - useRunnable= !isNew() && !getOriginal().isLocal(); - } else { - useRunnable= false; - } - } - if (useRunnable) { - IWorkspaceRunnable wr = new IWorkspaceRunnable() { - public void run(IProgressMonitor pm) throws CoreException { - doSave0(pm); - } - }; - ResourcesPlugin.getWorkspace().run(wr, null, 0, lmonitor.newChild(1)); - } else { - //file is persisted in the metadata not the workspace - doSave0(lmonitor.newChild(1)); - } - getLaunchManager().setMovedFromTo(null, null); - } - } - finally { - if(lmonitor != null) { - lmonitor.done(); - } - } - return new LaunchConfiguration(getName(), getContainer()); - } - - /** - * Performs the actual saving of the launch configuration. - * @throws CoreException - */ - private void doSave0(IProgressMonitor monitor) throws CoreException { - SubMonitor lmonitor = SubMonitor.convert(monitor, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_0, new String[] {getName()}), 2); - try { - // set up from/to information if this is a move - boolean moved = (!isNew() && isMoved()); - if (moved) { - ILaunchConfiguration to = new LaunchConfiguration(getName(), getContainer()); - ILaunchConfiguration from = getOriginal(); - getLaunchManager().setMovedFromTo(from, to); - } - ILaunchConfiguration orig = getOriginal(); - updateMonitor(lmonitor, 1); - writeNewFile(lmonitor.newChild(1)); - // delete the old file if this is not a new configuration - // or the file was renamed/moved - if (moved) { - orig.delete(); - } - fDirty = false; - } - finally { - if(lmonitor != null) { - lmonitor.done(); - } - } - } - - /** - * Writes the new configuration information to a file. - * - * @exception CoreException if writing the file fails - */ - protected void writeNewFile(IProgressMonitor monitor) throws CoreException { - String xml = null; - try { - xml = getInfo().getAsXML(); - } catch (Exception e) { - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1, new String[]{e.toString()}), null - ) - ); - } - SubMonitor lmonitor = SubMonitor.convert(monitor, IInternalDebugCoreConstants.EMPTY_STRING, 5); - try { - boolean added = false; - if (isLocal()) { - // use java.io to update configuration file - try { - lmonitor.subTask(DebugCoreMessages.LaunchConfigurationWorkingCopy_1); - IFileStore file = getFileStore(); - if (file == null) { - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_4, null - ) - ); - } - IFileStore dir = file.getParent(); - dir.mkdir(EFS.SHALLOW, null); - if (!file.fetchInfo().exists()) { - added = true; - updateMonitor(lmonitor, 1); - } - BufferedOutputStream stream = null; - try { - stream = new BufferedOutputStream(file.openOutputStream(EFS.NONE, null)); - stream.write(xml.getBytes("UTF8")); //$NON-NLS-1$ - } - finally { - if(stream != null) { - stream.close(); - } - } - //notify file saved - updateMonitor(lmonitor, 1); - } catch (IOException ie) { - lmonitor.done(); - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1, new String[]{ie.toString()}), null - ) - ); - } - } else { - // use resource API to update configuration file - IFile file = getFile(); - if (file == null) { - lmonitor.done(); - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_5, null - )); - } - IContainer dir = file.getParent(); - if (!dir.exists()) { - lmonitor.done(); - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2, null - ) - ); - } - ByteArrayInputStream stream = null; - try { - stream = new ByteArrayInputStream(xml.getBytes("UTF8")); //$NON-NLS-1$ - } catch (UnsupportedEncodingException ue) { - lmonitor.done(); - throw new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_5, ue - )); - } - SubMonitor smonitor = null; - if (!file.exists()) { - added = true; - //create file input stream: work one unit in a sub monitor - smonitor = lmonitor.newChild(1); - smonitor.setTaskName(MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_2, new String[] {getName()})); - file.create(stream, false, smonitor); - } else { - // validate edit - if (file.isReadOnly()) { - IStatus status = ResourcesPlugin.getWorkspace().validateEdit(new IFile[] {file}, null); - if (!status.isOK()) { - lmonitor.done(); - throw new CoreException(status); - } - } - //set the contents of the file: work 1 unit in a sub monitor - smonitor = lmonitor.newChild(1); - smonitor.setTaskName(MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_3, new String[] {getName()})); - file.setContents(stream, true, false, smonitor); - } - } - // notify of add/change for both local and shared configurations - see bug 288368 - if (added) { - getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getName(), getContainer())); - } else { - getLaunchManager().launchConfigurationChanged(new LaunchConfiguration(getName(), getContainer())); - } - } - finally { - if(lmonitor != null) { - lmonitor.done(); - } - } - } - - /** - * Updates the given monitor with the given tick count and polls for cancellation. If the monitor - * is cancelled an {@link OperationCanceledException} is thrown - * @param monitor - * @param ticks - * @throws OperationCanceledException - */ - private void updateMonitor(IProgressMonitor monitor, int ticks) throws OperationCanceledException { - if(monitor != null) { - monitor.worked(ticks); - if (monitor.isCanceled()) { - throw new OperationCanceledException(); - } - } - } - - /** - * @see ILaunchConfigurationWorkingCopy#setAttribute(String, int) - */ - public void setAttribute(String attributeName, int value) { - getInfo().setAttribute(attributeName, new Integer(value)); - setDirty(); - } - - /** - * @see ILaunchConfigurationWorkingCopy#setAttribute(String, String) - */ - public void setAttribute(String attributeName, String value) { - getInfo().setAttribute(attributeName, value); - setDirty(); - } - - /** - * @see ILaunchConfigurationWorkingCopy#setAttribute(String, boolean) - */ - public void setAttribute(String attributeName, boolean value) { - getInfo().setAttribute(attributeName, Boolean.valueOf(value)); - setDirty(); - } - - /** - * @see ILaunchConfigurationWorkingCopy#setAttribute(String, List) - */ - public void setAttribute(String attributeName, List value) { - getInfo().setAttribute(attributeName, value); - setDirty(); - } - - /** - * @see ILaunchConfigurationWorkingCopy#setAttribute(String, Map) - */ - public void setAttribute(String attributeName, Map value) { - getInfo().setAttribute(attributeName, value); - setDirty(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setAttribute(java.lang.String, java.util.Set) - */ - public void setAttribute(String attributeName, Set value) { - getInfo().setAttribute(attributeName, value); - setDirty(); - } - - /** - * @see ILaunchConfigurationWorkingCopy#getOriginal() - */ - public ILaunchConfiguration getOriginal() { - ILaunchConfiguration config = fOriginal; - ILaunchConfigurationWorkingCopy parent = fParent; - while(parent != null) { - config = parent.getOriginal(); - parent = parent.getParent(); - } - return config; - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#getParent() - */ - public ILaunchConfigurationWorkingCopy getParent() { - return fParent; - } - - /** - * Sets the launch configuration this working copy - * is based on. Initializes the attributes of this - * working copy to the current values of the given - * configuration. - * - * @param original the launch configuration this working - * copy is based on. - * @exception CoreException if unable to initialize this - * working copy based on the original's current attribute - * set - */ - private void copyFrom(LaunchConfiguration original) throws CoreException { - LaunchConfigurationInfo info = original.getInfo(); - setInfo(info.getCopy()); - fDirty = false; - } - - /** - * Sets the launch configuration this working copy - * is based on. - * - * @param original the launch configuration this working - * copy is based on. - */ - private void setOriginal(LaunchConfiguration original) { - fOriginal = original; - } - - /** - * Sets the working copy info object for this working copy. - * - * @param info a copy of attributes from this working copy's - * original launch configuration - */ - protected void setInfo(LaunchConfigurationInfo info) { - fInfo = info; - } - - /** - * @see ILaunchConfiguration#isWorkingCopy() - */ - public boolean isWorkingCopy() { - return true; - } - - /** - * A working copy keeps a local info object that is not - * cached with the launch manager. - * - * @see LaunchConfiguration#getInfo() - */ - protected LaunchConfigurationInfo getInfo() { - return fInfo; - } - - /** - * Sets this working copy's state to dirty. - * Notifies listeners that this working copy has - * changed. - */ - private void setDirty() { - fDirty = true; - if (!suppressChangeNotification()) { - getLaunchManager().getConfigurationNotifier().notify(this, LaunchManager.CHANGED); - } - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setModes(java.util.Set) - */ - public void setModes(Set modes) { - getInfo().setAttribute(ATTR_LAUNCH_MODES, (modes.size() > 0 ? modes : null)); - setDirty(); - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#addModes(java.util.Set) - */ - public void addModes(Set modes) { - try { - Set opts = getModes(); - if(opts.addAll(modes)) { - getInfo().setAttribute(ATTR_LAUNCH_MODES, opts); - setDirty(); - } - } - catch (CoreException e) { - DebugPlugin.log(e); - } - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeModes(java.util.Set) - */ - public void removeModes(Set options) { - try { - Set opts = getModes(); - if(opts.removeAll(options)) { - getInfo().setAttribute(ATTR_LAUNCH_MODES, (opts.size() < 1 ? null : opts)); - setDirty(); - } - } - catch (CoreException e) { - DebugPlugin.log(e); - } - } - - /** - * @see ILaunchConfigurationWorkingCopy#rename(String) - */ - public void rename(String name) { - if (!getName().equals(name)) { - setName(name); - fRenamed = isNew() || !(getOriginal().getName().equals(name)); - } - } - - /** - * Sets the new name for this configuration. - * - * @param name the new name for this configuration - */ - protected void setName(String name) { - super.setName(name); - setDirty(); - } - - /** - * Returns whether this working copy is new, or is a - * working copy of another launch configuration. - * - * @return whether this working copy is new, or is a - * working copy of another launch configuration - */ - protected boolean isNew() { - return getOriginal() == null; - } - - /** - * Returns whether this working copy is new or if its - * location has changed from that of its original. - * - * @return whether this working copy is new or if its - * location has changed from that of its original - */ - protected boolean isMoved() { - if (isNew() || fRenamed) { - return true; - } - IContainer newContainer = getContainer(); - IContainer originalContainer = ((LaunchConfiguration)getOriginal()).getContainer(); - if (newContainer == originalContainer) { - return false; - } - if (newContainer == null) { - return !originalContainer.equals(newContainer); - } - return !newContainer.equals(originalContainer); - } - - /** - * A working copy cannot generate a memento. - * - * @see ILaunchConfiguration#getMemento() - */ - public String getMemento() { - return null; - } - - /** - * Returns whether change notification should be - * suppressed - */ - protected boolean suppressChangeNotification() { - return fSuppressChange; - } - - /** - * @see ILaunchConfigurationWorkingCopy#setContainer(IContainer) - */ - public void setContainer(IContainer container) { - if (equalOrNull(getContainer(), container)) { - return; - } - super.setContainer(container); - setDirty(); - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setAttributes(java.util.Map) - */ - public void setAttributes(Map attributes) { - getInfo().setAttributes(attributes); - setDirty(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setResource(org.eclipse.core.resources.IResource) - */ - public void setMappedResources(IResource[] resources) { - ArrayList paths = null; - ArrayList types = null; - if(resources != null && resources.length > 0) { - paths = new ArrayList(resources.length); - types = new ArrayList(resources.length); - for (int i = 0; i < resources.length; i++) { - IResource resource = resources[i]; - if(resource != null) { - paths.add(resource.getFullPath().toPortableString()); - types.add(new Integer(resource.getType()).toString()); - } - } - } - setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS, paths); - setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, types); - } - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setPreferredLaunchDelegate(java.util.Set, java.lang.String) - */ - public void setPreferredLaunchDelegate(Set modes, String delegateId) { - if(modes != null) { - try { - Map delegates = getAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, (Map)null); - //copy map to avoid pointer issues - Map map = new HashMap(); - if(delegates != null) { - map.putAll(delegates); - } - if(delegateId == null) { - map.remove(modes.toString()); - } - else { - map.put(modes.toString(), delegateId); - } - setAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, map); - } - catch (CoreException ce) {DebugPlugin.log(ce);} - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.LaunchConfiguration#getWorkingCopy() - * CONTEXTLAUNCHING - */ - public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException { - return new LaunchConfigurationWorkingCopy(this); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeAttribute(java.lang.String) - */ - public Object removeAttribute(String attributeName) { - return getInfo().removeAttribute(attributeName); - } -} - diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java deleted file mode 100644 index 8ec2e22b9..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java +++ /dev/null @@ -1,250 +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.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchDelegate; -import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; - -import com.ibm.icu.text.MessageFormat; - -/** - * Proxy to a launch delegate extension - * Clients can contribute launch delegates through the launchDelegates extension point - * - * Example contribution of the local java launch delegate - *
                            - * 
                            -      
                            -          
                            -    		perspective="com.example.Perspective">
                            -   		  
                            -      
                            - * 
                            - * - * Clients are NOT intended to subclass this class - * - * @see IConfigurationElementConstants - * - * @since 3.3 - */ -public final class LaunchDelegate implements ILaunchDelegate { - - /** - * The configuration element for this delegate - */ - private IConfigurationElement fElement = null; - - /** - * The cached delegate. Remains null until asked for, then persisted - */ - private ILaunchConfigurationDelegate fDelegate = null; - - //a listing of sets of - private List fLaunchModes = null; - private String fType = null; - private HashMap fPerspectiveIds = null; - - /** - * Constructor - * @param element the configuration element to associate with this launch delegate - */ - public LaunchDelegate(IConfigurationElement element) { - fElement = element; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchDelegateProxy#getDelegate() - */ - public ILaunchConfigurationDelegate getDelegate() throws CoreException { - if(fDelegate == null) { - Object obj = fElement.createExecutableExtension(IConfigurationElementConstants.DELEGATE); - if(obj instanceof ILaunchConfigurationDelegate) { - fDelegate = (ILaunchConfigurationDelegate)obj; - } else { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, MessageFormat.format(DebugCoreMessages.LaunchDelegate_3, new String[]{getId()}), null)); - } - } - return fDelegate; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchDelegateProxy#getId() - */ - public String getId() { - return fElement.getAttribute(IConfigurationElementConstants.ID); - } - - /** - * Returns the id of the associated ILaunchConfigurationType or null if none provided - * @return the id of the ILaunchConfigurationType associated with this delegate - */ - public String getLaunchConfigurationTypeId() { - if(fType == null) { - //fall back to single association if no appliesTo - fType = fElement.getAttribute(IConfigurationElementConstants.TYPE); - if(fType == null) { - //the case when we have passed a launch configuration type to the launch delegate - fType = fElement.getAttribute(IConfigurationElementConstants.ID); - } - } - return fType; - } - - /** - * Simple method to parse mode strings (separated by commas) - * @param element the config element to read the mode string from - * @return a set of the parsed strings or an empty collection - * @since 3.3 - */ - private Set parseModes(IConfigurationElement element) { - HashSet set = new HashSet(); - String modes = element.getAttribute(IConfigurationElementConstants.MODES); - if (modes != null) { - String[] strings = modes.split(","); //$NON-NLS-1$ - for (int i = 0; i < strings.length; i++) { - set.add(strings[i].trim()); - } - } - return set; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchDelegateProxy#getModes() - */ - public List getModes() { - if(fLaunchModes == null) { - fLaunchModes = new ArrayList(); - fPerspectiveIds = new HashMap(); - IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.MODE_COMBINATION); - Set modeset = null; - for (int i = 0; i < children.length; i++) { - modeset = parseModes(children[i]); - fLaunchModes.add(modeset); - fPerspectiveIds.put(modeset, children[i].getAttribute(IConfigurationElementConstants.PERSPECTIVE)); - } - //try to get the modes from the old definition and make each one - //a separate set of one element - modeset = null; - String modes = fElement.getAttribute(IConfigurationElementConstants.MODES); - if (modes != null) { - String[] strings = modes.split(","); //$NON-NLS-1$ - for (int i = 0; i < strings.length; i++) { - modeset = new HashSet(); - modeset.add(strings[i].trim()); - fLaunchModes.add(modeset); - } - } - } - return fLaunchModes; - } - - /** - * Returns the human readable name for this launch delegate - * @return the human readable name for this launch delegate, or null if none - */ - public String getName() { - //try a delegateName attribute first, in the event this delegate was made from an ILaunchConfigurationType - String name = fElement.getAttribute(IConfigurationElementConstants.DELEGATE_NAME); - if(name == null) { - name = fElement.getAttribute(IConfigurationElementConstants.NAME); - if (name == null) { - name = getContributorName(); - } - name = name.trim(); - if (Character.isUpperCase(name.charAt(0))) { - name = MessageFormat.format(DebugCoreMessages.LaunchDelegate_1, new String[]{name}); - } else { - name = MessageFormat.format(DebugCoreMessages.LaunchDelegate_2, new String[]{name}); - } - } - return name; - } - - /** - * Returns the contributor name of this delegate (plug-in name). - * - * @return contributor name - */ - public String getContributorName() { - return fElement.getContributor().getName(); - } - - /** - * Returns the associated source locator id or null - * @return the associated source locator id or null if not provided - */ - public String getSourceLocatorId() { - return fElement.getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR); - } - - /** - * Returns the associated source path computer id or null - * @return the associated source path computer id or null if not provided - */ - public String getSourcePathComputerId() { - return fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER); - } - - /** - * @see org.eclipse.debug.core.ILaunchDelegate#getDescription() - */ - public String getDescription() { - String desc = fElement.getAttribute(IConfigurationElementConstants.DELEGATE_DESCRIPTION); - if(desc == null) { - return DebugCoreMessages.LaunchDelegate_0; - } - return desc; - } - - /** - * @see org.eclipse.debug.core.ILaunchDelegate#getPluginIdentifier() - */ - public String getPluginIdentifier() { - return fElement.getContributor().getName(); - } - - /** - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if(obj == null) { - return false; - } - return obj instanceof ILaunchDelegate && getId() != null && getId().equals(((ILaunchDelegate)obj).getId()); - } - - /** - * @see org.eclipse.debug.core.ILaunchDelegate#getPerspectiveId(java.util.Set) - */ - public String getPerspectiveId(Set modes) { - if(fPerspectiveIds == null) { - getModes(); - } - return (String) fPerspectiveIds.get(modes); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java deleted file mode 100644 index 6780dfde9..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java +++ /dev/null @@ -1,2685 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Sebastian Davids - bug 50567 Eclipse native environment support on Win98 - * Pawel Piech - Bug 82001: When shutting down the IDE, the debugger should first - * attempt to disconnect debug targets before terminating them - * Alena Laskavaia - Bug 259281 - * Marc Khouzam - Bug 313143: Preferred Launch Delegate not recovered from preferences - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.io.BufferedInputStream; -import java.io.BufferedReader; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import java.util.StringTokenizer; -import java.util.Map.Entry; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerException; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMSource; -import javax.xml.transform.stream.StreamResult; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileStore; -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.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.IResourceProxy; -import org.eclipse.core.resources.IResourceProxyVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -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.IProgressMonitor; -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.MultiStatus; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.VariablesPlugin; -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.ILaunchConfigurationListener; -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.core.ILaunchMode; -import org.eclipse.debug.core.ILaunchesListener; -import org.eclipse.debug.core.ILaunchesListener2; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IDisconnect; -import org.eclipse.debug.core.model.IPersistableSourceLocator; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; -import org.eclipse.debug.internal.core.sourcelookup.SourceContainerType; -import org.eclipse.debug.internal.core.sourcelookup.SourcePathComputer; -import org.eclipse.osgi.service.environment.Constants; -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; - -import com.ibm.icu.text.MessageFormat; - -/** - * Manages launch configurations, launch configuration types, and registered launches. - * - * @see ILaunchManager - */ -public class LaunchManager extends PlatformObject implements ILaunchManager, IResourceChangeListener { - - /** - * Preferred launch delegate preference name. - *

                            - * Prior to 3.5 this preferred launch delegates for all launch - * configuration types were serialized into a single XML string - * and stored in this preference. - *

                            - *

                            - * Since 3.5, the preferred launch delegates are stored in a separate - * preference for each launch configuration type. The name of this - * preference is composed of the prefix, followed by a slash, followed by - * the launch configuration type id. The values contain a set of launch - * delegates, delimited by a semicolon, and each delegate entry contains - * the delegate ID, followed by a comma, followed by comma-delimited - * launch modes. - * - * @since 3.3 - */ - protected static final String PREF_PREFERRED_DELEGATES = DebugPlugin.getUniqueIdentifier() + ".PREFERRED_DELEGATES"; //$NON-NLS-1$ - - /** - * Boolean preference on whether to delete associated configurations when a project is deleted. - * - * @since 3.3 - */ - public static final String PREF_DELETE_CONFIGS_ON_PROJECT_DELETE = DebugPlugin.getUniqueIdentifier() + ".PREF_DELETE_CONFIGS_ON_PROJECT_DELETE"; //$NON-NLS-1$ - - /** - * Constant to define debug.ui for the status codes - * - * @since 3.2 - */ - private static final String DEBUG_UI = "org.eclipse.debug.ui"; //$NON-NLS-1$ - - /** - * Listing of unsupported launch configuration names for the Win 32 platform - * @since 3.5 - */ - static final String[] UNSUPPORTED_WIN32_CONFIG_NAMES = new String[] {"aux", "clock$", "com1", "com2", "com3", "com4", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ - "com5", "com6", "com7", "com8", "com9", "con", "lpt1", "lpt2", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ - "lpt3", "lpt4", "lpt5", "lpt6", "lpt7", "lpt8", "lpt9", "nul", "prn"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ - - /** - * Disallowed characters for launch configuration names - * '@' and '&' are disallowed because they corrupt menu items. - * - * @since 3.5 - */ - static final char[] DISALLOWED_CONFIG_NAME_CHARS = new char[] { '@', '&','\\', '/', ':', '*', '?', '"', '<', '>', '|', '\0' }; - - /** - * Status code for which a UI prompter is registered. - * - * @since 3.2 - */ - protected static final IStatus promptStatus = new Status(IStatus.INFO, DEBUG_UI, 200, IInternalDebugCoreConstants.EMPTY_STRING, null); - - /** - * Step filter manager - */ - private StepFilterManager fStepFilterManager = null; - - /** - * Notifies a launch config listener in a safe runnable to handle - * exceptions. - */ - class ConfigurationNotifier implements ISafeRunnable { - - private ILaunchConfigurationListener fListener; - private int fType; - private ILaunchConfiguration fConfiguration; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during launch configuration change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /** - * Notifies the given listener of the add/change/remove - * - * @param configuration the configuration that has changed - * @param update the type of change - */ - public void notify(ILaunchConfiguration configuration, int update) { - fConfiguration = configuration; - fType = update; - if (fLaunchConfigurationListeners.size() > 0) { - Object[] listeners = fLaunchConfigurationListeners.getListeners(); - for (int i = 0; i < listeners.length; i++) { - fListener = (ILaunchConfigurationListener)listeners[i]; - SafeRunner.run(this); - } - } - fConfiguration = null; - fListener = null; - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.launchConfigurationAdded(fConfiguration); - break; - case REMOVED: - fListener.launchConfigurationRemoved(fConfiguration); - break; - case CHANGED: - fListener.launchConfigurationChanged(fConfiguration); - break; - } - } - } - - /** - * Notifies a launch listener (multiple launches) in a safe runnable to - * handle exceptions. - */ - class LaunchesNotifier implements ISafeRunnable { - - private ILaunchesListener fListener; - private int fType; - private ILaunch[] fNotifierLaunches; - private ILaunch[] fRegistered; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during launch change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /** - * Notifies the given listener of the adds/changes/removes - * - * @param launches the launches that changed - * @param update the type of change - */ - public void notify(ILaunch[] launches, int update) { - fNotifierLaunches = launches; - fType = update; - fRegistered = null; - Object[] copiedListeners= fLaunchesListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (ILaunchesListener)copiedListeners[i]; - SafeRunner.run(this); - } - fNotifierLaunches = null; - fRegistered = null; - fListener = null; - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.launchesAdded(fNotifierLaunches); - break; - case REMOVED: - fListener.launchesRemoved(fNotifierLaunches); - break; - case CHANGED: - case TERMINATE: - if (fRegistered == null) { - List registered = null; - for (int j = 0; j < fNotifierLaunches.length; j++) { - if (isRegistered(fNotifierLaunches[j])) { - if (registered != null) { - registered.add(fNotifierLaunches[j]); - } - } else { - if (registered == null) { - registered = new ArrayList(fNotifierLaunches.length); - for (int k = 0; k < j; k++) { - registered.add(fNotifierLaunches[k]); - } - } - } - } - if (registered == null) { - fRegistered = fNotifierLaunches; - } else { - fRegistered = (ILaunch[])registered.toArray(new ILaunch[registered.size()]); - } - } - if (fRegistered.length > 0) { - if (fType == CHANGED) { - fListener.launchesChanged(fRegistered); - } - if (fType == TERMINATE && fListener instanceof ILaunchesListener2) { - ((ILaunchesListener2)fListener).launchesTerminated(fRegistered); - } - } - break; - } - } - } - - /** - * Visitor for handling a resource begin deleted, and the need to check mapped configurations - * for auto-deletion - * @since 3.4 - */ - class MappedResourceVisitor implements IResourceDeltaVisitor { - - /* (non-Javadoc) - * @see org.eclipse.core.resources.IResourceDeltaVisitor#visit(org.eclipse.core.resources.IResourceDelta) - */ - public boolean visit(IResourceDelta delta) throws CoreException { - if (0 != (delta.getFlags() & IResourceDelta.OPEN)) { - return false; - } - if(delta.getKind() == IResourceDelta.REMOVED && delta.getFlags() != IResourceDelta.MOVED_TO) { - ArrayList configs = collectAssociatedLaunches(delta.getResource()); - if(configs.size() > 0) { - for(Iterator iter = configs.iterator(); iter.hasNext();) { - try { - ((ILaunchConfiguration)iter.next()).delete(); - } catch (CoreException e) { - DebugPlugin.log(e.getStatus()); - } - } - } - return false; - } - return true; - } - } - - /** - * Visitor for handling resource deltas. - */ - class LaunchManagerVisitor implements IResourceDeltaVisitor { - - /** - * @see IResourceDeltaVisitor#visit(IResourceDelta) - */ - public boolean visit(IResourceDelta delta) { - if (delta == null) { - return false; - } - if (0 != (delta.getFlags() & IResourceDelta.OPEN)) { - if (delta.getResource() instanceof IProject) { - IProject project = (IProject)delta.getResource(); - if (project.isOpen()) { - LaunchManager.this.projectOpened(project); - } else { - LaunchManager.this.projectClosed(project); - } - } - return false; - } - IResource resource = delta.getResource(); - if (resource instanceof IFile) { - IFile file = (IFile)resource; - if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(file.getFileExtension())) { - ILaunchConfiguration handle = new LaunchConfiguration(file); - switch (delta.getKind()) { - case IResourceDelta.ADDED : - LaunchManager.this.launchConfigurationAdded(handle); - break; - case IResourceDelta.REMOVED : - LaunchManager.this.launchConfigurationDeleted(handle); - break; - case IResourceDelta.CHANGED : - LaunchManager.this.launchConfigurationChanged(handle); - break; - } - } - return false; - } - return true; - } - } - - /** - * Notifies a launch listener (single launch) in a safe runnable to handle - * exceptions. - */ - class LaunchNotifier implements ISafeRunnable { - - private ILaunchListener fListener; - private int fType; - private ILaunch fLaunch; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, "An exception occurred during launch change notification.", exception); //$NON-NLS-1$ - DebugPlugin.log(status); - } - - /** - * Notifies listeners of the add/change/remove - * - * @param launch the launch that has changed - * @param update the type of change - */ - public void notify(ILaunch launch, int update) { - fLaunch = launch; - fType = update; - Object[] copiedListeners= fListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (ILaunchListener)copiedListeners[i]; - SafeRunner.run(this); - } - fLaunch = null; - fListener = null; - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.launchAdded(fLaunch); - break; - case REMOVED: - fListener.launchRemoved(fLaunch); - break; - case CHANGED: - if (isRegistered(fLaunch)) { - fListener.launchChanged(fLaunch); - } - break; - } - } - } - - /** - * Collects files whose extension matches the launch configuration file - * extension. - */ - class ResourceProxyVisitor implements IResourceProxyVisitor { - - private List fList; - - protected ResourceProxyVisitor(List list) { - fList= list; - } - /** - * @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy) - */ - public boolean visit(IResourceProxy proxy) { - if (proxy.getType() == IResource.FILE) { - if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equalsIgnoreCase(proxy.requestFullPath().getFileExtension())) { - fList.add(proxy.requestResource()); - } - return false; - } - return true; - } - } - - /** - * Internal class used to hold information about a preferred delegate - * - * @since 3.3 - */ - class PreferredDelegate { - private ILaunchDelegate fDelegate = null; - private String fTypeid = null; - private Set fModes = null; - - public PreferredDelegate(ILaunchDelegate delegate, String typeid, Set modes) { - fDelegate = delegate; - fTypeid = typeid; - fModes = modes; - } - - public String getTypeId() { - return fTypeid; - } - - public Set getModes() { - return fModes; - } - - public ILaunchDelegate getDelegate() { - return fDelegate; - } - } - - /** - * Types of notifications - */ - public static final int ADDED = 0; - public static final int REMOVED= 1; - public static final int CHANGED= 2; - public static final int TERMINATE= 3; - - /** - * The collection of native environment variables on the user's system. Cached - * after being computed once as the environment cannot change. - */ - private static HashMap fgNativeEnv= null; - private static HashMap fgNativeEnvCasePreserved= null; - - /** - * Path to the local directory where local launch configurations - * are stored with the workspace. - */ - public static final IPath LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH = - DebugPlugin.getDefault().getStateLocation().append(".launches"); //$NON-NLS-1$ - /** - * 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; - } - - /** - * Serializes a XML document into a string - encoded in UTF8 format, - * with platform line separators. - * - * @param doc document to serialize - * @return the document as a string - * @throws TransformerException if an unrecoverable error occurs during the serialization - * @throws IOException if the encoding attempted to be used is not supported - */ - public static String serializeDocument(Document doc) throws TransformerException, IOException { - ByteArrayOutputStream s = new ByteArrayOutputStream(); - TransformerFactory factory = TransformerFactory.newInstance(); - Transformer transformer = factory.newTransformer(); - transformer.setOutputProperty(OutputKeys.METHOD, "xml"); //$NON-NLS-1$ - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$ - DOMSource source = new DOMSource(doc); - StreamResult outputTarget = new StreamResult(s); - transformer.transform(source, outputTarget); - return s.toString("UTF8"); //$NON-NLS-1$ - } - - /** - * Collection of defined launch configuration type - * extensions. - */ - private List fLaunchConfigurationTypes = null; - - /** - * Launch configuration cache. Keys are LaunchConfiguration, - * values are LaunchConfigurationInfo. - */ - private Map fLaunchConfigurations = new HashMap(10); - - /** - * A cache of launch configuration names currently in the workspace. - */ - private String[] fSortedConfigNames = null; - - /** - * Collection of all launch configurations in the workspace. - * List of ILaunchConfiguration. - */ - private List fLaunchConfigurationIndex = null; - - /** - * Launch configuration comparator extensions, - * keyed by attribute name. - */ - private Map fComparators = null; - - /** - * Registered launch modes, or null if not initialized. - * Keys are mode identifiers, values are ILaunchModes. - */ - private Map fLaunchModes = null; - - /** - * A map of LaunchDelegate objects stored by id of delegate, or launch config type - */ - private HashMap fLaunchDelegates = null; - - /** - * Initial startup cache of preferred delegate so that the debug preferences are only parsed once - * - * @since 3.3 - */ - private Set fPreferredDelegates = null; - - /** - * Collection of launches - */ - private List fLaunches= new ArrayList(10); - /** - * Set of launches for efficient 'isRegistered()' check - */ - private Set fLaunchSet = new HashSet(10); - - /** - * Collection of listeners - */ - private ListenerList fListeners = new ListenerList(); - - /** - * Collection of "plural" listeners. - * @since 2.1 - */ - private ListenerList fLaunchesListeners = new ListenerList(); - - /** - * Visitor used to process resource deltas, - * to update launch configuration index. - */ - private LaunchManagerVisitor fgVisitor; - - /** - * Visitor used to process a deleted resource, - * to remove mapped launch configurations in the event - * auto-removal of launch configurations is enabled - * - * @since 3.4 - */ - private MappedResourceVisitor fgMRVisitor; - - /** - * Whether this manager is listening for resource change events - */ - private boolean fListening = false; - - /** - * Launch configuration listeners - */ - private ListenerList fLaunchConfigurationListeners = new ListenerList(); - - /** - * Table of source locator extensions. Keys - * are identifiers, and values are associated - * configuration elements. - */ - private Map fSourceLocators = null; - - /** - * The handles of launch configurations being moved, or null - */ - private ILaunchConfiguration fFrom; - - private ILaunchConfiguration fTo; - - /** - * Map of source container type extensions. Keys are extension ids - * and values are associated configuration elements. - */ - private Map sourceContainerTypes; - - /** - * Map of source path computer extensions. Keys are extension ids - * and values are associated configuration elements. - */ - private Map sourcePathComputers; - - private Set fActiveModes; - - /** - * @see ILaunchManager#addLaunch(ILaunch) - */ - public void addLaunch(ILaunch launch) { - if (internalAddLaunch(launch)) { - fireUpdate(launch, ADDED); - fireUpdate(new ILaunch[] {launch}, ADDED); - } - } - - /** - * @see ILaunchManager#addLaunchConfigurationListener(ILaunchConfigurationListener) - */ - public void addLaunchConfigurationListener(ILaunchConfigurationListener listener) { - fLaunchConfigurationListeners.add(listener); - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#addLaunches(org.eclipse.debug.core.ILaunch[]) - */ - public void addLaunches(ILaunch[] launches) { - List added = new ArrayList(launches.length); - for (int i = 0; i < launches.length; i++) { - if (internalAddLaunch(launches[i])) { - added.add(launches[i]); - } - } - if (!added.isEmpty()) { - ILaunch[] addedLaunches = (ILaunch[])added.toArray(new ILaunch[added.size()]); - fireUpdate(addedLaunches, ADDED); - for (int i = 0; i < addedLaunches.length; i++) { - fireUpdate(launches[i], ADDED); - } - } - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#addLaunchListener(org.eclipse.debug.core.ILaunchesListener) - */ - public void addLaunchListener(ILaunchesListener listener) { - fLaunchesListeners.add(listener); - } - - /** - * @see ILaunchManager#addLaunchListener(ILaunchListener) - */ - public void addLaunchListener(ILaunchListener listener) { - fListeners.add(listener); - } - - /** - * Computes and caches the native system environment variables as a map of - * variable names and values (Strings) in the given map. - *

                            - * Note that WIN32 system environment preserves - * the case of variable names but is otherwise case insensitive. - * Depending on what you intend to do with the environment, the - * lack of normalization may or may not be create problems. This - * method preserves mixed-case keys using the variable names - * recorded by the OS. - *

                            - * @since 3.1 - */ - private void cacheNativeEnvironment(Map cache) { - try { - String nativeCommand= null; - boolean isWin9xME= false; //see bug 50567 - String fileName= null; - if (Platform.getOS().equals(Constants.OS_WIN32)) { - String osName= System.getProperty("os.name"); //$NON-NLS-1$ - isWin9xME= osName != null && (osName.startsWith("Windows 9") || osName.startsWith("Windows ME")); //$NON-NLS-1$ //$NON-NLS-2$ - if (isWin9xME) { - // Win 95, 98, and ME - // SET might not return therefore we pipe into a file - IPath stateLocation= DebugPlugin.getDefault().getStateLocation(); - fileName= stateLocation.toOSString() + File.separator + "env.txt"; //$NON-NLS-1$ - nativeCommand= "command.com /C set > " + fileName; //$NON-NLS-1$ - } else { - // Win NT, 2K, XP - nativeCommand= "cmd.exe /C set"; //$NON-NLS-1$ - } - } else if (!Platform.getOS().equals(Constants.OS_UNKNOWN)){ - nativeCommand= "env"; //$NON-NLS-1$ - } - if (nativeCommand == null) { - return; - } - Process process= Runtime.getRuntime().exec(nativeCommand); - if (isWin9xME) { - //read piped data on Win 95, 98, and ME - Properties p= new Properties(); - File file= new File(fileName); - InputStream stream = new BufferedInputStream(new FileInputStream(file)); - p.load(stream); - stream.close(); - if (!file.delete()) { - file.deleteOnExit(); // if delete() fails try again on VM close - } - for (Enumeration enumeration = p.keys(); enumeration.hasMoreElements();) { - // Win32's environment variables are case insensitive. Put everything - // to uppercase so that (for example) the "PATH" variable will match - // "pAtH" correctly on Windows. - String key= (String) enumeration.nextElement(); - //no need to cast value - cache.put(key, p.get(key)); - } - } else { - //read process directly on other platforms - //we need to parse out matching '{' and '}' for function declarations in .bash environments - // pattern is [func name]=() { and we must find the '}' on its own line with no trailing ';' - InputStream stream = process.getInputStream(); - InputStreamReader isreader = new InputStreamReader(stream); - BufferedReader reader = new BufferedReader(isreader); - String line = reader.readLine(); - String key = null; - String value = null; - String newLine = System.getProperty("line.separator"); //$NON-NLS-1$ - while (line != null) { - int func = line.indexOf("=()"); //$NON-NLS-1$ - if(func > 0) { - key = line.substring(0, func); - //scan until we find the closing '}' with no following chars - value = line.substring(func+1); - while(line != null && !line.equals("}")) { //$NON-NLS-1$ - line = reader.readLine(); - if(line != null) { - value += newLine + line; - } - } - line = reader.readLine(); - } - else { - int separator = line.indexOf('='); - if (separator > 0) { - key = line.substring(0, separator); - value = line.substring(separator + 1); - line = reader.readLine(); - if(line != null) { - // this line has a '=' read ahead to check next line for '=', might be broken on more than one line - // also if line starts with non-identifier - it is remainder of previous variable - while (line.indexOf('=') < 0 || (line.length()>0 && !Character.isJavaIdentifierStart(line.charAt(0)))) { - value += newLine + line; - line = reader.readLine(); - if(line == null) { - //if next line read is the end of the file quit the loop - break; - } - } - } - } - } - if(key != null) { - cache.put(key, value); - key = null; - value = null; - } - else { - line = reader.readLine(); - } - } - reader.close(); - } - } catch (IOException e) { - // Native environment-fetching code failed. - // This can easily happen and is not useful to log. - } - } - - /** - * Clears all launch configurations (if any have been accessed) - */ - private void clearAllLaunchConfigurations() { - if (fLaunchConfigurationTypes != null) { - fLaunchConfigurationTypes.clear(); - } - if (fLaunchConfigurationIndex != null) { - fLaunchConfigurationIndex.clear(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getEncoding(org.eclipse.debug.core.ILaunchConfiguration) - */ - public String getEncoding(ILaunchConfiguration configuration) throws CoreException { - String encoding = configuration.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, (String)null); - if(encoding == null) { - IResource[] resources = configuration.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(); - } - } - else { - return ResourcesPlugin.getEncoding(); - } - } - return encoding; - } - - /** - * The launch config name cache is cleared when a config is added, deleted or changed. - */ - protected void clearConfigNameCache() { - fSortedConfigNames = null; - } - - /** - * Return an instance of DebugException containing the specified message and Throwable. - */ - protected DebugException createDebugException(String message, Throwable throwable) { - return new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, message, throwable - ) - ); - } - - /** - * Return a LaunchConfigurationInfo object initialized from XML contained in - * the specified stream. Simply pass out any exceptions encountered so that - * caller can deal with them. This is important since caller may need access to the - * actual exception. - */ - protected LaunchConfigurationInfo createInfoFromXML(InputStream stream) throws CoreException, - ParserConfigurationException, - IOException, - SAXException { - Element root = null; - DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); - parser.setErrorHandler(new DefaultHandler()); - root = parser.parse(new InputSource(stream)).getDocumentElement(); - LaunchConfigurationInfo info = new LaunchConfigurationInfo(); - info.initializeFromXML(root); - return info; - } - - /** - * Finds and returns all launch configurations in the given - * container (and sub-containers) - * - * @param container the container to search - * @exception CoreException an exception occurs traversing - * the container. - * @return all launch configurations in the given container - */ - protected List findLaunchConfigurations(IContainer container) { - List list = new ArrayList(10); - if (container instanceof IProject && !((IProject)container).isOpen()) { - return list; - } - ResourceProxyVisitor visitor= new ResourceProxyVisitor(list); - try { - container.accept(visitor, IResource.NONE); - } catch (CoreException ce) { - //Closed project...should not be possible with previous check - } - Iterator iter = list.iterator(); - List configs = new ArrayList(list.size()); - ILaunchConfiguration config = null; - while (iter.hasNext()) { - config = getLaunchConfiguration((IFile)iter.next()); - if(config != null && config.exists()) { - configs.add(config); - } - } - return configs; - } - - /** - * Finds and returns all local launch configurations. - * - * @return all local launch configurations - */ - protected List findLocalLaunchConfigurations() { - IPath containerPath = LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH; - List configs = new ArrayList(10); - final File directory = containerPath.toFile(); - if (directory.isDirectory()) { - FilenameFilter filter = new FilenameFilter() { - public boolean accept(File dir, String name) { - return dir.equals(directory) && - name.endsWith(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION); - } - }; - File[] files = directory.listFiles(filter); - LaunchConfiguration config = null; - for (int i = 0; i < files.length; i++) { - config = new LaunchConfiguration(LaunchConfiguration.getSimpleName(files[i].getName()), null); - configs.add(config); - } - } - return configs; - } - - /** - * Fires notification to (single) listeners that a launch has been - * added/changed/removed. - * - * @param launch launch that has changed - * @param update type of change - */ - public void fireUpdate(ILaunch launch, int update) { - new LaunchNotifier().notify(launch, update); - } - - /** - * Fires notification to (plural) listeners that a launch has been - * added/changed/removed. - * - * @param launches launches that have changed - * @param update type of change - */ - public void fireUpdate(ILaunch[] launches, int update) { - new LaunchesNotifier().notify(launches, update); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#generateUniqueLaunchConfigurationNameFrom(java.lang.String) - */ - public String generateUniqueLaunchConfigurationNameFrom(String baseName) { - int index = 1; - int length= baseName.length(); - int copyIndex = baseName.lastIndexOf(" ("); //$NON-NLS-1$ - if (copyIndex > -1 && length > copyIndex + 2 && baseName.charAt(length - 1) == ')') { - String trailer = baseName.substring(copyIndex + 2, length -1); - if (isNumber(trailer)) { - try { - index = Integer.parseInt(trailer); - baseName = baseName.substring(0, copyIndex); - } - catch (NumberFormatException nfe) {} - } - } - String newName = baseName; - while (isExistingLaunchConfigurationName(newName)) { - newName = MessageFormat.format(DebugCoreMessages.LaunchManager_31, new String[] {baseName, Integer.toString(index)}); - index++; - } - return newName; - } - - /** - * Return a String that can be used as the name of a launch configuration. The name - * is guaranteed to be unique (no existing or temporary launch configurations will have this name). - * The name that is returned uses the basename as a starting point. If - * there is no existing launch configuration with this name, then basename - * is returned. Otherwise, the value returned consists of the specified base plus - * some suffix that guarantees uniqueness. Passing null as the set of reserved names will cause this - * method to return generateUniqueLaunchConfigurationNameFrom(String baseName). - * - * By specifying a set of reserved names, you can further constrain the name that will be generated - * by this method. For example you can give a base name of 'test' and a reserved set of [test(1), test(2)], - * which will result in a name of 'test(3)' being returned iff a configuration with the name 'test' already exists. - * - * @return launch configuration name - * @param basename the String that the returned name must begin with - * @param reservednames a set of strings that is further used to constrain what names can be generated - * @since 3.3 - */ - public String generateUniqueLaunchConfigurationNameFrom(String basename, Set reservednames) { - if(reservednames == null) { - return generateUniqueLaunchConfigurationNameFrom(basename); - } - int index = 1; - int length= basename.length(); - String base = basename; - int copyIndex = base.lastIndexOf(" ("); //$NON-NLS-1$ - if (copyIndex > -1 && length > copyIndex + 2 && base.charAt(length - 1) == ')') { - String trailer = base.substring(copyIndex + 2, length -1); - if (isNumber(trailer)) { - try { - index = Integer.parseInt(trailer); - base = base.substring(0, copyIndex); - } - catch (NumberFormatException nfe) {} - } - } - String newname = base; - StringBuffer buffer = null; - while (isExistingLaunchConfigurationName(newname) || reservednames.contains(newname)) { - buffer = new StringBuffer(base); - buffer.append(" ("); //$NON-NLS-1$ - buffer.append(String.valueOf(index)); - index++; - buffer.append(')'); - newname = buffer.toString(); - } - return newname; - } - - /** - * Returns a collection of all launch configuration handles in - * the workspace. This collection is initialized lazily. - * - * @return all launch configuration handles - */ - private synchronized List getAllLaunchConfigurations() { - if (fLaunchConfigurationIndex == null) { - try { - fLaunchConfigurationIndex = new ArrayList(20); - List configs = findLocalLaunchConfigurations(); - verifyConfigurations(configs, fLaunchConfigurationIndex); - configs = findLaunchConfigurations(ResourcesPlugin.getWorkspace().getRoot()); - verifyConfigurations(configs, fLaunchConfigurationIndex); - } finally { - hookResourceChangeListener(); - } - } - return fLaunchConfigurationIndex; - } - - /** - * Return a sorted array of the names of all ILaunchConfigurations in - * the workspace. These are cached, and cache is cleared when a new config is added, - * deleted or changed. - */ - protected synchronized String[] getAllSortedConfigNames() { - if (fSortedConfigNames == null) { - ILaunchConfiguration[] configs = getLaunchConfigurations(); - fSortedConfigNames = new String[configs.length]; - for (int i = 0; i < configs.length; i++) { - fSortedConfigNames[i] = configs[i].getName(); - } - Arrays.sort(fSortedConfigNames); - } - return fSortedConfigNames; - } - - /** - * Returns the comparator registered for the given attribute, or - * null if none. - * - * @param attributeName attribute for which a comparator is required - * @return comparator, or null if none - */ - protected Comparator getComparator(String attributeName) { - Map map = getComparators(); - return (Comparator)map.get(attributeName); - } - - /** - * Returns comparators, loading if required - */ - protected Map getComparators() { - initializeComparators(); - return fComparators; - } - - /** - * Returns the launch configurations specified by the given - * XML document. - * - * @param root XML document - * @return list of launch configurations - * @exception IOException if an exception occurs reading the XML - */ - protected List getConfigsFromXML(Element root) throws CoreException { - DebugException invalidFormat = - new DebugException( - new Status( - IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), - DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchManager_Invalid_launch_configuration_index__18, null - ) - ); - - if (!root.getNodeName().equalsIgnoreCase("launchConfigurations")) { //$NON-NLS-1$ - throw invalidFormat; - } - - // read each launch configuration - List configs = new ArrayList(4); - NodeList list = root.getChildNodes(); - int length = list.getLength(); - Node node = null; - Element entry = null; - String memento = 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().equals("launchConfiguration")) { //$NON-NLS-1$ - throw invalidFormat; - } - memento = entry.getAttribute("memento"); //$NON-NLS-1$ - if (memento == null) { - throw invalidFormat; - } - configs.add(getLaunchConfiguration(memento)); - } - } - return configs; - } - - protected ConfigurationNotifier getConfigurationNotifier() { - return new ConfigurationNotifier(); - } - - /** - * @see ILaunchManager#getDebugTargets() - */ - public IDebugTarget[] getDebugTargets() { - synchronized (fLaunches) { - List allTargets= new ArrayList(fLaunches.size()); - if (fLaunches.size() > 0) { - Iterator e = fLaunches.iterator(); - IDebugTarget[] targets = null; - while (e.hasNext()) { - targets = ((ILaunch) e.next()).getDebugTargets(); - for (int i = 0; i < targets.length; i++) { - allTargets.add(targets[i]); - } - } - } - return (IDebugTarget[])allTargets.toArray(new IDebugTarget[allTargets.size()]); - } - } - - /** - * Returns the resource delta visitor for the launch manager. - * - * @return the resource delta visitor for the launch manager - */ - private LaunchManagerVisitor getDeltaVisitor() { - if (fgVisitor == null) { - fgVisitor= new LaunchManagerVisitor(); - } - return fgVisitor; - } - - /** - * Returns the resource delta visitor for auto-removal of mapped launch configurations - * @return the resource delta visitor for auto-removal of mapped launch configurations - * - * @since 3.4 - */ - private MappedResourceVisitor getMappedResourceVisitor() { - if(fgMRVisitor == null) { - fgMRVisitor = new MappedResourceVisitor(); - } - return fgMRVisitor; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getEnvironment(org.eclipse.debug.core.ILaunchConfiguration) - */ - public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException { - Map configEnv = configuration.getAttribute(ATTR_ENVIRONMENT_VARIABLES, (Map) null); - if (configEnv == null) { - return null; - } - Map env = new HashMap(); - // build base environment - boolean append = configuration.getAttribute(ATTR_APPEND_ENVIRONMENT_VARIABLES, true); - if (append) { - env.putAll(getNativeEnvironmentCasePreserved()); - } - - // Add variables from config - Iterator iter= configEnv.entrySet().iterator(); - boolean win32= Platform.getOS().equals(Constants.OS_WIN32); - Map.Entry entry = null; - String key = null; - String value = null; - Object nativeValue = null; - Iterator envIter = null; - Map.Entry nativeEntry = null; - String nativeKey = null; - while (iter.hasNext()) { - entry = (Map.Entry) iter.next(); - key = (String) entry.getKey(); - value = (String) entry.getValue(); - // translate any string substitution variables - if (value != null) { - value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value); - } - boolean added= false; - if (win32) { - // First, check if the key is an exact match for an existing key. - nativeValue = env.get(key); - if (nativeValue != null) { - // If an exact match is found, just replace the value - env.put(key, value); - } else { - // Win32 variables are case-insensitive. If an exact match isn't found, iterate to - // check for a case-insensitive match. We maintain the key's case (see bug 86725), - // but do a case-insensitive comparison (for example, "pAtH" will still override "PATH"). - envIter = env.entrySet().iterator(); - while (envIter.hasNext()) { - nativeEntry = (Map.Entry) envIter.next(); - nativeKey = (String) (nativeEntry).getKey(); - if (nativeKey.equalsIgnoreCase(key)) { - nativeEntry.setValue(value); - added = true; - break; - } - } - } - } - if (!added) { - env.put(key, value); - } - } - - iter = env.entrySet().iterator(); - List strings = new ArrayList(env.size()); - StringBuffer buffer = null; - while (iter.hasNext()) { - entry = (Map.Entry) iter.next(); - buffer = new StringBuffer((String) entry.getKey()); - buffer.append('=').append((String) entry.getValue()); - strings.add(buffer.toString()); - } - return (String[]) strings.toArray(new String[strings.size()]); - } - - /** - * Returns the info object for the specified launch configuration. - * If the configuration exists, but is not yet in the cache, - * an info object is built and added to the cache. - * - * @exception CoreException if an exception occurs building - * the info object - * @exception DebugException if the config does not exist - * @since 3.5 - */ - protected LaunchConfigurationInfo getInfo(LaunchConfiguration config) throws CoreException { - LaunchConfigurationInfo info = (LaunchConfigurationInfo)fLaunchConfigurations.get(config); - if (info == null) { - IFileStore store = config.getFileStore(); - if (config.exists()) { - BufferedInputStream stream = null; - try { - stream = new BufferedInputStream(store.openInputStream(EFS.NONE, null)); - info = createInfoFromXML(stream); - synchronized (this) { - fLaunchConfigurations.put(config, info); - } - } catch (FileNotFoundException e) { - throwException(config, e); - } catch (SAXException e) { - throwException(config, e); - } catch (ParserConfigurationException e) { - throwException(config, e); - } catch (IOException e) { - throwException(config, e); - } finally { - if (stream != null) { - try { - stream.close(); - } catch (IOException e) { - throwException(config, e); - } - } - } - - } else { - if (store != null){ - throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager_does_not_exist, new String[]{config.getName(), store.toURI().toString()}), null); - } else { - throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager_does_not_exist_no_store_found, new String[]{config.getName()}), null); - } - } - } - return info; - } - - /** - * @see ILaunchManager#getLaunchConfiguration(IFile) - */ - public ILaunchConfiguration getLaunchConfiguration(IFile file) { - hookResourceChangeListener(); - return new LaunchConfiguration(file); - } - - /** - * @see ILaunchManager#getLaunchConfiguration(String) - */ - public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException { - hookResourceChangeListener(); - return new LaunchConfiguration(memento); - } - - /** - * @see ILaunchManager#getLaunchConfigurations() - */ - public synchronized ILaunchConfiguration[] getLaunchConfigurations() { - List allConfigs = getAllLaunchConfigurations(); - return (ILaunchConfiguration[])allConfigs.toArray(new ILaunchConfiguration[allConfigs.size()]); - } - - /** - * @see ILaunchManager#getLaunchConfigurations(ILaunchConfigurationType) - */ - public synchronized ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException { - Iterator iter = getAllLaunchConfigurations().iterator(); - List configs = new ArrayList(); - ILaunchConfiguration config = null; - while (iter.hasNext()) { - config = (ILaunchConfiguration)iter.next(); - if (config.getType().equals(type)) { - configs.add(config); - } - } - return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]); - } - - /** - * Returns all launch configurations that are stored as resources - * in the given project. - * - * @param project a project - * @return collection of launch configurations that are stored as resources - * in the given project - */ - protected synchronized List getLaunchConfigurations(IProject project) { - Iterator iter = getAllLaunchConfigurations().iterator(); - List configs = new ArrayList(); - ILaunchConfiguration config = null; - IFile file = null; - while (iter.hasNext()) { - config = (ILaunchConfiguration)iter.next(); - file = config.getFile(); - if (file != null && file.getProject().equals(project)) { - configs.add(config); - } - } - return configs; - } - - /** - * @see ILaunchManager#getLaunchConfigurationType(String) - */ - public ILaunchConfigurationType getLaunchConfigurationType(String id) { - ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); - for(int i = 0; i < types.length; i++) { - if (types[i].getIdentifier().equals(id)) { - return types[i]; - } - } - return null; - } - - /** - * @see ILaunchManager#getLaunchConfigurationTypes() - */ - public ILaunchConfigurationType[] getLaunchConfigurationTypes() { - initializeLaunchConfigurationTypes(); - return (ILaunchConfigurationType[])fLaunchConfigurationTypes.toArray(new ILaunchConfigurationType[fLaunchConfigurationTypes.size()]); - } - - /** - * @see ILaunchManager#getLaunches() - */ - public ILaunch[] getLaunches() { - synchronized (fLaunches) { - return (ILaunch[])fLaunches.toArray(new ILaunch[fLaunches.size()]); - } - } - - /**) - * @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String) - */ - public ILaunchMode getLaunchMode(String mode) { - initializeLaunchModes(); - return (ILaunchMode) fLaunchModes.get(mode); - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#getLaunchModes() - */ - public ILaunchMode[] getLaunchModes() { - initializeLaunchModes(); - Collection collection = fLaunchModes.values(); - return (ILaunchMode[]) collection.toArray(new ILaunchMode[collection.size()]); - } - - /** - * Returns all of the launch delegates. The returned listing of delegates cannot be directly used to launch, - * instead the method IlaunchDelegate.getDelegate must be used to acquire an executable form of - * the delegate, allowing us to maintain lazy loading of the delegates themselves. - * @return all of the launch delegates - * - * @since 3.3 - */ - public ILaunchDelegate[] getLaunchDelegates() { - initializeLaunchDelegates(); - Collection col = fLaunchDelegates.values(); - return (ILaunchDelegate[]) col.toArray(new ILaunchDelegate[col.size()]); - } - - /** - * Returns the listing of launch delegates that apply to the specified - * ILaunchConfigurationType id - * @param typeid the id of the launch configuration type to get delegates for - * @return An array of LaunchDelegates that apply to the specified launch configuration - * type, or an empty array, never null - * - * @since 3.3 - */ - public LaunchDelegate[] getLaunchDelegates(String typeid) { - initializeLaunchDelegates(); - ArrayList list = new ArrayList(); - LaunchDelegate ld = null; - for(Iterator iter = fLaunchDelegates.keySet().iterator(); iter.hasNext();) { - ld = (LaunchDelegate) fLaunchDelegates.get(iter.next()); - if(ld.getLaunchConfigurationTypeId().equals(typeid)) { - list.add(ld); - } - } - return (LaunchDelegate[]) list.toArray(new LaunchDelegate[list.size()]); - } - - /** - * This method returns the ILaunchDelegate instance corresponding to the id - * of the launch delegate specified - * @param id the id of the ILaunchDelegate to find - * @return the ILaunchDelegate or null if not found - * - * @since 3.3 - */ - public ILaunchDelegate getLaunchDelegate(String id) { - if(id != null) { - ILaunchDelegate[] delegates = getLaunchDelegates(); - for(int i = 0; i < delegates.length; i++) { - if(id.equals(delegates[i].getId())) { - return delegates[i]; - } - } - } - return null; - } - - /** - * Initializes the listing of delegates available to the launching framework - * - * @since 3.3 - */ - private synchronized void initializeLaunchDelegates() { - if(fLaunchDelegates == null) { - fLaunchDelegates = new HashMap(); - //get all launch delegate contributions - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES); - IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); - LaunchDelegate delegate = null; - for(int i = 0; i < infos.length; i++) { - delegate = new LaunchDelegate(infos[i]); - fLaunchDelegates.put(delegate.getId(), delegate); - } - //get all delegates from launch configuration type contributions - extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); - infos = extensionPoint.getConfigurationElements(); - for(int i = 0; i < infos.length; i++) { - //must check to see if delegate is provided in contribution - if(infos[i].getAttribute(IConfigurationElementConstants.DELEGATE) != null) { - delegate = new LaunchDelegate(infos[i]); - fLaunchDelegates.put(delegate.getId(), delegate); - } - } - } - } - - /** - * This method is used to initialize a simple listing of all preferred delegates, which is then used by each - * ILaunchConfigurationType to find if they have preferred delegates. Once an ILaunchConfigurationType - * has used this listing to initialize its preferred delegates it will maintain changes to its preferred delegate, which are - * then written back to the preference store only when the launch manager shuts down. - *

                            - * This cache is not synchronized with the runtime preferred delegates stored in launch configuration types. - *

                            - * @since 3.3 - */ - private synchronized void initializePreferredDelegates() { - if(fPreferredDelegates == null) { - fPreferredDelegates = new HashSet(); - String preferred = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_PREFERRED_DELEGATES, IInternalDebugCoreConstants.EMPTY_STRING, null); - if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(preferred)) { - try { - Element root = DebugPlugin.parseDocument(preferred); - NodeList nodes = root.getElementsByTagName(IConfigurationElementConstants.DELEGATE); - Element element = null; - String typeid = null; - Set modeset = null; - for(int i = 0; i < nodes.getLength(); i++) { - element = (Element) nodes.item(i); - String delegateid = element.getAttribute(IConfigurationElementConstants.ID); - typeid = element.getAttribute(IConfigurationElementConstants.TYPE_ID); - String[] modes = element.getAttribute(IConfigurationElementConstants.MODES).split(","); //$NON-NLS-1$ - modeset = new HashSet(Arrays.asList(modes)); - LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateid, modeset); - if (delegate != null) { - //take type id, modeset, delegate and create entry - if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(typeid) & modeset != null) { - fPreferredDelegates.add(new PreferredDelegate(delegate, typeid, modeset)); - } - } - } - } - catch (CoreException e) {DebugPlugin.log(e);} - } - } - } - - /** - * Allows internal access to reset preferred delegates when re-importing - * preferences. - * - * @since 3.6 - */ - protected void resetPreferredDelegates() { - fPreferredDelegates = null; - } - - /** - * Allows internal access to a preferred delegate for a given type and mode set - * @param typeid the id of the ILaunchConfigurationType to find a delegate for - * @param modes the set of modes for the delegate - * @return the preferred delegate for the specified type id and mode set, or null if none - * - * @since 3.3 - */ - protected ILaunchDelegate getPreferredDelegate(String typeid, Set modes) { - // Retrieve preferred delegates using legacy mechanism for backward - // compatibility. - initializePreferredDelegates(); - PreferredDelegate pd = null; - for(Iterator iter = fPreferredDelegates.iterator(); iter.hasNext();) { - pd = (PreferredDelegate) iter.next(); - if(pd.getModes().equals(modes) & pd.getTypeId().equals(typeid)) { - return pd.getDelegate(); - } - } - - // @since 3.5 - // If the legacy mechanism didn't work, try the new preference name for - // the given launch type. - String preferred = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), "//" + LaunchManager.PREF_PREFERRED_DELEGATES + '/' + typeid, IInternalDebugCoreConstants.EMPTY_STRING, null); //$NON-NLS-1$ - if (preferred != null && preferred.length() != 0) { - StringTokenizer tokenizer = new StringTokenizer(preferred, ";"); //$NON-NLS-1$ - while(tokenizer.hasMoreTokens()) { - StringTokenizer tokenizer2 = new StringTokenizer(tokenizer.nextToken(), ","); //$NON-NLS-1$ - String delegateId = tokenizer2.nextToken(); - HashSet modeset = new HashSet(); - while(tokenizer2.hasMoreTokens()) { - modeset.add(tokenizer2.nextToken()); - } - LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateId, modeset); - if (delegate != null && modeset.equals(modes)) { - return delegate; - } - } - - } - return null; - } - - /** - * Returns the launch delegate extension that matches the given type, delegate ID, and - * set of modes. - * - * @param typeId Launch configuration type. - * @param id Launch delegate ID. - * @param modeset Set of modes that the launch delegate applies to. - * @return The launch delegate matching the specified parameters, or - * null if not found. - * - * @since 3.5 - */ - private LaunchDelegate getLaunchDelegateExtension(String typeId, String id, Set modeset) { - LaunchDelegate[] extensions = getLaunchDelegates(typeId); - for(int j = 0; j < extensions.length; j++) { - if(id.equals(extensions[j].getId())) { - List modesets = extensions[j].getModes(); - if(modesets.contains(modeset)) { - return extensions[j]; - } - } - } - return null; - } - - /** - * Returns all launch configurations that are stored locally. - * - * @return collection of launch configurations stored locally - */ - protected synchronized List getLocalLaunchConfigurations() { - Iterator iter = getAllLaunchConfigurations().iterator(); - List configs = new ArrayList(); - ILaunchConfiguration config = null; - while (iter.hasNext()) { - config = (ILaunchConfiguration)iter.next(); - if (config.isLocal()) { - configs.add(config); - } - } - return configs; - } - - /** - * Returns the launch configurations mapping to the specified resource - * @param resource the resource to collect mapped launch configurations for - * @return a list of launch configurations if found or an empty list, never null - * @since 3.2 - */ - public ILaunchConfiguration[] getMappedConfigurations(IResource resource) { - List configurations = new ArrayList(); - try { - ILaunchConfiguration[] configs = getLaunchConfigurations(); - IResource[] resources = null; - for(int i = 0; i < configs.length; i++) { - resources = configs[i].getMappedResources(); - if(resources != null) { - for(int j = 0; j < resources.length; j++) { - if(resources[j].equals(resource)) { - configurations.add(configs[i]); - } - } - } - } - } - catch(CoreException e) {DebugPlugin.log(e);} - return (ILaunchConfiguration[])configurations.toArray(new ILaunchConfiguration[configurations.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getMigrationCandidates() - */ - public ILaunchConfiguration[] getMigrationCandidates() throws CoreException { - List configs = new ArrayList(); - ILaunchConfiguration[] candidates = getLaunchConfigurations(); - for(int i = 0; i < candidates.length; i++) { - if(!candidates[i].isReadOnly() && candidates[i].isMigrationCandidate()) { - configs.add(candidates[i]); - } - } - return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]); - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#getMovedFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - public ILaunchConfiguration getMovedFrom(ILaunchConfiguration addedConfiguration) { - if (addedConfiguration.equals(fTo)) { - return fFrom; - } - return null; - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#getMovedTo(org.eclipse.debug.core.ILaunchConfiguration) - */ - public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration) { - if (removedConfiguration.equals(fFrom)) { - return fTo; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getNativeEnvironment() - */ - public synchronized Map getNativeEnvironment() { - if (fgNativeEnv == null) { - Map casePreserved = getNativeEnvironmentCasePreserved(); - if (Platform.getOS().equals(Constants.OS_WIN32)) { - fgNativeEnv= new HashMap(); - Iterator entries = casePreserved.entrySet().iterator(); - Map.Entry entry = null; - String key = null; - while (entries.hasNext()) { - entry = (Entry) entries.next(); - key = ((String)entry.getKey()).toUpperCase(); - fgNativeEnv.put(key, entry.getValue()); - } - } else { - fgNativeEnv = new HashMap(casePreserved); - } - } - return new HashMap(fgNativeEnv); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getNativeEnvironmentCasePreserved() - */ - public synchronized Map getNativeEnvironmentCasePreserved() { - if (fgNativeEnvCasePreserved == null) { - fgNativeEnvCasePreserved= new HashMap(); - cacheNativeEnvironment(fgNativeEnvCasePreserved); - } - return new HashMap(fgNativeEnvCasePreserved); - } - - /** - * @see ILaunchManager#getProcesses() - */ - public IProcess[] getProcesses() { - synchronized (fLaunches) { - List allProcesses = new ArrayList(fLaunches.size()); - Iterator e = fLaunches.iterator(); - IProcess[] processes = null; - while (e.hasNext()) { - processes = ((ILaunch) e.next()).getProcesses(); - for (int i= 0; i < processes.length; i++) { - allProcesses.add(processes[i]); - } - } - return (IProcess[])allProcesses.toArray(new IProcess[allProcesses.size()]); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getSourceContainerType(java.lang.String) - */ - public ISourceContainerType getSourceContainerType(String id) { - initializeSourceContainerTypes(); - return (ISourceContainerType) sourceContainerTypes.get(id); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getSourceContainerTypes() - */ - public ISourceContainerType[] getSourceContainerTypes() { - initializeSourceContainerTypes(); - Collection containers = sourceContainerTypes.values(); - return (ISourceContainerType[]) containers.toArray(new ISourceContainerType[containers.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#newSourcePathComputer(org.eclipse.debug.core.ILaunchConfiguration) - */ - public ISourcePathComputer getSourcePathComputer(ILaunchConfiguration configuration) throws CoreException { - String id = null; - id = configuration.getAttribute(ISourcePathComputer.ATTR_SOURCE_PATH_COMPUTER_ID, (String)null); - - if (id == null) { - //use default computer for configuration type, if any - return configuration.getType().getSourcePathComputer(); - } - return getSourcePathComputer(id); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#getSourcePathComputer(java.lang.String) - */ - public ISourcePathComputer getSourcePathComputer(String id) { - initializeSourceContainerTypes(); - return (ISourcePathComputer) sourcePathComputers.get(id); - } - - /** - * Starts listening for resource change events - */ - private synchronized void hookResourceChangeListener() { - if (!fListening) { - ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE); - fListening = true; - } - } - - /** - * Load comparator extensions. - */ - private synchronized void initializeComparators() { - if (fComparators == null) { - IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fComparators = new HashMap(infos.length); - IConfigurationElement configurationElement = null; - String attr = null; - for (int i= 0; i < infos.length; i++) { - configurationElement = infos[i]; - attr = configurationElement.getAttribute("attribute"); //$NON-NLS-1$ - if (attr != null) { - fComparators.put(attr, new LaunchConfigurationComparator(configurationElement)); - } else { - // invalid status handler - IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, - MessageFormat.format("Invalid launch configuration comparator extension defined by plug-in {0} - attribute not specified.", new String[] {configurationElement.getContributor().getName()}), null); //$NON-NLS-1$ - DebugPlugin.log(s); - } - } - } - } - - /** - * Initializes the listing of LaunchConfigurationTypes. - */ - private synchronized void initializeLaunchConfigurationTypes() { - if (fLaunchConfigurationTypes == null) { - hookResourceChangeListener(); - IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES); - IConfigurationElement[] infos = extensionPoint.getConfigurationElements(); - fLaunchConfigurationTypes = new ArrayList(infos.length); - for (int i= 0; i < infos.length; i++) { - fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i])); - } - } - } - - /** - * Load comparator extensions. - * - * @exception CoreException if an exception occurs reading - * the extensions - * - */ - private synchronized void initializeLaunchModes() { - if (fLaunchModes == null) { - try { - IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_MODES); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fLaunchModes = new HashMap(); - ILaunchMode mode = null; - for (int i= 0; i < infos.length; i++) { - mode = new LaunchMode(infos[i]); - fLaunchModes.put(mode.getIdentifier(), mode); - } - } - catch (CoreException e) {DebugPlugin.log(e);} - } - } - - /** - * Initializes source container type and source path computer extensions. - */ - private synchronized void initializeSourceContainerTypes() { - if (sourceContainerTypes == null) { - IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_CONTAINER_TYPES); - IConfigurationElement[] extensions = extensionPoint.getConfigurationElements(); - sourceContainerTypes = new HashMap(); - for (int i = 0; i < extensions.length; i++) { - sourceContainerTypes.put( - extensions[i].getAttribute(IConfigurationElementConstants.ID), - new SourceContainerType(extensions[i])); - } - extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_PATH_COMPUTERS); - extensions = extensionPoint.getConfigurationElements(); - sourcePathComputers = new HashMap(); - for (int i = 0; i < extensions.length; i++) { - sourcePathComputers.put( - extensions[i].getAttribute(IConfigurationElementConstants.ID), - new SourcePathComputer(extensions[i])); - } - } - } - - /** - * Register source locators. - * - * @exception CoreException if an exception occurs reading - * the extensions - */ - private synchronized void initializeSourceLocators() { - if (fSourceLocators == null) { - IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS); - IConfigurationElement[] infos= extensionPoint.getConfigurationElements(); - fSourceLocators= new HashMap(infos.length); - IConfigurationElement configurationElement = null; - String id = null; - for (int i= 0; i < infos.length; i++) { - configurationElement = infos[i]; - id = configurationElement.getAttribute(IConfigurationElementConstants.ID); - if (id != null) { - fSourceLocators.put(id,configurationElement); - } else { - // invalid status handler - IStatus s = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, - MessageFormat.format("Invalid source locator extension defined by plug-in \"{0}\": \"id\" not specified.", new String[] {configurationElement.getContributor().getName()} ), null); //$NON-NLS-1$ - DebugPlugin.log(s); - } - } - } - } - - /** - * Adds the given launch object to the list of registered launches, - * and returns whether the launch was added. - * - * @param launch launch to register - * @return whether the launch was added - */ - protected boolean internalAddLaunch(ILaunch launch) { - // ensure the step filter manager is created on the first launch - getStepFilterManager(); - synchronized (fLaunches) { - if (fLaunches.contains(launch)) { - return false; - } - fLaunches.add(launch); - fLaunchSet.add(launch); - return true; - } - } - - /** - * Removes the given launch object from the collection of registered - * launches. Returns whether the launch was removed. - * - * @param launch the launch to remove - * @return whether the launch was removed - */ - protected boolean internalRemoveLaunch(ILaunch launch) { - if (launch == null) { - return false; - } - synchronized (fLaunches) { - fLaunchSet.remove(launch); - return fLaunches.remove(launch); - } - } - /** - * @see ILaunchManager#isExistingLaunchConfigurationName(String) - */ - public boolean isExistingLaunchConfigurationName(String name) { - String[] sortedConfigNames = getAllSortedConfigNames(); - int index = Arrays.binarySearch(sortedConfigNames, name); - if (index < 0) { - return false; - } - return true; - } - - /** - * Returns whether the given String is composed solely of digits - */ - private boolean isNumber(String string) { - int numChars= string.length(); - if (numChars == 0) { - return false; - } - for (int i= 0; i < numChars; i++) { - if (!Character.isDigit(string.charAt(i))) { - return false; - } - } - return true; - } - - /** - * Returns whether the user has selected to delete associated configurations when a - * project is deleted. - * - * @return whether to auto-delete configurations - */ - private boolean isDeleteConfigurations() { - return Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchManager#isRegistered(org.eclipse.debug.core.ILaunch) - */ - public boolean isRegistered(ILaunch launch) { - synchronized (fLaunches) { - return fLaunchSet.contains(launch); - } - } - - /** - * Returns whether the given launch configuration passes a basic - * integrity test by retrieving its type. - * - * @param config the configuration to verify - * @return whether the config meets basic integrity constraints - */ - protected boolean isValid(ILaunchConfiguration config) { - try { - config.getType(); - } catch (CoreException e) { - if (e.getStatus().getCode() != DebugException.MISSING_LAUNCH_CONFIGURATION_TYPE) { - // only log warnings due to something other than a missing - // launch config type - DebugPlugin.log(e); - } - return false; - } - return true; - } - - /** - * Notifies the launch manager that a launch configuration - * has been added. The configuration is added to the index of - * configurations by project, and listeners are notified. - * - * @param config the launch configuration that was added - */ - protected void launchConfigurationAdded(ILaunchConfiguration config) { - if (config.isWorkingCopy()) { - return; - } - if (isValid(config)) { - boolean added = false; - synchronized (this) { - List allConfigs = getAllLaunchConfigurations(); - if (!allConfigs.contains(config)) { - allConfigs.add(config); - added = true; - } - } - if (added) { - getConfigurationNotifier().notify(config, ADDED); - clearConfigNameCache(); - } - } else { - launchConfigurationDeleted(config); - } - } - - /** - * Notifies the launch manager that a launch configuration - * has been changed. The configuration is removed from the - * cache of info objects such that the new attributes will - * be updated on the next access. Listeners are notified of - * the change. - * - * @param config the launch configuration that was changed - */ - protected void launchConfigurationChanged(ILaunchConfiguration config) { - synchronized(this) { - fLaunchConfigurations.remove(config); - } - clearConfigNameCache(); - if (isValid(config)) { - // in case the config has been refreshed and it was removed from the - // index due to 'out of synch with local file system' (see bug 36147), - // add it back (will only add if required) - launchConfigurationAdded(config); - getConfigurationNotifier().notify(config, CHANGED); - } else { - launchConfigurationDeleted(config); - } - } - - /** - * Notifies the launch manager that a launch configuration - * has been deleted. The configuration is removed from the - * cache of info and from the index of configurations by - * project, and listeners are notified. - * - * @param config the launch configuration that was deleted - */ - protected void launchConfigurationDeleted(ILaunchConfiguration config) { - boolean removed = false; - synchronized (this) { - Object key = fLaunchConfigurations.remove(config); - removed = key != null; - getAllLaunchConfigurations().remove(config); - } - if (removed) { - getConfigurationNotifier().notify(config, REMOVED); - clearConfigNameCache(); - } - } - - /** - * @see ILaunchManager#newSourceLocator(String) - */ - public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException { - initializeSourceLocators(); - IConfigurationElement config = (IConfigurationElement)fSourceLocators.get(identifier); - if (config == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.INTERNAL_ERROR, - MessageFormat.format(DebugCoreMessages.LaunchManager_Source_locator_does_not_exist___0__13, new String[] {identifier} ), null)); - } - IPersistableSourceLocator sourceLocator = (IPersistableSourceLocator)config.createExecutableExtension("class"); //$NON-NLS-1$ - if (sourceLocator instanceof AbstractSourceLookupDirector) { - ((AbstractSourceLookupDirector)sourceLocator).setId(identifier); - } - return sourceLocator; - } - - /** - * The specified project has just closed - remove its - * launch configurations from the cached index. - * - * @param project the project that has been closed - * @exception CoreException if writing the index fails - */ - protected void projectClosed(IProject project) { - List configs = getLaunchConfigurations(project); - if (!configs.isEmpty()) { - Iterator iterator = configs.iterator(); - while (iterator.hasNext()) { - launchConfigurationDeleted((ILaunchConfiguration)iterator.next()); - } - } - //bug 12134 - terminateMappedConfigurations(project); - } - - /** - * The specified project has just opened - add all launch - * configs in the project to the index of all configs. - * - * @param project the project that has been opened - * @exception CoreException if reading the index fails - */ - protected void projectOpened(IProject project) { - List configs = findLaunchConfigurations(project); - if (!configs.isEmpty()) { - Iterator iterator = configs.iterator(); - while (iterator.hasNext()) { - launchConfigurationAdded((ILaunchConfiguration) iterator.next()); - } - } - } - - /** - * @see ILaunchManager#removeLaunch(ILaunch) - */ - public void removeLaunch(final ILaunch launch) { - if (internalRemoveLaunch(launch)) { - fireUpdate(launch, REMOVED); - fireUpdate(new ILaunch[] {launch}, REMOVED); - } - } - - /** - * @see ILaunchManager#removeLaunchConfigurationListener(ILaunchConfigurationListener) - */ - public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener) { - fLaunchConfigurationListeners.remove(listener); - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#removeLaunches(org.eclipse.debug.core.ILaunch[]) - */ - public void removeLaunches(ILaunch[] launches) { - List removed = new ArrayList(launches.length); - for (int i = 0; i < launches.length; i++) { - if (internalRemoveLaunch(launches[i])) { - removed.add(launches[i]); - } - } - if (!removed.isEmpty()) { - ILaunch[] removedLaunches = (ILaunch[])removed.toArray(new ILaunch[removed.size()]); - fireUpdate(removedLaunches, REMOVED); - for (int i = 0; i < removedLaunches.length; i++) { - fireUpdate(removedLaunches[i], REMOVED); - } - } - } - /** - * @see org.eclipse.debug.core.ILaunchManager#removeLaunchListener(org.eclipse.debug.core.ILaunchesListener) - */ - public void removeLaunchListener(ILaunchesListener listener) { - fLaunchesListeners.remove(listener); - } - - /** - * @see ILaunchManager#removeLaunchListener(ILaunchListener) - */ - public void removeLaunchListener(ILaunchListener listener) { - fListeners.remove(listener); - } - - /** - * Traverses the delta looking for added/removed/changed launch - * configuration files. - * - * @see IResourceChangeListener#resourceChanged(IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - if (delta != null) { - LaunchManagerVisitor visitor = getDeltaVisitor(); - MappedResourceVisitor v = null; - if (isDeleteConfigurations()) { - v = getMappedResourceVisitor(); - } - try { - delta.accept(visitor); - if (v != null) { - delta.accept(v); - } - } catch (CoreException e) { - DebugPlugin.log(e.getStatus()); - } - } - } - - /** - * Gets the launch configuration associated with the specified IResource. - * This method relies on the resource mapping existing, if no such mapping - * exists the launch configuration is ignored. - * - * @param resource the resource to collect launch configurations for - * @return the list of associated launch configurations - */ - private ArrayList collectAssociatedLaunches(IResource resource) { - ArrayList list = new ArrayList(); - try { - ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations(); - IResource[] resources = null; - for(int i = 0; i < configs.length; i++) { - if(configs[i].isLocal()) { - resources = configs[i].getMappedResources(); - if(resources != null) { - for(int j = 0; j < resources.length; j++){ - if(resource.equals(resources[j]) || - resource.getFullPath().isPrefixOf(resources[j].getFullPath())) { - list.add(configs[i]); - break; - } - } - } - } - } - } catch (CoreException e) { - DebugPlugin.log(e); - } - return list; - } - - /** - * Indicates the given launch configuration is being moved from the given - * location to the new location. - * - * @param from the location a launch configuration is being moved from, or - * null - * @param to the location a launch configuration is being moved to, - * or null - */ - protected void setMovedFromTo(ILaunchConfiguration from, ILaunchConfiguration to) { - fFrom = from; - fTo = to; - } - /** - * Terminates/Disconnects any active debug targets/processes. - * Clears launch configuration types. - */ - public void shutdown() { - fListeners = new ListenerList(); - fLaunchesListeners = new ListenerList(); - fLaunchConfigurationListeners = new ListenerList(); - ILaunch[] launches = getLaunches(); - ILaunch launch = null; - for (int i= 0; i < launches.length; i++) { - launch = launches[i]; - try { - if (launch instanceof IDisconnect) { - IDisconnect disconnect = (IDisconnect)launch; - if (disconnect.canDisconnect()) { - disconnect.disconnect(); - } - } - if (launch.canTerminate()) { - launch.terminate(); - } - } catch (DebugException e) { - DebugPlugin.log(e); - } - } - - persistPreferredLaunchDelegates(); - clearAllLaunchConfigurations(); - fStepFilterManager = null; - ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); - } - - /** - * Saves the listings of preferred launch delegates from all of the launch configuration types - * - * @since 3.3 - */ - public void persistPreferredLaunchDelegates() { - ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); - for(int i = 0; i < types.length; i++) { - persistPreferredLaunchDelegate((LaunchConfigurationType)types[i]); - } - } - - /** - * Persists the given launch configuration delegate. - * @param type Launch configuration type to persist - * - * @since 3.6 - */ - public void persistPreferredLaunchDelegate(LaunchConfigurationType type) { - String preferenceName = PREF_PREFERRED_DELEGATES + '/' + type.getIdentifier(); - Map preferred = type.getPreferredDelegates(); - if(preferred != null && preferred.size() > 0) { - StringBuffer str = new StringBuffer(); - for(Iterator iter = preferred.keySet().iterator(); iter.hasNext();) { - Set modes = (Set) iter.next(); - ILaunchDelegate delegate = (ILaunchDelegate) preferred.get(modes); - if(delegate != null) { - str.append(delegate.getId()); - str.append(','); - for(Iterator iter2 = modes.iterator(); iter2.hasNext();) { - str.append(iter2.next()); - if(iter2.hasNext()) { - str.append(','); - } - } - if (iter.hasNext()) { - str.append(';'); - } - } - } - Preferences.setString(DebugPlugin.getUniqueIdentifier(), preferenceName, str.toString(), null); - } else { - Preferences.setToDefault(DebugPlugin.getUniqueIdentifier(), preferenceName); - } - - // Reset the legacy preference string. - Preferences.setToDefault(DebugPlugin.getUniqueIdentifier(), PREF_PREFERRED_DELEGATES); - } - - /** - * finds and terminates any running launch configurations associated with the given resource - * @param resource the resource to search for launch configurations and hence launches for - * @since 3.2 - */ - protected void terminateMappedConfigurations(IResource resource) { - ILaunch[] launches = getLaunches(); - ILaunchConfiguration[] configs = getMappedConfigurations(resource); - try { - for(int i = 0; i < launches.length; i++) { - for(int j = 0; j < configs.length; j++) { - if(configs[j].equals(launches[i].getLaunchConfiguration()) & launches[i].canTerminate()) { - launches[i].terminate(); - } - } - } - } - catch(CoreException e) {DebugPlugin.log(e);} - } - - /** - * Throws a debug exception with the given throwable that occurred - * while processing the given configuration. - * @since 3.5 - */ - private void throwException(LaunchConfiguration config, Throwable e) throws DebugException { - String uri = config.getName(); - try { - IFileStore store = config.getFileStore(); - if (store != null) { - uri = store.toString(); - } - } catch (CoreException ce) { - } - throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager__0__occurred_while_reading_launch_configuration_file__1___1, new String[]{e.toString(), uri}), e); - } - - /** - * Verify basic integrity of launch configurations in the given list, - * adding valid configurations to the collection of all launch configurations. - * Exceptions are logged for invalid configurations. - * - * @param verify the list of configurations to verify - * @param valid the list to place valid configurations in - */ - protected void verifyConfigurations(List verify, List valid) { - Iterator configs = verify.iterator(); - ILaunchConfiguration config = null; - while (configs.hasNext()) { - config = (ILaunchConfiguration)configs.next(); - if (!valid.contains(config) && isValid(config)) { - valid.add(config); - } - } - } - - /** - * Returns the name of the given launch mode with accelerators removed, - * or null if none. - * - * @param id launch mode identifier - * @return launch mode name with accelerators removed or null - */ - public String getLaunchModeName(String id) { - ILaunchMode launchMode = getLaunchMode(id); - if (launchMode != null) { - return removeAccelerators(launchMode.getLabel()); - } - return null; - } - /** - * Returns the label with any accelerators removed. - * - * @param label label to process - * @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 singleton step filter manager. - * - * @return the step filter manager - */ - public synchronized StepFilterManager getStepFilterManager() { - if (fStepFilterManager == null) { - fStepFilterManager = new StepFilterManager(); - } - return fStepFilterManager; - } - - /** - * Imports launch configurations represented by the given local files, overwriting - * any existing configurations. Sends launch configuration change notification - * as required (i.e. added or changed). - *

                            - * If a file is imported that has the same name as a configuration in the workspace - * (i.e. a shared configuration), the shared configuration is deleted (becomes local). - *

                            - * @param files files to import - * @param monitor progress monitor or null - * @throws CoreException if an exception occurs while importing configurations - * @since 3.4.0 - */ - public void importConfigurations(File[] files, IProgressMonitor monitor) throws CoreException { - if (monitor == null) { - monitor = new NullProgressMonitor(); - } - Map sharedConfigs = new HashMap(); - List stati = null; - Iterator iterator = getAllLaunchConfigurations().iterator(); - while (iterator.hasNext()) { - ILaunchConfiguration config = (ILaunchConfiguration) iterator.next(); - if (!config.isLocal()) { - StringBuffer buf = new StringBuffer(config.getName()); - buf.append('.'); - buf.append(ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION); - sharedConfigs.put(buf.toString(), config); - } - } - monitor.beginTask(DebugCoreMessages.LaunchManager_29, files.length); - for (int i = 0; i < files.length; i++) { - if (monitor.isCanceled()) { - break; - } - File source = files[i]; - monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchManager_28, new String[]{source.getName()})); - IPath location = new Path(LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.toOSString()).append(source.getName()); - File target = location.toFile(); - IPath locationdir = location.removeLastSegments(1); - if(!locationdir.toFile().exists()) { - locationdir.toFile().mkdirs(); - } - boolean added = !target.exists(); - try { - copyFile(source, target); - ILaunchConfiguration configuration = new LaunchConfiguration(LaunchConfiguration.getSimpleName(source.getName()), null); - ILaunchConfiguration shared = (ILaunchConfiguration) sharedConfigs.get(target.getName()); - if (shared != null) { - setMovedFromTo(shared, configuration); - shared.delete(); - launchConfigurationChanged(configuration); - } else if (added) { - launchConfigurationAdded(configuration); - } else { - launchConfigurationChanged(configuration); - } - } catch (IOException e) { - if (stati == null) { - stati = new ArrayList(); - } - stati.add(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, - MessageFormat.format(DebugCoreMessages.LaunchManager_27, new String[]{source.getPath()}), e)); - } - monitor.worked(1); - } - if (!monitor.isCanceled()) { - monitor.done(); - } - if (stati != null) { - if (stati.size() > 1) { - MultiStatus multi = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchManager_26, null); - Iterator it = stati.iterator(); - while (it.hasNext()) { - multi.add((IStatus) it.next()); - } - throw new CoreException(multi); - } else { - throw new CoreException((IStatus) stati.get(0)); - } - } - } - - /** - * Copies a file from one location to another, replacing any existing file. - * - * @param in the file to copy - * @param out the file to be copied out to - * @throws IOException - * @since 3.4.0 - */ - private void copyFile(File in, File out) throws IOException { - FileInputStream fis = new FileInputStream(in); - FileOutputStream fos = new FileOutputStream(out); - byte[] buf = new byte[1024]; - int i = 0; - while((i = fis.read(buf)) != -1) { - fos.write(buf, 0, i); - } - fis.close(); - fos.close(); - } - - /** - * Returns whether any launch config supports the given mode. - * - * @param mode launch mode - * @return whether any launch config supports the given mode - */ - public synchronized boolean launchModeAvailable(String mode) { - if (fActiveModes == null) { - ILaunchConfigurationType[] types = getLaunchConfigurationTypes(); - ILaunchMode[] modes = getLaunchModes(); - fActiveModes = new HashSet(3); - for (int i = 0; i < types.length; i++) { - for (int j = 0; j < modes.length; j++) { - if (types[i].supportsMode(modes[j].getIdentifier())) { - fActiveModes.add(modes[j].getIdentifier()); - } - } - } - } - return fActiveModes.contains(mode); - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#generateLaunchConfigurationName(java.lang.String) - */ - public String generateLaunchConfigurationName(String namePrefix) { - String name = generateUniqueLaunchConfigurationNameFrom(namePrefix); - try { - isValidLaunchConfigurationName(name); - return name; - } - catch(IllegalArgumentException iae) { - //blanket change all reserved names - if(Platform.OS_WIN32.equals(Platform.getOS())) { - for(int i = 0; i < UNSUPPORTED_WIN32_CONFIG_NAMES.length; i++) { - if(UNSUPPORTED_WIN32_CONFIG_NAMES[i].equals(name)) { - name = "launch_configuration"; //$NON-NLS-1$ - } - } - } - //blanket replace all invalid chars - for (int i = 0; i < DISALLOWED_CONFIG_NAME_CHARS.length; i++) { - name = name.replace(DISALLOWED_CONFIG_NAME_CHARS[i], '_'); - } - } - //run it through the generator once more in case a replaced name has already been done - return generateUniqueLaunchConfigurationNameFrom(name); - } - - /** - * @see org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(java.lang.String) - */ - public boolean isValidLaunchConfigurationName(String configname) throws IllegalArgumentException { - if(Platform.OS_WIN32.equals(Platform.getOS())) { - for(int i = 0; i < UNSUPPORTED_WIN32_CONFIG_NAMES.length; i++) { - if(configname.equals(UNSUPPORTED_WIN32_CONFIG_NAMES[i])) { - throw new IllegalArgumentException(MessageFormat.format(DebugCoreMessages.LaunchManager_invalid_config_name, new String[] {configname})); - } - } - } - for (int i = 0; i < DISALLOWED_CONFIG_NAME_CHARS.length; i++) { - if (configname.indexOf(DISALLOWED_CONFIG_NAME_CHARS[i]) > -1) { - throw new IllegalArgumentException(MessageFormat.format(DebugCoreMessages.LaunchManager_invalid_config_name_char, new String[] {String.valueOf(DISALLOWED_CONFIG_NAME_CHARS[i])})); - } - } - return true; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java deleted file mode 100644 index 48a25f627..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java +++ /dev/null @@ -1,95 +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.core; - -import com.ibm.icu.text.MessageFormat; -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.DebugPlugin; -import org.eclipse.debug.core.ILaunchMode; - -/** - * Proxy to a launch mode extension. - * - * @see IConfigurationElementConstants - */ -public class LaunchMode implements ILaunchMode { - - private IConfigurationElement fConfigurationElement; - - /** - * Constructs a new launch mode. - * - * @param element configuration element - * @exception CoreException if required attributes are missing - */ - public LaunchMode(IConfigurationElement element) throws CoreException { - fConfigurationElement = element; - verifyAttributes(); - } - - /** - * Verifies required attributes. - * - * @exception CoreException if required attributes are missing - */ - private void verifyAttributes() throws CoreException { - verifyAttributeExists(IConfigurationElementConstants.MODE); - verifyAttributeExists(IConfigurationElementConstants.LABEL); - } - - /** - * Verifies the given attribute exists - * - * @exception CoreException if attribute does not exist - */ - private void verifyAttributeExists(String name) throws CoreException { - if (fConfigurationElement.getAttribute(name) == null) { - missingAttribute(name); - } - } - - /** - * This method is used to create a new internal error describing that the specified attribute - * is missing - * @param attrName the name of the attribute that is missing - * @throws CoreException - */ - private void missingAttribute(String attrName) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, MessageFormat.format(DebugCoreMessages.LaunchMode_1,new String[]{attrName}), null)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchMode#getIdentifier() - */ - public String getIdentifier() { - return fConfigurationElement.getAttribute(IConfigurationElementConstants.MODE); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchMode#getLabel() - */ - public String getLabel() { - return fConfigurationElement.getAttribute(IConfigurationElementConstants.LABEL); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchMode#getLaunchAsLabel() - */ - public String getLaunchAsLabel() { - String label = fConfigurationElement.getAttribute(IConfigurationElementConstants.LAUNCH_AS_LABEL); - if (label == null) { - return MessageFormat.format(DebugCoreMessages.LaunchMode_0, new String[]{getLabel()}); - } - return label; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchablePropertyTester.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchablePropertyTester.java deleted file mode 100644 index 70175ead8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchablePropertyTester.java +++ /dev/null @@ -1,34 +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.core; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.runtime.Platform; -import org.eclipse.debug.core.DebugPlugin; - -/** - * 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 (((LaunchManager)(DebugPlugin.getDefault().getLaunchManager())).launchModeAvailable((String)expectedValue)) { - return Platform.getAdapterManager().hasAdapter(receiver, "org.eclipse.debug.ui.actions.ILaunchable"); //$NON-NLS-1$ - } - } - return false; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java deleted file mode 100644 index 5c5c02931..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java +++ /dev/null @@ -1,282 +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.core; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.Map.Entry; - -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.ILogicalStructureType; -import org.eclipse.debug.core.model.IValue; - -/** - * Manages logical structure extensions - * - * @since 3.0 - */ -public class LogicalStructureManager { - - private static LogicalStructureManager fgDefault; - private List fTypes = null; - private List fTypeProviders; - - /** - * Map containing the user's selection for each combination of logical - * structure types. - * key: String - Comma-separated list of ints representing a combination of structure types. - * These integers are indeces into the fStructureTypeIds array. - * value: Integer - One of the ints from the combo key (the one chosen by the user) or -1 if - * the user has chosen not to display any structures for this combination - */ - private Map fStructureTypeSelections= null; - /** - * List of known type identifiers. An identifier's index in this list is used as - * its ID number. This list is maintained as a space-saving measure so that the various - * combinations of structure types can be persisted using indeces instead of storing the - * full index strings. - */ - private List fStructureTypeIds= null; - - /** - * Preference key used for storing the user's selected structure for each combination - * or structures. The preference value is stored in the form: - * int,int,...,int|int,int,...int|... - * Where int is an integer index of a structure in the array of known structures. - */ - public static final String PREF_STRUCTURE_SELECTIONS= "selectedStructures"; //$NON-NLS-1$ - /** - * Preference key used for storing the array of known structures. The preference - * value is in the form: - * string,string,string,...,string, - * Where string is an identifier of a logical structure. - */ - public static final String PREF_STRUCTURE_IDS= "allStructures"; //$NON-NLS-1$ - - public static LogicalStructureManager getDefault() { - if (fgDefault == null) { - fgDefault = new LogicalStructureManager(); - } - return fgDefault; - } - - /** - * Returns the logical structure types that are applicable to the given value. - * @param value the value - * @return the logical structure types that are applicable to the given value - */ - public ILogicalStructureType[] getLogicalStructureTypes(IValue value) { - initialize(); - // looks in the logical structure types - Iterator iterator = fTypes.iterator(); - List select = new ArrayList(); - while (iterator.hasNext()) { - ILogicalStructureType type = (ILogicalStructureType)iterator.next(); - if (type.providesLogicalStructure(value)) { - select.add(type); - } - } - // asks the logical structure providers - for (Iterator iter= fTypeProviders.iterator(); iter.hasNext();) { - ILogicalStructureType[] logicalStructures= ((LogicalStructureProvider) iter.next()).getLogicalStructures(value); - for (int i= 0; i < logicalStructures.length; i++) { - select.add(logicalStructures[i]); - } - } - return (ILogicalStructureType[]) select.toArray(new ILogicalStructureType[select.size()]); - } - - /** - * Loads the map of structure selections from the preference store. - */ - private void loadStructureTypeSelections() { - fStructureTypeSelections= new HashMap(); - String selections= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, IInternalDebugCoreConstants.EMPTY_STRING, null); - // selections are stored in the form: - // selection|selection|...selection| - StringTokenizer tokenizer= new StringTokenizer(selections, "|"); //$NON-NLS-1$ - while (tokenizer.hasMoreTokens()) { - String selection = tokenizer.nextToken(); - // selection string is of the form: - // id,id,...,selectedid - int i = selection.lastIndexOf(','); - if (i > 0 && i < selection.length() - 1) { - String comboKey= selection.substring(0, i + 1); - String selected= selection.substring(i + 1, selection.length()); - fStructureTypeSelections.put(comboKey, new Integer(Integer.parseInt(selected))); - } - } - } - - /** - * Stores the map of structure selections to the preference store - */ - private void storeStructureTypeSelections() { - StringBuffer buffer= new StringBuffer(); - Iterator iter = fStructureTypeSelections.entrySet().iterator(); - while (iter.hasNext()) { - Map.Entry entry = (Entry) iter.next(); - buffer.append(entry.getKey()); - buffer.append(entry.getValue()); - buffer.append('|'); - } - Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, buffer.toString(), null); - } - - /** - * Loads the collection of known structures identifiers from the preference store - */ - private void loadStructureTypeIds() { - fStructureTypeIds= new ArrayList(); - // Types are stored as a comma-separated, ordered list. - String types= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, IInternalDebugCoreConstants.EMPTY_STRING, null); - StringTokenizer tokenizer= new StringTokenizer(types, ","); //$NON-NLS-1$ - while (tokenizer.hasMoreTokens()) { - String id= tokenizer.nextToken(); - if (id.length() > 0) { - fStructureTypeIds.add(id); - } - } - } - - /** - * Stores the collection of known structure identifiers to the preference store - */ - private void storeStructureTypeIds() { - StringBuffer buffer= new StringBuffer(); - Iterator iter = fStructureTypeIds.iterator(); - while (iter.hasNext()) { - buffer.append(iter.next()).append(','); - } - Preferences.setString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_IDS, buffer.toString(), null); - } - - /** - * Returns the structure that the user has chosen from among the given - * collection of structures or null if the user has chosen - * to display none. - * @param structureTypes the collection of structures available - * @return the structure that the user has chosen from among the given collection - * or null if the user has chosen to display none - */ - public ILogicalStructureType getSelectedStructureType(ILogicalStructureType[] structureTypes) { - if (structureTypes.length == 0) { - return null; - } - String combo= getComboString(structureTypes); - // Lookup the combo - Integer index = (Integer) fStructureTypeSelections.get(combo); - if (index == null) { - // If the user hasn't explicitly chosen anything for this - // combo yet, just return the first type. - return structureTypes[0]; - } else if (index.intValue() == -1) { - // An index of -1 means the user has deselected all structures for this combo - return null; - } - // If an index is stored for this combo, retrieve the id at the index - String id= (String) fStructureTypeIds.get(index.intValue()); - for (int i = 0; i < structureTypes.length; i++) { - // Return the type with the retrieved id - ILogicalStructureType type = structureTypes[i]; - if (type.getId().equals(id)) { - return type; - } - } - return structureTypes[0]; - } - - /** - * - * @param types - * @param selected the type that is selected for the given combo or null - * if the user has deselected any structure for the given combo - */ - public void setEnabledType(ILogicalStructureType[] types, ILogicalStructureType selected) { - String combo= getComboString(types); - int index= -1; // Initialize to "none selected" - if (selected != null) { - index= fStructureTypeIds.indexOf(selected.getId()); - } - Integer integer= new Integer(index); - fStructureTypeSelections.put(combo, integer); - storeStructureTypeSelections(); - storeStructureTypeIds(); - } - - /** - * Returns the string representing the given combination of logical - * structure types. This string will be a series of comma-separated - * indeces representing the various types. If any of the given types - * don't have indeces associated with them, this method will create - * the appropriate index. - * @param types the logical structure types - * @return the string representing the given combination of logical - * structure types - */ - protected String getComboString(ILogicalStructureType[] types) { - StringBuffer comboKey= new StringBuffer(); - for (int i = 0; i < types.length; i++) { - ILogicalStructureType type = types[i]; - int typeIndex = fStructureTypeIds.indexOf(type.getId()); - if (typeIndex == -1) { - typeIndex= fStructureTypeIds.size(); - fStructureTypeIds.add(type.getId()); - } - comboKey.append(typeIndex).append(','); - } - return comboKey.toString(); - } - - private synchronized void initialize() { - if (fTypes == null) { - //get the logical structure types from the extension points - IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LOGICAL_STRUCTURE_TYPES); - IConfigurationElement[] extensions = point.getConfigurationElements(); - fTypes = new ArrayList(extensions.length); - for (int i = 0; i < extensions.length; i++) { - IConfigurationElement extension = extensions[i]; - LogicalStructureType type; - try { - type = new LogicalStructureType(extension); - fTypes.add(type); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - // get the logical structure providers from the extension point - point= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LOGICAL_STRUCTURE_PROVIDERS); - extensions= point.getConfigurationElements(); - fTypeProviders= new ArrayList(extensions.length); - for (int i= 0; i < extensions.length; i++) { - try { - fTypeProviders.add(new LogicalStructureProvider(extensions[i])); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - } - if (fStructureTypeSelections == null) { - loadStructureTypeSelections(); - } - if (fStructureTypeIds == null) { - loadStructureTypeIds(); - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java deleted file mode 100644 index 6aea4bea8..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureProvider.java +++ /dev/null @@ -1,75 +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.core; - -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.DebugPlugin; -import org.eclipse.debug.core.ILogicalStructureProvider; -import org.eclipse.debug.core.ILogicalStructureType; -import org.eclipse.debug.core.model.IValue; - -/** - * Manage logical structure provider extensions - * - * @see IConfigurationElementConstants - */ -public class LogicalStructureProvider { - - private IConfigurationElement fConfigurationElement; - - private String fModelIdentifier; - - private ILogicalStructureProvider fDelegate; - - public LogicalStructureProvider(IConfigurationElement element) throws CoreException { - fConfigurationElement= element; - fModelIdentifier= fConfigurationElement.getAttribute(IConfigurationElementConstants.MODEL_IDENTIFIER); - if (fModelIdentifier == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LogicalStructureProvider_0, null)); - } - String className= fConfigurationElement.getAttribute(IConfigurationElementConstants.CLASS); - if (className == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LogicalStructureProvider_1, null)); - } - } - - /** - * Return the logical structure type able to provide a logical structure for - * the given value. - * - * @param value value for which structure types are requested - * @return logical structure types - */ - public ILogicalStructureType[] getLogicalStructures(IValue value) { - if (fModelIdentifier.equals(value.getModelIdentifier())) { - return getDelegate().getLogicalStructureTypes(value); - } - return new ILogicalStructureType[0]; - } - - /** - * Return the ILogicalStructureProvider for this extension. - */ - protected ILogicalStructureProvider getDelegate() { - if (fDelegate == null) { - try { - fDelegate = (ILogicalStructureProvider) fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - return fDelegate; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java deleted file mode 100644 index 95633f5a6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java +++ /dev/null @@ -1,150 +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.core; - -import com.ibm.icu.text.MessageFormat; - -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.*; -import org.eclipse.debug.core.model.*; - -/** - * Proxy to a logical structure type extension. - * - * @see IConfigurationElementConstants - */ -public class LogicalStructureType implements ILogicalStructureType { - - private IConfigurationElement fConfigurationElement; - private ILogicalStructureTypeDelegate fDelegate; - private String fModelId; - // whether the 'description' attribute has been verified to exist: it is only - // required when the delegate does *not* implement ILogicalStructureTypeDelegate2. - private boolean fVerifiedDescription = false; - - /** - * Constructs a new logical structure type, and verifies required attributes. - * - * @param element configuration element - * @exception CoreException if required attributes are missing - */ - public LogicalStructureType(IConfigurationElement element) throws CoreException { - fConfigurationElement = element; - verifyAttributes(); - } - - /** - * Verifies required attributes. - * - * @exception CoreException if required attributes are missing - */ - private void verifyAttributes() throws CoreException { - verifyAttributeExists(IConfigurationElementConstants.ID); - verifyAttributeExists(IConfigurationElementConstants.CLASS); - fModelId = fConfigurationElement.getAttribute(IConfigurationElementConstants.MODEL_IDENTIFIER); - if (fModelId == null) { - missingAttribute(IConfigurationElementConstants.MODEL_IDENTIFIER); - } - } - - /** - * Verifies the given attribute exists - * - * @exception CoreException if attribute does not exist - */ - private void verifyAttributeExists(String name) throws CoreException { - if (fConfigurationElement.getAttribute(name) == null) { - missingAttribute(name); - } - } - - /** - * Throws a new CoreException about the specified attribute being missing - * @param attrName the name of the missing attribute - * @throws CoreException - */ - private void missingAttribute(String attrName) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, MessageFormat.format(DebugCoreMessages.LogicalStructureType_1, new String[]{attrName}), null)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.ILogicalStructureType#getDescription() - */ - public String getDescription() { - return fConfigurationElement.getAttribute(IConfigurationElementConstants.DESCRIPTION); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.ILogicalStructureType#getId() - */ - public String getId() { - return fConfigurationElement.getAttribute(IConfigurationElementConstants.ID); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.ILogicalStructureType#getLogicalStructure(org.eclipse.debug.core.model.IValue) - */ - public IValue getLogicalStructure(IValue value) throws CoreException { - return getDelegate().getLogicalStructure(value); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.ILogicalStructureType#providesLogicalStructure(org.eclipse.debug.core.model.IValue) - */ - public boolean providesLogicalStructure(IValue value) { - if (value.getModelIdentifier().equals(fModelId)) { - return getDelegate().providesLogicalStructure(value); - } - return false; - } - - /** - * Returns the ILogicalStructuresTypeDelegate delegate - * @return the delegate - */ - protected ILogicalStructureTypeDelegate getDelegate() { - if (fDelegate == null) { - try { - fDelegate = (ILogicalStructureTypeDelegate) fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - return fDelegate; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2#getDescription(org.eclipse.debug.core.model.IValue) - */ - public String getDescription(IValue value) { - ILogicalStructureTypeDelegate delegate = getDelegate(); - if (delegate instanceof ILogicalStructureTypeDelegate2) { - ILogicalStructureTypeDelegate2 d2 = (ILogicalStructureTypeDelegate2) delegate; - return d2.getDescription(value); - } - if (!fVerifiedDescription) { - fVerifiedDescription = true; - try { - verifyAttributeExists(IConfigurationElementConstants.DESCRIPTION); - } catch (CoreException e) { - DebugPlugin.log(e); - } - } - String description = getDescription(); - if (description == null) { - return DebugCoreMessages.LogicalStructureType_0; - } - return description; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java deleted file mode 100644 index 25a381d84..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.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 - * WindRiver - Bug 192028 [Memory View] Memory view does not - * display memory blocks that do not reference IDebugTarget - *******************************************************************************/ - -package org.eclipse.debug.internal.core; - -import java.util.ArrayList; - -import org.eclipse.core.runtime.ISafeRunnable; -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.IMemoryBlockListener; -import org.eclipse.debug.core.IMemoryBlockManager; -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; - - -/** - * Implementation of IMemoryBlockManager - * The manager is responsible to manage all memory blocks in the workbench. - * - * @since 3.1 - * - */ -public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetListener { - - private ArrayList listeners = new ArrayList(); // list of all IMemoryBlockListener - private ArrayList memoryBlocks = new ArrayList(); // list of all memory blocks - - private static final int ADDED = 0; - private static final int REMOVED = 1; - /** - * Notifies a memory block listener in a safe runnable to - * handle exceptions. - */ - class MemoryBlockNotifier implements ISafeRunnable { - - private IMemoryBlockListener fListener; - private int fType; - private IMemoryBlock[] fMemoryBlocks; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - DebugPlugin.log(exception); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.memoryBlocksAdded(fMemoryBlocks); - break; - case REMOVED: - fListener.memoryBlocksRemoved(fMemoryBlocks); - break; - } - } - - /** - * Notify listeners of added/removed memory block events - * - * @param memBlocks blocks that have changed - * @param update type of change - */ - public void notify(IMemoryBlock[] memBlocks, int update) { - if (listeners != null) { - fType = update; - Object[] copiedListeners= listeners.toArray(new IMemoryBlockListener[listeners.size()]); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IMemoryBlockListener)copiedListeners[i]; - fMemoryBlocks = memBlocks; - SafeRunner.run(this); - } - } - fListener = null; - fMemoryBlocks = null; - } - } - - /** - * Returns the MemoryBlockNotifier - * @return the MemoryBlockNotifier - * - * TODO consider using only one of these, and sync where needed, - * this way we are not creating a new every single time. - */ - private MemoryBlockNotifier getMemoryBlockNotifier() { - return new MemoryBlockNotifier(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IMemoryBlockManager#addMemoryBlock(org.eclipse.debug.core.model.IMemoryBlock) - */ - public void addMemoryBlocks(IMemoryBlock[] mem) { - if (memoryBlocks == null) { - return; - } - if (mem == null) { - DebugPlugin.logMessage("Null argument passed into IMemoryBlockManager.addMemoryBlock", null); //$NON-NLS-1$ - return; - } - - if(mem.length > 0) { - ArrayList newMemoryBlocks = new ArrayList(); - for (int i=0; i 0) { - for (int i=0; i= 0) { - //do nothing - } - } catch (IOException e) { - } - } - }, DebugCoreMessages.NullStreamsProxy_0); - thread.setDaemon(true); - thread.start(); - - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamMonitor#addListener(org.eclipse.debug.core.IStreamListener) - */ - public void addListener(IStreamListener listener) { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamMonitor#getContents() - */ - public String getContents() { - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamMonitor#removeListener(org.eclipse.debug.core.IStreamListener) - */ - public void removeListener(IStreamListener listener) { - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java deleted file mode 100644 index c5fa6dae0..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java +++ /dev/null @@ -1,273 +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.core; - - -import java.io.BufferedInputStream; -import java.io.IOException; -import java.io.InputStream; - -import org.eclipse.core.runtime.ISafeRunnable; -import org.eclipse.core.runtime.ListenerList; -import org.eclipse.core.runtime.SafeRunner; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IStreamListener; -import org.eclipse.debug.core.model.IFlushableStreamMonitor; - -/** - * Monitors the output stream of a system process and notifies - * listeners of additions to the stream. - * - * The output stream monitor reads system out (or err) via - * and input stream. - */ -public class OutputStreamMonitor implements IFlushableStreamMonitor { - /** - * The stream being monitored (connected system out or err). - */ - private InputStream fStream; - - /** - * A collection of listeners - */ - private ListenerList fListeners= new ListenerList(); - - /** - * Whether content is being buffered - */ - private boolean fBuffered = true; - - /** - * The local copy of the stream contents - */ - private StringBuffer fContents; - - /** - * The thread which reads from the stream - */ - private Thread fThread; - - /** - * The size of the read buffer - */ - private static final int BUFFER_SIZE= 8192; - - /** - * Whether or not this monitor has been killed. - * When the monitor is killed, it stops reading - * from the stream immediately. - */ - private boolean fKilled= false; - - private long lastSleep; - - private String fEncoding; - - /** - * Creates an output stream monitor on the - * given stream (connected to system out or err). - * - * @param stream input stream to read from - * @param encoding stream encoding or null for system default - */ - public OutputStreamMonitor(InputStream stream, String encoding) { - fStream = new BufferedInputStream(stream, 8192); - fEncoding = encoding; - fContents= new StringBuffer(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamMonitor#addListener(org.eclipse.debug.core.IStreamListener) - */ - public synchronized void addListener(IStreamListener listener) { - fListeners.add(listener); - } - - /** - * Causes the monitor to close all - * communications between it and the - * underlying stream by waiting for the thread to terminate. - */ - protected void close() { - if (fThread != null) { - Thread thread= fThread; - fThread= null; - try { - thread.join(); - } catch (InterruptedException ie) { - } - fListeners = new ListenerList(); - } - } - - /** - * Notifies the listeners that text has - * been appended to the stream. - */ - private void fireStreamAppended(String text) { - getNotifier().notifyAppend(text); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamMonitor#getContents() - */ - public synchronized String getContents() { - return fContents.toString(); - } - - /** - * Continually reads from the stream. - *

                            - * This method, along with the startReading - * method is used to allow OutputStreamMonitor - * to implement Runnable without publicly - * exposing a run method. - */ - private void read() { - lastSleep = System.currentTimeMillis(); - long currentTime = lastSleep; - byte[] bytes= new byte[BUFFER_SIZE]; - int read = 0; - while (read >= 0) { - try { - if (fKilled) { - break; - } - read= fStream.read(bytes); - if (read > 0) { - String text; - if (fEncoding != null) { - text = new String(bytes, 0, read, fEncoding); - } else { - text = new String(bytes, 0, read); - } - synchronized (this) { - if (isBuffered()) { - fContents.append(text); - } - fireStreamAppended(text); - } - } - } catch (IOException ioe) { - if (!fKilled) { - DebugPlugin.log(ioe); - } - return; - } catch (NullPointerException e) { - // killing the stream monitor while reading can cause an NPE - // when reading from the stream - if (!fKilled && fThread != null) { - DebugPlugin.log(e); - } - return; - } - - currentTime = System.currentTimeMillis(); - if (currentTime - lastSleep > 1000) { - lastSleep = currentTime; - try { - Thread.sleep(1); // just give up CPU to maintain UI responsiveness. - } catch (InterruptedException e) { - } - } - } - try { - fStream.close(); - } catch (IOException e) { - DebugPlugin.log(e); - } - } - - protected void kill() { - fKilled= true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamMonitor#removeListener(org.eclipse.debug.core.IStreamListener) - */ - public synchronized void removeListener(IStreamListener listener) { - fListeners.remove(listener); - } - - /** - * Starts a thread which reads from the stream - */ - protected void startMonitoring() { - if (fThread == null) { - fThread= new Thread(new Runnable() { - public void run() { - read(); - } - }, DebugCoreMessages.OutputStreamMonitor_label); - fThread.setDaemon(true); - fThread.setPriority(Thread.MIN_PRIORITY); - fThread.start(); - } - } - - /** - * @see org.eclipse.debug.core.model.IFlushableStreamMonitor#setBuffered(boolean) - */ - public synchronized void setBuffered(boolean buffer) { - fBuffered = buffer; - } - - /** - * @see org.eclipse.debug.core.model.IFlushableStreamMonitor#flushContents() - */ - public synchronized void flushContents() { - fContents.setLength(0); - } - - /** - * @see IFlushableStreamMonitor#isBuffered() - */ - public synchronized boolean isBuffered() { - return fBuffered; - } - - private ContentNotifier getNotifier() { - return new ContentNotifier(); - } - - class ContentNotifier implements ISafeRunnable { - - private IStreamListener fListener; - private String fText; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - DebugPlugin.log(exception); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - fListener.streamAppended(fText, OutputStreamMonitor.this); - } - - public void notifyAppend(String text) { - if (text == null) - return; - fText = text; - Object[] copiedListeners= fListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IStreamListener) copiedListeners[i]; - SafeRunner.run(this); - } - fListener = null; - fText = null; - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Preferences.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Preferences.java deleted file mode 100644 index 3268363bf..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/Preferences.java +++ /dev/null @@ -1,415 +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.core; - -import org.eclipse.core.runtime.preferences.DefaultScope; -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IScopeContext; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.debug.core.DebugPlugin; -import org.osgi.service.prefs.BackingStoreException; - -/** - * Convenience class to facilitate using the new {@link IEclipsePreferences} story - * - * @since 3.6 - * @noinstantiate This class is not intended to be instantiated by clients. - */ -public final class Preferences { - - static final IScopeContext[] contexts = new IScopeContext[] {new DefaultScope(), new InstanceScope()}; - - static final int DEFAULT_CONTEXT = 0; - static final int INSTANCE_CONTEXT = 1; - - /** - * Constructor - */ - private Preferences() { - // no direct instantiation - } - - /** - * Sets a string preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setString(String qualifier, String key, String value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.put(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).put(key, value); - } - } - - /** - * Sets a boolean preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setBoolean(String qualifier, String key, boolean value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.putBoolean(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).putBoolean(key, value); - } - } - - /** - * Sets a integer preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setInt(String qualifier, String key, int value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.putInt(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).putInt(key, value); - } - } - - /** - * Sets a long preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setLong(String qualifier, String key, long value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.putLong(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).putLong(key, value); - } - } - - /** - * Sets a byte array preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setByteArray(String qualifier, String key, byte[] value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.putByteArray(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).putByteArray(key, value); - } - } - - /** - * Sets a double preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setDouble(String qualifier, String key, double value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.putDouble(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).putDouble(key, value); - } - } - - /** - * Sets a float preference in the {@link InstanceScope} or the given {@link IScopeContext} if it - * is not null. Preferences set in a given context are flushed as they are set. - * @param qualifier - * @param key the key - * @param value the value - * @param context - */ - public static synchronized void setFloat(String qualifier, String key, float value, IScopeContext context) { - if(context != null) { - try { - IEclipsePreferences node = context.getNode(qualifier); - node.putFloat(key, value); - node.flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - else { - contexts[INSTANCE_CONTEXT].getNode(qualifier).putFloat(key, value); - } - } - - /** - * Sets a string in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultString(String qualifier, String key, String value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).put(key, value); - } - - /** - * Sets a boolean in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultBoolean(String qualifier, String key, boolean value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).putBoolean(key, value); - } - - /** - * Sets a byte array in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultByteArray(String qualifier, String key, byte[] value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).putByteArray(key, value); - } - - /** - * Sets a double in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultDouble(String qualifier, String key, double value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).putDouble(key, value); - } - - /** - * Sets a float in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultFloat(String qualifier, String key, float value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).putFloat(key, value); - } - - /** - * Sets a integer in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultInt(String qualifier, String key, int value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).putInt(key, value); - } - - /** - * Sets a long in the {@link DefaultScope} - * @param qualifier - * @param key the key - * @param value the new value - */ - public static synchronized void setDefaultLong(String qualifier, String key, long value) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).putLong(key, value); - } - - /** - * Sets the given preference to its default value. This is done by removing any set value - * from the {@link InstanceScope}. Has no effect if the given key is null. - * @param qualifier - * @param key the key for the preference - */ - public static synchronized void setToDefault(String qualifier, String key) { - if(key != null) { - contexts[INSTANCE_CONTEXT].getNode(qualifier).remove(key); - } - } - - /** - * Returns the default boolean value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the boolean value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized boolean getDefaultBoolean(String qualifier, String key, boolean defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).getBoolean(key, defaultvalue); - } - - /** - * Returns the default string value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the string value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized String getDefaultString(String qualifier, String key, String defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).get(key, defaultvalue); - } - - /** - * Returns the default byte array value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the byte array value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized byte[] getDefaultByteArray(String qualifier, String key, byte[] defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).getByteArray(key, defaultvalue); - } - - /** - * Returns the default integer value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the integer value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized int getDefaultInt(String qualifier, String key, int defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).getInt(key, defaultvalue); - } - - /** - * Returns the default long value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the long value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized long getDefaultLong(String qualifier, String key, long defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).getLong(key, defaultvalue); - } - - /** - * Returns the default double value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the double value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized double getDefaultDouble(String qualifier, String key, double defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).getDouble(key, defaultvalue); - } - - /** - * Returns the default float value stored in the {@link DefaultScope} for the given key - * or the specified default value if the key does not appear in the {@link DefaultScope} - * @param qualifier - * @param key - * @param defaultvalue - * - * @return the float value set in the {@link DefaultScope} for the given key, or the specified default value. - */ - public static synchronized float getDefaultFloat(String qualifier, String key, float defaultvalue) { - return contexts[DEFAULT_CONTEXT].getNode(qualifier).getFloat(key, defaultvalue); - } - - /** - * Save the preferences for the given plugin identifier. - * It should be noted that all pending preference changes will be flushed with this method. - * @param qualifier - */ - public static synchronized void savePreferences(String qualifier) { - try { - contexts[DEFAULT_CONTEXT].getNode(qualifier).flush(); - contexts[INSTANCE_CONTEXT].getNode(qualifier).flush(); - } - catch(BackingStoreException bse) { - DebugPlugin.log(bse); - } - } - - /** - * Adds the given preference listener to the {@link DefaultScope} and the {@link InstanceScope} - * @param qualifier - * @param listener - */ - public static void addPreferenceListener(String qualifier, IEclipsePreferences.IPreferenceChangeListener listener) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).addPreferenceChangeListener(listener); - contexts[INSTANCE_CONTEXT].getNode(qualifier).addPreferenceChangeListener(listener); - } - - /** - * Removes the given preference listener from the {@link DefaultScope} and the {@link InstanceScope} - * @param qualifier - * @param listener - */ - public static void removePreferenceListener(String qualifier, IEclipsePreferences.IPreferenceChangeListener listener) { - contexts[DEFAULT_CONTEXT].getNode(qualifier).removePreferenceChangeListener(listener); - contexts[INSTANCE_CONTEXT].getNode(qualifier).removePreferenceChangeListener(listener); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java deleted file mode 100644 index b75ced816..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java +++ /dev/null @@ -1,55 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - -import org.eclipse.core.runtime.preferences.IEclipsePreferences; -import org.eclipse.core.runtime.preferences.IPreferenceNodeVisitor; -import org.eclipse.core.runtime.preferences.PreferenceModifyListener; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.osgi.service.prefs.BackingStoreException; - -/** - * Used to listen for preference imports that include changes to - * preferred launch delegates. - * - * @since 3.6 - */ -public class PreferredDelegateModifyListener extends PreferenceModifyListener { - class Visitor implements IPreferenceNodeVisitor { - - public boolean visit(IEclipsePreferences node) throws BackingStoreException { - if (node.name().equals(DebugPlugin.getUniqueIdentifier())) { - // reset preferred delegates, so they are re-initialized from the preferences - LaunchManager manager = (LaunchManager)DebugPlugin.getDefault().getLaunchManager(); - manager.resetPreferredDelegates(); - ILaunchConfigurationType[] types = manager.getLaunchConfigurationTypes(); - for (int i = 0; i < types.length; i++) { - ((LaunchConfigurationType) types[i]).resetPreferredDelegates(); - } - return false; - } - return true; - } - - } - - public IEclipsePreferences preApply(IEclipsePreferences node) { - try { - // force VMs to be initialized before we import the new VMs - node.accept(new Visitor()); - } catch (BackingStoreException e) { - DebugPlugin.log(e); - } - return node; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RefreshScopeComparator.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RefreshScopeComparator.java deleted file mode 100644 index 4a3ef6a51..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RefreshScopeComparator.java +++ /dev/null @@ -1,48 +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.core; - -import java.util.Comparator; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.RefreshUtil; - -/** - * Compares refresh scope attributes as the format has changed from a working - * set memento to an XML memento of resource paths. Avoids migrating attribute - * to new format until something else in the configuration changes. - * - * @since 3.6 - */ -public class RefreshScopeComparator implements Comparator { - - public int compare(Object o1, Object o2) { - String m1 = (String) o1; - String m2 = (String) o2; - try { - IResource[] r1 = RefreshUtil.toResources(m1); - IResource[] r2 = RefreshUtil.toResources(m2); - if (r1.length == r2.length) { - for (int i = 0; i < r2.length; i++) { - if (!r1[i].equals(r2[i])) { - return -1; - } - } - return 0; - } - } catch (CoreException e) { - return -1; - } - return -1; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java deleted file mode 100644 index 789cdd96a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ResourceFactory.java +++ /dev/null @@ -1,73 +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.core; - - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRoot; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.Path; - -/** - * The ResourceFactory is used to save and recreate an IResource object. - * As such, it implements the IPersistableElement interface for storage - * and the IElementFactory interface for recreation. - */ -public class ResourceFactory { - - // These persistence constants are stored in XML. Do not - // change them. - public static final String TAG_PATH = "path";//$NON-NLS-1$ - - public static final String TAG_TYPE = "type";//$NON-NLS-1$ - - /** - * Creates and returns an element based on the given memento - * - * @param memento element memento - * @return associated element - */ - public static IAdaptable createElement(XMLMemento memento) { - // Get the file name. - String fileName = memento.getString(TAG_PATH); - if (fileName == null) { - return null; - } - - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - String type = memento.getString(TAG_TYPE); - IResource res = null; - if (type == null) { - // Old format memento. Create an IResource using findMember. - // Will return null for resources in closed projects. - res = root.findMember(new Path(fileName)); - } else { - int resourceType = Integer.parseInt(type); - - if (resourceType == IResource.ROOT) { - res = root; - } else if (resourceType == IResource.PROJECT) { - res = root.getProject(fileName); - } else if (resourceType == IResource.FOLDER) { - res = root.getFolder(new Path(fileName)); - } else if (resourceType == IResource.FILE) { - res = root.getFile(new Path(fileName)); - } - } - return res; - } - - public static void saveState(XMLMemento memento, IResource res) { - memento.putString(TAG_PATH, res.getFullPath().toString()); - memento.putString(TAG_TYPE, Integer.toString(res.getType())); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java deleted file mode 100644 index 1ceb5bfc4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java +++ /dev/null @@ -1,88 +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.core; - -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.commands.IStepFiltersHandler; -import org.eclipse.debug.internal.core.commands.DebugCommandRequest; - -/** - * As targets are launched, this manager sets its step filter - * support settings according to the "use step filter" setting. - * - * @since 3.0 - */ -public class StepFilterManager implements ILaunchListener { - - public static final String PREF_USE_STEP_FILTERS = DebugPlugin.getUniqueIdentifier() + ".USE_STEP_FILTERS"; //$NON-NLS-1$ - - /** - * The step filter manager is instantiated by the debug UI plug-in, - * and should be accessed from the DebugUIPlugin class. - */ - protected StepFilterManager() { - DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); - } - - /** - * This method is called by the debug UI plug-in at shutdown. - */ - public void shutdown() { - DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch) - */ - public void launchAdded(ILaunch launch) { - launchChanged(launch); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch) - */ - public void launchChanged(ILaunch launch) { - IStepFiltersHandler command = (IStepFiltersHandler)launch.getAdapter(IStepFiltersHandler.class); - if (command != null) { - command.execute(new DebugCommandRequest(new Object[]{launch})); - } - } - - /** - * Returns whether the 'use step filters' preference is on. - * - * @return whether to use step filters - */ - public boolean isUseStepFilters() { - return Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), PREF_USE_STEP_FILTERS, false, null); - } - - /** - * Sets whether to use step filters. - * - * @param useFilters whether to use step filters - */ - public void setUseStepFilters(boolean useFilters) { - Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), PREF_USE_STEP_FILTERS, useFilters, null); - ILaunch[] launchs = DebugPlugin.getDefault().getLaunchManager().getLaunches(); - for (int i = 0; i < launchs.length; i++) { - ILaunch launch = launchs[i]; - launchChanged(launch); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch) - */ - public void launchRemoved(ILaunch launch) {} -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java deleted file mode 100644 index 0bae93602..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java +++ /dev/null @@ -1,145 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core; - - -import java.io.IOException; - -import org.eclipse.debug.core.model.IStreamMonitor; -import org.eclipse.debug.core.model.IStreamsProxy; -import org.eclipse.debug.core.model.IStreamsProxy2; - -/** - * Standard implementation of a streams proxy for IStreamsProxy. - */ - -public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 { - /** - * The monitor for the output stream (connected to standard out of the process) - */ - private OutputStreamMonitor fOutputMonitor; - /** - * The monitor for the error stream (connected to standard error of the process) - */ - private OutputStreamMonitor fErrorMonitor; - /** - * The monitor for the input stream (connected to standard in of the process) - */ - private InputStreamMonitor fInputMonitor; - /** - * Records the open/closed state of communications with - * the underlying streams. Note: fClosed is initialized to - * false by default. - */ - private boolean fClosed; - /** - * Creates a StreamsProxy on the streams - * of the given system process. - * - * @param process system process to create a streams proxy on - * @param encoding the process's encoding or null if default - */ - public StreamsProxy(Process process, String encoding) { - if (process == null) { - return; - } - fOutputMonitor= new OutputStreamMonitor(process.getInputStream(), encoding); - fErrorMonitor= new OutputStreamMonitor(process.getErrorStream(), encoding); - fInputMonitor= new InputStreamMonitor(process.getOutputStream(), encoding); - fOutputMonitor.startMonitoring(); - fErrorMonitor.startMonitoring(); - fInputMonitor.startMonitoring(); - } - - /** - * Causes the proxy to close all - * communications between it and the - * underlying streams after all remaining data - * in the streams is read. - */ - public void close() { - if (!isClosed(true)) { - fOutputMonitor.close(); - fErrorMonitor.close(); - fInputMonitor.close(); - } - } - - /** - * Returns whether the proxy is currently closed. This method - * synchronizes access to the fClosed flag. - * - * @param setClosed If true this method will also set the - * fClosed flag to true. Otherwise, the fClosed - * flag is not modified. - * @return Returns whether the stream proxy was already closed. - */ - private synchronized boolean isClosed(boolean setClosed) { - boolean closed = fClosed; - if (setClosed) { - fClosed = true; - } - return closed; - } - - /** - * Causes the proxy to close all - * communications between it and the - * underlying streams immediately. - * Data remaining in the streams is lost. - */ - public void kill() { - synchronized (this) { - fClosed= true; - } - fOutputMonitor.kill(); - fErrorMonitor.kill(); - fInputMonitor.close(); - } - - /** - * @see IStreamsProxy#getErrorStreamMonitor() - */ - public IStreamMonitor getErrorStreamMonitor() { - return fErrorMonitor; - } - - /** - * @see IStreamsProxy#getOutputStreamMonitor() - */ - public IStreamMonitor getOutputStreamMonitor() { - return fOutputMonitor; - } - - /** - * @see IStreamsProxy#write(String) - */ - public void write(String input) throws IOException { - if (!isClosed(false)) { - fInputMonitor.write(input); - } else { - throw new IOException(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStreamsProxy2#closeInputStream() - */ - public void closeInputStream() throws IOException { - if (!isClosed(false)) { - fInputMonitor.closeInputStream(); - } else { - throw new IOException(); - } - - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemPropertyResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemPropertyResolver.java deleted file mode 100644 index 01c5d19d5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemPropertyResolver.java +++ /dev/null @@ -1,36 +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.core; - -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.DebugPlugin; - -/** - * Resolves the value of system properties from the Eclipse SDK runtime. - */ -public class SystemPropertyResolver 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 { - if (argument == null) { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), IStatus.ERROR, DebugCoreMessages.SystemPropertyResolver_0, null)); - } - return System.getProperty(argument); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java deleted file mode 100644 index da4d5e543..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.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.core; - -import java.net.URL; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; - -/** - * Resolves common system variables. The current set of variables - * supported (referenced as an argument to this variable) are: - *

                              - *
                            • ARCH - value of BootLoader.getOSArch()
                            • - *
                            • ECLIPSE_HOME - location of the Eclipse installation
                            • - *
                            • NL - value of BootLoader.getNL()
                            • - *
                            • OS - value of BootLoader.getOS()
                            • - *
                            • WS - value of BootLoader.getWS()
                            • - *
                            - * @since 3.0 - */ -public class SystemVariableResolver 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 { - if ("ARCH".equals(argument)) { //$NON-NLS-1$ - return Platform.getOSArch(); - } else if ("ECLIPSE_HOME".equals(argument)) { //$NON-NLS-1$ - URL installURL = Platform.getInstallLocation().getURL(); - IPath ppath = new Path(installURL.getFile()).removeTrailingSeparator(); - return getCorrectPath(ppath.toOSString()); - } else if ("NL".equals(argument)) { //$NON-NLS-1$ - return Platform.getNL(); - } else if ("OS".equals(argument)) { //$NON-NLS-1$ - return Platform.getOS(); - } else if ("WS".equals(argument)) { //$NON-NLS-1$ - return Platform.getWS(); - } - return null; - } - - private static String getCorrectPath(String path) { - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < path.length(); i++) { - char c = path.charAt(i); - if (Platform.getOS().equals("win32")) { //$NON-NLS-1$ - if (i == 0 && c == '/') - continue; - } - // Some VMs may return %20 instead of a space - if (c == '%' && i + 2 < path.length()) { - char c1 = path.charAt(i + 1); - char c2 = path.charAt(i + 2); - if (c1 == '2' && c2 == '0') { - i += 2; - buf.append(" "); //$NON-NLS-1$ - continue; - } - } - buf.append(c); - } - return buf.toString(); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java deleted file mode 100644 index ed51fc9e6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java +++ /dev/null @@ -1,295 +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.core; - -import org.eclipse.core.runtime.Platform; -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.ILaunchConfiguration; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IWatchExpression; -import org.eclipse.debug.core.model.IWatchExpressionDelegate; -import org.eclipse.debug.core.model.IWatchExpressionListener; -import org.eclipse.debug.core.model.IWatchExpressionResult; - -/** - * Base watch expression implementation. - * - * @since 3.0 - */ -public class WatchExpression implements IWatchExpression { - - protected String fExpressionText; - protected IWatchExpressionResult fResult; - protected IDebugElement fCurrentContext; - private boolean fEnabled= true; - private boolean fPending= false; - - /** - * Creates a new watch expression with the given expression - * text. - * @param expression the text of the expression to be evaluated. - */ - public WatchExpression(String expression) { - fExpressionText= expression; - } - - /** - * Creates a new watch expression with the given expression - * and the given enablement; - * - * @param expressionText the text of the expression to be evaluated - * @param enabled whether or not the new expression should be enabled - */ - public WatchExpression(String expressionText, boolean enabled) { - this(expressionText); - fEnabled= enabled; - } - - /** - * @see org.eclipse.debug.core.model.IWatchExpression#evaluate() - */ - public void evaluate() { - IDebugElement context= fCurrentContext; - if (context == null) { - return; - } - - IWatchExpressionListener listener= new IWatchExpressionListener() { - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchExpressionListener#watchEvaluationFinished(org.eclipse.debug.core.model.IWatchExpressionResult) - */ - public void watchEvaluationFinished(IWatchExpressionResult result) { - setResult(result); - } - }; - setPending(true); - IWatchExpressionDelegate delegate= DebugPlugin.getDefault().getExpressionManager().newWatchExpressionDelegate(context.getModelIdentifier()); - if (delegate != null) { - delegate.evaluateExpression(getExpressionText(), context, listener); - } else { - // No delegate provided - listener.watchEvaluationFinished(new IWatchExpressionResult() { - public IValue getValue() { - return null; - } - public boolean hasErrors() { - return true; - } - public String[] getErrorMessages() { - return new String[] { DebugCoreMessages.WatchExpression_0 }; - } - public String getExpressionText() { - return WatchExpression.this.getExpressionText(); - } - public DebugException getException() { - return null; - } - }); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchExpression#setExpressionContext(org.eclipse.debug.core.model.IDebugElement) - */ - public void setExpressionContext(IDebugElement context) { - synchronized (this) { - fCurrentContext= context; - } - if (context == null) { - setResult(null); - return; - } - if (!isEnabled()) { - return; - } - - evaluate(); - } - - /** - * Sets the result of the last expression and fires notification that - * this expression's value has changed. - * - * @param result result of a watch expression - */ - public void setResult(IWatchExpressionResult result) { - synchronized (this) { - fResult= result; - fPending = false; - } - fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.STATE)); // pending state - fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT)); // value change - } - - /** - * Fires the given debug event - * @param event - */ - protected void fireEvent(DebugEvent event) { - DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event}); - } - - /** - * Notifies the expression manager that this watch expression's - * values have changed so the manager can update the - * persisted expression. - * - * @param persist whether to persist the expression - */ - private void watchExpressionChanged(boolean persist) { - ((ExpressionManager)DebugPlugin.getDefault().getExpressionManager()).watchExpressionChanged(this, persist); - } - - /** - * @see org.eclipse.debug.core.model.IExpression#getExpressionText() - */ - public String getExpressionText() { - return fExpressionText; - } - - /** - * @see org.eclipse.debug.core.model.IExpression#getValue() - */ - public synchronized IValue getValue() { - if (fResult == null) { - return null; - } - return fResult.getValue(); - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() - */ - public IDebugTarget getDebugTarget() { - IDebugElement element = fCurrentContext; - if (element != null) { - return element.getDebugTarget(); - } - return null; - } - - /** - * @see org.eclipse.debug.core.model.IExpression#dispose() - */ - public void dispose() { - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() - */ - public String getModelIdentifier() { - synchronized (this) { - IValue value = getValue(); - if (value != null) { - return value.getModelIdentifier(); - } - if (fCurrentContext != null) { - return fCurrentContext.getModelIdentifier(); - } - } - return DebugPlugin.getUniqueIdentifier(); - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() - */ - public ILaunch getLaunch() { - IDebugTarget debugTarget = getDebugTarget(); - if (debugTarget != null) { - return debugTarget.getLaunch(); - } - return null; - } - - /** - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - //CONTEXTLAUNCHING - if(adapter.equals(ILaunchConfiguration.class)) { - ILaunch launch = getLaunch(); - if(launch != null) { - return launch.getLaunchConfiguration(); - } - } - return Platform.getAdapterManager().getAdapter(this, adapter); - } - - /** - * @param enabled - */ - public void setEnabled(boolean enabled) { - fEnabled= enabled; - watchExpressionChanged(true); - evaluate(); - } - - /** - * @param expression - */ - public void setExpressionText(String expression) { - fExpressionText= expression; - watchExpressionChanged(true); - evaluate(); - } - - /** - * @return Whether or not this watch expression is currently enabled. - * Enabled watch expressions will continue to update their value - * automatically. Disabled expressions require a manual update. - */ - public boolean isEnabled() { - return fEnabled; - } - - /** - * @see org.eclipse.debug.core.model.IWatchExpression#isPending() - */ - public synchronized boolean isPending() { - return fPending; - } - - /** - * Sets the pending state of this expression. - * - * @param pending whether or not this expression should be - * flagged as pending - */ - protected void setPending(boolean pending) { - synchronized (this) { - fPending= pending; - } - fireEvent(new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.STATE)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IErrorReportingExpression#hasErrors() - */ - public boolean hasErrors() { - return fResult != null && fResult.hasErrors(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IErrorReportingExpression#getErrorMessages() - */ - public String[] getErrorMessages() { - if (fResult == null) { - return new String[0]; - } - return fResult.getErrorMessages(); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java deleted file mode 100644 index 6daf96598..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java +++ /dev/null @@ -1,599 +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.core; - - -import java.io.IOException; -import java.io.PrintWriter; -import java.io.Reader; -import java.io.Writer; -import java.util.ArrayList; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.ParserConfigurationException; - -import org.eclipse.debug.core.DebugPlugin; -import org.w3c.dom.Attr; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; -import org.w3c.dom.Text; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * An XML memento. Copied from workspace plug-in. - */ -public final class XMLMemento { - private Document factory; - - private Element element; - - /** - * Creates a Document from the Reader - * and returns a memento on the first Element for reading - * the document. - *

                            - * Same as calling createReadRoot(reader, null) - *

                            - * - * @param reader the Reader used to create the memento's document - * @return a memento on the first Element for reading the document - * @throws Exception if IO problems, invalid format, or no element. - */ - public static XMLMemento createReadRoot(Reader reader) - throws Exception { - return createReadRoot(reader, null); - } - - /** - * Creates a Document from the Reader - * and returns a memento on the first Element for reading - * the document. - * - * @param reader the Reader used to create the memento's document - * @param baseDir the directory used to resolve relative file names - * in the XML document. This directory must exist and include the - * trailing separator. The directory format, including the separators, - * must be valid for the platform. Can be null if not - * needed. - * @return a memento on the first Element for reading the document - * @throws Exception if IO problems, invalid format, or no element. - */ - public static XMLMemento createReadRoot(Reader reader, String baseDir) - throws Exception { - String errorMessage = null; - Exception exception = null; - - try { - DocumentBuilderFactory factory = DocumentBuilderFactory - .newInstance(); - DocumentBuilder parser = factory.newDocumentBuilder(); - InputSource source = new InputSource(reader); - if (baseDir != null) { - source.setSystemId(baseDir); - } - Document document = parser.parse(source); - NodeList list = document.getChildNodes(); - for (int i = 0; i < list.getLength(); i++) { - Node node = list.item(i); - if (node instanceof Element) { - return new XMLMemento(document, (Element) node); - } - } - } catch (ParserConfigurationException e) { - exception = e; - // errorMessage = WorkbenchMessages.XMLMemento_parserConfigError; - } catch (IOException e) { - exception = e; - // errorMessage = WorkbenchMessages.XMLMemento_ioError; - } catch (SAXException e) { - exception = e; - // errorMessage = WorkbenchMessages.XMLMemento_formatError; - } - - String problemText = null; - if (exception != null) { - problemText = exception.getMessage(); - } - if (problemText == null || problemText.length() == 0) { - problemText = errorMessage != null ? errorMessage - :"ERROR"; //;WorkbenchMessages.XMLMemento_noElement; //$NON-NLS-1$ - } - throw new Exception(problemText, exception); - } - - /** - * Returns a root memento for writing a document. - * - * @param type the element node type to create on the document - * @return the root memento for writing a document - */ - public static XMLMemento createWriteRoot(String type) { - Document document; - try { - document = DocumentBuilderFactory.newInstance() - .newDocumentBuilder().newDocument(); - Element element = document.createElement(type); - document.appendChild(element); - return new XMLMemento(document, element); - } catch (ParserConfigurationException e) { -// throw new Error(e); - throw new Error(e.getMessage()); - } - } - - /** - * Creates a memento for the specified document and element. - *

                            - * Clients should use createReadRoot and - * createWriteRoot to create the initial - * memento on a document. - *

                            - * - * @param document the document for the memento - * @param element the element node for the memento - */ - public XMLMemento(Document document, Element element) { - super(); - this.factory = document; - this.element = element; - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public XMLMemento createChild(String type) { - Element child = factory.createElement(type); - element.appendChild(child); - return new XMLMemento(factory, child); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public XMLMemento createChild(String type, String id) { - Element child = factory.createElement(type); - child.setAttribute(IMementoConstants.TAG_ID, id == null ? "" : id); //$NON-NLS-1$ - element.appendChild(child); - return new XMLMemento(factory, child); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public XMLMemento copyChild(XMLMemento child) { - Element childElement = child.element; - Element newElement = (Element) factory.importNode(childElement, true); - element.appendChild(newElement); - return new XMLMemento(factory, newElement); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public XMLMemento getChild(String type) { - - // Get the nodes. - NodeList nodes = element.getChildNodes(); - int size = nodes.getLength(); - if (size == 0) { - return null; - } - - // Find the first node which is a child of this node. - for (int nX = 0; nX < size; nX++) { - Node node = nodes.item(nX); - if (node instanceof Element) { - Element element1 = (Element) node; - if (element1.getNodeName().equals(type)) { - return new XMLMemento(factory, element1); - } - } - } - - // A child was not found. - return null; - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public XMLMemento[] getChildren(String type) { - - // Get the nodes. - NodeList nodes = element.getChildNodes(); - int size = nodes.getLength(); - if (size == 0) { - return new XMLMemento[0]; - } - - // Extract each node with given type. - ArrayList list = new ArrayList(size); - for (int nX = 0; nX < size; nX++) { - Node node = nodes.item(nX); - if (node instanceof Element) { - Element element1 = (Element) node; - if (element1.getNodeName().equals(type)) { - list.add(element1); - } - } - } - - // Create a memento for each node. - size = list.size(); - XMLMemento[] results = new XMLMemento[size]; - for (int x = 0; x < size; x++) { - results[x] = new XMLMemento(factory, (Element) list.get(x)); - } - return results; - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public Float getFloat(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) { - return null; - } - String strValue = attr.getValue(); - try { - return new Float(strValue); - } catch (NumberFormatException e) { - DebugPlugin.logMessage("Memento problem - Invalid float for key: " //$NON-NLS-1$ - + key + " value: " + strValue, e); //$NON-NLS-1$ - return null; - } - } - - public String getType() { - return element.getNodeName(); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public String getID() { - return element.getAttribute(IMementoConstants.TAG_ID); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public Integer getInteger(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) { - return null; - } - String strValue = attr.getValue(); - try { - return new Integer(strValue); - } catch (NumberFormatException e) { - DebugPlugin - .logMessage("Memento problem - invalid integer for key: " + key //$NON-NLS-1$ - + " value: " + strValue, e); //$NON-NLS-1$ - return null; - } - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public String getString(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) { - return null; - } - return attr.getValue(); - } - - public Boolean getBoolean(String key) { - Attr attr = element.getAttributeNode(key); - if (attr == null) { - return null; - } - return Boolean.valueOf(attr.getValue()); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public String getTextData() { - Text textNode = getTextNode(); - if (textNode != null) { - return textNode.getData(); - } - return null; - } - - public String[] getAttributeKeys() { - NamedNodeMap map = element.getAttributes(); - int size = map.getLength(); - String[] attributes = new String[size]; - for (int i = 0; i < size; i++) { - Node node = map.item(i); - attributes[i] = node.getNodeName(); - } - return attributes; - } - - /** - * Returns the Text node of the memento. Each memento is allowed only - * one Text node. - * - * @return the Text node of the memento, or null if - * the memento has no Text node. - */ - private Text getTextNode() { - // Get the nodes. - NodeList nodes = element.getChildNodes(); - int size = nodes.getLength(); - if (size == 0) { - return null; - } - for (int nX = 0; nX < size; nX++) { - Node node = nodes.item(nX); - if (node instanceof Text) { - return (Text) node; - } - } - // a Text node was not found - return null; - } - - /** - * Places the element's attributes into the document. - * @param copyText true if the first text node should be copied - */ - private void putElement(Element element1, boolean copyText) { - NamedNodeMap nodeMap = element1.getAttributes(); - int size = nodeMap.getLength(); - for (int i = 0; i < size; i++) { - Attr attr = (Attr) nodeMap.item(i); - putString(attr.getName(), attr.getValue()); - } - - NodeList nodes = element1.getChildNodes(); - size = nodes.getLength(); - // Copy first text node (fixes bug 113659). - // Note that text data will be added as the first child (see putTextData) - boolean needToCopyText = copyText; - for (int i = 0; i < size; i++) { - Node node = nodes.item(i); - if (node instanceof Element) { - XMLMemento child = createChild(node.getNodeName()); - child.putElement((Element) node, true); - } else if (node instanceof Text && needToCopyText) { - putTextData(((Text) node).getData()); - needToCopyText = false; - } - } - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public void putFloat(String key, float f) { - element.setAttribute(key, String.valueOf(f)); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public void putInteger(String key, int n) { - element.setAttribute(key, String.valueOf(n)); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public void putMemento(XMLMemento memento) { - // Do not copy the element's top level text node (this would overwrite the existing text). - // Text nodes of children are copied. - putElement(memento.element, false); - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public void putString(String key, String value) { - if (value == null) { - return; - } - element.setAttribute(key, value); - } - - /** - * @param key - * @param value - * @since 3.4 - */ - public void putBoolean(String key, boolean value) { - element.setAttribute(key, value ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$ - } - - /* (non-Javadoc) - * Method declared in XMLMemento. - */ - public void putTextData(String data) { - Text textNode = getTextNode(); - if (textNode == null) { - textNode = factory.createTextNode(data); - // Always add the text node as the first child (fixes bug 93718) - element.insertBefore(textNode, element.getFirstChild()); - } else { - textNode.setData(data); - } - } - - /** - * Saves this memento's document current values to the - * specified writer. - * - * @param writer the writer used to save the memento's document - * @throws IOException if there is a problem serializing the document to the stream. - */ - public void save(Writer writer) throws IOException { - DOMWriter out = new DOMWriter(writer); - try { - out.print(element); - } finally { - out.close(); - } - } - - /** - * A simple XML writer. Using this instead of the javax.xml.transform classes allows - * compilation against JCL Foundation (bug 80053). - */ - private static final class DOMWriter extends PrintWriter { - - private int tab; - - /* constants */ - private static final String XML_VERSION = ""; //$NON-NLS-1$ - - /** - * Creates a new DOM writer on the given output writer. - * - * @param output the output writer - */ - public DOMWriter(Writer output) { - super(output); - tab = 0; - println(XML_VERSION); - } - - /** - * Prints the given element. - * - * @param element the element to print - */ - public void print(Element element) { - // Ensure extra whitespace is not emitted next to a Text node, - // as that will result in a situation where the restored text data is not the - // same as the saved text data. - boolean hasChildren = element.hasChildNodes(); - startTag(element, hasChildren); - if (hasChildren) { - tab++; - boolean prevWasText = false; - NodeList children = element.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - Node node = children.item(i); - if (node instanceof Element) { - if (!prevWasText) { - println(); - printTabulation(); - } - print((Element) children.item(i)); - prevWasText = false; - } - else if (node instanceof Text) { - print(getEscaped(node.getNodeValue())); - prevWasText = true; - } - } - tab--; - if (!prevWasText) { - println(); - printTabulation(); - } - endTag(element); - } - } - - private void printTabulation() { - // Indenting is disabled, as it can affect the result of getTextData(). - // In 3.0, elements were separated by a newline but not indented. - // This causes getTextData() to return "\n" even if no text data had explicitly been set. - // The code here emulates that behaviour. - -// for (int i = 0; i < tab; i++) -// super.print("\t"); //$NON-NLS-1$ - } - - private void startTag(Element element, boolean hasChildren) { - StringBuffer sb = new StringBuffer(); - sb.append("<"); //$NON-NLS-1$ - sb.append(element.getTagName()); - NamedNodeMap attributes = element.getAttributes(); - for (int i = 0; i < attributes.getLength(); i++) { - Attr attribute = (Attr)attributes.item(i); - sb.append(" "); //$NON-NLS-1$ - sb.append(attribute.getName()); - sb.append("=\""); //$NON-NLS-1$ - sb.append(getEscaped(String.valueOf(attribute.getValue()))); - sb.append("\""); //$NON-NLS-1$ - } - sb.append(hasChildren ? ">" : "/>"); //$NON-NLS-1$ //$NON-NLS-2$ - print(sb.toString()); - } - - private void endTag(Element element) { - StringBuffer sb = new StringBuffer(); - sb.append(""); //$NON-NLS-1$ - print(sb.toString()); - } - - private static void appendEscapedChar(StringBuffer buffer, char c) { - String replacement = getReplacement(c); - if (replacement != null) { - buffer.append('&'); - buffer.append(replacement); - buffer.append(';'); - } else if (c==9 || c==10 || c==13 || c>=32){ - buffer.append(c); - } - } - - private static String getEscaped(String s) { - StringBuffer result = new StringBuffer(s.length() + 10); - for (int i = 0; i < s.length(); ++i) { - appendEscapedChar(result, s.charAt(i)); - } - return result.toString(); - } - - private static String getReplacement(char c) { - // Encode special XML characters into the equivalent character references. - // The first five are defined by default for all XML documents. - // The next three (#xD, #xA, #x9) are encoded to avoid them - // being converted to spaces on deserialization - // (fixes bug 93720) - switch (c) { - case '<' : - return "lt"; //$NON-NLS-1$ - case '>' : - return "gt"; //$NON-NLS-1$ - case '"' : - return "quot"; //$NON-NLS-1$ - case '\'' : - return "apos"; //$NON-NLS-1$ - case '&' : - return "amp"; //$NON-NLS-1$ - case '\r': - return "#x0D"; //$NON-NLS-1$ - case '\n': - return "#x0A"; //$NON-NLS-1$ - case '\u0009': - return "#x09"; //$NON-NLS-1$ - } - return null; - } - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java deleted file mode 100644 index 5d47e7b30..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java +++ /dev/null @@ -1,122 +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.core.commands; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.commands.IDisconnectHandler; -import org.eclipse.debug.core.commands.IDropToFrameHandler; -import org.eclipse.debug.core.commands.IResumeHandler; -import org.eclipse.debug.core.commands.IStepFiltersHandler; -import org.eclipse.debug.core.commands.IStepIntoHandler; -import org.eclipse.debug.core.commands.IStepOverHandler; -import org.eclipse.debug.core.commands.IStepReturnHandler; -import org.eclipse.debug.core.commands.ISuspendHandler; -import org.eclipse.debug.core.commands.ITerminateHandler; -import org.eclipse.debug.core.model.IDebugElement; -import org.eclipse.debug.core.model.IDisconnect; -import org.eclipse.debug.core.model.IDropToFrame; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.model.IStep; -import org.eclipse.debug.core.model.ISuspendResume; -import org.eclipse.debug.core.model.ITerminate; - -/** - * Adapter factory for debug commands. - * - * @since 3.3 - * - */ -public class CommandAdapterFactory implements IAdapterFactory { - - - private static ITerminateHandler fgTerminateCommand = new TerminateCommand(); - private static IStepOverHandler fgStepOverCommand = new StepOverCommand(); - private static IStepIntoHandler fgStepIntoCommand = new StepIntoCommand(); - private static IStepReturnHandler fgStepReturnCommand = new StepReturnCommand(); - private static IDropToFrameHandler fgDropToFrameCommand = new DropToFrameCommand(); - private static IDisconnectHandler fgDisconnectCommand = new DisconnectCommand(); - private static ISuspendHandler fgSuspendCommand = new SuspendCommand(); - private static IResumeHandler fgResumeCommand = new ResumeCommand(); - private static IStepFiltersHandler fgStepFiltersCommand = new StepFiltersCommand(); - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) - */ - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (IStepFiltersHandler.class.equals(adapterType)) { - if (adaptableObject instanceof IDebugElement || - adaptableObject instanceof ILaunch || - adaptableObject instanceof IProcess) { - return fgStepFiltersCommand; - } - } - - if (ITerminateHandler.class.equals(adapterType)) { - if (adaptableObject instanceof ITerminate) { - return fgTerminateCommand; - } - } - if (IStepOverHandler.class.equals(adapterType)) { - if (adaptableObject instanceof IStep) { - return fgStepOverCommand; - } - } - if (IStepIntoHandler.class.equals(adapterType)) { - if (adaptableObject instanceof IStep) { - return fgStepIntoCommand; - } - } - if (IStepReturnHandler.class.equals(adapterType)) { - if (adaptableObject instanceof IStep) { - return fgStepReturnCommand; - } - } - if (ISuspendHandler.class.equals(adapterType)) { - if (adaptableObject instanceof ISuspendResume) { - return fgSuspendCommand; - } - } - if (IResumeHandler.class.equals(adapterType)) { - if (adaptableObject instanceof ISuspendResume) { - return fgResumeCommand; - } - } - if (IDisconnectHandler.class.equals(adapterType)) { - if (adaptableObject instanceof IDisconnect) { - return fgDisconnectCommand; - } - } - if (IDropToFrameHandler.class.equals(adapterType)) { - if (adaptableObject instanceof IDropToFrame) { - return fgDropToFrameCommand; - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() - */ - public Class[] getAdapterList() { - return new Class[]{ - ITerminateHandler.class, - IStepOverHandler.class, - IStepIntoHandler.class, - IStepReturnHandler.class, - ISuspendHandler.class, - IResumeHandler.class, - IDropToFrameHandler.class, - IDisconnectHandler.class, - IStepFiltersHandler.class}; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java deleted file mode 100644 index 5d447e5df..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.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.core.commands; - -import org.eclipse.debug.core.commands.IDebugCommandRequest; - -/** - * @since 3.3 - */ -public class DebugCommandRequest extends Request implements IDebugCommandRequest { - - private Object[] fElements; - - public DebugCommandRequest(Object[] elements) { - fElements = elements; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandRequest#getElements() - */ - public Object[] getElements() { - return fElements; - } - - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DisconnectCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DisconnectCommand.java deleted file mode 100644 index 956c4df47..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DisconnectCommand.java +++ /dev/null @@ -1,49 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IDisconnectHandler; -import org.eclipse.debug.core.model.IDisconnect; - -/** - * Default disconnect command for the standard debug model. - * - * @since 3.3 - */ -public class DisconnectCommand extends ForEachCommand implements IDisconnectHandler { - - protected Object getTarget(Object element) { - return getAdapter(element, IDisconnect.class); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.ForEachCommand#execute(java.lang.Object) - */ - protected void execute(Object target) throws CoreException { - ((IDisconnect)target).disconnect(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.ForEachCommand#isExecutable(java.lang.Object) - */ - protected boolean isExecutable(Object target) { - return ((IDisconnect)target).canDisconnect(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IDisconnectHandler.class; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DropToFrameCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DropToFrameCommand.java deleted file mode 100644 index a0d712de0..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DropToFrameCommand.java +++ /dev/null @@ -1,49 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IDropToFrameHandler; -import org.eclipse.debug.core.model.IDropToFrame; - -/** - * Default drop to frame command for the standard debug model. - * - * @since 3.3 - */ -public class DropToFrameCommand extends StepCommand implements IDropToFrameHandler { - - protected Object getTarget(Object element) { - return getAdapter(element, IDropToFrame.class); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.StepCommand#isSteppable(java.lang.Object) - */ - protected boolean isSteppable(Object target) throws CoreException { - return ((IDropToFrame)target).canDropToFrame(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.StepCommand#step(java.lang.Object) - */ - protected void step(Object target) throws CoreException { - ((IDropToFrame)target).dropToFrame(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IDropToFrameHandler.class; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ForEachCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ForEachCommand.java deleted file mode 100644 index a92772e35..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ForEachCommand.java +++ /dev/null @@ -1,53 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.IRequest; -import org.eclipse.debug.core.commands.AbstractDebugCommand; -import org.eclipse.debug.core.commands.IEnabledStateRequest; - -/** - * A command that operates on each element individually. - * - * @since 3.3 - */ -public abstract class ForEachCommand extends AbstractDebugCommand { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.DebugCommand#doExecute(java.lang.Object[], org.eclipse.core.runtime.IProgressMonitor, org.eclipse.debug.core.IRequest) - */ - protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { - for (int i = 0; i < targets.length; i++) { - execute(targets[i]); - monitor.worked(1); - } - } - - protected abstract void execute(Object target) throws CoreException; - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.DebugCommand#isExecutable(java.lang.Object[], org.eclipse.core.runtime.IProgressMonitor, org.eclipse.debug.core.commands.IEnabledStateRequest) - */ - protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) throws CoreException { - for (int i = 0; i < targets.length; i++) { - if (!isExecutable(targets[i])) { - return false; - } - monitor.worked(1); - } - return true; - } - - protected abstract boolean isExecutable(Object target); - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/Request.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/Request.java deleted file mode 100644 index 4de8e2136..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/Request.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 - * John Cortell (Freescale) - update javadoc tags (Bug 292301) - *******************************************************************************/ -package org.eclipse.debug.internal.core.commands; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.IRequest; - -/** - * @since 3.3 - */ -public class Request implements IRequest { - - private IStatus fStatus; - private boolean fCanceled = false; - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IRequest#done() - */ - public void done() { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IRequest#getStatus() - */ - public IStatus getStatus() { - return fStatus; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IRequest#setStatus(org.eclipse.core.runtime.IStatus) - */ - public void setStatus(IStatus status) { - fStatus = status; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IRequest#cancel() - */ - public synchronized void cancel() { - fCanceled = true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IRequest#isCanceled() - */ - public synchronized boolean isCanceled() { - return fCanceled; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ResumeCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ResumeCommand.java deleted file mode 100644 index 91475b019..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ResumeCommand.java +++ /dev/null @@ -1,40 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IResumeHandler; -import org.eclipse.debug.core.model.ISuspendResume; - -/** - * Default resume command for the standard debug model. - * - * @since 3.3 - */ -public class ResumeCommand extends SuspendCommand implements IResumeHandler { - - protected void execute(Object target) throws CoreException { - ((ISuspendResume)target).resume(); - } - - protected boolean isExecutable(Object target) { - return ((ISuspendResume)target).canResume(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.SuspendCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IResumeHandler.class; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java deleted file mode 100644 index 9fd08ae4d..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java +++ /dev/null @@ -1,82 +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.core.commands; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.IRequest; -import org.eclipse.debug.core.commands.AbstractDebugCommand; -import org.eclipse.debug.core.commands.IEnabledStateRequest; -import org.eclipse.debug.core.model.IStackFrame; -import org.eclipse.debug.core.model.IStep; - -/** - * Common function for step commands. - * - * @since 3.3 - */ -public abstract class StepCommand extends AbstractDebugCommand { - - protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { - for (int i = 0; i < targets.length; i++) { - step(targets[i]); - } - } - - protected abstract void step(Object target) throws CoreException ; - - protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest collector) throws CoreException { - if (isThreadCompatible(targets)) { - for (int i = 0; i < targets.length; i++) { - if (!isSteppable(targets[i])) { - return false; - } - } - return true; - } else { - return false; - } - } - - protected abstract boolean isSteppable(Object target) throws CoreException; - - protected boolean isThreadCompatible(Object[] targets) { - if (targets.length == 1) { - return true; - } - // check if frames from same thread - Set threads = new HashSet(targets.length); - for (int i = 0; i < targets.length; i++) { - Object object = targets[i]; - IStackFrame frame = null; - if (object instanceof IStackFrame) { - frame = (IStackFrame) object; - } else if (object instanceof IAdaptable) { - frame = (IStackFrame)((IAdaptable)object).getAdapter(IStackFrame.class); - } - if (frame != null) { - if (!threads.add(frame.getThread())) { - return false; - } - } - } - return true; - } - - protected Object getTarget(Object element) { - return getAdapter(element, IStep.class); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java deleted file mode 100644 index e5bfdc959..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java +++ /dev/null @@ -1,99 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IStepFiltersHandler; -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.IStepFilters; - -/** - * Default toggle step filters command for the standard debug model. - * - * @since 3.3 - */ -public class StepFiltersCommand extends ForEachCommand implements IStepFiltersHandler { - - protected Object getTarget(Object element) { - IDebugTarget[] targets = getDebugTargets(element); - if (targets.length > 0) { - IStepFilters[] filters = new IStepFilters[targets.length]; - for (int i = 0; i < targets.length; i++) { - IDebugTarget target = targets[i]; - if (target instanceof IStepFilters) { - filters[i] = (IStepFilters) target; - } else { - filters[i] = (IStepFilters) getAdapter(element, IStepFilters.class); - } - if (filters[i] == null) { - return null; - } - } - return filters; - } - return null; - } - - private IDebugTarget[] getDebugTargets(Object element) { - if (element instanceof IDebugElement) { - IDebugElement debugElement = (IDebugElement) element; - return new IDebugTarget[] { debugElement.getDebugTarget() }; - } else if (element instanceof ILaunch) { - ILaunch launch = (ILaunch) element; - return launch.getDebugTargets(); - } else if (element instanceof IProcess) { - IProcess process = (IProcess) element; - return process.getLaunch().getDebugTargets(); - } else { - return new IDebugTarget[0]; - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.ForEachCommand#execute(java.lang.Object) - */ - protected void execute(Object target) throws CoreException { - if (target == null) { - return; - } - IStepFilters[] filters = (IStepFilters[]) target; - for (int i = 0; i < filters.length; i++) { - IStepFilters filter = filters[i]; - filter.setStepFiltersEnabled(DebugPlugin.isUseStepFilters()); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.ForEachCommand#isExecutable(java.lang.Object) - */ - protected boolean isExecutable(Object target) { - IStepFilters[] filters = (IStepFilters[]) target; - for (int i = 0; i < filters.length; i++) { - IStepFilters filter = filters[i]; - if (filter == null || !filter.supportsStepFilters()) { - return false; - } - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IStepFiltersHandler.class; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepIntoCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepIntoCommand.java deleted file mode 100644 index 998c15319..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepIntoCommand.java +++ /dev/null @@ -1,40 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IStepIntoHandler; -import org.eclipse.debug.core.model.IStep; - -/** - * Default step into command for the standard debug model. - * - * @since 3.3 - */ -public class StepIntoCommand extends StepCommand implements IStepIntoHandler { - - protected boolean isSteppable(Object target) { - return ((IStep)target).canStepInto(); - } - - protected void step(Object target) throws CoreException { - ((IStep)target).stepInto(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IStepIntoHandler.class; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepOverCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepOverCommand.java deleted file mode 100644 index bf8d2d8e3..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepOverCommand.java +++ /dev/null @@ -1,44 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IStepOverHandler; -import org.eclipse.debug.core.model.IStep; - -/** - * Default step over command for the standard debug model. - * - * @since 3.3 - */ -public class StepOverCommand extends StepCommand implements IStepOverHandler { - - - protected void step(Object target) throws CoreException { - ((IStep)target).stepOver(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.commands.StepCommand#isSteppable(java.lang.Object) - */ - protected boolean isSteppable(Object target) { - return ((IStep)target).canStepOver(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IStepOverHandler.class; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepReturnCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepReturnCommand.java deleted file mode 100644 index f44a89663..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepReturnCommand.java +++ /dev/null @@ -1,41 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IStepReturnHandler; -import org.eclipse.debug.core.model.IStep; - -/** - * Default step return command for the standard debug model. - * - * @since 3.3 - */ -public class StepReturnCommand extends StepCommand implements IStepReturnHandler { - - protected boolean isSteppable(Object target) { - return ((IStep)target).canStepReturn(); - } - - protected void step(Object target) throws CoreException { - ((IStep)target).stepReturn(); - } - - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return IStepReturnHandler.class; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/SuspendCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/SuspendCommand.java deleted file mode 100644 index 3db9b9be9..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/SuspendCommand.java +++ /dev/null @@ -1,43 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.ISuspendHandler; -import org.eclipse.debug.core.model.ISuspendResume; - -/** - * Default suspend command for the standard debug model. - * - * @since 3.3 - */ -public class SuspendCommand extends ForEachCommand implements ISuspendHandler { - - protected Object getTarget(Object element) { - return getAdapter(element, ISuspendResume.class); - } - - protected void execute(Object target) throws CoreException { - ((ISuspendResume)target).suspend(); - } - - protected boolean isExecutable(Object target) { - return ((ISuspendResume)target).canSuspend(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return ISuspendHandler.class; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/TerminateCommand.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/TerminateCommand.java deleted file mode 100644 index 35962d892..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/TerminateCommand.java +++ /dev/null @@ -1,43 +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.core.commands; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.ITerminateHandler; -import org.eclipse.debug.core.model.ITerminate; - -/** - * Default terminate command for the standard debug model. - * - * @since 3.3 - */ -public class TerminateCommand extends ForEachCommand implements ITerminateHandler { - - protected Object getTarget(Object element) { - return getAdapter(element, ITerminate.class); - } - - protected void execute(Object target) throws CoreException { - ((ITerminate)target).terminate(); - } - - protected boolean isExecutable(Object target) { - return ((ITerminate)target).canTerminate(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - protected Object getEnabledStateJobFamily(IDebugCommandRequest request) { - return ITerminateHandler.class; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceContainerType.java deleted file mode 100644 index 935d11532..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceContainerType.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.core.sourcelookup; - -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.DebugPlugin; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.ISourceContainerType; -import org.eclipse.debug.core.sourcelookup.ISourceContainerTypeDelegate; -import org.eclipse.debug.internal.core.IConfigurationElementConstants; - -/** - * Proxy to contributed source container type extension. - * - * @see IConfigurationElementConstants - * - * @since 3.0 - */ -public class SourceContainerType implements ISourceContainerType { - - // lazily instantiated delegate - private ISourceContainerTypeDelegate fDelegate = null; - - // extension definition - private IConfigurationElement fElement = null; - - /** - * Constructs a source container type on the given extension. - * - * @param element extension definition - */ - public SourceContainerType(IConfigurationElement element) { - fElement = element; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - return getDelegate().createSourceContainer(memento); - } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) - */ - public String getMemento(ISourceContainer container) throws CoreException { - if (this.equals(container.getType())) { - return getDelegate().getMemento(container); - } - IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, SourceLookupMessages.SourceContainerType_0, null); - throw new CoreException(status); - } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getName() - */ - public String getName() { - return fElement.getAttribute(IConfigurationElementConstants.NAME); - } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getId() - */ - public String getId() { - return fElement.getAttribute(IConfigurationElementConstants.ID); - } - - /** - * Lazily instantiates and returns the underlying source container type. - * - * @exception CoreException if unable to instantiate - */ - private ISourceContainerTypeDelegate getDelegate() throws CoreException { - if (fDelegate == null) { - fDelegate = (ISourceContainerTypeDelegate) fElement.createExecutableExtension(IConfigurationElementConstants.CLASS); - } - return fDelegate; - } - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getDescription() - */ - public String getDescription() { - return fElement.getAttribute(IConfigurationElementConstants.DESCRIPTION); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLocatorMementoComparator.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLocatorMementoComparator.java deleted file mode 100644 index 159b81698..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLocatorMementoComparator.java +++ /dev/null @@ -1,53 +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.core.sourcelookup; - -import java.util.Comparator; - -/** - * Comparator for source locator mementors. Ignores whitespace differences. - * - * @since 3.0 - */ -public class SourceLocatorMementoComparator implements Comparator { - /* (non-Javadoc) - * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) - */ - public int compare(Object o1, Object o2) { - String m1 = (String)o1; - String m2 = (String)o2; - int i1 = 0, i2 = 0; - while (i1 < m1.length()) { - i1 = skipWhitespace(m1, i1); - i2 = skipWhitespace(m2, i2); - if (i1 < m1.length() && i2 < m2.length()) { - if (m1.charAt(i1) != m2.charAt(i2)) { - return -1; - } - i1++; - i2++; - } else { - if (i2 < m2.length()) { - return -1; - } - return 0; - } - } - return 0; - } - - private int skipWhitespace(String string, int offset) { - while (offset < string.length() && Character.isWhitespace(string.charAt(offset))) { - offset++; - } - return offset; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.java deleted file mode 100644 index e63731cf4..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.java +++ /dev/null @@ -1,66 +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 - Initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core.sourcelookup; - -import org.eclipse.osgi.util.NLS; - -public class SourceLookupMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages";//$NON-NLS-1$ - - public static String AbstractSourceLookupDirector_11; - public static String AbstractSourceLookupDirector_12; - public static String AbstractSourceLookupDirector_13; - public static String AbstractSourceLookupDirector_14; - - public static String Source_Lookup_Error; - - public static String ExternalArchiveSourceContainer_1; - - public static String ExternalArchiveSourceContainer_2; - - public static String ExternalArchiveSourceContainerType_10; - public static String ExternalArchiveSourceContainerType_11; - public static String ExternalArchiveSourceContainerType_12; - - public static String DefaultSourceContainer_0; - public static String DefaultSourceContainerType_6; - public static String DefaultSourceContainerType_7; - - public static String DirectorySourceContainerType_10; - public static String DirectorySourceContainerType_11; - public static String DirectorySourceContainerType_12; - - public static String FolderSourceContainerType_10; - public static String FolderSourceContainerType_11; - public static String FolderSourceContainerType_12; - - public static String LocalFileStorage_0; - - public static String ProjectSourceContainerType_10; - public static String ProjectSourceContainerType_11; - public static String ProjectSourceContainerType_12; - - public static String SourceContainerType_0; - - public static String WorkspaceSourceContainer_0; - - public static String WorkspaceSourceContainerType_3; - public static String WorkspaceSourceContainerType_4; - - public static String ZipEntryStorage_0; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, SourceLookupMessages.class); - } - - public static String AbstractSourceLookupDirector_10; -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.properties deleted file mode 100644 index 429f05e6a..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupMessages.properties +++ /dev/null @@ -1,50 +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 -############################################################################### - -AbstractSourceLookupDirector_11=Unable to restore source lookup path - expecting typeId attribute. -AbstractSourceLookupDirector_12=Unable to restore source lookup path - unknown type source container type specified: {0} -AbstractSourceLookupDirector_13=Unable to restore source lookup path - expecting memento attribute. -AbstractSourceLookupDirector_14=Unable to read source lookup path - expecting sourceLookupDirector node. -AbstractSourceLookupDirector_10=Exception occurred during source lookup - -ExternalArchiveSourceContainer_2=Unable to access archive {0} -ExternalArchiveSourceContainer_1=Archive does not exist: {0} - -ExternalArchiveSourceContainerType_10=Invalid or missing attribute in archive memento. -ExternalArchiveSourceContainerType_11=Missing node in archive memento. -ExternalArchiveSourceContainerType_12=Invalid archive memento - -DefaultSourceContainer_0=Default -DefaultSourceContainerType_6=Unable to restore default source lookup path - expecting default element. -DefaultSourceContainerType_7=Unable to restore default source lookup path - invalid memento. - -DirectorySourceContainerType_10=Unable to restore directory source lookup entry - missing path attribute. -DirectorySourceContainerType_11=Unable to restore directory source lookup entry - expecting directory element. -DirectorySourceContainerType_12=Unable to restore directory source lookup entry - invalid memento. - -FolderSourceContainerType_10=Unable to restore source lookup folder - missing path attribute. -FolderSourceContainerType_11=Unable to restore source lookup folder - expecting folder element. -FolderSourceContainerType_12=Unable to restore source lookup folder - invalid memento. - -LocalFileStorage_0=Exception occurred retrieving file contents. - -ProjectSourceContainerType_10=Unable to restore project source lookup entry - missing name attribute. -ProjectSourceContainerType_11=Unable to restore project source lookup entry - expecting project element. -ProjectSourceContainerType_12=Unable to restore project source lookup entry - invalid memento. - -WorkspaceSourceContainer_0=Workspace - -WorkspaceSourceContainerType_3=Unable to restore workspace source lookup entry - expecting workspace element. -WorkspaceSourceContainerType_4=Unable to restore workspace source lookup entry - invalid memento. - -ZipEntryStorage_0=Unable to read ZipEntry contents -Source_Lookup_Error=Source lookup error -SourceContainerType_0=Unable to persist source lookup path. diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java deleted file mode 100644 index 67b2bb831..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java +++ /dev/null @@ -1,148 +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.core.sourcelookup; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.zip.ZipFile; - -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchesListener2; - -/** - * Utility and supporting methods for source location. Most of these - * utilities should be migrated to the DebugPlugin and LanuchManager - * when this facility becomes public API. - * - * @see org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector - * @since 3.0 - */ -public class SourceLookupUtils { - - /** - * Cache of shared zip files. Zip files are closed - * when this class's plug-in is shutdown, when a project - * is about to be closed or deleted, when a launch is - * removed, and when a debug target or process terminates. - */ - private static HashMap fgZipFileCache = new HashMap(5); - private static ArchiveCleaner fgCleaner = null; - - /** - * Returns a zip file with the given name - * - * @param name zip file name - * @return The zip file with the given name - * @exception IOException if unable to create the specified zip - * file - */ - public static ZipFile getZipFile(String name) throws IOException { - synchronized (fgZipFileCache) { - if (fgCleaner == null) { - fgCleaner = new ArchiveCleaner(); - DebugPlugin.getDefault().getLaunchManager().addLaunchListener(fgCleaner); - ResourcesPlugin.getWorkspace().addResourceChangeListener(fgCleaner, IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_CLOSE); - } - ZipFile zip = (ZipFile)fgZipFileCache.get(name); - if (zip == null) { - zip = new ZipFile(name); - fgZipFileCache.put(name, zip); - } - return zip; - } - } - - /** - * Closes all zip files that have been opened, - * and removes them from the zip file cache. - * This method is only to be called by the debug - * plug-in. - */ - public static void closeArchives() { - synchronized (fgZipFileCache) { - Iterator iter = fgZipFileCache.values().iterator(); - while (iter.hasNext()) { - ZipFile file = (ZipFile)iter.next(); - synchronized (file) { - try { - file.close(); - } catch (IOException e) { - DebugPlugin.log(e); - } - } - } - fgZipFileCache.clear(); - } - } - - /** - * Called when the debug plug-in shuts down. - */ - public static void shutdown() { - closeArchives(); - if (fgCleaner != null) { - DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(fgCleaner); - ResourcesPlugin.getWorkspace().removeResourceChangeListener(fgCleaner); - } - } - - /** - * Clears the cache of open zip files when a launch terminates, - * is removed, or when a project is about to be deleted or closed. - */ - static class ArchiveCleaner implements IResourceChangeListener, ILaunchesListener2 { - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[]) - */ - public void launchesRemoved(ILaunch[] launches) { - for (int i = 0; i < launches.length; i++) { - ILaunch launch = launches[i]; - if (!launch.isTerminated()) { - SourceLookupUtils.closeArchives(); - return; - } - } - } - - /* (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.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent) - */ - public void resourceChanged(IResourceChangeEvent event) { - SourceLookupUtils.closeArchives(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[]) - */ - public void launchesTerminated(ILaunch[] launches) { - SourceLookupUtils.closeArchives(); - } - - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourcePathComputer.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourcePathComputer.java deleted file mode 100644 index 21bc87d27..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourcePathComputer.java +++ /dev/null @@ -1,75 +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.core.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputer; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate; -import org.eclipse.debug.internal.core.IConfigurationElementConstants; - -/** - * Proxy to contributed source path computer extension. - * - * @see IConfigurationElementConstants - */ -public class SourcePathComputer implements ISourcePathComputer { - - // lazily instantiated delegate - private ISourcePathComputerDelegate fDelegate = null; - - // extension definition - private IConfigurationElement fElement = null; - - /** - * Constructs a source path computer on the given extension. - * - * @param element extension definition - */ - public SourcePathComputer(IConfigurationElement element) { - fElement = element; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputer#getId() - */ - public String getId() { - return fElement.getAttribute(IConfigurationElementConstants.ID); - } - - /** - * Lazily instantiates and returns the underlying source container type. - * - * @exception CoreException if unable to instantiate - */ - private ISourcePathComputerDelegate getDelegate() throws CoreException { - if (fDelegate == null) { - fDelegate = (ISourcePathComputerDelegate) fElement.createExecutableExtension(IConfigurationElementConstants.CLASS); - } - return fDelegate; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor) - */ - public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) { - try { - return getDelegate().computeSourceContainers(configuration, monitor); - } catch (CoreException e) { - DebugPlugin.log(e); - } - return new ISourceContainer[0]; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ArchiveSourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ArchiveSourceContainerType.java deleted file mode 100644 index 27c6d768f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ArchiveSourceContainerType.java +++ /dev/null @@ -1,70 +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.core.sourcelookup.containers; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate; -import org.eclipse.debug.core.sourcelookup.containers.ArchiveSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * Archive source container type for archives in the workspace. - * - * @since 3.0 - */ -public class ArchiveSourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("archive".equals(element.getNodeName())) { //$NON-NLS-1$ - String string = element.getAttribute("path"); //$NON-NLS-1$ - if (string == null || string.length() == 0) { - abort(SourceLookupMessages.ExternalArchiveSourceContainerType_10, null); - } - String detect = element.getAttribute("detectRoot"); //$NON-NLS-1$ - boolean auto = "true".equals(detect); //$NON-NLS-1$ - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(string)); - return new ArchiveSourceContainer(file, auto); - } - abort(SourceLookupMessages.ExternalArchiveSourceContainerType_11, null); - } - abort(SourceLookupMessages.ExternalArchiveSourceContainerType_12, null); - return null; - } - /* (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 { - ArchiveSourceContainer archive = (ArchiveSourceContainer) container; - Document document = newDocument(); - Element element = document.createElement("archive"); //$NON-NLS-1$ - element.setAttribute("path", archive.getFile().getFullPath().toString()); //$NON-NLS-1$ - String detectRoot = "false"; //$NON-NLS-1$ - if (archive.isDetectRoot()) { - detectRoot = "true"; //$NON-NLS-1$ - } - element.setAttribute("detectRoot", detectRoot); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DefaultSourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DefaultSourceContainerType.java deleted file mode 100644 index bea44536c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DefaultSourceContainerType.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core.sourcelookup.containers; - -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.core.sourcelookup.containers.DefaultSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * A default source lookup path. The default path is computed by a - * source path computer. - * - * @since 3.0 - */ -public class DefaultSourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) - */ - public String getMemento(ISourceContainer container) throws CoreException { - Document document = newDocument(); - Element element = document.createElement("default"); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento)throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("default".equals(element.getNodeName())) { //$NON-NLS-1$ - return new DefaultSourceContainer(); - } - abort(SourceLookupMessages.DefaultSourceContainerType_6, null); - } - abort(SourceLookupMessages.DefaultSourceContainerType_7, null); - return null; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DirectorySourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DirectorySourceContainerType.java deleted file mode 100644 index d25a0ff66..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DirectorySourceContainerType.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 - *******************************************************************************/ -package org.eclipse.debug.internal.core.sourcelookup.containers; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate; -import org.eclipse.debug.core.sourcelookup.containers.DirectorySourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * A folder in the local file system. - * - * @since 3.0 - */ -public class DirectorySourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("directory".equals(element.getNodeName())) { //$NON-NLS-1$ - String string = element.getAttribute("path"); //$NON-NLS-1$ - if (string == null || string.length() == 0) { - abort(SourceLookupMessages.DirectorySourceContainerType_10, null); - } - String nest = element.getAttribute("nest"); //$NON-NLS-1$ - boolean nested = "true".equals(nest); //$NON-NLS-1$ - return new DirectorySourceContainer(new Path(string), nested); - } - abort(SourceLookupMessages.DirectorySourceContainerType_11, null); - } - abort(SourceLookupMessages.DirectorySourceContainerType_12, null); - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) - */ - public String getMemento(ISourceContainer container) throws CoreException { - DirectorySourceContainer folder = (DirectorySourceContainer) container; - Document document = newDocument(); - Element element = document.createElement("directory"); //$NON-NLS-1$ - element.setAttribute("path", folder.getDirectory().getAbsolutePath()); //$NON-NLS-1$ - String nest = "false"; //$NON-NLS-1$ - if (folder.isComposite()) { - nest = "true"; //$NON-NLS-1$ - } - element.setAttribute("nest", nest); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ExternalArchiveSourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ExternalArchiveSourceContainerType.java deleted file mode 100644 index 43f295ac5..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ExternalArchiveSourceContainerType.java +++ /dev/null @@ -1,66 +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.core.sourcelookup.containers; - -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.core.sourcelookup.containers.ExternalArchiveSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * External archive source container type. - * - * @since 3.0 - */ -public class ExternalArchiveSourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("archive".equals(element.getNodeName())) { //$NON-NLS-1$ - String string = element.getAttribute("path"); //$NON-NLS-1$ - if (string == null || string.length() == 0) { - abort(SourceLookupMessages.ExternalArchiveSourceContainerType_10, null); - } - String detect = element.getAttribute("detectRoot"); //$NON-NLS-1$ - boolean auto = "true".equals(detect); //$NON-NLS-1$ - return new ExternalArchiveSourceContainer(string, auto); - } - abort(SourceLookupMessages.ExternalArchiveSourceContainerType_11, null); - } - abort(SourceLookupMessages.ExternalArchiveSourceContainerType_12, null); - return null; - } - /* (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 { - ExternalArchiveSourceContainer archive = (ExternalArchiveSourceContainer) container; - Document document = newDocument(); - Element element = document.createElement("archive"); //$NON-NLS-1$ - element.setAttribute("path", archive.getName()); //$NON-NLS-1$ - String detectRoot = "false"; //$NON-NLS-1$ - if (archive.isDetectRoot()) { - detectRoot = "true"; //$NON-NLS-1$ - } - element.setAttribute("detectRoot", detectRoot); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/FolderSourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/FolderSourceContainerType.java deleted file mode 100644 index ce9ea0899..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/FolderSourceContainerType.java +++ /dev/null @@ -1,73 +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.core.sourcelookup.containers; - -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainerTypeDelegate; -import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * A folder in the workspace. - * - * @since 3.0 - */ -public class FolderSourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) - */ - public String getMemento(ISourceContainer container) throws CoreException { - FolderSourceContainer folderSourceContainer = (FolderSourceContainer)container; - Document document = newDocument(); - Element element = document.createElement("folder"); //$NON-NLS-1$ - element.setAttribute("path", folderSourceContainer.getContainer().getFullPath().toString()); //$NON-NLS-1$ - String nest = "false"; //$NON-NLS-1$ - if (folderSourceContainer.isComposite()) { - nest = "true"; //$NON-NLS-1$ - } - element.setAttribute("nest", nest); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("folder".equals(element.getNodeName())) { //$NON-NLS-1$ - String string = element.getAttribute("path"); //$NON-NLS-1$ - if (string == null || string.length() == 0) { - abort(SourceLookupMessages.FolderSourceContainerType_10, null); - } - String nest = element.getAttribute("nest"); //$NON-NLS-1$ - boolean nested = "true".equals(nest); //$NON-NLS-1$ - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IFolder folder = workspace.getRoot().getFolder(new Path(string)); - return new FolderSourceContainer(folder, nested); - } - abort(SourceLookupMessages.FolderSourceContainerType_11, null); - } - abort(SourceLookupMessages.FolderSourceContainerType_12, null); - return null; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ProjectSourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ProjectSourceContainerType.java deleted file mode 100644 index 7dfbb6c40..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ProjectSourceContainerType.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core.sourcelookup.containers; - -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -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.core.sourcelookup.containers.ProjectSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * The type for creating/restoring a project source container. - * - * @since 3.0 - */ -public class ProjectSourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer) - */ - public String getMemento(ISourceContainer container) throws CoreException { - ProjectSourceContainer project = (ProjectSourceContainer) container; - Document document = newDocument(); - Element element = document.createElement("project"); //$NON-NLS-1$ - element.setAttribute("name", project.getContainer().getName()); //$NON-NLS-1$ - String referenced = "false"; //$NON-NLS-1$ - if (project.isSearchReferencedProjects()) { - referenced = "true"; //$NON-NLS-1$ - } - element.setAttribute("referencedProjects", referenced); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("project".equals(element.getNodeName())) { //$NON-NLS-1$ - String string = element.getAttribute("name"); //$NON-NLS-1$ - if (string == null || string.length() == 0) { - abort(SourceLookupMessages.ProjectSourceContainerType_10, null); - } - String nest = element.getAttribute("referencedProjects"); //$NON-NLS-1$ - boolean ref = "true".equals(nest); //$NON-NLS-1$ - IWorkspace workspace = ResourcesPlugin.getWorkspace(); - IProject project = workspace.getRoot().getProject(string); - return new ProjectSourceContainer(project, ref); - } - abort(SourceLookupMessages.ProjectSourceContainerType_11, null); - } - abort(SourceLookupMessages.ProjectSourceContainerType_12, null); - return null; - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/WorkspaceSourceContainerType.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/WorkspaceSourceContainerType.java deleted file mode 100644 index 460fadd1f..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/WorkspaceSourceContainerType.java +++ /dev/null @@ -1,53 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.internal.core.sourcelookup.containers; - -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.core.sourcelookup.containers.WorkspaceSourceContainer; -import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; - -/** - * The type for creating/restoring workspace source containers. - * - * @since 3.0 - */ -public class WorkspaceSourceContainerType extends AbstractSourceContainerTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String) - */ - public ISourceContainer createSourceContainer(String memento) throws CoreException { - Node node = parseDocument(memento); - if (node.getNodeType() == Node.ELEMENT_NODE) { - Element element = (Element)node; - if ("workspace".equals(element.getNodeName())) { //$NON-NLS-1$ - return new WorkspaceSourceContainer(); - } - abort(SourceLookupMessages.WorkspaceSourceContainerType_3, null); - } - abort(SourceLookupMessages.WorkspaceSourceContainerType_4, null); - return null; - } - /* (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 { - Document document = newDocument(); - Element element = document.createElement("workspace"); //$NON-NLS-1$ - document.appendChild(element); - return serializeDocument(document); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ContainerResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ContainerResolver.java deleted file mode 100644 index b01601c03..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ContainerResolver.java +++ /dev/null @@ -1,32 +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.core.variables; - -import org.eclipse.core.resources.IResource; - -/** - * Resolver for the ${container_*} variables. Accepts an optional - * argument that is interpretted as a full path to a container in the workspace. - *

                            - * Moved to debug core in 3.5, existed in debug.iu since 3.0. - *

                            - * @since 3.5 - */ -public class ContainerResolver extends ResourceResolver { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.stringsubstitution.ResourceResolver#translateSelectedResource(org.eclipse.core.resources.IResource) - */ - protected IResource translateSelectedResource(IResource resource) { - return resource.getParent(); - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.java deleted file mode 100644 index 739cdb48c..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.java +++ /dev/null @@ -1,28 +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 - *******************************************************************************/ -package org.eclipse.debug.internal.core.variables; - -import org.eclipse.osgi.util.NLS; - -public class Messages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.debug.internal.core.variables.Messages"; //$NON-NLS-1$ - public static String ResourceResolver_0; - public static String ResourceResolver_1; - public static String ResourceResolver_2; - public static String WorkspaceResolver_0; - static { - // initialize resource bundle - NLS.initializeMessages(BUNDLE_NAME, Messages.class); - } - - private Messages() { - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.properties b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.properties deleted file mode 100644 index 9029703b6..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/Messages.properties +++ /dev/null @@ -1,14 +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 -############################################################################### -ResourceResolver_0=Variable references non-existent resource : {0} -ResourceResolver_1=Variable references empty selection: {0} -ResourceResolver_2=Variable not recognized: {0} -WorkspaceResolver_0=Variable references non-existent resource : {0} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ProjectResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ProjectResolver.java deleted file mode 100644 index ad7b0a8a0..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ProjectResolver.java +++ /dev/null @@ -1,30 +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.core.variables; - -import org.eclipse.core.resources.IResource; - -/** - * Resolver for the ${project_*} variables. Accepts an optional argument - * that is interpretted as the name of a project. - *

                            - * Moved to debug core in 3.5, existed in debug.iu since 3.0. - *

                            - * @since 3.5 - */ -public class ProjectResolver extends ResourceResolver { - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.stringsubstitution.ResourceResolver#translateSelectedResource(org.eclipse.core.resources.IResource) - */ - protected IResource translateSelectedResource(IResource resource) { - return resource.getProject(); - } -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java deleted file mode 100644 index 91c9bc45b..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java +++ /dev/null @@ -1,168 +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.core.variables; - -import java.io.File; -import java.net.URI; - -import org.eclipse.core.filesystem.EFS; -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.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; -import org.eclipse.core.variables.IStringVariableManager; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.debug.core.DebugPlugin; - -import com.ibm.icu.text.MessageFormat; - -/** - * Common function of variable resolvers. - * Moved to debug core in 3.5, existed in debug.iu since 3.0. - * - * @since 3.5 - */ -public class ResourceResolver implements IDynamicVariableResolver { - - /* (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 { - IResource resource = null; - if (argument == null) { - resource = getSelectedResource(variable); - } else { - resource = getWorkspaceRoot().findMember(new Path(argument)); - } - if (resource != null && resource.exists()) { - resource = translateSelectedResource(resource); - if (resource != null && resource.exists()) { - return translateToValue(resource, variable); - } - } - abort(MessageFormat.format(Messages.ResourceResolver_0, new String[]{getReferenceExpression(variable, argument)}), null); - return null; - } - - /** - * Returns the resource applicable to this resolver, relative to the selected - * resource. This method is called when no argument is present in a variable - * expression. For, example, this method might return the project for the - * selected resource. - * - * @param resource selected resource - * @return resource applicable to this variable resolver - */ - protected IResource translateSelectedResource(IResource resource) { - return resource; - } - - /** - * Returns the workspace root - * - * @return workspace root - */ - protected IWorkspaceRoot getWorkspaceRoot() { - return ResourcesPlugin.getWorkspace().getRoot(); - } - - /** - * Returns an expression used to reference the given variable and optional argument. - * For example, ${var_name:arg}. - * - * @param variable referenced variable - * @param argument referenced argument or null - * @return variable reference expression - */ - protected String getReferenceExpression(IDynamicVariable variable, String argument) { - StringBuffer reference = new StringBuffer(); - reference.append("${"); //$NON-NLS-1$ - reference.append(variable.getName()); - if (argument != null) { - reference.append(":"); //$NON-NLS-1$ - reference.append(argument); - } - reference.append("}"); //$NON-NLS-1$ - return reference.toString(); - } - - /** - * Throws an exception with the given message and underlying exception. - * - * @param message exception message - * @param exception underlying exception or null - * @throws CoreException - */ - protected void abort(String message, Throwable exception) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, message, exception)); - } - - /** - * Returns the selected resource. Uses the ${selected_resource_path} variable - * to determine the selected resource. This variable is provided by the debug.ui - * plug-in. Selected resource resolution is only available when the debug.ui - * plug-in is present. - * - * @param variable variable referencing a resource - * @return selected resource - * @throws CoreException if there is no selection - */ - protected IResource getSelectedResource(IDynamicVariable variable) throws CoreException { - IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); - try { - String pathString = manager.performStringSubstitution("${selected_resource_path}"); //$NON-NLS-1$ - return ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(pathString)); - } catch (CoreException e) { - // unable to resolve a selection - } - abort(MessageFormat.format(Messages.ResourceResolver_1, new String[]{getReferenceExpression(variable, null)}), null); - return null; - } - - /** - * Translates the given resource into a value for this variable resolver. - * - * @param resource the resource applicable to this resolver's variable - * @param variable the variable being resolved - * @return variable value - * @throws CoreException if the variable name is not recognized - */ - protected String translateToValue(IResource resource, IDynamicVariable variable) throws CoreException { - String name = variable.getName(); - IPath path = null; - URI uri = null; - if (name.endsWith("_loc")) { //$NON-NLS-1$ - uri = resource.getLocationURI(); - if(uri != null) { - File file = EFS.getStore(uri).toLocalFile(0, null); - if(file != null) { - return file.getAbsolutePath(); - } - } - } else if (name.endsWith("_path")) { //$NON-NLS-1$ - path = resource.getFullPath(); - if(path != null) { - return path.toOSString(); - } - } else if (name.endsWith("_name")) { //$NON-NLS-1$ - return resource.getName(); - } - abort(MessageFormat.format(Messages.ResourceResolver_2, new String[]{getReferenceExpression(variable, null)}), null); - return null; - } - -} diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/WorkspaceResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/WorkspaceResolver.java deleted file mode 100644 index 86abb50f1..000000000 --- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/WorkspaceResolver.java +++ /dev/null @@ -1,58 +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.core.variables; - -import java.io.File; -import java.net.URI; -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.resources.*; -import org.eclipse.core.runtime.*; -import org.eclipse.core.variables.*; -import org.eclipse.osgi.util.NLS; - -/** - * Resolves the ${workspace_loc} variable. The variable resolves to the - * location of the workspace. If an argument is provided, it is interpreted as a - * workspace relative path to a specific resource. - */ -public final class WorkspaceResolver 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 { - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IResource resource; - - if (argument == null) { - resource = root; - } else { - resource = root.findMember(new Path(argument)); - } - - if (resource != null && resource.exists()) { - URI uri = resource.getLocationURI(); - - if (uri != null) { - File file = EFS.getStore(uri).toLocalFile(EFS.NONE, null); - - if (file != null) { - return file.getAbsolutePath(); - } - } - } - - String expression = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression(variable.getName(), argument); - String message = NLS.bind(Messages.WorkspaceResolver_0, expression); - - throw new CoreException(new Status(IStatus.ERROR, ResourcesPlugin.PI_RESOURCES, IResourceStatus.RESOURCE_NOT_FOUND, message, null)); - } -} diff --git a/org.eclipse.debug.core/doc/.cvsignore b/org.eclipse.debug.core/doc/.cvsignore deleted file mode 100644 index af3f463c2..000000000 --- a/org.eclipse.debug.core/doc/.cvsignore +++ /dev/null @@ -1,15 +0,0 @@ -book.css -org_eclipse_debug_core_breakpoints.html -org_eclipse_debug_core_launchConfigurationComparators.html -org_eclipse_debug_core_launchConfigurationTypes.html -org_eclipse_debug_core_launchDelegates.html -org_eclipse_debug_core_launchers.html -org_eclipse_debug_core_launchModes.html -org_eclipse_debug_core_logicalStructureTypes.html -org_eclipse_debug_core_processFactories.html -org_eclipse_debug_core_sourceContainerTypes.html -org_eclipse_debug_core_sourceLocators.html -org_eclipse_debug_core_sourcePathComputers.html -org_eclipse_debug_core_statusHandlers.html -org_eclipse_debug_core_watchExpressionDelegates.html -schema.css diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_sourceContainerTypes.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_sourceContainerTypes.html deleted file mode 100644 index 98981aa52..000000000 --- a/org.eclipse.debug.core/doc/org_eclipse_debug_core_sourceContainerTypes.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - -

                            Source Container Types

                            -

                            -org.eclipse.debug.core.sourceContainerTypes

                            -3.0 -

                            - -

                            -

                            This extension point allows for an extensible set of source container types to be contributed by the debug platform - source lookup facilities.

                            -

                            -

                            <!ELEMENT extension (sourceContainerType*)>

                            -

                            <!ATTLIST extension

                            -

                            point CDATA #REQUIRED

                            id    CDATA #IMPLIED

                            name  CDATA #IMPLIED>

                            -

                            -
                              -
                            • point - a fully qualified identifier of the target extension point
                            • -
                            • id - an optional identifier of the extension instance
                            • -
                            • name - an optional name of the extension instance
                            • -
                            -

                            <!ELEMENT sourceContainerType EMPTY>

                            -

                            <!ATTLIST sourceContainerType

                            -

                            id    CDATA #REQUIRED

                            name  CDATA #REQUIRED

                            class CDATA #REQUIRED>

                            -

                            -
                              -
                            • id - The unique id used to refer to this type
                            • -
                            • name - The name of this source container type use for presentation purposes.
                            • -
                            • class - A class that implements ISourceContainerType
                            • -
                            -
                            Value of the attribute class must be a fully qualified name of a Java class that implements the interface ISourceContainerType. -

                            - -
                            -

                            - - Copyright (c) 2003 IBM Corporation and others. All Rights Reserved. -

                            -

                            - -

                            - - diff --git a/org.eclipse.debug.core/doc/org_eclipse_debug_core_sourcePathComputers.html b/org.eclipse.debug.core/doc/org_eclipse_debug_core_sourcePathComputers.html deleted file mode 100644 index 930540395..000000000 --- a/org.eclipse.debug.core/doc/org_eclipse_debug_core_sourcePathComputers.html +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - -

                            Source Path Computers

                            -

                            -org.eclipse.debug.core.sourcePathComputers

                            -3.0 -

                            - -

                            -

                            Defines an extension point to register a computer that can describe a default source lookup path for - a launch configuration. Source path computers are associated with launch configuration types via the - launchConfigurationTypes extension point. As well, a source path computer can be associated with a - specific launch configuration via the launch configuration attribute ATTR_SOURCE_PATH_COMPUTER_ID.

                            -

                            -

                            <!ELEMENT extension (sourcePathComputer*)>

                            -

                            <!ATTLIST extension

                            -

                            point CDATA #REQUIRED

                            id    CDATA #IMPLIED

                            name  CDATA #IMPLIED>

                            -

                            -
                              -
                            • point - a fully qualified identifier of the target extension point
                            • -
                            • id - an optional identifier of the extension instance
                            • -
                            • name - an optional name of the extension instance
                            • -
                            -

                            <!ELEMENT sourcePathComputer EMPTY>

                            -

                            <!ATTLIST sourcePathComputer

                            -

                            id    CDATA #REQUIRED

                            class CDATA #REQUIRED>

                            -

                            -

                            -Defines an extension point to register a computer that can describe a default source lookup path - for a launch configuration.

                            -
                            -
                              -
                            • id - The unique id used to refer to this computer.
                            • -
                            • class - A class that implements ISourcePathComputer.
                            • -
                            -
                            Value of the attribute class must be a fully qualified name of a Java class that implements the interface ISourcePathComputer. -

                            - -
                            -

                            - - Copyright (c) 2003 IBM Corporation and others. All Rights Reserved. -

                            -

                            - -

                            - - diff --git a/org.eclipse.debug.core/hglegal2003.htm b/org.eclipse.debug.core/hglegal2003.htm deleted file mode 100644 index 47c8540c8..000000000 --- a/org.eclipse.debug.core/hglegal2003.htm +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - Legal Notices - - - -

                            -Notices

                            -(c) Copyright (c) 2000, 2003 IBM Corporation and others. All Rights Reserved. - - diff --git a/org.eclipse.debug.core/ngibmcpy2003.gif b/org.eclipse.debug.core/ngibmcpy2003.gif deleted file mode 100644 index c786e43e1..000000000 Binary files a/org.eclipse.debug.core/ngibmcpy2003.gif and /dev/null differ diff --git a/org.eclipse.debug.core/plugin.properties b/org.eclipse.debug.core/plugin.properties deleted file mode 100644 index 62739c182..000000000 --- a/org.eclipse.debug.core/plugin.properties +++ /dev/null @@ -1,68 +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 -############################################################################### - -pluginName=Debug Core -providerName=Eclipse.org -launcherExtensionPointName=Launcher -breakpointExtensionPointName=Breakpoint -launchConfigurationTypeNameExtensionPointName=Launch Configuration Type -launchConfigurationComparatorsExtensionPointName=Launch Configuration Comparators -statusHandlerExtensionPointName=Status Handler -sourceLocatorsExtensionPointName=Source Locator -launchModesExtensionPointName=Launch Modes -launchDelegatesExtensionPointName=Launch Delegates -breakpointImportParticipantsExtensionPoint.name = Breakpoint Import Participant -watchExpressionDelegatesName= Watch Expression Delegates -processFactoriesExtensionPointName=Process Factories -logicalStructureTypesExtensionPointName=Logical Structure Types -logicalStructureProvidersExtensionPointName=Logical Structure Providers -sourceContainerTypesName = Source Container Types -sourcePathComputersName = Source Path Computers - -run=&Run -debug=&Debug -profile=&Profile -runAs.label=&Run As -debugAs.label=&Debug As -profileAs.label=&Profile As - -env_var.description=Returns the value of an environment variable. An environment variable name must be specified as an argument. -system_var.description=Returns the value of an Eclipse system variable. A variable name must be specified as an argument - one of ARCH, ECLIPSE_HOME, NL, OS, or WS. -system_property.description=Returns the value of a system property from the Eclipse runtime. A system property name must be specified as an argument. - -containerName.archive = Archive -containerDescription.archive = A jar or zip in the workspace containing source files -containerName.externalArchive = External Archive -containerDescription.externalArchive = A jar or zip in the local file system containing source files -containerName.project = Project -containerDescription.project = A project in the workspace -containerName.folder = Workspace Folder -containerDescription.folder = A folder in the workspace -containerName.directory = File System Directory -containerDescription.directory = A directory in the local file system -containerName.workspace = Workspace -containerDescription.workspace = All projects in the workspace -containerName.default = Default -containerDescription.default = Default source lookup path - -workspace_loc.description=Returns the absolute file system path of the workspace root. When an argument is specified, the absolute file system path of the resource identified by a workspace relative path is returned. -container_loc.description=Returns the absolute file system path of a resource's container. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -container_path.description=Returns the workspace relative path of a resource's container. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -container_name.description=Returns the name of a resource's container. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -project_loc.description=Returns the absolute file system path of a resource's project. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -project_path.description=Returns the workspace relative path of a resource's project. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -project_name.description=Returns the name of a resource's project. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -resource_loc.description=Returns the absolute file system path of a resource. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -resource_path.description=Returns the workspace relative path of a resource. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. -resource_name.description=Returns the name of a resource. The target resource is the selected resource when no argument is specified, or the resource identified by a workspace relative path. - -LineBreakpoint.name = Line Breakpoint -Breakpoint.name = Breakpoint diff --git a/org.eclipse.debug.core/plugin.xml b/org.eclipse.debug.core/plugin.xml deleted file mode 100644 index 19ba532a6..000000000 --- a/org.eclipse.debug.core/plugin.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.core/r2_0_buildnotes_platform-debug.html b/org.eclipse.debug.core/r2_0_buildnotes_platform-debug.html deleted file mode 100644 index 90f26fd52..000000000 --- a/org.eclipse.debug.core/r2_0_buildnotes_platform-debug.html +++ /dev/null @@ -1,1102 +0,0 @@ - - - - - - - Platform Debug Release Notes for the 2.0 release - - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 20, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -20365: Bidi - NPE when closing Eclipse
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 19, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -20492: Extra separator in run/debug history menus
                            -19878: Collapse/expand symbol (+/-) dissappears in inspect window
                            -19998: NullPointerException when launching rsource that has no extension
                            -20066: TVT2: Hardcoded "None" in debug preferences
                            -20594: Preference listeners should use equals, not ==
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 12, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -19928: Run/Debug menu ordering
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 11, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -17462: IllegalArgumentException when printing long stack to console
                            -19375: Duplicate launch config naming problem
                            -19170: LaunchConfigurationDialog etc leakage when last launched is Runtime
                            -19740: Content assist is now retargetable
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 10, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -19613: LaunchConfig marked PRIVATE shows in Console View
                            -19338: Missing copyrights
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 7, 2002 -

                            -What's new in this drop

                            -
                          • API change - a spelling mistake was fixed in the name of a method in IPersistableSourceLocator
                          • - -

                            -Problem Reports Fixed

                            -18789: Source editor not given focus on suspend
                            -19170: LaunchConfigurationDialog etc leakage when last launched is
                            -18772: Launch Configurations: Table is cut off on motif
                            -19379: Debug remembers selected state of toolbar entry even if it is no longer enabled
                            -19443: IPersistableSourceLocator has misspelled method
                            -19489: References to IDebugViewAdapter (DOC)
                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 1, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -18209: Unable to run a program on first attempt
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 31, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -15671: Strange behavior of the console view
                            -17017: Not always prompted to find source location
                            -18334: Launch view holding onto Objects longer than necessary
                            -18153: launch last and run/debug buttons
                            -18385: NPE during launching after removing the launch info
                            -16946: several Eclipse buttons are too short
                            -18474: Empty group in history menus
                            -16764: Debug Perspective leaks actions
                            -10383: Help pass for 2.0
                            -16152: NLS pass
                            -16379: Launch configs tree is missing label and is not wide enough
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 30, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -17087: Launch view, source lookup and closed projects
                            -17029: DCR: Please let me specify a launch history size of 20
                            -16378: Missing icons in launch config creation tabs
                            -18156: Debug/Run As cascade menu should be sorted
                            -16462: Not all tabs visible in Run-time Workbench config
                            -18154: Launch shortcuts menu labels
                            -16685: Internal error changing launch history preference
                            -16963: Mneumonic missing on table label for Select Launch Configuration
                            -16975: Up/down button on launch history page not working correctly
                            -17512: Missing mneumonics in Console Preference page
                            -18222: All XML written using platform line delimiters/UTF8
                            -16955: NPE opening java perspective.
                            -17633: ActionDelegateHelper should nullify fTextEditor when it does not need it
                            -17380: Launch history maintains duplicate entries
                            -14406: Debug menu items becoming disabled inappropriately
                            -17794: Disabled actions in the context menu of the Launch config dialog viewer
                            -17358: Revert button not enabled after changes
                            -17116: Launch related walkbacks in .log
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 29, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -18099: Change provider name
                            -17490: F1 help for launch config tabs
                            -18121: Static menus items should be at the top
                            -17649: ObjectCollectedException written to console
                            -16838: Over zealous error logging when config has been deleted
                            -17105: Attempt to save shared launch configs in closed projects
                            -18122: Scrapbook configs show up in list for Launch history pref page
                            -16970: ClassCastException out of Launch history preference page
                            -16492: CommonTab Switch to String
                            -16956: NPE opening java perspective
                            -17100: Launch Config name with underscore is truncated
                            -16638: Missing menmonic on Debug Action Groups page
                            -17072: "Show Supported Breakpoints" has just one calorie, not meaningful enough
                            -17946: Generalize launch shortcuts/convenience actions
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 28, 2002 -

                            -What's new in this drop

                            -
                          • New/replaced extension point. The extension point "org.eclipse.debug.ui.launchConfigurationShortcuts" has - been replaced with "org.eclipse.debug.ui.launchShortcuts". Please see extension point documentation - for details.
                          • - -

                            -Problem Reports Fixed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 27, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -16757: Launch.removeDebugTarget does not work
                            -17534: Two huge bugs in Launch class
                            -17676: Run menu history menus not updated after organize favorites
                            -17069: NPE deleting project with shared config
                            -16655: Streams are not closed when a java program is finished
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 21, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -16185: Show/hide package names button in doesn't work in debug view
                            -15964: Updates to preference pages
                            -16476: TextViewerGotoLineAction$NumberValidator
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 19, 2002 -

                            -What's new in this drop

                            -
                          • API change - deprecated method was removed - ILaunchConfigurationTab.isValid()
                          • -
                          • New extension point - org.eclipse.debug.core.launchConfigurationComparator. This - extension point is for launch configuration attributes that require a custom - equality implementation. See documentation for extension point.
                          • - -

                            -Problem Reports Fixed

                            -15704: Default "Maximum launch history size" should be at least 10
                            -15560: Cancel button on edit Configurations is much smaller than others
                            -15952: Remove deprecated method
                            -15953: No longer expanding debug target to show threads
                            -15988: ArrayIndexOutOfBoundsException in config reselection
                            -16107: NPE opening editor
                            -16063: Preference pages now re-size
                            -16060: Re-sizable launch config dialog
                            -15850: LaunchView changes required from platform ui changes
                            -16143: Multiple *.launch filters
                            -12032: Debug Constants should include value in javadoc
                            -6485: Extension & Package documentation
                            -16217: launch config "revert" causes flicker
                            -16325: Content assist action icon
                            -16356: NPE out of ConsoleDocumentManager
                            -16148: IProcess should support an exit value
                            -14927: Cancel button in progress monitor of launch configuration dialog
                            -15775: Deleting launch config should select the next config
                            - -

                            -Problem Reports Closed

                            -16113: Execution arguments gets lost if starting a class file of a jar library
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 14, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -13766: Error recovery on failed launch - need to bring up dialog
                            -11540: Misc Debugger source lookup dialog
                            -15506: Switching launch configs should show busy cursor
                            -15618: DebugDropDownAction missing resource string
                            -15375: ClassCastException trying to resume
                            -15720: Debug perspective should define place holders for standard views
                            -12316: Message (stack trace) silently written to console when trying to run small java example
                            -4130: Eclipse Debugger: Setting Breakpoints via keyboard not possilbe (1GITILH)
                            -15449: 'show detail pane' toolbar button behaves differently than other buttons
                            -12904: Creating shard Launch Configuration fails
                            -15748: Duplicate action in launch config dialog
                            -15848: Change Debug Menu id
                            -15533: DebugAction contains redundant cascade menu
                            -14922: Config created by double clicking on launch type; delete not enabled
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 08, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -9034: Variables view should scroll to display new variables
                            -12001: Plug-in startup
                            -14412: Launch configuration XML should be written to file immediately
                            -15246: Allow private launch configs to perspective switch
                            -15325: Remove 'Configuration' from debug action labels
                            -1636: Copy/paste across console docs (1GF61GB)
                            -13457: Should expose launch history length as user preference
                            -15024: Launch configuration dialog doesn't display "favorite" option
                            -15180: DND.ERROR_CANNOT_SET_CLIPBOARD must be handled
                            -14657: LaunchDropDownAction and coolbar support
                            -14897: many missing '...' on buttons in launch configs
                            -15362: Standard out not always hooked to console
                            -15446: first click in the debug/launch history preference page results in exception
                            -11894: Mneumonic collision in the debug menu
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 30, 2002 -

                            -What's new in this drop

                            -
                          • Changes in the launch configuration dialog: -
                              -
                            • To free up screen real estate for editing launch configurations, the tree of launch - configurations has been made more narrow by removing the "copy" button from the - dialog. The "new" button copies a configuration when a configuration is selected, and - creates a new configuration (based on the workbench selection) when a configuration - type is selected.
                            • -
                            • The "Cancel" button has been replaced with a "Close" button (closing the dialog - does not cancel changes). You will be prompted to save unsaved changes.
                            • -
                            • A "Revert" button has been added to the edit area to revert changes on the - currently selected launch configuration (under edit).
                            • -
                            -
                          • -
                          • Changes to launch behavior -
                              -
                            • Pressing the run or debug toolbar buttons launches the configuration that was last launched - (in the workspace), in the appropriate mode (run or debug).
                            • -
                            • To create a new launch configuration, use the cascading menu items on the run or debug - menu. For example "New Configuration -> Local Java Application" - this will create a new - configuration based on the selection in the workbench (or active editor).
                            • -
                            • "Single-click launching" preference has been removed. It was determined that a preference - which changes the behavior of a toolbar button is disorienting to the user.
                            • -
                            -
                          • -
                          • Changes to ILaunchManager -
                              -
                            • API for setting default launch configuration types has been removed.
                            • -
                            -
                          • - -

                            -Problem Reports Fixed

                            -13537: DebugActionGroups: Clearer wording in preference page
                            -13909: Inconsistent margins on preference pages
                            -11889: Buttons too small in the Console and Launch Configuration Preference pages
                            -13513: Running a debug view in a Java perspective has several problems
                            -13536: DebugActionGroups: Collision on ID wipes out both action groups
                            -13317: New Configuration menu empty
                            -14560: Deleting breakpoint selects another breakpoint in the wrong direction
                            -14143: Breakpoints View appears with "Go to file" button enabled regardless of breakpoints
                            -9834: Views do not remember package visibility filter settings
                            -11904: Debug menu mneumonics
                            -14797: NumberFormatException if cancel Go to line in console
                            -13440: menu reorganization
                            -14550: Need to be able to make launch configuration type invisible
                            -6388: Variables view's static and field buttons are backwards
                            -14495: clipboards must be disposed
                            -13665: Debug preference page looks cluttered
                            -14485: Cannot delete a launch config using the Delete key
                            -14486: Default perspective for Run should not be Debug
                            -11697: Debug Preference Page needs group box
                            -14540: Relaunch action not enabled correctly
                            -14556: Enable breakpoint action using old selection
                            -14520: Debug plugins should provide consistent unique identifier access
                            -12577: Launch configurations wizard - usability
                            -13555: Edit configuration dialog UI confusing
                            - -

                            -Problem Reports Closed

                            -12292: Unable to suspend a running thread to see stack frames
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 23, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -13836: Missing and duplicated extensions in debug plugin.xml
                            -12125: NLS debug projects
                            -14111: Console terminate button not enabled
                            -13041: Remove all terminated action incorrectly enabled
                            -13372: Strange UI feedback when breakpoint hit during evaluation
                            -13430: Open on Type in console can work better; less beep
                            -12184: IncompatibleThreadStateException on launchAdded
                            -14190: Stack dumps noticed in log
                            -14125: Debug view "Resume" always jumps to source - menu item does not
                            -

                            -Problem Reports Closed

                            -12132: Can't launch debugger if proxy set.
                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 18, 2002 -

                            -What's new in this drop

                            -
                              -
                            • Support for old launchers has been removed (ILauncher, ILauncherDelegate, ILaunchWizard). - Launch configruations now rule the launching world.
                            • -
                            • The extension point "org.eclipse.debug.ui.launchTabs" has been removed and replaced with - a new extension point "org.eclipse.debug.ui.launchTabGroups".
                            • -
                            • The constants IDebugUIConstants.PREF_AUTO_SHOW_DEBUG_VIEW & IDebugUIConstants.PREF_AUTO_SHOW_PROCESS_VIEW - have been removed. Users can now set a default perspective for each of Run & Debug which may be - overridden in a launch configuration.
                            • -
                            - -

                            -Problem Reports Fixed

                            -13385: Showing detail should be disabled when multi-select in var view
                            -12788: Cut, copy, paste actions don't work in details pane
                            -8590: Allow position of "step debug" in step tools
                            -12982: Need ability to set initial state of debug view based on AbstractDebugView
                            -13554: Incorrect dependencies: result is NPE in DebugActionGroupsManager
                            -13714: Pressing Apply makes tabs disappear
                            -13307: NPE in launch configs
                            -12382: Action set part association for the launch view?
                            -13285: Debug/Run With use old launchers when in config mode
                            -13425: Double click to expand/contract tree in variable and expression views
                            -13864: npe on lanuning (latest after 0412)
                            -12281: Launch configuration tab widgets are private
                            -13501: hostname cut off when show qualified names is off
                            -12257: remove single event handling support
                            -12722: Actions for configuration dialogs should appear on Debug menu
                            -13324: Change of selection lost in Launch configuration dialog
                            -11942: Single click launching preference text
                            -13088: NPE in the log after exiting workspace
                            -13565: Properties page for process should not contain defaults/apply buttons
                            -13853: native code error
                            -13613: Delegating presentation and #setAttribute()...
                            -12962: Same target shows up twice in drop-downs
                            -13375: Show Detail Pane in popup menu missing mneumonic
                            -12785: Select all in the details pane selects all variables
                            -13383: Copy variables action not enabled correctly
                            -13993: Debug and Run buttons have been accidentally swapped
                            -12953: Action "type" constants should be moved from AbstractDebugView to IDebugView
                            -14124: Launch configuration classes not in launch configuration package
                            - -

                            -Problem Reports Closed

                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 11, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -12677: Single click launching and F11, Ctrl-F11
                            -13214: ArrayOutOfBoundException in launch history pref page
                            -13480: NPE creating Java Project when running Runtime Workbench
                            -13345: exception in log - after opening/closing projects
                            -13085: DebugActionGroups cannot handle two actions with same ID in views
                            - -

                            -Problem Reports Closed

                            - - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 09, 2002 -

                            -What's new in this drop

                            -
                          • A new extension point exists in the debug ui to control the types of launch configurations that can - be created from the cascading "New run/debug configuration" menu (off the run/debug dropdown menus). - A type of configuration can be contributed to mulitple perspectives.
                          • - -

                            -Problem Reports Fixed

                            -1696: DCR: Perspective specific launcher filtering (1GIYJXH)
                            -11733: duplicate shared config after close & restart
                            -11899: Launch config name collission
                            -12658: Single click launching doesn't work if the active editor isn't selected
                            -12488: Launch config dialog should allow double-click on config type
                            -11710: Deleting a launch configuration leaves no selection
                            -12598: Launch config - tab group API inconvenience
                            -11190: cannot set working directory if it includes a japanese character
                            -12160: Launch creation/lifecycle
                            -8772: Infinitely looping stack trace in target pgm locks UI
                            -12619: Exception during startup.
                            -10282: Rendering of changed variables
                            -12310: Need ability to determine if a breakpoint applies to a target
                            -12981: Launcher - listed name does not match given name
                            -9825: Action icon inconsistencies
                            -12891: Several IOExceptions from .log in StreamsProxy.write(StreamsProxy.java:92)
                            -11906: Useless single click launch for classes with no main
                            - -

                            -Problem Reports Closed

                            -12276: Index out of bounds exception from launch configuration dialog
                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 2, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -12289: Breakpoint should extend platform object
                            -12548: Debug event filters should use event sets
                            -12613: Exception when on target workspace when starting eclipse
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 28, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -11756: Launch config dialog: button sizes
                            -11923: Console preference page needs reworking
                            -11880: Launch ConfigurationType property page missing accelerator
                            -11925: Up/down buttons for launch history restricted to single select
                            -11457: Launch Configuration Dialog issues
                            -11702: Launch configuration defaults are set after widgets are initialized
                            -11330: JavaEnvironmentTab depends on JavaMainTab
                            -11053: Launch view too optimistic on source lookup
                            -11982: Logging exceptions
                            -12339: NPE when i switch to debug perspective
                            -7609: Attempting to go to a marker that no longer exists
                            -11326: Restore instead of rebuild launch config index
                            -11720: Need replacement for #hasChildren
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 26, 2002 -

                            -What's new in this drop

                            -
                          • Breaking API change: IDebugViewAdapter had been renamed to IDebugView
                          • -
                          • Launch configurations are the default launch mechanism.
                          • -
                          • Debug events are reported in sets. @see IDebugEventSetListener and IDebugEventListener
                          • - -

                            -Problem Reports Fixed

                            -11610: Doc: identifier for launch extension points are incorrect
                            -11401: API on ILaunch.getDebugTarget()
                            -11303: Deadlock on startup processing breakpoints
                            -11919: 2 NPEs using Preferences->Debug->Launch Configuration Types
                            -6212: Debug view toolbar/menu pollution
                            -11849: Duplicate history items showing up
                            -10448: IExpressionManager#hasExpression, IBreakpointManager#hasBreakpoints,etc.
                            -10817: configs in java packages get copied to output folder
                            -11207: IDebugViewAdapter should be named IDebugView
                            -11612: Agressive clearing of instruction pointer
                            -12025: Invalid thread access out of Launch configurations
                            -12229: Set default launching style to configuration based
                            -9650: Variable change notification bug
                            -12157: Debug event sets
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 18, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -11197: Feature request: Delete in breakpoints view
                            -11212: Debug UI plugin.xml references jdt
                            -11308: Launch configurations make workspace non-transportable
                            -11346: Registering a launch multiple times is not handled well
                            -10586: Use new workbench selection service
                            -11425: ILaunchConfiguration JavaDoc is incorrect
                            -11189: Flicker in the Launch Configurations dialog
                            -11253: Launch config tab flicker
                            -11370: Launch view update bug
                            -11462: Launch config metadata change generates parse exception
                            -10637: "currently active project" should be the "current working directory"
                            -10162: Console View to front on error output only
                            -8937: Feature Request: Select all in the breakpoints view
                            - -

                            -Problem Reports Closed

                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 12, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -10775: New, delete copy of Launch configurations remain disabled
                            -10780: Delete and Copy enabled for Launch configuration type
                            -10778: Launch configuration names should be trimmed
                            -6376: Should be possible to remove entries from the "Run list"
                            -10855: Use new workbench API for show perspective
                            -10610: Null exception when lauchviewer processing events on remove tree items
                            -8420: Cannot edit ExpressionView detail area until after inspect.
                            -11076: Delete configs reamin in favorite list
                            -9922: Null pointer in launch configuration type property page
                            -7605: Feature: Doubleclicking in launch config dialog
                            -11072: History menu update
                            -8294: "Debug History" and "Run History" have empty submenus
                            -11133: NPE in LaunchView.initializeSelection()
                            -11110: NPE in AbstractListenerActionDelegate.pageActivated
                            -10847: API - AbstractLaunchConfiguration tab
                            -

                            - -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 05, 2002 -

                            -What's new in this drop

                            -
                          • Launch Configuration API has changed. The launch configuration tab lifecycle is now similar - to that of preference and wizard pages.
                          • - -

                            -Problem Reports Fixed

                            -9680: Launch config: pressing save returns to first tab
                            -9660: Launch Config Flicker
                            -10524: Provide default label provider API
                            -10506: NPE in launch view
                            -10582: SWT Exception closing a Debug Perspective in JUnit test
                            -7207: Launch configuration bugs
                            -7430: Debug perspective not reused
                            -10652: Remove action enabled when nothing to be removed
                            -7430: Debug perspective not reused
                            -

                            -Problem Reports Closed

                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -February 28, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -10243: ClassCastException when removing a breakpoint
                            - -

                            -Problem Reports Closed

                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -February 26, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            - - -

                            -Problem Reports Closed

                            -7767: Changing from "Debug View"
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -February 14, 2002 -

                            -What's new in this drop

                            -
                          • As part of the transition to configuration-based launching, early adopters may -continue to access the launch configuration dialog by Shift-clicking the run and debug -buttons, but configuration-based launches will NOT appear in the history, and -CANNOT be relaunched.
                          • - -

                            -Problem Reports Fixed

                            -9166: NPE in preference page
                            -9167: LaunchConfigurationLabelDecorator should not be on by default
                            -9483: NPE in LaunchConfigurationTypePropertyPage
                            -9652: IllegalArgumentException out of Console
                            -9704: NPE on shutdown in BreakpointsView
                            -9167: LaunchConfigurationLabelDecorator should not be on by default
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -February 12, 2002 -

                            -What's new in this drop

                            -
                          • Removed deprecated constant IDebugUIConstants.ID_PROCESS_VIEW
                          • -
                          • Basic icons and their support has been removed
                          • -
                          • Breakpoint property sheet has been replaced with breakpoint properties dialog. - Choose "Properties..." from the pop-up menu in the breakpoints view.
                          • - -

                            -Problem Reports Fixed

                            -8230: Console does not show process as ; better tracking of changes
                            -9194: Attempting to modify locked resource tree in BreakpointManager
                            -9200: Editor not opening for suspended stack frame with modified prefs
                            -9218: NPE in LaunchConfigurationLabelDecorator.isLaunchConfigFile
                            -9280: Debug event handlers performing runnables after dispose
                            -9057: API - CHANGE event should be better specified
                            -9111: Invalid thread access running test suite
                            -6370: Breakpoint Properties Dialog
                            -9327: JavaDebugOptionsManager startup loading breakpoints during resource changed
                            -9200: Editor not opening for suspended stack frame with modified prefs
                            -9178: Remove All Terminated always disabled?
                            -9065: WID opening editor for breakpoint
                            -8296: Debug With menu items have interesting numbering
                            -9421: NPE out of the LaunchView on shutdown with running target
                            -7301: no way to switch to custom debug perspective on debug
                            -5311: Missing debug information should be conveyed
                            -1683: Extra Action delegates (1GIGUK0)
                            - -

                            -Problem Reports Closed

                            -9299: NPE in LaunchView.showMarkerForCurrentSelection
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -February 05, 2002 -

                            -What's new in this drop

                            -
                          • Launch configuration infrastructure and UI is available for early adopters. -Developers that have contributed launchers should migrate to launch configurations. To -access launch configurations from the workbench, press the run/debug buttons while holding -the SHIFT key down.
                          • -
                          • The debugger indicates variables that have changed since the last suspend. See 1533. -
                          • The debug action set has been renamed from Debug/Run to Debug. See 8729.
                          • - -

                            -Problem Reports Fixed

                            -8729: Rename Debug action set from "Debug/Run" to "Debug"
                            -8945: Non-Persisted breakpoint can be incorrectly deleted at startup
                            -7965: Debug view refresh flicker
                            -1533: Feature: notification of changing variables (1G5NRPC)
                            -1721: Small Feature: separate disable/enable breakpoints (1GKKEI5)
                            -8245: Launch preferences page problems
                            -1621: Debugger doesn't come to front when breakpoint is hit (1GEUZEX)
                            -9102: Remove & Terminate walkback
                            -6807: launch configurations not crash proof
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -January 29, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -7837: Launch configuration page verifier error
                            -8235: Ctrl-space does not work for code assist in details pane
                            -7763: (usability) selecting in variables view with details pane causes un-maximize
                            -7814: API for char range within a line
                            - -

                            -Problem Reports Closed

                            -8501: "Disable all" breakpoints action
                            -7864: Need API for selection changes in debug view
                            -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -January 24, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -8059: NPE out of ControlActionDelegate
                            -8005: Terminate & Remove disabled
                            -8063: NPE in BreakpointsView when closing workbench
                            -8318: internal error occured, if open the menu "Debug -> Debug History"
                            - -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -January 22, 2002 -

                            -What's new in this drop

                            -
                          • Breakpoint API has been updated to allow selective persistence of breakpoint -of the same type
                          • -
                          • Breakpoint API now allows for "hidden" breakpoints. @see IBreakpoint.isRegistered()
                          • - -

                            -Problem Reports Fixed

                            -7578: .metadata launch files not in correct location
                            -7626: Widget is disposed error relaunching
                            -1710: DCR - Launcher should have control over perspective switching (1GJUT9J)
                            -6480: Launch configurations - store with workspace
                            -7961: updating source twice per suspend event
                            -7507: debugger keyboard shortcuts do not work in 20020109
                            -2990: Internal errors when fast clicking in debug stack (1GLDZVH)
                            -7974: Stack overflow pression "remove all" from Expression View
                            - -

                            -Problem Reports Closed

                            -1563: Fully qualified rendering of launch element name (1GD7U0Z)
                            -7418: Need the Process view back
                            -7627: Tooltips not working in debug views
                            -7755: The Breakpoints pane should highlight the breakpoint where the debugger stops
                            -5141: Breakpoint manager can use new marker API
                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -January 15, 2002 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            -6088: Move "qualified name" rendering to java debug
                            -7420: "Debug UI.xml" references JDT
                            -7580: NPE out of AbstractDebugEventHandler on shutdown
                            -7513: Terminate and remove fails to remove when timeouts occur
                            - -

                            -Problem Reports Closed

                            -7316: Inconsistent casing for Show detail pane
                            -7370: TimeoutException occurs during stepping
                            -1714: Confusion of launches from different projects in history (1GJYNLK)
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -January 9, 2002 -

                            -What's new in this drop

                            -
                          • The debugger now uses the workbench editor re-use policy.
                          • -
                          • There is no longer a Process view. The Debug view shows all debug -sessions and processes launched. When a workspace is re-started that -had a Process view open, an error message will appear explaining that -the Process view could not be created.
                          • -
                          • The debug action set has been split into two groups - debug and launch. -Existing debug and Java perspectives need to be closed and re-opened to obtain -run and debug buttons in the toolbar. @see bug 1724.
                          • -
                          • There is no longer an Inspector view - it has been replaced with an -Expressions view. When a workspace is re-started that had an Inspector -view open, an error message will appear explaining the Inspector view -could not be created.
                          • -
                          • A launch can be annotated with client specific data. @see bug 6481.
                          • -
                          • A launch can now contain more than one debug target. API has changed - in ILaunch, ILaunchListener, and ILaunchManager to suppport this.
                          • -

                            -Problem Reports Fixed

                            -7120: NPE during shutdown of DebugUIPlugin
                            -6954: Use new workbench API for openning perspective
                            -6206: Make AbstractDebugView API
                            -7151: Toggling ShowDetailPaneAction sets focus to the launch view
                            -7164: NPE during shutdown to do with DebugSelectionManager
                            -1724: Feature: split debug action set in to debug & launch (1GKCQVZ)
                            -7167: NPE shutting down in abstract debug view 'save state'
                            -6771: DebugEvent constructors changed to take IDebugElement
                            -1574: Settings in debug views not persisted (1GDTUNW)
                            -6105: Step accelerators should not take focus from editor
                            -1671: Option to autoclear terminated processes (1GHSO3L)
                            -6357: Combine Process/Debug Views
                            -6200: Extensible set of debug elements
                            -7204: Copy variables action needs icon
                            -7031: Inspector is missing a toString area
                            -6213: Breakpoints view improvements
                            -6481: Feature: Annotate launch with transaction id
                            -1617: type names not always shown in inspector (1GEULC4)
                            -6484: Ability for "super adaptor"
                            -6783: Console should not steal focus while writing output
                            -7277: Step detail events for into/over/return
                            -6214: More that one debug target per lanuch
                            - -

                            -Problem Reports Closed

                            -6482: Ability to group debug targets in one launch
                            -6215: Exception handling in variables view
                            -1688: Object display options (1GIKMIG)
                            -1606: Feature: Source Lookup (1GEPJEN)
                            -1553: Handling of no source is confusing (1GC2TVU)
                            -7166: Remove terminated launches preference does not applied correctly
                            -7169: Debug "F" keys not enabled properly on new editor
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -December 18, 2001 -

                            -What's new in this drop

                            -

                            -Problem Reports Fixed

                            -5260: TVT: Properties view for debug process is missing substitution variable
                            -6321: Console IOException
                            -7003: Debug With menu launches incorrect program (not finding selection)
                            - -

                            -Problem Reports Closed

                            -1548: Extensible launch modes (1GBEQYO)
                            -1592: DebugPlugin must allow for null elements in updateHistory() (1GEI3C1)
                            -6886: Request: Keep perspective when running application
                            -1627: Previous editor's unsaved contents are still visible (1GEX5LS)
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -December 11, 2001 -

                            -What's new in this drop

                            -
                              -
                            • The "relaunch last" action has been remapped to use F9 instead of F10. - Please see "6387: Can't use F10" for details. -
                            -

                            -Problem Reports Fixed

                            -6387: Can't use F10
                            -

                            -Problem Reports Closed

                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -December 6, 2001 -

                            -What's new in this drop

                            -
                              -
                            - -

                            -Problem Reports Fixed

                            - -6521: Variables view stays empty with stack frame selected (1GLE8PW)
                            -6577: NPE in DebugContentProvider
                            -6598: Problem using old workspace with new build
                            -

                            -Problem Reports Closed

                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -December 4, 2001 -

                            -What's new in this drop

                            -
                              -
                            - -

                            -Problem Reports Fixed

                            - -6321: Console IOException
                            -6216: Help for debug views in 1.0
                            -6521: Newly added resources cannot be checked out
                            - -

                            -Problem Reports Closed

                            - -1715: Consider removing state change actions from BreakpointsView (1GKKT90)
                            -1559: Debugger doesn't pop to front when breakpoint hit (1GD7P7D)
                            -1564: README: printf's in native code only show up in console at the end of execution (1GD80QZ)
                            -1588: README: System.exit(0) from Scrapbook (1GE8JU3)
                            -5485: NPE if missing launcher when using launch history
                            -1770: Last launch not updated upon deletion (1GLEANH)
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 27, 2001 -

                            -What's new in this drop

                            -
                              -
                            • Procedural Debug API - new debug element interfaces have been defined to support the notion of registers, -register groups, memory blocks, and memory block retrieval: -
                                -
                              • IRegister - a register in a register group
                              • -
                              • IRegisterGroup - register groups are available from each stack frame (that supports registers)
                              • -
                              • IMemoryBlock - a contiguos block of bytes from memory allocated by a running program
                              • -
                              • IMemoryBlockRetrieval - support to retrieve arbitrary blocks of memory from a running program
                              • -
                              -
                            • -
                            - -

                            -Problem Reports Fixed

                            - -1720: Issue: breakpoint manager breaks lazy plug-in load rule (1GK
                            - -

                            -Problem Reports Closed

                            - -6097: The inspector is not refresh
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 20, 2001 -

                            -What's new in this drop

                            -
                              -
                            • API Change - method addition - @see ILaunch.getLaunchConfiguration(). This does -not break any clients, as the only implementation of ILaunch is org.eclipse.debug.core.Launch, -which has been updated.
                            • -
                            • API Change - method return value - @see ILaunch.getLauncher(). A launch -is now allowed to return null for #getLauncher() when it was created by a launch -configuration rather than a launcher. This does not break any clients, as launch configurations -are not in use yet. The main client that will have to be updated is the Debug UI.
                            • -
                            • New debug preference - "Build (if required) before launch"
                            • -
                            - -

                            -Problem Reports Fixed

                            - -4023: Prompt user for save and build before run (1GGCBO0)
                            -5818: Debugger Source Lookup page claims project is closed
                            -5895: NPE out of the Console view on shutdown
                            -5896: NPE out of LaunchManagerVisitor on shutdown
                            -1623: StackFrame selected but toolbar actions disable (1GEV0L7)
                            -5681: Show debug perspective doesn't reuse my perspective
                            -5909: Should have terminate on Debug menu
                            -5582: Keyboard shortcut for run/debug
                            -5789: Console Empty on Hello World Examples
                            - -

                            -Problem Reports Closed

                            - -5951: Console buffer not flushed?
                            -5946: NPE in LaunchManagerVisitor
                            -5808: Console output being lost
                            -5925: DebugView does not survive platform crash
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 13, 2001 -

                            -What's new in this drop

                            - -

                            -Problem Reports Fixed

                            - - -5360: ListenerList#removeAll
                            -5613: Debugger hangs when it hits breakpoints during self hosting
                            -4269: Simplifying debugger perspective (1GKRAWI)
                            - - -

                            -Problem Reports Closed

                            - -5588: General Protection Fault double clicking on breakpoint in th
                            -5795: Reached Breakpoint, but no stacktrace
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 12, 2001 -

                            -What's new in this drop

                            -
                              -
                            • Draft definition and infrastructure for launch configurations.
                            • -
                            • API Change: Presentation of variable value details allows for long running -computation. @see IDebugModelPresentation.computeDetail(IValue, IValueDetailListener). @see IValueDetailListener. -
                            - -

                            -Problem Reports Fixed

                            - -5686: Launch/Run actions should be available on menubar
                            -5579: Would like option to switch to Debug perspective on breakpoi
                            - -

                            -Problem Reports Closed

                            - - - - diff --git a/org.eclipse.debug.core/r2_1_buildnotes_platform-debug.html b/org.eclipse.debug.core/r2_1_buildnotes_platform-debug.html deleted file mode 100644 index 3e0da8ca6..000000000 --- a/org.eclipse.debug.core/r2_1_buildnotes_platform-debug.html +++ /dev/null @@ -1,410 +0,0 @@ - - - - - - - Platform Debug Release Notes - - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 25, 2003 -

                            -Problem Reports Fixed

                            -35459: "Run As ..." menu disabled
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 24, 2003 -

                            -Problem Reports Fixed

                            -35410: VariableView#fExpandedVariables is not always cleaned
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -March 17, 2003 -

                            -Problem Reports Fixed

                            -32335: Eclipse M5, launcher, arguments tab truncated
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -March 13, 2003 -

                            -Problem Reports Fixed

                            -34901: Typos(?)
                            -34899: Typos
                            -34554: console: locking during 6 second clear request on big contents
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -March 6, 2003 -

                            -Problem Reports Fixed

                            -33767: Step with filters label
                            -32335: Eclipse M5, launcher, arguments tab truncated
                            -33993: NPE in launch config getMemento
                            -33996: Making a shared favorite config does not appear in fav's
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -March 4, 2003 -

                            -Problem Reports Fixed

                            -32631: Problem with text input from console
                            -32668: Invalid thread access disposing process drop down menu
                            -32706: Can re-enable LCD when disabled for run in foreground
                            -32621: Console Pref page: punctuation and capitalization
                            -33289: Console: ShowProcess tooltip should use book capitilization
                            -29752: Removal of the "launchers" extension point
                            -31519: action set part associations
                            -33579: NPE in launch view event handler on shutdown
                            -33613: NPE in console line notifier
                            -32722: Attempting two background builds at same time: lose console document
                            -33620: NPE attempting to launch from a LCD with no selection area (Run Ant...)
                            -33153: Debug As and Run As actions are ignored if there is no selection
                            -33185: Activate workbench when breakpoint hit should be on by default
                            -32775: BadLocationException on file hyperlink from ant build
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Feb 20, 2003 -

                            -Problem Reports Fixed

                            -18665: Launch progress message bar is too short
                            -32191: LaunchManager added too late as resource changed listener
                            -31431: Show In...from the Console to the Debug View
                            -32247: Missing hashCode in org.eclipse.debug.internal.core.LaunchConfigurationInfo
                            -32176: Hyperlink on wrapped line draws line badly
                            -32275: Debug console selection shows the wrong information
                            -30513: Step actions should be disabled when debug view closed
                            -31161: Dialogs don't use standard platform spacing for buttons
                            -31216: Offer Show In...
                            -31734: Console line trackers not notified of last line
                            -11991: Renamed config not updated in history
                            -31745: No feedback for navigating links in console using keyboard
                            -30586: NPE opening editor in LaunchView
                            -32433: ShowProcessAction reference to its process keeps hyperlinks in memory
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Feb 18, 2003 -

                            -Problem Reports Fixed

                            -31565: Selecting part of stack trace in console loses focus
                            -29326: Launch configuration with errors can be launched
                            -29045: StringIndexOutOfBoundsException from Console
                            -31394: New console UI does not provide a "Clear History" option
                            -31898: Error in the status bar without any text selected in the console
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Feb 13, 2003 -

                            -Problem Reports Fixed

                            -30901: Dialog flicker when launching a program
                            -31500: Double click for create a new launch configuration
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Feb 11, 2003 -

                            -Problem Reports Fixed

                            -31321: disable/enable breakpoints does not scale
                            -31502: Refactor LaunchHistoryPreferenceTab
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Feb 5, 2003 -

                            -Problem Reports Fixed

                            -30411: Exceptions deleting Launch Configurations
                            -28148: Debug and Run toolbar actions missing mneumonics
                            -30493: No need for the verify key listener in the VariablesView
                            -22815: Support delete key in viewers
                            -30125: Provide inforpops for launch configuration types
                            -30332: Not enough IDisconnect support
                            -28827: Run Screen Sizing
                            -30167: Would like a way to navigate back from debugger to corresponding launch config
                            -30333: Problem when multiple debug events occur at the same time
                            -30831: Console View: Terminate and Clear are too close
                            -29503: Debug preference page error messaging
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Jan 28, 2003 -

                            -Problem Reports Fixed

                            -29877: Chkpii errors in debug
                            -28295: ConcurrentModificationException during "Run Ant..." build
                            -18306: Use safe runnables for listeners and "untrusted" code
                            -30037: Use platform support for breakpoint persistence
                            -29843: tooltip of the debug and run buttons displays "Debu&g" and "Ru&n"
                            -30307: Apparent mispelled catalog reference in Expressions pane
                            -30222: External tool builder build command path is fully qualified
                            -30324: NPE restoring shared launch config
                            -29112: Add key binding to "open link" action in console
                            -30180: Stale launch if runtime-workbench launch is canceled
                            -29028: Stack trace hyperlink does not work after clear
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Jan 21, 2003 -

                            -Problem Reports Fixed

                            -24154: Add interfaces to debug core for enhanced debug function...
                            -27782: Improve Debug UI plug-in startup
                            -29660: Only top stack frame icon correct after long step
                            -29676: Better error reporting when a launch config goes missing
                            -29720: launch dialog for edit/run of a single config
                            -26157: launch config working sets applied globally
                            -27989: Provide 'final verification' launch configuration API
                            -29450: LaunchManager.searchForFiles optimization
                            -24821: [Key Bindings] Provide debug action definitions
                            -29153: Migrate extension point schema ownership
                            - -

                            -Eclipse Platform Build Notes 
                            -Java Debug

                            -Jan 14, 2003 -

                            -Problem Reports Fixed

                            -28969: convenience action to open LCD
                            -27342: No busy cursor when creating new config
                            -25569: Checkbox in launch config doesn't keep its value
                            -27164: shared launch configs and "validate edit"
                            -29064: Attached source not recognized
                            -27830: Use IActionDelegate2
                            -28033: external tools dialog title shows as "&External Tools"
                            -27403: Should consider using the new font propogation support
                            -27444: [Dialogs] Dialog font should be used by debug components
                            -22927: Add word-wrap option to Variables display area
                            -28127: NPE if AbstractDebugView handling exception early
                            -22230: #setButtonLayoutData addition
                            -24754: Preferences - should offer font choice for variable details pane
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Jan 07, 2003 -

                            -Problem Reports Fixed

                            -28386: Source selection disappears
                            -28571: Text selection updates on evaluation end
                            -10016: Flicker of System.err output in console
                            -28060: Launch#canTerminate
                            -24884: Launching progress monitor
                            -28562: details area does not update when BP hit while stepping
                            -7715: Console does not show output of selected process
                            -28867: [Console] Navigation between output of hosted/debugged apps
                            -27172: Hang copying variables with cycle
                            -29052: ConsolePreferencePage problem
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Dec 17, 2002 -

                            -Problem Reports Fixed

                            -28383: Debug view flashes during stepping
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Dec 16, 2002 - -

                            -Problem Reports Fixed

                            -28245: No launchAdded notification on first relaunch
                            -28282: Launch view doesn't select stack frame when it is made visible
                            -27011: NPE from LaunchConfigurationTabGroupViewer
                            -28317: NPE exiting workbench
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Dec 13, 2002 - -

                            -Problem Reports Fixed

                            -28050: Extra separator if no history, only favorites.
                            -27881: Remote Debug Connection Configuration
                            -28088: Console view caused NPE when "becomesVisible"
                            -27092: Only update variables/expressions when visible
                            -28227: NPE painting console document
                            -28100: Re-factor "isVisible" debug view function
                            -25437: Console Performance when output alternates between streams
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Dec 10, 2002 - -

                            -Problem Reports Fixed

                            -27139: Common tab has duplicate accelerator
                            -23216: Shared launches marked as favorites do not show up after importing existing project
                            -23951: Flicker when closing launch config dialog
                            -26333: Improve launch manager startup
                            -24715: Launch dialog open return codes are internal
                            -14758: ILaunchConfigurationTab#performApply called twice on hitting the Apply button
                            -26335: Improve debug plug-in startup
                            -27834: LaunchHistory registers unnecessary listener
                            -27607: Better Ant project names
                            -26503: launch groups/dropdown should support shortcuts
                            -27877: Don't use a marker for stack frame line highlighting
                            -27816: Re-work launch actions to use launch group framework
                            -27952: hyperlink region should not be stored in hyperlink
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Dec 03, 2002 - -

                            -Problem Reports Fixed

                            -27353: ConsoleContentProvider -> ConsoleColorProvider
                            -27347: Process types
                            -27200: "Show console when program writes ..." doesn't work
                            -19674: LaunchConfigurationDialog is over 3,000 lines (whew!)
                            -27248: Launch config dialog is grotesquely large
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Nov 26, 2002 - -

                            -Problem Reports Fixed

                            -18814: Cannot 'save changes' and duplicate a Launch configuration at the same time
                            -25745: NPE if no tab group specified for a configuration type
                            -26996: get/setAttributes on ILaunchConfiguration/WorkingCopy
                            -26702: Allow single launch config to be edited
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Nov 12, 2002 - -

                            -Problem Reports Fixed

                            -25701: Instruction pointer disappears
                            -23477: Most recent launch config lost after each restart
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Nov 05, 2002 - -

                            -Problem Reports Fixed

                            -1524: Feature: Displaying Instruction pointer (1G3A7CG)
                            -14758: ILaunchConfigurationTab#performApply called twice on hitting the Apply button
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Oct 22, 2002 - -

                            -Problem Reports Fixed

                            -24738: Launch Config Dialog: Pressing cancel permanently diables 'Apply'
                            -16817: DebugException: The resource tree is locked for modifications.
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Oct 15, 2002 - -

                            -Problem Reports Fixed

                            -24364: Investigate opening launch config dialog from inside a delegate's launch() method
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Oct 8, 2002 - -

                            -Problem Reports Fixed

                            -24270: UI hangs when try to debug with 'bad' VM arguments
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Oct 1, 2002 -

                            -Problem Reports Fixed

                            -24100: LaunchConfigurationWorkingSetPage.setSelection should work without container being set
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Sept 17, 2002 -

                            -Problem Reports Fixed

                            -23124: Presentation of "no source"
                            -23266: NPE exception in VariablesViewContentProvider
                            -22595: No code assist in details pane
                            -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Aug 27, 2002 -

                            -Problem Reports Fixed

                            -22283: ArrayIndexOutOfBoundsException in launch view
                            -19856: Create a new launch configuration should always be an option in launch configuration wizard
                            -18877: Flicker in VariablesView when rapid stepping
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -August 06, 2002 -

                            -Problem Reports Fixed

                            -21585: Evaluating expression switches editors
                            -9687: Should have busy cursor opening editor
                            -21640: Show types action in Variables view is confused
                            -18787: Slightly off message in details pane of Expressions view
                            -15847: Disable Run / Debug buttons in toolbar if no contribution is associated with that mode
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 30, 2002 - -

                            -Problem Reports Fixed

                            -21504: Both "enable" and "disable" breakpoints actions are enabled when multiple breakpoints are selected
                            -20431: Run/debug include in favorites setting ineffective
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 16, 2002 - -

                            -Problem Reports Fixed

                            -19099: Console in different window keeps name of terminated and removed debug target
                            -20504: Launch view accelerator update workaround no longer needed
                            -20602: Potential NPE in AbstractDebugView when subclass does not persist state in memento
                            -20610: [Console] Terminate button disabled on Clear Console, even when app still running
                            -20713: 2 requests to change value of variable when enter pressed on invalid value.
                            - - - diff --git a/org.eclipse.debug.core/r3_0_buildnotes_platform-debug.html b/org.eclipse.debug.core/r3_0_buildnotes_platform-debug.html deleted file mode 100644 index fb29aedf4..000000000 --- a/org.eclipse.debug.core/r3_0_buildnotes_platform-debug.html +++ /dev/null @@ -1,994 +0,0 @@ - - - - - - - Platform Debug Release Notes - - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            3.0 - RC4

                            -

                            Problem Reports Fixed

                            -68181: [doc] Error in IDebugUIConstants javadoc (launchActionSet)
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            3.0 - RC3

                            -

                            Problem Reports Fixed

                            -61992: Slow selection change in debug view
                            -66586: Debug-related views no longer "come to front" in non-debug perspective
                            -66990: PopupInformationControl does not specify shell for handler
                            -66330: Remote Debug Connection not disconnected when JDIDebugModel.newDebugTarget(...) fails
                            -66443: Review LaunchView call to IEditorReference#getEditor(true)
                            -67522: Views don't open when auto-manage initially activated
                            -67463: Launch Shortcuts schema is incorrect
                            -67507: Ampersand ('&') in label when adding directory to source lookup path
                            -67620: Breakpoints should not be shown in the overview ruler
                            -65051: string_prompt variable prevents other variables from executing
                            -67781: color tuning
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            3.0 - RC2

                            -

                            Problem Reports Fixed

                            -64638: Don't use new "Run" icon on Debug objects
                            -45980: Check calls to IWorkspace.run(...)
                            -65067: switch perspective when breakpoint hit not honored
                            -57293: [doc] Beef up contextViewBinding schema
                            -66033: Move isAutoManageViews() to LaunchViewContextListener
                            -63340: Remove DebugContextManager
                            -65814: o.e.debug.core.memoryRenderings extension point
                            -65581: broken doc link for stringVariablePresentations
                            -65351: Breakpoint migration from 2.1 to 3.0
                            -64940: Delay on breakpoint rendering when enable/disable
                            -66187: Polish patch: support view activation via a keyboard shortcut
                            -65356: source lookup tab migration from 2.1 to 3.0
                            -65072: workbench not activated when breakpoint hit
                            -64984: Inspect doesn't work in Display View
                            -65039: Launch view should use IPerspectiveListener2
                            -64666: Run/Debug prompts to continue before compiling [JUnit]
                            -52336: [Viewers] Internal error at start of debug session
                            -62677: Adding working set to Source Lookup Tabs causes problems in the tab.
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            June 1, 2004

                            -

                            Problem Reports Fixed

                            -56012: Consistency in space at top of launch configuration tabs
                            -64188: Classcast exception when trying to resolve non-stackframe object
                            -63468: ConsoleView should set it's title using setContentDescription()
                            -64019: IllegalArgumentException when editing ant builder
                            -63449: Wrong menu path for profile action set.
                            -61117: enable checkbox state after "Show Breakpoints Supported by Selected Target"
                            -62322: Green triangle for Run is confused with the Resume button
                            -63951: Wrong window activated when new window is opened
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            May 25, 2004

                            -

                            Problem Reports Fixed

                            -63328: Move "show debug action set" to LaunchView
                            -63493: LaunchView keeps lots of state from last debug session in memory
                            -63016: Display view always brought to the top
                            -64337: unqualified source lookup fails in external archive
                            -62803: ExternalArchiveSourceContainer needs to handle multiple root paths
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            May 21, 2004

                            -

                            Problem Reports Fixed

                            -63348: NPE from popup
                            -63374: NPE in LaunchView.partClosed
                            -63575: Invalid button states in EnvironmentTab of Launch Configuration
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            May 20, 2004

                            -

                            Problem Reports Fixed

                            -62798: Ok to launch Yes/No should also honor cancel
                            -62960: NullPointerException when restoring default in Source Lookup Tab
                            -62677: Adding working set to Source Lookup Tabs causes problems in the tab.
                            -63009: Source Lookup Tab does not properly show icons for Jar files
                            -63182: Warning about error in pre-requisite wrong
                            -63090: Console scroll button has its logic reversed.
                            -63053: View Management view menu drop down has no mnemonic
                            -63249: uneccessary error logging
                            -63029: Show As for logical structure has no mnemonic
                            -62564: A runnable may not be run, if the previous one throws an exception
                            -54407: Make a pass on all the properties files
                            -62643: [External Tools] Quoted args send quote to process
                            -63027: View Management "Reset Now" button does not layed out correctly
                            -56042: [Coolbar] [Workbench] Toolbar flash selecting stack frames
                            -62592: Debug view can fail to close generic debugging views
                            -63050: NPE in VariablesViewContentProvider
                            -62574: Expose Debug view's "view tracking" behavior
                            -63293: Pressing "Reset Now/Cancel" does not cancel
                            -63256: NPE when adding a breakpoint in an external Java file
                            -62391: View management: Views opened in wrong perspective
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            May 18, 2004

                            -

                            Problem Reports Fixed

                            -57519: Console should bold title when new output is available
                            -53508: Activate debug action set with debug view
                            -61801: A null String object reference becomes the value "null"
                            -62069: NullPointerException in LaunchViewContextListener#initViewCollection
                            -61940: Customized perspective opens closed views
                            -61064: improve string variable descriptions
                            -61116: Common watch expressions don't work for wrapper adapters
                            -60024: Memory view code could make use of Debug plugin logging support
                            -61385: Remove debug action group doc
                            -47295: Hard to pin down a console
                            -62236: Debug color settings should NOT be shown in Workbench>Colors and Fonts
                            -61938: Add source location dialog always selects Java Classpath Variable
                            -62193: No RunToLine action in context menu
                            -62488: Default pref settings
                            -62490: out-of-box experience
                            -61412: Source lookup tab causes config to need saving
                            -44632: Debug view need to be error-proof
                            -61958: dangerous practice of catching Throwable
                            -60327: Review LaunchViewContextListener multi-window behavior
                            -56412: Duplicate favorites after rename
                            -61630: schema for external tools configurationDuplicationMaps ext point
                            -55400: context menu>watch from the variables view doesn't open/activate the expressions view
                            -62258: No vertical scroll bar on inspect results
                            -61826: Add file extension filtering for run/debug context menu
                            -51435: CommonSourceNotFoundEditor#resetEditor
                            -60016: Accessibility: Run config, Arguments tab: Working directory not read
                            -61868: Double tree viewer in debug view
                            -61917: use .exsd for extension pt schemas
                            -62202: Run context menu does not filter actions based on enabled activities
                            -62269: Uneccessary label computation
                            -61928: Launch Views leaking
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            May 11, 2004

                            -

                            Problem Reports Fixed

                            -54598: Launch configuration; wizard buttons New/Delete margins
                            -57637: turn Remove All Terminated Launches on by default
                            -60305: Layout problems on the Environment tab
                            -58384: Profile toolbar launch menu should use "Profile As >"
                            -51916: Add ability to change source lookup of a running launch
                            -58725: [Debug] "Switch to assciated perspective when launching" should set to "Prompt" by default
                            -60286: API Request: Ability to open launch configuration properties dialog on a specific tab
                            -60838: Support matchesContentType property test
                            -45656: New Annotation Features
                            -59319: make scroll lock global to all process consoles
                            -60927: notifyResult(...) in OpenLaunchDialogAction
                            -60952: Chkpii errors in I20040504
                            -60364: debug used deprecated runtime code
                            -61321: ui.console should not depend on core.resources
                            -60918: [KeyBindings] Some key bindings not working
                            -60974: make org.eclipse.debug.internal.ui.views.console.ProcessConsolePage.getConsoleViewer() method public
                            -61105: Configure view management per perspective
                            -60010: Auto manage view action move to view menu
                            -61221: No progress dialog when prompted to wait for build
                            -57763: NPE running from scrapbook
                            -61166: source not found
                            -61120: Should closed projects be skipped?
                            -55423: don't schedule build if already building
                            -41376: Incorrect english: doesn't account for case where launch config type starts with vowel
                            -53722: Run As... menu disabled if selection is empty
                            -61634: Compile errors in workspace message should be more general
                            -61336: Compile errors prompt should use a warning dialog
                            -61291: Breakpoint view is displayed when a breakpoint is hit
                            -57052: [KeyBindings] F11 (Debug Last Launched) Conflict on MacOS X
                            -46168: fork() methods should use jobs
                            -61427: LaunchConfigurationDialog leaked for each use
                            -54946: Contextual launch contribution should not set adaptable=true
                            -60051: Launching with Ant buildfile errors
                            -61308: Display var/expression shows in unreadable popup
                            -57333: Provide API to specify whether a substitution variable supports arguments
                            -57164: Context view activation should maintain view "stack"
                            -57588: Removing process from launch doesn't remove associated console
                            -61810: NPE in the log
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            May 4, 2004

                            -

                            Problem Reports Fixed

                            -60064: Memory preference page is missing mnemonic
                            -60254: Change required in AbstractMemoryRenderer
                            -56146: Memory View Contribution to Eclipse
                            -56827: NPE - ExpressionManager expects a delegate for all debug models
                            -57862: Ability to configure variables from variable selection dialog
                            -54726: Fix schema reference in launch shortcut extension
                            -51503: Add filter button to Expressions view to show expressions by debug target
                            -59776: Migrate memory view pref page to view setting
                            -60203: Launch job waiting forever
                            -60655: Memory Block is not enabled / disabled by the Memory View properly
                            -59986: Move from ProgressMonitorDialog to IProgressService.busyCursorWhile()
                            -57272: AlwaysNeverDialog should have "Eclipse standard" look
                            -60708: Edit String Substitution Variable dialog does not use the dialog font
                            -58933: Remove activity filtering in Breakpoints view
                            -59330: migrate to new search API
                            -59183: Cancelling foreground launch waits for build to complete
                            -59535: Opening launch configuration dialog with "profile" mode.
                            -59356: LaunchConfigurationDelegate needs a way to tell it per instance to not put up status prompts.
                            -60409: Use of deprecated fontDefinition extension point
                            -59854: Debug keybindings wrong on Mac
                            -59990: function keys not working
                            -58528: User prompted to switch to debug when debug perspective is active
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            April 27, 2004

                            -

                            Problem Reports Fixed

                            -58957: breakpoints : Remove BreakpointManagerListener on dispose
                            -57305: flashing breakpoints view
                            -57173: Activity filtering not working for debug
                            -58684: Installed JRE can't be named "."
                            -42138: Provide a way to dynamically change the process label shown in the console title and debug view
                            -47164: Need to be able to disable go to file action for breakpoints.
                            -57517: eval popup are initially too small
                            -57735: When including assert tags in private method, breakpoint can't be set
                            -59483: Predefine some launch conifiguration variables
                            -59042: Invalid Launch configurations are never cleaned up
                            -58725: [Debug] "Switch to assciated perspective when launching" should set to "Prompt" by default
                            -39024: Need better icon for object browsers action
                            -57999: Breakpoints added to view while breakpoint manager disabled are not greyed
                            -58516: HandlerSubmission constructor marked as deprecated
                            -58766: doc/enhance stratum breakpoint
                            -59002: Do we need marker definitions for instruction pointers
                            -57642: [ViewMgmt] debug tests failures due to missing selection
                            -57836: Support to put paths in variable values
                            -59729: Run-> context menu only enabled for a single selection
                            -56246: InstructionPointerAnnotation and IDebugEditorPresentation
                            -58209: Support multi-select for Resume action
                            -58377: 'Esc' out of change variable dialog doesn't cancel action
                            -58650: replace debugModelActivityBinding with pattern binding
                            -59828: Various issues with SelectedResourceManager
                            -7552: Keep breakpoints when renaming a resource
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            April 20, 2004

                            -

                            Problem Reports Fixed

                            -58290: Launch error message spelling
                            -56850: DebugViewDecoratingLabelProvider.computedText never cleared
                            -29890: Debug Platform Source Lookup Facilites
                            -45887: When selecting "Build before launching", the build is not specific to the project launched, but the whole workspace
                            -58754: Wait for build never and prompt preferences reversed
                            -55419: Generalize compilation error detection for other launchers
                            -56191: Skip breakpoints in run-to-line
                            -57306: Improve progress feedback when user wants to wait on build before a launch
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            April 13, 2004

                            -

                            Problem Reports Fixed

                            -57790: Support multiple debug-model-to-context extensions
                            -53222: Trigger activities when debug elements selected
                            -53640: Registers view
                            -57929: Scope step actions with debuging context
                            -58052: Launch view can open views in the wrong window
                            -57788: API changes to IHandler causing compile errors
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            April 6, 2004

                            -

                            Problem Reports Fixed

                            -56235: Organize Favorites dialog could remember size
                            -56266: Reorder preference choices for Save dirty editors
                            -56966: Skip All Breakpoints should have a keyboard shortcut
                            -30639: Debug preference pages cut of in High Contrast
                            -57328: NPE from ResourceResolver
                            -55685: Get rid of MoveResultToViewerAction
                            -55808: SelectedResourceManager holds onto selections too long
                            -56192: Remove unused command for close popup
                            -55612: Rename "Run" keybinding category to "Run/Debug"
                            -56035: Console text font should be moved to Workbench Appearance
                            -51901: Breakpoint image specification is on jdt.ui instead of debug.ui
                            -56214: ProjectSourceContainer#getSourceContainers() and referenced projects
                            -51084: Launch view should not track view open/close during perspective reset
                            -52524: Blocked launch dialog should offer cancel as an option
                            -56013: Remove the use of the deprecated shared icons
                            -56070: New and Delete buttons remained disabled after cancelling search
                            -53548: Automatically close views that were opened automatically
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            March 30, 2004

                            -

                            Problem Reports Fixed

                            -56677: AssertionFailed from LaunchConfigurationView
                            -56082: no junit test for LaunchConfigurationDelegate.preLaunchCheck()
                            -55309: Leak: RetargetWatchpointAction hangs onto last activated part
                            -56672: 'Marker id not found' error in breakpoint view during fast create/delete breakpoint actions
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            March 25, 2004

                            -

                            Problem Reports Fixed

                            -55704: Step into selection leads to too many breakpoints being skipped
                            -56238: Continue Launch when compile errors preference: Never
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            March 23, 2004

                            -

                            Problem Reports Fixed

                            -53677: Remove "debug popup" scope when dialogs support key bindings
                            -52613: [New Look] Duplicate debugger perspective opened while stopping at brk pt
                            -55124: Warning reported in the builds
                            -36495: Debugger support for roles and activities
                            -55040: Don't provide ILaunchListener2 API
                            -54925: want option to not run programs with errors
                            -54631: debug view opens while prompting for perspective change
                            -6400: DCR - suggestion to improve running vs. debugging
                            -55183: Preference to switch perspective on suspend is too eager
                            -55442: ClassCastException in LaunchViewEventHandler
                            -55194: "String" problems with the DebugPreferencePage
                            -55430: "[KeyBindings] Migrate Popup keybinding support to new EnabledSubmission API
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            March 16, 2004

                            -

                            Problem Reports Fixed

                            -50156: Disable "Use Step Filters" toggle for targets that do not support step filters
                            -54189: Disable "Use ToggleAutoManageViewsActionDelegate is missing required id
                            -37485: Icons for launch short-cuts should be optional
                            -44234: Type names always qualified in expressions view
                            -53223: Expression popup should also show toString()/details
                            -54073: Chkpii warnings in plugin.xml files
                            -10302: 'Run to Line' stops at breakpoints
                            -52809: Evaluating in debugger should not stop on breakpoint
                            -38950: Display offset of cursor in variables detail pane
                            -10078: Feature: Global enable/disable of breakpoints (and leave breakpoints list untouched)
                            -54182: Two prompts when starting a debug session
                            -44632: Debug view need to be error-proof
                            -12746: refactoring support for launch configurations
                            -52017: Add createCheckButton API to AbstractLaunchConfigurationTab
                            -34345: Disabled watch expression label includes "obsolete"
                            -53001: Need a separator between 'Include type inheriting ...' and 'stop in main' in the main Java launch configuration tab
                            -54859: Breakpoint are not set as non-registered when deleted from the breakpoint view
                            -54117: Contextual Launch should use XML Expression Language
                            -52952: show all env vars when replacing environment
                            -48933: Move to use the Platform UI color support
                            -50384: Debugger perspective: default layout improvements
                            -37514: global retargettable breakpoint action
                            -52450: Don't open Expression View by default
                            -51402: [Generic console] need showConsoleView() method
                            -51935: Add UI support for variables when specifying environment variable values
                            -54065: Tooltip text for profile button in toolbar is wrong
                            -54901: Better error logging when launch configuration blows up
                            -51568: Numerated accelerators for launch shorts in context menu
                            -54924: Variable selection dialog needs mneumonic for Variable Desc
                            -54619: Doc for breakpoint manager enablement
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            March 9, 2004

                            -

                            Problem Reports Fixed

                            -14414: Use detail pane for variable value setting
                            -53636: Label changes after display/inspect popup is visible
                            -53665: NPE with "double click"
                            -48313: Message console does not support tab size
                            -52964: Persist size of debug pop-ups (or size better)
                            -53470: launch waiting for build shows up in context menu
                            -53693: Variables view doesn't show variables.
                            -51787: Stepping in Java Perspective
                            -53554: Default perspective switching preferences are backwards
                            -53954: "Change variable value" action.
                            -50886: Update debug markerAnnotationSpecification
                            -44135: ability to prompt for arguments in run/debug profiles
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            March 2, 2004

                            -

                            Problem Reports Fixed

                            -52607: console: no action when drop down is pressed
                            -51387: API for retreiving console associated with a process
                            -52867: New look - console no longer has a view title
                            -53225: Display keybinding for default close action in debug popup
                            -51386: Variables view does not persist size of details area
                            -13933: Terminating launch does not send launchChanged event
                            -53313: StringIndexOutOfBoundsException from LaunchConfiguration
                            -52330: Logical Structure should have a single value
                            -52974: NPE in launch dialog when creating a new config
                            -53409: Launch view doesn't persist "views to not close"
                            -49887: Expose the exit value of IProcess
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Feb 24, 2004

                            -

                            Problem Reports Fixed

                            -29953: Launch configuration not found, many stacktraces in the .log
                            -13449: Better description when launch configuration type is selected
                            -52397: NPE from AddFavoritesAction and others when rename launch config
                            -52763: Edit String Substitution Variable dialog clears value on name change
                            -52170: Improve debug context inheritance
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Feb 17, 2004

                            -

                            Problem Reports Fixed

                            -51998: Bad label for a menu item
                            -51465: Variable subranges
                            -51635: Debug view is not brought to the front when a breakpoint is hit
                            -37942: Launch config dialog should have some way to determine the full location of JARs that are listed on the classpath
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Feb 12, 2004

                            -

                            Problem Reports Fixed

                            -51803: ClassCastException importing preferences
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Feb 10, 2004

                            -

                            Problem Reports Fixed

                            -18338: Run/Debug in the context menu
                            -51388: Show "Selection Not Applicable"
                            -51422: NPE on hitting breakpoint
                            -49934: Promote views with debugging contexts
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Feb 3, 2004

                            -

                            Problem Reports Fixed

                            -50155: New Job#schedule() behavior
                            -50203: Exception in error log + blank rendered in sessions view
                            -50543: Cannot override PATH environment variable
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Jan 27, 2004

                            -

                            Problem Reports Fixed

                            -49972: Nothing happens when launching
                            -50232: Missing localizations for extension point names
                            -49891: Problems launching a program, when using linked resources in CLASSPATH, which are not set
                            -50407: NPE in selected text resolver
                            -50223: Missing localizations for extension point names
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Jan 20, 2004

                            -

                            Problem Reports Fixed

                            -46781: Console buffer size limit
                            -46869: Message console does not buffer output
                            -49288: Set Variable dialog not sized properly or resizable.
                            -47601: external tools: add ${selection} as a variable
                            -48320: Adapt to annotation deprecations
                            -49977: Less invasive background labels
                            -41510: Step with Filters: unify function across languages by allowing filters to be enabled/disabled on the 3 basic step functions
                            -50232: Missing localizations for extension point names
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Jan 13, 2004

                            -

                            Problem Reports Fixed

                            -45603: Cycles in string substitutions
                            -46363: Lazy label provider for variables view
                            -49884: ProcessConsolePage does not deregister hyperlink action
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Dec 15, 2003

                            -

                            Problem Reports Fixed

                            -48608: Handle null for IProcess#getStreamsProxy()
                            -46868: Changing text color via a MessageStream doesn't update colors
                            -46797: Possible NPE when writing launch configurations
                            -48226: Tooltip text for "External Tools" toolbar button not updated.
                            -47668: Exclude exception location
                            -37506: RefreshTab makes use of WorkbenchPlugin
                            -45991: need package.html in "variables" plug-in
                            -47848: IDebugEditorPresentation methods called in different order
                            -47855: Review VariableViewToggleAction
                            -48224: Target execution order hidden
                            -47268: Selected launch configuration incorrect
                            -48190: Variables context menu actions need eclipses [...]
                            -40541: NPE in launch configuration dialog
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Dec 9, 2003

                            -

                            Problem Reports Fixed

                            -37918: Console uses Date format that is not appropriate for Japanese
                            -47949: Nothing added to launch history
                            -47924: Thread label flicker
                            -47834: No feedback that launch got queued/postponed
                            -47377: Console: order of local toolbar items should remain stable
                            -42272: Resize problem in Launch Config dialog
                            -41609: invalid tab size (rendering) in console
                            -48315: LaunchView thread timer runs too long
                            -47389: Use of deprecated API from IActivityManager
                            -38419: Variable "filters" is a misnomer
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Dec 2, 2003

                            -

                            Problem Reports Fixed

                            -47478: Switching to use JRE Library container
                            -47107: Open Resource not available in Debug perspective
                            -45981: Move debug projects to use PDE dynamic classpath support
                            -46811: Deadlock saving working copied
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 25, 2003

                            -

                            Problem Reports Fixed

                            -47248: NPE starting run-time workspace
                            -38979: Should not be able to remove contributed variables
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 21, 2003

                            -

                            Problem Reports Fixed

                            -47100: TitleAreaDialog image has been disposed
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 20, 2003

                            -

                            Problem Reports Fixed

                            -47071: Set instruction point layer to 6 in code
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 19, 2003

                            -

                            Problem Reports Fixed

                            -46858: FileLink needs to resolve an editorId
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 18, 2003

                            -

                            Problem Reports Fixed

                            -45524: Artwork for array partitions
                            -46728: org.eclipse.ui.console should be tagged as 3.0 plug-in
                            -44479: Exception when trying to start RuntimeWorkbench while workspace is building
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 11, 2003

                            -

                            Problem Reports Fixed

                            -43388: Possible problem with DebugPlugin$AsynchJob
                            -36942: [plan item] Present logical view of Java objects in debugger
                            -45903: Breakpoint incorrectly enabled after activity filtering
                            -43387: Refresh tab and specific resources
                            -44566: Refresh tab does not enable "Apply" when changing selection
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Nov 4, 2003

                            -

                            Problem Reports Fixed

                            -45849: ConcurrentModificationException in Expression manager
                            -43332: String Substitution Support - org.eclipse.core.variables
                            -43952: Improve launch tab interface/notification
                            -44100: UI blocked removing breakpoints from breakpoints view with other jobs
                            -46152: Revise usage of IWorkspace.run
                            -46035: NPE in Run... pages
                            -45858: User gets prompted multiple times to save the same resources
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Oct 28, 2003

                            -

                            Problem Reports Fixed

                            -43388: Possible problem with DebugPlugin$AsynchJob
                            -45195: Debug View: Copy Stack only copies
                            -44856: errors in label update
                            -44723: Redundant launching job message
                            -36735: Would like automatic partitioning of large arrays
                            -44099: organize favorites...
                            -44577: Suspended debug target not given "suspended" overlay
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Oct 21, 2003

                            -

                            Problem Reports Fixed

                            -44934: Remove dependancies on Xerces plugin
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Oct 15, 2003

                            -

                            Problem Reports Fixed

                            -44660: MessageConsole.appendToDocument(...)
                            -44040: IConsoleLineTrackerExtension and after consoleClosed
                            -44012: missing closed notification for console line tracker
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Oct 07, 2003

                            -

                            Problem Reports Fixed

                            -40609: Launch configuration dialog re-initializes all of the tabs on close
                            -43226: Deadlock using 0916
                            -44048: Cannot create New String Substitutions
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Sep 30, 2003

                            -

                            API Changes

                            -
                              -
                            • Support for variables that support string substitution has been changed. - The previously experimental extension points for simpleLaunchVariables, contextLaunchVariables, - and refreshLaunchVariables have been replaced with new (and yet experimental) - extension points valueVariables and contextVariables. The new support is purely - string based and is currently implemented in internal packages. It is percieved - that the new support could be moved to a new plug-in such that more clients - could leverage the support, as the current implementation is not tied to the - debug plug-in.
                            • -
                            • A console line tracker (IConsoleLineTracker) can be notified when its associated - console is closed (i.e. all of its streams are closed), by implementing the - new interface IConsoleLineTrackerExtension. The notification indicates that - no more output will be appended to the console.
                            • -
                            - -

                            Problem Reports Fixed

                            -31734: Console line trackers not notified of last line
                            -43608: NPE removing an existing program in the external tools launching configuration
                            -43477: Console plug-in needs package.html
                            -43704: LaunchConfiguration.getFile does not handle linked resources: NPE
                            -41579: Move selection to next suspended thread after resuming
                            -43197: Race condition between console line tracker and debug terminate event
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Sep 23, 2003

                            -

                            Problem Reports Fixed

                            -43225: No prompt to save dirty editors
                            -43353: Environment variable names all lowercased when appending to native environment
                            -43331: Rework Refresh Tab to avoid use of "refresh variables"
                            -43334: Refresh Tab always needs "apply" when working set specified
                            -33866: Move to using the PDE generated build.xml for exporting plugins
                            -37263: Support for generic console
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Sep 16, 2003

                            -

                            Problem Reports Fixed

                            -42570: Promote RuntimeProcess to API
                            -42779: Duplicate entry in expression view
                            -42814: Ability of "override" environment
                            -42877: Clean up Launch in Background / Run in Background
                            -19292: Icons for enable/disable breakpoints very confusing
                            -37091: Need icon for environment tab and variables
                            -10668: Variable view - should reselect selected variable name
                            -42177: Installed JRE's preference page is huge
                            -40863: Env var usability
                            -37784: Rename "Debug" preference page to "Run/Debug"
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Sep 09, 2003

                            -

                            Problem Reports Fixed

                            -42020: Move "Run in background" to builders only
                            -41866: Reference to IConsoleDocumentContentProvider in error message
                            -42179: Reevaluate watch expression enabled with no active targets
                            -41633: ILaunchManager#getLaunchConfigurations returns private configs
                            -41352: Incorrect lineAppended notification from ConsoleLineNotifier
                            -1562: Suspending on a breakpoint...select that breakpoint (1GD5P0D)
                            -42184: Edit->Find action for the console is only enabled after some text is selected
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Sep 2, 2003

                            -

                            Problem Reports Fixed

                            -41758: "Profile Last Launched" menu item is at the bottom, should be at the top
                            -42218: LAUNCH_CONFIGURATION_DIALOG_LAUNCH_LAST no longer used
                            -41947: LaunchConfigurationDialog and cancellation
                            -42064: "New Launch Variable" and "Edit Launch Variable" dialogs do not use dialog font
                            -42189: NPE during shutdown
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -

                            Aug 27, 2003

                            -

                            New Features in Milestone 3 (release 3.0)

                            -

                            Extensible Watch Expressions

                            -

                            In release 3.0, the debug platform provides an implementation of watch expressions. - Debug models can contribute watch expression delegates if they support watch - expressions. When a stack frame is selected, the associated delegate is queried - to provide a value for a watch expression in the given (stack frame) context. - The debug platform provides persistence, enabling, disabling, entering, and - editing of watch expressions. See the new extension point org.eclipse.debug.core.watchExpressionDelegates - for more details.

                            -

                            API Changes

                            -

                            Launch Tabs & Tab Groups

                            -

                            Launch tab groups and launch tabs are no longer notified when a launch completes. - The method launched(ILaunch) in the interfaces ILaunchConfigurationTab - and ILaunchConfigurationTabGroup has been deprecated and is no - longer called. Relying on this method for launch function was always problematic, - since tabs only exist when launching is performed from the launch dialog. Also, - with the introduction of background launching, this method can no longer be - called, as the launch dialog is be closed before the resulting launch object - exists.

                            -

                            Problem Reports Fixed

                            -41675: breakpoints no longer visible in overview ruler
                            -38842: Make enabling and disabling expressions part of the debug framework.
                            -27493: Re-use "watch list" actions
                            -41940: watch item not updated when enabled
                            -41941: API method should be internal
                            -41550: launch in the background
                            -41977: watch items will not disappear
                            -42013: Launching should not be UIJob
                            -42037: Breakpoint not shown as checked when enabled.
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Aug 19, 2003 -

                            Problem Reports Fixed

                            -41499: Update doc for watchExpressionDelegates extension point
                            -41448: launch shortcuts should be sorted
                            -41506: NPE attempting to create watch expression
                            -27281: The watch expressions don't persist across workbench invocations
                            -41575: Can't open breakpoint view
                            -41585: shared launch configurations are not being encoded with UTF-8
                            -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Aug 12, 2003 -

                            Problem Reports Fixed

                            -41290: Typo: "persepctive" in launch configurations window
                            -41276: Clarify ILaunchConfiguration#getLocation()
                            -41384: Chkpii errors in debug
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Aug 5, 2003 -

                            Problem Reports Fixed

                            -40964: Got DebugException when stepping and removing a breakpoint
                            -38365: current instruction pointer annotation only added for ITextEditor
                            -40961: Refresh tab indicates working set error when no refresh
                            -40962: Refresh tab revert enabled incorrectly
                            -19581: Single launch config error logged many time
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 29, 2003 -

                            Problem Reports Fixed

                            -40576: NPE with pinned console
                            -40844: NPE using debug
                            -35453: Process output causes switch to wrong console view.
                            -35573: Console output on new run or debug
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 22, 2003 -

                            Problem Reports Fixed

                            -40235: preference page 'launch variables' uses borderless table, which looks suboptimal
                            -40275: Superfluous semicolons in the generated jdt eval tests
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 15, 2003 -

                            New Features in Milestone 2 (release 3.0)

                            -

                            Extensible Debug Events

                            -

                            The debug platform supports an extensible set of debug events. A debug event - kind of MODEL_SPECIFIC has been added in the 3.0 release to indicate - an application specific debug event. When a debug event of kind MODEL_SPECIFIC - is created, the detail code in the event is client defined. The source of the - event (debug element that generated the event) identifies the debug model from - which the event was generated. The debug platform and user interface ignores - model specific debug events.

                            -

                            A data field has been added to debug events to allow clients to store application - specific data in debug events.

                            -

                            Extensible Instruction Pointer Images

                            -

                            When a stack frame is selected in the debug view, the debugger opens a corresponding - editor and displays an image in the editor ruler on the line that corresponds - to the selected stack frame. In releases prior to 3.0, the images were provided - by the debug plug-in and could not be overridden by a debug model. In release - 3.0, a debug model presentation (IDebugModelPresentation) can provide - specialized images by implementing the debug editor presentation interface (IDebugEditorPresentation).

                            -

                            Editor Positioning and Custom Decorations

                            -

                            In release 3.0, debug model presentations can control the positioning of editors - opened by the debugger for a stack frame, and may add extra decorations to the - editor for a stack frame (for example, custom background coloring, etc.). This - can be acheived by having a debug model presentation implement the new interface - IDebugEditorPresentation, and implementing the appropriate methods - - selectAndReveal, decorateEditor, and removeDecorations.

                            -

                            Problem Reports Fixed

                            -33598: Need to dynamically set icon for current line
                            -38976: Cancelling on launch var pref page does not work
                            -38980: var descriptions not persisted.
                            -37793: When moving folders and/or files in the navigator window UI hangs
                            -36147: Launch framework doesn't handle out of sync launch files
                            -37092: Environment tab variables should be sorted
                            -38534: Duplicate environment variables
                            -39979: Edit button should be disabled for multiselect
                            -36597: Would like to say what text attributes to use when selecting the executing statement
                            -35208: IAE in JavaMainTab when entering project name with path seperator
                            -39980: Selection of launch variables in the Launch Variable pref page
                            -38324: Double dialog for launch variable is unnecessary
                            -40122: NPE in TextEditorSelection.remove
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 9, 2003 -

                            -Problem Reports Fixed

                            -39058: Would like "collapse all" action in variable view
                            -38577: Setting detail pane to be visible can hide selected variable
                            -39482: NPE adding Java Watch expressions
                            -39709: Duplicated entries in the debugger
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 1, 2003 -

                            -Problem Reports Fixed

                            -38584: Book Capitilization for the tooltip for Toggle Variable Filters
                            -38508: [Dialog] [Font] Remote Java Application/Connect Page
                            -38302: An IProcess that returns null for getStreamsProxy generates 2 null pointer exceptions
                            -39397: Consolidate variables & general debug preference page
                            -39208: Context menu "Copy" should show Icon from ISharedImages [Console]
                            -39344: Convert ProcessMonitor to be a Job
                            -39258: Launch Configuration dialog: Screen cheese when switching between nodes
                            -39394: Extensible debug events
                            -23432: Some exceptions should not be logged.
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 17, 2003 -

                            -Problem Reports Fixed

                            -38676: can't debug into class if file/class name identifier has _$$_
                            -38722: Need restoration of preference store for those actions that are enabled only
                            -38532: Variables view orientation actions should more closely mimic the type hierarchy
                            -22941: Details area orientation
                            -37241: Support for core variables
                            -38837: CHKPII errors with launch variables
                            -38972: variable values only persisted when added/removed
                            -38967: simple launch variables & lazy init of plug-in
                            -38725: Debug context variables missing descriptions
                            -38727: IVariableComponent#setEnabled(boolean)
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 10, 2003 -

                            -Problem Reports Fixed

                            -38671: NPE from LaunchVariableManager
                            -38649: Plugin.xml and schema validation
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 5, 2003 -

                            -Problem Reports Fixed

                            -38423: NPE during creation of varibles view
                            -38529: UI locks up toggline on the variable filters
                            -38420: Details pane does not populate when first opened
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -June 3, 2003 - -

                            Extensible Launch Modes

                            -

                            The debug platform supports an extensible set of launch modes. Releases prior - to 3.0 only supported two launch modes - run and debug. The debug platform now - provides an extension point for contributing new launch modes - org.eclipse.debug.core.launchModes. - The debug platform now defines (contributes) three basic launch modes - run, - debug, and profile. Other clients may contribute new launch modes. The launch - manager (ILaunchManager) has additional API to retrieve all launch - modes, and a human readable label for each launch mode.

                            -

                            The debug platform has a new extension point to support the contribution of - a launch delegate for a specific launch configuration type and launch mode - - org.eclipse.debug.core.launchDelegates. This allows launch configurations - to be extended by third parties, to support new launch modes. For example, a - client could contribute a launch delegate that launches a Java Application in - profile mode (currently, the SDK does not provide a profiler).

                            -

                            The debug platform has added an optional element (launchMode), - to the definition of a launch tab group extension - (org.eclipse.debug.ui.launchConfigurationTabGroup), - to support the contribution of a set of tabs for a specific launch configuration - type and launch mode. This allows third parties to extend an existing lauch - configuration user interface. For example, a client contributing a launch delegate - to profile a Java Application would also contribute a set of tabs to configure - the profiler. The launchMode element defines a perpsective attribute to specify - the default perspective associated with the launch configuration type and mode. - This controls the perspective that is switched to/opened, by default, when a - configuration is launched in the associated mode. For example, a client contributing - a profiler may also contribute a profiling perspective that should be displayed - when an application is profiled.

                            - -

                            -Problem Reports Fixed

                            -38083: [Viewers] Debug exception when double-clicking on hashtable
                            -38249: NPE trying to create project builder
                            -37141: Common tab icon should not be a bug
                            -38283: Remove the setting of the target perspective on working copies
                            -38102: [Debug] [Preferences] Launch Variables Page; Table Columns truncated
                            -38330: No double click to edit for launch variable
                            -38325: Launch variable not removed from table on remove
                            -38336: Support delete key in launch variable table
                            -38328: Launch variable table needs to be sorted alphabetically
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 27, 2003 -

                            -Problem Reports Fixed

                            -38070: AbstractLaunchConfigurationTabGroup#launched() javadoc typo
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 06, 2003 -

                            -Problem Reports Fixed

                            -37090: Apply/Revert incorrectly enabled for Environment tab
                            -36930: Support variables in launch configurations
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 29, 2003 -

                            -Problem Reports Fixed

                            -27243: Environment for external tools
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 22, 2003 -

                            -Problem Reports Fixed

                            -35740: Disable edit launch config popup action for private launch
                            -36390: Doc error in schema for consoleColorProviders and consoleLineTrackers
                            -36152: Workbench Help set on wrong Composite
                            -36035: Request a variant on DebugPlugin.exec that takes an environment pointer
                            -36409: TODO marker for help context for OpenLaunchDialogAction
                            -27444: [Dialogs] Dialog font should be used by debug components
                            - - - diff --git a/org.eclipse.debug.core/r3_0_changes.html b/org.eclipse.debug.core/r3_0_changes.html deleted file mode 100644 index 1e584cbbe..000000000 --- a/org.eclipse.debug.core/r3_0_changes.html +++ /dev/null @@ -1,260 +0,0 @@ - - -3.0 Debug Platform Change Notes - - - - -

                            3.0 Debug Platform Change Notes

                            -

                            This document describes important changes in the 3.0 debug platform, relative - to the 2.1 release.

                            - -

                            New Features

                            - -

                            Extensible Launch Modes

                            -

                            The debug platform supports an extensible set of launch modes. Releases prior - to 3.0 only supported two launch modes - run and debug. The debug platform now - provides an extension point for contributing new launch modes - org.eclipse.debug.core.launchModes. - The debug platform now defines (contributes) three basic launch modes - run, - debug, and profile. Other clients may contribute new launch modes. The launch - manager (ILaunchManager) has additional API to retrieve all launch - modes, and a human readable label for each launch mode.

                            -

                            The debug platform has a new extension point to support the contribution of - a launch delegate for a specific launch configuration type and launch mode - - org.eclipse.debug.core.launchDelegates. This allows launch configurations - to be extended by third parties, to support new launch modes. For example, a - client could contribute a launch delegate that launches a Java Application in - profile mode (currently, the SDK does not provide a profiler).

                            -

                            For backwards compatibility, the launch delegate supplied by a launch configuration - type extension is used for the launch modes specified by the launch configuration - type. A launch delegate supplied for a specific mode, is used only for that - mode.

                            -

                            The debug platform has added an optional element (launchMode), - to the definition of a launch tab group extension - (org.eclipse.debug.ui.launchConfigurationTabGroup), - to support the contribution of a set of tabs for a specific launch configuration - type and launch mode. This allows third parties to extend an existing launch - configuration user interface. For example, a client contributing a launch delegate - to profile a Java Application would also contribute a set of tabs to configure - the profiler. The launchMode element defines a perspective - attribute to specify the default perspective associated with the launch configuration - type and mode. This controls the perspective that is switched to/opened, by - default, when a configuration is launched in the associated mode. For example, - a client contributing a profiler may also contribute a profiling perspective - that should be displayed when an application is profiled.

                            -

                            For backwards compatibility, the tab group contributed for a launch configuration - type (specifying no launch mode), is used for all launch modes for which a specific - launch tab group is not contributed. Thus, when a mode is not specified by a - tab group, the tab group effectively becomes the default tab group.

                            - -

                            Extensible Debug Events

                            -

                            The debug platform supports an extensible set of debug events. A debug event - kind of MODEL_SPECIFIC has been added in the 3.0 release to indicate - an application specific debug event. When a debug event of kind MODEL_SPECIFIC - is created, the detail code in the event is client defined. The source of the - event (debug element that generated the event) identifies the debug model from - which the event was generated. The debug platform and user interface ignores - model specific debug events.

                            -

                            A data field has been added to debug events to allow clients to store application - specific data in debug events.

                            - -

                            Editor Positioning and Custom Annotations

                            -

                            In release 3.0, a debug model presentation can position and annotate editors - opened by the debugger for stack frames. This is done by implementing the new - interface IDebugEditorPresentation on the applicable debug model - presentation. When implemented, the model presentation is used as a delegate - to position editors, add annotations, and remove annotations for stack frames.

                            - -

                            Extensible Watch Expressions

                            -

                            In release 3.0, the debug platform provides an implementation of watch expressions. - Debug models can contribute watch expression delegates if they support watch - expressions. When a stack frame is selected, the associated delegate is queried - to provide a value for a watch expression in the given (stack frame) context. - The debug platform provides persistence, enabling, disabling, entering, and - editing of watch expressions.

                            - -

                            Process Factories

                            -

                            The debug platform provides an extension point (org.eclipse.debug.core.processFactories) - for contributing process factories. A process factory can be used to override - default process creation for a launch configuration when the debug plug-in (i.e. - org.eclipse.debug.core.DebugPlugin) is consulted to create a new process. - A launch configuration can reference a process factory to use when creating - a process, via the launch configuration attribute DebugPlugin.ATTR_PROCESS_FACTORY_ID.

                            - -

                            Automatic Array Partitioning

                            -

                            The debug plug-in now supports automatic array partitioning in the variables, - which partitions large arrays into sub-ranges in the variables view. This is - supported with the introduction of a new interface in the debug model representing - an indexed value - org.eclipse.core.debug.model.IIndexedValue. - If a value implements this interface, the variables view will automatically - partition its elements as required, into sub-ranges

                            - -

                            Logical Structure Types

                            -

                            Often, it is convenient to navigate complex data structures in terms of a logical - structure, rather than an implementation structure. For example, no matter how - a list is implemented (i.e. linked list, collection of arrays, etc.), it is - often convenient to be able to view the list as an ordered collection. To facilitate - the display of logical structures in the variables view, an extension point - has been added (org.eclipse.debug.core.logicalStructureTypes) allowing - debug models to contribute logical structures of its values, where applicable. - Debug models may contribute delegates to translate raw implementation values - into logical values. The variables view will display the logical values, when - the option to display logical structures is turned on. More than one logical - structure can be provided for a single value - the user can choose which structure - to display.

                            - -

                            Step Filters

                            -

                            To support step filters on all stepping functions (into, over, return), a new - interface has been added to the debug platform - IStepFilters - - which can be implemented by debug targets. This interface replaces IFilteredStep, - which is now deprecated. The debugger provides a global toggle that turns step - filters on/off for all stepping functions. Toggle actions are provided in the - Run menu, Debug View context menu, and Debug View toolbar, which replaces the - 'Step with Filters' action in previous releases. As well, an API is provided - on DebugUITools to modify step filter enablement. It is up to debug - targets to implement this new interface and to honor the step filter enablement - setting when stepping. See javadoc for IStepFilters for more details.

                            -

                            This change maintains binary compatibility with previous releases. However, - targets wishing to leverage the new function must implement the new interface.

                            - -

                            Launch Termination Notification

                            -

                            A new interface has been introduced to provide a mechanism for launch listeners - to be notified when a launch terminates. A launch is simply a container of processes - and debug targets. When all of the contained targets and processes terminate, - a terminate notification is now sent to those listeners that implement - ILaunchesListener2.

                            - - -

                            Launch Delegate Enhancements

                            -

                            Lanuch delegates can optionally implement the new interface ILaunchConfigurationDelegate2. - This allows launch delegates to provide a launch object to be used for a launch. - For example, when debugging on a server a delegate could create a new launch - object or may reuse an existing launch object if the server is already running - in debug mode.

                            - -

                            Retargettable Actions

                            -

                            The debug platform now provides retargettable actions for the following actions.

                            -
                              -
                            • Run to Line
                            • -
                            • Toggle Line Breakpoint
                            • -
                            • Toggle Method Breakpoint
                            • -
                            • Toggle Watchpoint
                            • -
                            -

                            Debug implementations can plug into the retargettable actions by providing - appropriate adapters for relevant editors and model objects that perform the - actual operations (IRunToLineTarget and IToggleBreakpointsTarget, - defined in the org.eclipse.debug.ui.actions package). A retargettable - action works on the active part. First the part is asked for a target adapter. - If the part does not provide an adapter, the selected objects within the part - are consulted for adapters.

                            -

                            As well, action delegates actions are provided by the debug platform such that - debug implementations can contribute appropriate actions to context menus. An - editor actions delegate is provided for the run to line action, and an object - action delegate is provided for toggling method breakpoints and watchpoints. - See the following classes: RunToLineActionDelegate, ToggleMethodBreakpointActionDelegate, - and ToggleWatchpointActionDelegate in the org.eclipse.debug.ui.actions - package.

                            - -

                            API Changes

                            - -

                            Debug Action Groups removed

                            -

                            The Debug Action Groups extension point (org.eclipse.debug.ui.debugActionGroups) has been - removed. In Eclipse 3.0, the workbench introduced support for Activities via the - org.eclipse.platform.ui.activities extension point. This support provides everything - that Debug Action Groups provided and is also easier to use (it supports patterns instead of - specifying all actions exhaustively) and has a programmatic API to support it.

                            -

                            Failing to remove references to the old extension point won't cause any failures. - References to the extension point will simply be ignored. Product vendors are encouraged to - use the workbench Activities support to associate language-specific debugger actions with - language-specific activities (for example, C++ debugging actions might be associated with - an activity called "Developing C++").

                            - -

                            Extensible Launch Modes

                            -

                            With the introduction of extensible launch modes, more than one launch delegate - can exist for a launch configuration type. Releases prior to 3.0 only supported - one launch delegate per launch configuration type. The method ILaunchConfigurationType.getDelegate() - is now deprecated. The method getDelegate(String mode) should be - used in its place to retrieve the launch delegate for a specific launch mode. - The deprecated method has been changed to return the launch delegate for the - run mode.

                            - -

                            Launch Tabs & Tab Groups

                            -

                            Launch tab groups and launch tabs are no longer notified when a launch completes. - The method launched(ILaunch) in the interfaces ILaunchConfigurationTab - and ILaunchConfigurationTabGroup has been deprecated and is no - longer called. Relying on this method for launch function was always problematic, - since tabs only exist when launching is performed from the launch dialog. Also, - with the introduction of background launching, this method can no longer be - called, as the launch dialog is be closed before the resulting launch object - exists.

                            - -

                            Perspective Switching

                            -

                            In prior releases, perspective switching was specified on a launch configuration, - via the launch configuration attributes ATTR_TARGET_DEBUG_PERSPECTIVE - and ATTR_TARGET_RUN_PERSPECTIVE. With the addition of extensible - launch modes in 3.0, this approach no longer scales. Perspective switching is - now specified on launch configuration type basis, per launch mode that a launch - configuration type supports. API has been added to DebugUITools - to set and get the perspective associated with a launch configuration type for - a specific launch mode.

                            -

                            An additional, optional, launchMode element has been added to - the launchConfigurationTabGroup extension point, allowing a contributed - tab group to specify a default perspective for a launch configuration type and - mode.

                            -

                            From the Eclipse user interface, users can edit the perspective associated - with a launch configuration type by opening the launch configuration dialog, - and selecting a launch configuration type node in the tree (rather than an individual - configuration). A tab is displayed allowing the user to set a perspective with - each supported launch mode.

                            - -

                            Generic Console

                            -

                            With the work for the generic console support - (Bug 37263), the view id for the Eclipse (formerly debug) console has changed. - This results in problems at startup such as "Could not restore workbench layout" - with details that "Could not create view: org.eclipse.debug.ui.ConsoleView" - for the particular perspective that contained reference to the old view id. - The equivalent view id is now: "org.eclipse.ui.console.ConsoleView".
                            - The generic console is available via the Window>Show View>Basic>Console and - is used by the Eclipse debug and Ant integration.

                            - -

                            Console Line Tracker Extension

                            -

                            A console line tracker (IConsoleLineTracker) can be notified when - its associated console is closed (i.e. all of its streams are closed), by implementing - the new interface IConsoleLineTrackerExtension. The notification - indicates that no more output will be appended to the console.

                            - -

                            Launch Configuration Tab Enhancements

                            -

                            Two methods have been added to the ILaunchConfigurationTab interface - - activated and deactivated. These new life cycle methods are called when a - tab is entered and exited respectively. Existing implementations of ILaunchConfigurationTab - that subclass the abstract class provided by the debug plug-in (AbstractLaunchConfigurationTab) - will maintain binary compatibility, as the methods have been added in the abstract - class.

                            -

                            In prior releases, a tab was sent the message initializeFrom when - it was activated, and performApply when it was deactivated. In - this way, the launch configuration tab framework provided inter-tab communication - via a launch configuration (by updating the configuration with current attribute - values when a tab is exited, and updating the newly entered tab). However, since - many tabs do not perform inter-tab communication, this can be inefficient. As - well, there was no way to distinguish between a tab being activated, and a tab - displaying a selected launch configuration for the first time. The newly added - methods allow tabs to distinguish between activation and initialization, and - deactivation and saving current values.

                            -

                            To avoid breaking the behavior of current tab implementations, the default - implementation of activated, provided by the abstract tab, calls - initializeFrom. And, the default implementation of deactivated - calls performApply. Tabs wishing to take advantage of the new API - should override these methods as required. Generally, for tabs that do not perform - inter-tab communication, a correct implementation of these methods is to do - nothing.

                            - -

                            BreakpointManager Can Be Disabled

                            -

                            IBreakpointManager now defines the methods setEnabled(boolean) and isEnabled(). - When the breakpoint manager is disabled, debuggers should ignore all registered breakpoints. - The debug platform also provides a new listener mechanism, IBreakpointManagerListener - which allows clients to register with the breakpoint manager to be notified when its - enablement changes.

                            -

                            The Breakpoints view calls this API from a new toggle action that allows the user to - "Skip All Breakpoints." Debuggers which do not honor the breakpoint manager's enablement - will thus appear somewhat broken if the user tries to use this feature.

                            - - diff --git a/org.eclipse.debug.core/r3_1_buildnotes_platform-debug.html b/org.eclipse.debug.core/r3_1_buildnotes_platform-debug.html deleted file mode 100644 index 3562b6e20..000000000 --- a/org.eclipse.debug.core/r3_1_buildnotes_platform-debug.html +++ /dev/null @@ -1,975 +0,0 @@ - - - - - - - Platform Debug Release Notes - - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -3.1 RC4 -

                            -Problem Reports Fixed

                            -100807: Source not found
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -3.1 RC3 -

                            -Problem Reports Fixed

                            -99407: Handle BLE from toggle breakpoint action
                            -99796: Refactoring changed launch config name to "null"
                            -99693: Invalid stack frames during display
                            -84458: [Doc] package.html needs to be updated for org.eclipse.ui.console
                            -99752: Console Terminate Hangs Eclipse
                            -99996: NPE when bringing the Memory View to the top from a view stack
                            -100105: Help context id fixes
                            -100489: "color" as a preference keyword
                            -100283: [Memory View]: SWTException when launch a session with Memory view open
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -3.1 RC2 - June 10, 2005 -

                            -Problem Reports Fixed

                            -94441: deallocated Inspect Expression incorrectly displayed in details pane
                            -97654: Pref Page General/Colors and Fonts - problems
                            -97564: breakpoint group shows as disabled when enabled
                            -98655: [Preferences] Error message too long in Preferences dialog
                            -96972: NullPointerException when trying to set breakpoint (in ToggleBreakpointAction)
                            -97304: DebugRequestJob should be system job
                            -97327: renaming main type does not update launch history
                            -97628: Edit source path dialog not re-sizeable
                            -97742: Console uses wrong link color
                            -97847: An internal error occurred during: "Fetching children from debug target"
                            -97869: Pref Page Run/Debug - problems
                            -98272: Key binding for terminate - works 3.0, not 3.1 (debug view issue)
                            -98389: Stack overflow when launching from within project with circular plugin dependancy
                            -71794: Mnemonic in error message
                            -98090: source lookup with relative path names
                            -95490: String substitution variables are lost during import
                            -98048: "Terminate and Remove" doesn't assure termination of launch object
                            -98090: source lookup with relative path names
                            -99174: launch view should use async instead of sync
                            -98249: cvs console missing icon
                            -99063: DebugModePromptStatusHandler should check preference before getting the active shell
                            -91305: program spewing large amounts to console causes eclipse to OOM
                            -92135: Investigate console performance test failures
                            -97348: Run button enabled without selection
                            -98162: Missing properties string in AddMemoryRenderingAction
                            -98003: 3.1 RC1 javadoc warnings
                            -96657: Clipped message for missing source.
                            -97726: Carat location should be updated when user types in Console.
                            -98900: Console hyperlinks inaccurately detected
                            -98995: Monitor Memory Dialog needs to accept empty expression
                            -99067: Add Memory Monitor dialog should stay up if there is an error adding a memory monitor
                            -99247: Potential NegativeArraySizeException in Table Rendering
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -3.1 RC1 - May 27, 2005 -

                            -Problem Reports Fixed

                            -94446: CodePagesPrefDialog using internal help access
                            -84324: Changes to Watch Expressions not updated in view when not debugging
                            -84959: action background job hangs onto elements
                            -89961: NPE running test suite
                            -93686: Provide select all / deselect all buttons for BreakpointWorkingSetPage
                            -95190: Display view context menu item is missing label
                            -95199: consoleFactories extension point doesn't specify implementation reqs
                            -94749: terminate all does not work
                            -95256: Marker doesn't exist error from breakpoint sorter
                            -94357: breakpoints view not auto-opened on second launch
                            -87586: View closure doesn't pay attention to perspectives
                            -71486: no error message when CTRL-S used to change var value
                            -85612: NPE trying to create new launch config
                            -93545: No feedback when re-enabling breakpoints
                            -95662: Activity enablement not working in debug platform
                            -93474: "Step filters" incorrectly enabled when launch selected
                            -94281: [Preferences] Some Parts not using Dialog Fonts
                            -90206: Stack trace console should use console font
                            -95204: FolderSourceContainerDialog and internal ref
                            -95767: (polish) Use "open" instead of "switch" terminology for perspectives
                            -95956: typo in NLS keys
                            -92547: Job not shut down correctly
                            -92949: potential NPE in RenderingViewPane
                            -95477: Infinite "restore viewer state" in Registers view
                            -91543: Exception when placing a breakpoint (double click on ruler)
                            -91786: top frame annotated as "secondary"
                            -77252: Consistency in SDK consoles
                            -96546: Debug plugins should restrict access to their packages
                            -95470: Debug jobs should be system jobs
                            -87587: Debugging views automatically opened before perspective switch
                            -96470: Breakpoint type group shows up not "enabled"
                            -96199: NPE in RemoteTreeViewer.deferExpansion running Ant test suite
                            -96724: FindVariableDelegate leaks as remains as DebugEventListener
                            -96557: Missing adapter type: BreakpointTypeCategory
                            -94406: Context Enabled not opened in Java Perspective in multi-langauage scenario
                            -94535: TimedOut VM remains in Debug View
                            -96451: Memory View throws exception in multi-window scenario
                            -95745: console/editor: allow editor selection/load of source files for none stack traces
                            -96766: Console hyperlinks broken by 3.1M7
                            -96432: Debug/Run As "Ant build" shows up for Java files
                            -85770: Hyperlink over multiple lines: text colored only on first line
                            -96731: Leak: RemoteTreeViewer jobs holding on to debug elements
                            -96728: Leak: MemoryViewSynchronizationService remains as listener of IMemoryBlockManager
                            -94454: Find Variable action from Variable view missing mnemonic
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 13, 2005 -

                            -Problem Reports Fixed

                            -94208: Debug UI depends on IDE to declare "Goto Breakpoint" image.
                            -94216: Open type does not work for generic types
                            -94447: WorkingSetSourceContainerBrowser and internal WorkbenchPlugin
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 9, 2005 -

                            -Problem Reports Fixed

                            -92939: Render links in the console as hyperlinks
                            -93712: missing messages in DebugUIMessages
                            -93198: ClassCastException when monitoring large array in Expression View
                            -93578: java.lang.ArrayIndexOutOfBoundsException in ConsoleDocumentAdapter
                            -93800: Serialize requests per target
                            -93805: Run/Debug as menu should never be empty
                            -93909: No longer able to launch java application from navigator view folder
                            -93927: Add keywords to preference pages
                            -93949: Tests opening external browsers
                            -93976: Add Source Container dialog should add the new container to the top of the source container list by default.
                            -94133: [Console] console does not automatically appear on write to stdout
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 3, 2005 -

                            -Problem Reports Fixed

                            -93711: Eraser icon is difficult to see and analogy is often missed
                            -89548: no message for native methods in var view
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -May 3, 2005 -

                            -Problem Reports Fixed

                            -85033: Memory View: Screen reader does not read content properly
                            -92704: Classcast exception from Registers View
                            -76032: inconsistent "Run" rightclick menu on French OS vs. English OS
                            -92817: [api] fields deleted from MessageConsole
                            -92838: [api] add missing @since 3.1 tags on API added in 3.1 cycles
                            -92902: Can't launch with errors
                            -92836: [api] missing @since 3.1 tag on AbstractDebugView.setViewer
                            -92930: 4 methods added to CommonTab intended to be private
                            -90289: >1 debug worker thread calling IStackFrame.getVariables()
                            -92938: Unused Keys in ConsoleMessages
                            -92840: [api] deleted field IDebugUIConstants.IMG_ACT_SYNCED
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 26, 2005 -

                            -Problem Reports Fixed

                            -88685: stepxxx and resume calls made even if "canStepxxx()" and "canResume()" return false
                            -91605: ShowTypesAction runs twice when it is invoked.
                            -89604: [polish] Prompted to delete all selected breakpoints for empty group
                            -91889: top frame not selected when monitor added to stack
                            -78166: [performance test] console
                            -79426: Exception in log file
                            -92135: Output out of sync with process when debugging
                            -90351: [performance test] Tests completing too quickly
                            -91552: Console view shows "Console" as content description when no consoles open
                            -91625: IndexedValuePartition's #getVariables is inefficient
                            -91984: RemoteTreeViewer.StateRestorationJob should be pushed down stack
                            -92132: Memory rendering's dispose() method gets called twice when closing the rendering
                            -89743: [polish] [Console] Process Console not opened if output is not captured anywhere
                            -87420: Provide feedback during source lookup
                            -89230: Run as mnemonic has been changed from S to U
                            -89693: Exception occurred when looking at monitors
                            -92244: SelectedResourceManager copies entire text selection upon every selection change
                            -81330: Missing mnemonics in Context menu of Console
                            -85588: No error/warning when console encoding not set
                            -74885: Review all Threads created to see if they should be set as daemon
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 19, 2005 -

                            -Problem Reports Fixed

                            -91208: firing PropertyChangeEvent in TextConsole.addHyperlink can be expensive
                            -78318: Backport performance tests
                            -91471: Avoid asyncs in action updating
                            -89865: Poor debug performance in I20050330-0500
                            -89184: Eclipse hangs during shutdown after error disposing display
                            -90975: Consoles removed when using multiple windows
                            -91569: TextConsoleViewer should not change selection when auto-scrolling
                            -91067: Performance problem in Console View if more than one Console View is opened
                            -91597: OutputStreamMonitor #read method is inefficient
                            -82530: DebugPluginImages and ImageRegistry
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 12, 2005 -

                            -Problem Reports Fixed

                            -89748: [polish] "Search for duplicate source files" option doesn't work
                            -82627: Source containers should be case-insensitive on platforms that are case insensitive.
                            -89883: Exception triggered by Memory View
                            -90154: [Memory View] Short Input Rejected by Hex Rendering
                            -88261: create component XML for debug plugins
                            -90892: Typos in javadoc of IConsoleFactory
                            -90318: Change string externalization to use new format
                            -88677: AbstractDebugEventHandler$EventProcessingJob can hog UI thread
                            -90387: Debug with break point cause error in 3.1M6
                            -90518: JAR debug plug-ins
                            -90838: Folder and Directory source containers should have slightly more descriptive names.
                            -90470: StatusDialog now available in JFace
                            -76794: Error Disabling Breakpoint: "Unable to create class prepare request."
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 5, 2005 - M6 -

                            -Problem Reports Fixed

                            -89741: [polish] Debug config: Suggestion: When user clicks new, put focus in name text field
                            -89590: Scroll Lock is broken
                            -89711: Display View unexpectedly brought to top when debug session is suspended
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -April 1, 2005 - M6 -

                            -Problem Reports Fixed

                            -89772: [Memory View] NPE in AbstractTableRendering when throwing Debug Exception during rendering creation
                            -89308: Pass combined preference store to TextSourceViewerConfiguration(IPreferenceStore)
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Mar 29, 2005 -

                            -Problem Reports Fixed

                            -88945: [Memory View] Add code page preference for Memory View
                            -84378: Open several tabs in memory view at once
                            -89293: [Memory View] Selection problems in Memory View
                            -82245: Multiple memory views
                            -88828: [Memory View] Allow clients to provider custom decorations in AbstractTableRendering
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Mar 24, 2005 -

                            -Problem Reports Fixed

                            -88833: TableRenderingLabelProviderEx should cache font/color providers
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Mar 22, 2005 -

                            -Problem Reports Fixed

                            -86510: Filtering all threads from the debug view causes infinite expand attempts
                            -88585: Find action in variables and expressions view context menu has no text
                            -80857: ProjectSourceContainer fails to search for files specified by relative paths
                            -86572: banner image for launch config tab groups ignored
                            -88465: VariableValueEditorManager does not need to be API
                            -86743: Register view shows the same as Variables view in CVS HEAD
                            -88027: ConsoleManager does not recognize Workbench shutdown.
                            -88264: [Memory View] Support for non-scrollable IMemoryBlockExtension
                            -88404: [Memory View] Support for mixed-endianess in a memory block
                            -88232: AbstractSourceLookupDirector disposes existing containers
                            -86725: Environment vars on windows: lowercase/uppercase
                            -85216: [API] platform could provide double-click breakpoint action
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Mar 15, 2005 -

                            -Problem Reports Fixed

                            -86793: Support for dynamic help in LaunchConfigurationView
                            -87421: IMemoryBlockExtension: Rename getAddressibleSize
                            -52939: Launch from the context menu in an editor
                            -74343: Some contextual views not opening after a perspective switch
                            -87569: Infinte loop obtaining image when switching to Debug Perspective
                            -87955: Exception on startup
                            -86617: Memory view scrolling problem under GTK
                            -83246: Javadoc warnings in latest builds
                            -87692: setConsoleWidth() causes Invalid thread access
                            -86859: NPE running Ant debugger test suite
                            -86895: NPE from source lookup from Ant debug tests
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Mar 8, 2005 -

                            -Problem Reports Fixed

                            -87108: ProcessConsole.ConsoleLogFilePatternMatcher should remove itself once a match has been found
                            -78288: [API] Drop to Frame not enabled
                            -86850: Console should scroll to last line, not end of document
                            -86956: Adapt to the key binding changes
                            -87225: NPE during compile using clover 1.2.2
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Mar 1, 2005 -

                            -Problem Reports Fixed

                            -85623: NPE opening View Management preference page
                            -77566: [API] Implementations of AbstractJavaLaunchConfigurationDelegate.launch are too monolithic
                            -85322: remote viewers should cancel jobs when disposed
                            -85964: RemoteVariablesContentProvider.hasChildren() communicating with Target in UI Thread
                            -86030: VariablesView communicates with target in UI thread while populated Details pane
                            -86199: [M5a] Memory view is not updated when padded string is changed
                            -81211: [KeyBindings] preference page: key bindings don't show relevant platform
                            -51887: Feature request: Allow more control over Debug view
                            -86573: Console prcoess type property tester poorly named
                            -76526: [API] ILaunchManager/Launch not extensible.
                            -87081: Invalid thread access during "Populate Detail Pane"
                            -85600: NPE from format in Java Stack trace console
                            -77255: RemoveAllTerminatedAction and ConsoleRemoveAllTerminatedAction differences/bugs
                            -85626: View tracking state still honored after toggling "track views" preference
                            -84362: Relaunch does not terminate current launch
                            -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Feb 22, 2005 -

                            -Problem Reports Fixed

                            -85740: "Display in favorites" selection table is too small
                            -85734: Debug view flickers excessively
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Feb 17, 2005 -

                            -Problem Reports Fixed

                            -85582: index out of bounds
                            -85653: Reuse of source lookup result
                            -84111: Exception while running test suite
                            -85603: Attempting to capture output to invalid file
                            -85330: Illegal Argument Exception in VariablesView details panel
                            -85579: launch view event handler performs insert rather than refresh
                            -85701: source selection only cleared on thread termination
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Feb 15, 2005 -

                            -Problem Reports Fixed

                            -84588: Dummy launch should be rendered with italics
                            -84587: dummy launch not cleaned up when job terminated
                            -84257: Expanding tree in the variable view collapses the tree
                            -78553: Console hyperlink painting needs improvement
                            -84795: Missing NLS string
                            -84586: Launch doesn't wait for build if launching while "cleaning" before build
                            -82318: Breakpoint enablement blocks UI
                            -80325: Deferred content adapater will override workbench adapter
                            -84075: deferred workbench adapters for expressions and registers
                            -84825: new variables no longer revealed
                            -84672: breakpoint does not have marker errors in test log
                            -84907: Invalid thread access while removing launches
                            -84958: class cast exceptions
                            -85048: RemoveAllTerminatedAction causes debug view to refresh
                            -84932: Deleting a breakpoint leaves no selection in the breakpoints view
                            -83793: Find Variable could be mapped to Ctrl-F
                            -84959: action background job hangs onto elements
                            -84951: Launch leak
                            -73397: Setting ErrorHandlers for XML parsing
                            -84960: Launch view source lookup result hangs onto launch
                            -83245: [Breakpoint Groups] Improve icons for breakpoint type groups
                            -84884: test failure: memory rendering types
                            -84925: refactoring of doUpdateItem(...)
                            -85291: NPE in find variale action
                            -84933: Adding a lock to Debug View deselects stack frame
                            -85007: Invalid stack frames displayed in Debug View, Owned monitors not displayed
                            -84641: StringIndexOutOfBoundsException in console
                            -84870: Hang in PasteBreakpointsAction.updateSelection
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Feb 8, 2005 -

                            -Problem Reports Fixed

                            -84072: Text field doesn't have border
                            -83237: [Breakpoint Groups] Breakpoint working set actions
                            -84258: Find variable enabled when view is empty
                            -83453: Infinite "restore viewer state"
                            -73417: Wrong thread selected
                            -84078: RemoteTreeContentManager should override default job name
                            -84493: Flashing job notification on stepping: "Restore Viewer state
                            -84189: Remove "final" limitation from Launch implementation
                            -77781: No feedback when launch is waiting for build
                            -84454: Allow termination of launch when in "waiting for build..." state
                            -83607: ClassCastException during saving VariablesView state
                            -84605: update javadoc for IDebugModelPresentation
                            -84385: disabling breakpoint with ruler action does update check box in breakpoints view
                            -83794: API issue with logical structures
                            -72838: Say which project in "Errors exist in a required project. Continue to launch?"
                            -64424: Enhancement required in the Launch Configuration extension point
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Feb 1, 2005 -

                            -Problem Reports Fixed

                            -83779: NPE attempting to edit string
                            -75849: Support for search in variables view.
                            -83054: Changing toString() setting at debug time has no immediate effect
                            -83570: Mnemonic collisions on CommonTab
                            -83956: Hang while debugging
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Jan 25, 2005 -

                            -Problem Reports Fixed

                            -82866: [Breakpoint Groups] The default groups should be emphasized
                            -82993: "show qualified names" broken in breakpoints view
                            -83035: breakpoints not visible when view brought to top
                            -83103: newly created breakpoint not visible in breakpoints view
                            -82886: Breakpoints view "expands all" too often
                            -83244: [Breakpoint Groups] wording in advanced ordering dialog
                            -44724: background content in debug views
                            -82840: Concurrent modification exception
                            -82729: Run to line should work in the background
                            -82931: NPE in RenderingViewPane
                            -82869: [Breakpoint Groups] show only breakpoint working sets
                            -74125: [Console] provide API for images
                            -75227: Allow DND of breakpoints to breakpoint groups
                            -83235: [Breakpoint Groups] show empty breakpoint sets
                            -83238: [Breakpoint Groups] Breakpoint actions
                            -83260: dnd with nested breakpoint groups
                            -83277: Run/Debug: reuse editor does not affect current workbench session
                            -82492: Groups do not indicate that the breakpoint manager is disabled
                            -83365: Cutting a breakpoint doesn't remove the breakpoint from editor
                            -82912: breakpoint groups "Others" category could be more descriptive
                            -75891: Stratum line breakpoints should be grouped by stratum.
                            -83202: No mnemonics on Breakpoint working set page
                            -82868: [Breakpoint Groups] Custom working set dialog
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Jan 18, 2005 -

                            -Problem Reports Fixed

                            -80991: Promote StringVariableSelectionDialog to API
                            -82553: NPE from TerminateAllAction
                            -80924: errors in log running test suite
                            -75194: CommonSourceNotFoundEditor is closed unexpectedly
                            -76272: Use working sets to store custom breakpoint groups
                            -71149: [artwork] When breakpoints are disabled (skipped), the bullet should be different
                            -81236: Consider console output to a workspace file
                            -82708: Cannot delete console output file w/o removing console
                            -82908: console ckpii error
                            -80321: Support "Group By > Working Set" in Breakpoints view
                            -82865: [Breakpoint Groups] "Show" actions for breakpoints
                            -82871: [Breakpoint Groups] Deselect working should disable when none
                            -82882: Need to provide an icon for "working set organizer"
                            -82883: IBreakpointOrganizer not needed in public API
                            -82885: "Breakpoint organizers" don't show icons in cascade menu
                            -82895: Broken strings in new "breakpoint working set" dialog
                            -82900: should be able to create empty breakpoint working set
                            -80207: launch variables should insert at cursor
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Jan 11, 2005 -

                            -Problem Reports Fixed

                            -82003: The IDisconnect implementation by Launch module is too restrictive
                            -82001: When shutting down the IDE, the debugger should first attempt to disconnect debug targets before terminating them
                            -80551: Provide AbstractRunToLineAdapter
                            -82402: [Memory View] Bad error message format
                            -74559: Memory View does not scroll properly on Linux
                            -82403: [Memory View] Unable to remove more than one memory monitor
                            -82280: remove TextConsole.setAutoScroll()
                            -82479: run to line test failures
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Jan 4, 2005 -

                            -Problem Reports Fixed

                            -72909: Add "Remove All Breakpoints" action to "Run" menu
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -Dec 21, 2004 -

                            -Problem Reports Fixed

                            -81540: no need to create annotation for editors without annotation model
                            -71149: [artwork] When breakpoints are disabled (skipped), the bullet should be different
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -M4, 2004 -

                            -Problem Reports Fixed

                            -70938: Need to be able to turn off "Watch" action for IVariable
                            -80522: VariablesView and problems with hyperlink support
                            -81234: Console Pinning causes no console to be displayed.
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -December 14, 2004 -

                            -Problem Reports Fixed

                            -80227: Fixed width console of 80 chars double spaces 80 char lines
                            -80546: Incorrect package ref for IRunToLineTarget
                            -80617: Memory View does not synchronize properly
                            -80331: NPE from AbstractDebugActionDelegate
                            -80409: Breakpoints Group By > menu should number submenu starting with 1
                            -76297: Enhancements to memory block API
                            -78335: Support for word-addressable memory in memory view
                            -78423: Enhancements to Memory Rendering Extension Point
                            -79255: Enhancements to Memory View
                            -80284: Enhancements to Memory View - replace MemoryViewPane with Tree Viewer
                            -80229: AIOB exception with fixed width console
                            -80679: Encoding dropdown enabled on common tab of launch config when default selected
                            -80653: IllegalArgumentException from OpenBreakpointMarkerAction
                            -1654: USABILITY - Can't look at client server output in one perspective (1GFX2ZU)
                            -80726: new launch doesn't open console view
                            -80728: ShowConsoleAction not working when console pinned
                            -80720: Pinned console does not remain on top
                            -80373: Pinning of consoles is lost after relaunch of debug process
                            -80729: NPE in console
                            -80873: Fill out schema for logical structure providers
                            -80721: Conflicting key binding for 'org.eclipse.debug.ui.commands.eof' and 'org.eclipse.ui.edit.text.delete.line'
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -December 7, 2004 -

                            -Problem Reports Fixed

                            -79153: [Common Tab] redirect to file should do variable expansion
                            -79043: Translatable attributes not translated in memoryRenderingTypes extensions
                            -79757: NoClassDefFoundError when opening type
                            -79897: Debug view flashes after terminating target
                            -79903: Source not found automatically for higher level plugins
                            -79949: Console View is missing Ctrl-C in context menu item.
                            -79841: Memory view leaks
                            -79606: Common tab is too tall
                            -79735: Allow to append / overwrite when output to file from console
                            -79304: Incorrect stack frame selected
                            -79952: broken hyperlink in console redirecting process output to console.
                            -79306: Custom breakpoint group action enablement
                            -30779: Queue/Fire debug events in separate thread
                            -79951: Output lost / colored incorrect with echoProperties
                            -80073: Shortcut for show debug perspective
                            -79510: background source lookup
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 30, 2004 -

                            -Problem Reports Fixed

                            -78881: NullPointerException in memory view when selecting watch expressions
                            -78079: Error loading classes to to Apple's VM packaging.
                            -79097: Mnemonic collision on the Commons tab
                            -79466: Capture Output file widgets enabled initially
                            -35400: new Debugger view can't get to associated text editor
                            -79043: Translatable attributes not translated in memoryRenderingTypes extensions
                            -23064: RFE: Add option to redirect console output (stderr & stdout) to file
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 23, 2004 -

                            -Problem Reports Fixed

                            -76316: Addition of memory block manager to API
                            -76310: Memory block enhancements: MemoryByte
                            -78864: Using new registry API
                            -61801: A null String object reference becomes the value "null"
                            -77060: Toggling show qualified names in the Debug view collapses thread
                            -78010: NPE closing eclipse
                            -79008: Dialog units should not be used for calculating button heights
                            -77380: hyperlinks in stack trace console draw "higher" than original text
                            -78739: stack trace console unexpectedly restored
                            -78751: Extension Point Schema Changes
                            -78996: ContextualLaunchAction assumes launch group category supports mode
                            -78759: NPE in WatchExpression.getLaunch
                            -78338: Selection is lost in debug view while stepping with monitor info on
                            -79304: Incorrect stack frame selected
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 16, 2004 -

                            -Problem Reports Fixed

                            -77202: font setting for process console
                            -73882: ConsoleDocumentManager caused a deadlock
                            -77779: Advanced Breakpoints grouping dialog improvements
                            -76119: source containers not disposed when launch removed
                            -78338: Selection is lost in debug view while stepping with monitor info on
                            -78191: [console] context menu contributions
                            -77995: NPE out of LaunchViewer running test suite
                            -74590: Console colors not changed for terminated processes
                            -52336: [Viewers] Internal error at start of debug session
                            -68621: Invalid thread access in launcher from Checkout thread
                            -78193: IOConsolePartitioner.TrimJob quits too early if lastPartition is null
                            -78351: Please add shortcut keys to switch to Variables and Breakpoints views
                            -77416: Filter console factories by capabilities
                            -78386: NPE in ProcessConsoleManager
                            -73460: Console flicker when launching
                            -78456: Breakpoint group setting lost on close of breakpoints view
                            -78494: State of child BreakpointContainers are not updated when parent is enabled/disabled
                            -75851: Custom variable edit widget
                            -78513: Memory View: Length and change state incorrect for IMemoryBlock
                            -29581: Launch shortcut hotkeys
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 9, 2004 -

                            -Problem Reports Fixed

                            -74584: [Console] IOConsole does not bold title when contents change
                            -75571: restore defaults does not enable console buffer size text field
                            -77667: Invalid error message in Run/Debug|Console
                            -77783: No mnemonic for "Group By"
                            -77670: breakpoint group rendered as "enabled" when manager disabled
                            -77721: groups not expanded when switching between none and other
                            -77991: Leak: IOConsolePage needs to dispose ScrollLockAction
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 5, 2004 -

                            -Problem Reports Fixed

                            -77703: Deselecting Map$Entry/Show As>/Key And Value Deselects Map/Show As>/Map Entries
                            -77754: Inefficient loop rendering styled text
                            -77472: NPE in TextConsolePage runnable
                            -77994: TextConsoleViewer leaks ConsoleDocumentAdapter
                            -77998: IOConsoleViewer leaks a document listener
                            -76605: Set our compiler settings for each project so they are shared
                            -77748: NPE terminating a target
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -November 2, 2004 -

                            -Problem Reports Fixed

                            -76771: Inconsistency between schema description and implementation in logicalStructureTypes
                            -77049: SelectBreakpointGroupDialog doesn't allow selection of existing groups
                            -76675: Pattern Matching independent of IOConsole and IOConsolePartitioner
                            -77028: Element 'breakpointContainerFactory' is not legal as a child of element 'extension'.
                            -77046: Console causing Ant test failures
                            -77072: Composite breakpoint group expansion problem
                            -77065: scroll lock not required in stack trace console
                            -77066: Pressing <Enter> in strack trace console appends to EOD
                            -76907: Clarify run menu (run, run..., run > run...? RUN!)
                            -54916: Environment tab should show icons for env vars
                            -74206: Delete breakpoint needs to "preserve selection"
                            -74031: No mnemonics on Open Console drop down items
                            -74123: Console font problem
                            -75370: Hyperlinks to source in console don't work sometimes
                            -77029: "Browse" button on the Common tab does not resize properly
                            -77033: Console encoding on Common tab: mnemonics and NLS
                            -77189: exception during test suite
                            -77202: font setting for process console
                            -77068: Typing in stack trace console moves line to top of view
                            -77116: API cannot reference internal classes
                            -77306: Provide a rendering view pane in the Memory View
                            -69815: DBCS -- System console cannot display Unicode characters properly
                            -76427: Run configuration dialog layout
                            -69083: Switch to associated perspective on suspension
                            -77063: JavaStackTraceConsole should use Hyperlink Color
                            -77295: Argument parsing for command line launching
                            -77238: Enable/Disable not on context menu for breakpoint groups
                            -77048: ArrayIndexOutOfBounds removing breakpoint
                            -77397: Book capitalization in Color and Font extensions
                            -77253: Sort the consoles in the Open console dropdown
                            -77073: Expand to show breakpoint containers
                            -77421: [Themes] default text editor font changes by itself
                            -77462: CVS Plug-in fails to start
                            -74596: Always group by breakpoint type
                            -75119: Default breakpoint group setting not used when breakpoints view not there
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -October 26, 2004 -

                            -Problem Reports Fixed

                            -76539: ILaunchConfiguration.getAttributes doc/clone usage pbm
                            -76677: Console Input incorrect
                            -76110: Breakpoints not showing as installed in the BreakpointsView
                            -76532: Deleting multipe groups prompts for each group
                            -75183: DebugEvent.CHANGE does not cause run control action states to be updated
                            -76797: Two output stream reader threads and 100% CPU usages
                            -76743: Console pipes should be closed when program terminated
                            -51884: Feature request: More flexible debug hierarchy
                            -76514: Allow debug presentations to provide colors
                            -76517: NPE in LaunchViewContextListener
                            -76529: Renaming a custom group collapses all of the groups
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -October 19, 2004 -

                            -Problem Reports Fixed

                            -75967: NullPointerException in IOConsolePartitioner.getRegion
                            -75769: Console doesn't restore displayed tab width 8 on restart
                            -74909: Automated test for console input
                            -75174: Can not clear console with unlimited output
                            -75546: hang during debug session
                            -72500: Migrate StringMatcher to RegEx 1.4 support
                            -75198: breakpoint groups don't support double click expand
                            -76428: Run configuration dialog; source tab
                            -76270: Scroll in Console is always lock.
                            -74909: Automated test for console input
                            -76208: Incorrect code for converting String-> boolean
                            -75282: Composite breakpoint groups
                            -76518: Buttons in the Group Breakpoints "Advanced" dialog incorrectly sized
                            -76521: Incorrect icon names for the breakpoint group actions
                            -76519: Expand all in the Breakpoints view with no groups causes infinite recursion
                            -74673: Add Expand/Collapse All to Breakpoints view
                            -74560: Group all should expand groups on creation
                            -76495: Delete action is enabled for a group
                            -76498: "set custom group" should have "..."
                            -76497: illegal argument exception
                            -76326: Shared launch configurations not removed when containing project is deleted
                            -76527: Flaw in AbstractBreakpointGroupAction->rename and dissolve broken
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -October 12, 2004 -

                            -Problem Reports Fixed

                            -75454: RuntimeProcess.isTerminated() replies "false" if process segfaults
                            -75402: NPE on LaunchShortcutsAction.createContext
                            -75588: generalize watchpoint to debug platform
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -October 5, 2004 -

                            -Problem Reports Fixed

                            -75111: ArrayIndexOutOfBoundsException in ContentWidthCache.textChanged
                            -75177: Error setting Console Preference
                            -75204: NPE using build 200409240800
                            -75226: IllegalArgumentException setting console size from 200k to 400k
                            -75506: Adjust for the many deprecations in the command extension point
                            -75405: Allow a logical structure type to provide more than one logical structure
                            -75123: Use PerspectiveLabelProvider in ViewManagementPreferencePage
                            -75372: NPE in org.eclipse.ui.console.IOConsole.getHyperlink
                            -72209: Inspect and Display popup does not allow copying of values
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -September 28, 2004 -

                            -Problem Reports Fixed

                            -74947: Remove warnings from 200409240800 build
                            -74741: console hyperlink search is slow
                            -34052: CTRL-Z Not Recognized as EOF
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -September 21-23, 2004 -

                            -Problem Reports Fixed

                            -56253: [Generic Console] no support for extending the toolbar
                            -73942: IllegalMonitorStateException pasting into the Java Stack Trace Console
                            -73908: [Console] Incorrect colorization when multi streams write to same line
                            -56252: [Generic Console] no support for enabled/disabled lifecycles
                            -73957: API break introduced with IConsoleHyperlink change
                            -73924: Console can be removed before it's page is created
                            -73893: Should disallow close in LCD when running an operation
                            -73842: Remove from Group enabled when breakpoint not in a group
                            -73576: Pattern matching in IOConsole is too expensive
                            -73996: Add to Group / Remove from Group incorrectly disabled
                            -74005: Persist last breakpoint group across invocations
                            -73460: Console flicker when launching
                            -73950: MemoryView leaks AddMemoryBlockAction
                            -73951: CopyViewTabToClipboardAction leaks Clipboard
                            -74033: ClassCastException on selection change in Breakpoints view
                            -73840: Group by>File seems to only match on name
                            -74000: ClassCastException filtering for "show support breakpoints"
                            -73870: [misc] NPE when terminating large output
                            -73917: [Console] Missing hyperlinks
                            -74080: Process console did not flush stream monitors
                            -74124: Console type should be promoted to IConsole
                            -74308: Wrong number of lines in output
                            -74331: CPU at 99% after a debug session
                            -74340: NPE in IOConsoleViewer
                            -74370: NPE from ProcessConsolePageParticipant
                            -74039: NPE in ProcessConsole.connect
                            -68077: Manually closed views do not open when view management is reset
                            -73841: Icon for grouped breakpoints not disabled with set to skip breakpoints
                            -74229: Debug test failure for program arguments
                            -74283: Empty output in debug tests
                            -74703: Console view activated even if nothing is written to standart out
                            -74431: [Mac] runtime discovers JDI interfaces in classes.jar before jdi.jar
                            -48286: Add support for input on consoles
                            -74024: Console buffer implementation is line based rather than char based
                            -74428: Clearing console during output breaks hyperlinks
                            -74363: "Terminate and Remove" action doesn't close a view tied to a Context
                            -74563: renaming breakpoint group collapses group
                            -74560: Group all should expand groups on creation
                            -74381: Launch view manages views in other perspectives
                            -74384: Numerous action delegates leaked on debug perspective closed
                            -74465: Pasting multiple lines in console
                            -74558: "Dissolve Group" should be "Ungroup"
                            -21597: Difficult to enter text in debug console
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -September 14, 2004 -

                            -Problem Reports Fixed

                            -72317: Copying from IOConsole inserts extra line breaks.
                            -73823: Reorganize BreakpointsView menus
                            -72167: ProcessConsole should extend IOConsole
                            -44986: Support for Breakpoint groups
                            -73704: Provide action to group breakpoints by Type
                            -70066: Bind "Alt+Shift+Q C" to active console view
                            -73493: Default VM Args field should parse quotes intuitively
                            -73577: Find (Ctrl-F) not enabled in ConsoleView
                            -73779: Allow browse in "Add To Group" dialog
                            -70471: ExpressionManager#handleDebugEvents() doesn't work as intended
                            -73844: Mnemonics missing from breakpoint groups
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -September 7, 2004 -

                            -Problem Reports Fixed

                            -72986: ExpressionInformationControl leaks
                            -72000: Run as Application: duplicate menmonics
                            -72449: NPE in VariablesView.saveState
                            -73068: Support for ordering launch shortcuts
                            -73069: bogus extension point id in org.eclipse.debug.ui.launchShortcuts
                            -73110: IConsoleColorProvider is not disconnected
                            -72472: Remove unused dependancies
                            -72551: add System property to test suite to turn off workbench and console activation
                            -51562: console doesn't wrap input
                            -72317: IOConsole inserts extra line breaks when pasting
                            -72517: Replace "Run As >" with context launch
                            -73272: NPE in ProcessConsoleManager when no process type
                            -70664: TVT3.0: Improper characters combination "Run As"
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -August 31, 2004 -

                            -Problem Reports Fixed

                            -72300: Confirmation on RemoveAll actions
                            -72350: NPE in BreakpointsView.dispose
                            -72881: LineTracker Test Failure
                            -72483: NPE attempt to Inspect if never shown Variable view
                            -27895: Add new command to Run-menu; Resume All Threads
                            -67383: breakpoint manage fires add notificaiton on initialization
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -August 24, 2004 -

                            -Problem Reports Fixed

                            -72169: provided debug context for non-UI thread
                            -26830: Allow external programs to create tasks and markers through regex matches on the output
                            -27591: [Console] Hyperlink color not used
                            -72165: MessageConsole should extend IOConsole
                            -70864: API method to show the console view has a bug
                            -28193: Watch expressions updating when expression view not visible
                            -31899: Consolidate "Java" hyperlinks
                            -71292: Launch name is truncated in MRU list
                            -71429: Choosing 'Cancel' in the ${string_prompt} dialog does not cancel the Run command
                            -61447: keybinding clean up.
                            -71561: Inspect popup doesn't handle tabs in inspected expression
                            -72370: [Console] ArrayIndexOutOfBounds
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -August 17, 2004 -

                            -Problem Reports Fixed

                            -70354: JSP editor does not scroll to/highlight the current execution line when debug with JDT
                            - - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -August 3, 2004 -

                            -Problem Reports Fixed

                            -69470: TVT3.0: NL Truncation occurs in Run -> External Tools -> External Tools
                            -69723: TVT3.0: Truncated text in memory view
                            -69952: ILaunchConfigurationListener's launchConfigurationRemoved gets a configuration that doesn't exist
                            -71185: TVT3.0: Extra mnemonics for Debug, Run, and External tools
                            -61566: Launch configs dialog: Arrow_Up/Down in configurations tree extremely slow
                            -64370: Fix setTitle deprecations
                            -68808: all debug actions (step, terminate, etc), should be done async
                            - -

                            -Eclipse Platform Build Notes 
                            -Platform Debug

                            -July 27, 2004 -

                            -Problem Reports Fixed

                            -69536: Infinite loop on rendering variables
                            -69978: TVT3.0: Two shortcuts for one menuitem
                            -69057: Incorrect icon in Breakpoints view when breakpoint manager disabled
                            -69190: NullPointerException @ org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainer.isFindDuplicates
                            -70472: MemoryBlockManager has redundant null check
                            -70492: Possible NPE in AddSourceContainerDialog
                            -70493: Possible NPE in ViewTabCursorManager
                            -70495: Redundant null check in RefreshTab
                            -70499: Unnecessary null check in ContextualLaunchAction#selectionChanged(...)
                            -69452: NPE initializing source lookup
                            -70571: launch config save location on Common tab
                            -68523: missing `return' in org.eclipse.ui.internal.console.MessageConsolePartition
                            -24829: Multiple toString results shown if hold down arrow key
                            -68413: NPE from InstructionPointerManager
                            -70051: MemoryViewTab does not calculate delta and selected address correctly after error
                            - - - diff --git a/org.eclipse.debug.core/r3_1_changes.html b/org.eclipse.debug.core/r3_1_changes.html deleted file mode 100644 index fb2cba6ac..000000000 --- a/org.eclipse.debug.core/r3_1_changes.html +++ /dev/null @@ -1,183 +0,0 @@ - - -3.1 Debug Platform Change Notes - - - - -

                            3.1 Debug Platform Change Notes

                            -

                            This document describes new features and important changes in the 3.1 debug - platform, relative to the 3.0 release.

                            - -

                            New Features

                            - -

                            Breakpoint Organizers

                            -

                            The breakpoints view allows breakpoints to be displayed in groups. The platform - supports breakpoint groupings by breakpoint type, file, project, and breakpoint - working sets and resource based working sets (as well, it supports nested groupings). - The breakpointOrganizers extension point allows for other grouping - strategies to be contributed to the debug platform.

                            -

                            A new, optional, name attribute has been added to the breakpoints - extension point to provide a type name for breakpoints. This name appears as - the group label, when the user chooses to group breakpoints by type. If this - attribute is not specified on a breakpoint extension, the breakpoints are considered - to not have a type, and will be displayed in the "Others" group.

                            -

                            Logical Structure Providers

                            -

                            Logical structures have been enhanced to allow clients to more easily contribute - more than one logical structure for a given value. The new extension point logicalStructureProviders - allows clients to contribute an implementation of an ILogicalStrugureProvider. - A logical structure provider provides a simple way to contribute a single factory - of logical structures for a debug model.

                            -

                            In addition the optional interface ILogicalStructureTypeDelegate2 - has been added to allow a logical structure delegate to provide a dynamic label - for a value's logical structure type.

                            -

                            Process Console Enhancements

                            -

                            The debug console has been enhanced to allow output to be multiplexed between - the console and/or a file. As well, the encoding used to translate output to - characters can now be specified. All of these options are available to the user - on the "Common" launch configuration tab. As well, the options are - available programmatically as launch configuration attributes. The following - attributes have been added to org.eclipse.debug.ui.IDebugUIConstants.

                            -
                              -
                            • ATTR_CONSOLE_ENCODING
                            • -
                            • ATTR_CAPTURE_IN_CONSOLE
                            • -
                            • ATTR_CAPTURE_IN_FILE
                            • -
                            • ATTR_APPEND_TO_FILE
                            • -
                            -

                            Memory View

                            -

                            The Memory view, which was first released in 3.0 as internal API, has become - public API in 3.1. See the new extension point memoryRenderings, - and the new API package org.eclipse.debug.ui.memory for more information.

                            -

                            Parse Arguments

                            -

                            A convenience API method has been added to DebugPlugin to separate - arguments in a single string into an array of arguments that can be passed to - the command line for execution. See DebugPlugin.parseArguments(String).

                            -

                            Run To Line Handler

                            -

                            Many debuggers implement "run to line" functionality by creating - a breakpoint at the line a user has chosen to "run to", and then resuming - execution until that breakpoint is hit. A new API class, RunToLineHandler, - has been created to simplify the task. The handler manages the "skip breakpoints - while performing run to line" user preference as well canceling the operation - if another breakpoint is hit before the "run to line" operation completes.

                            -

                            Run To Line Action Delegate

                            -

                            The RunToLineActionDelegate introduced in 3.0 can now also be - contributed to a view (in 3.0 it could only be contributed to an editor). The - action additionally implements IViewActionDelegate.

                            -

                            Variable Value Editors

                            -

                            A new extension point, variableValueEditors, allows debuggers - to contribute custom editors for modifying a variable's value selected in the - Variables view.

                            -

                            Launch Shortcut Keybindings

                            -

                            To register a key-binding for a launch shortcut, define a command with an id - the same as the launch shortcut id, - suffixed with the launch mode. For example, the id of the "Java Application" - launch short cut is org.eclipse.jdt.debug.ui.localJavaShortcut, - so the command id for launching in debug mode is org.eclipse.jdt.debug.ui.localJavaShortcut.debug. - Then define a key-binding for your command.

                            -

                            When the command is invoked via the key-binding, the selection or active editor - will be used as the target for the launch shortcut's launch method. The shortcut - is only invoked if the shortcut is enabled for the selection or editor.

                            -

                            Source Lookup/Display Facility

                            -

                            API methods have been added to DebugUITools to facilitate source - lookup and display. See the methods lookupSource(Object, ISourceLocator) - and displaySource(ISourceLookupResult, IWorkbenchPage). When a - source lookup result for a stack frame is displayed, the open editor is also - annotated with an appropriate instruction pointer.

                            -

                            Watchpoints (IWatchpoint) and Images

                            -

                            As watchpoints are common to many debug architectures, the notion of an IWatchpoint - has been added to the debug model. A watch point is a breakpoint that suspends - execution when an associated variable is read and/or written. As well, default - images for rendering watchpoints have been added to the debug platform.

                            -

                            Colors and Fonts for Debug Elements

                            -

                            In 3.1, debug model presentations (IDebugModelPresentation) may - optionally implement IColorProvider and IFontProvider to - override default fonts and colors for debug elements.

                            -

                            Inserting Elements into Debug View

                            -

                            The Debug view allows for debug models to insert arbitrary elements into the - debug model element hierarchy. For example, the Java debugger now displays lock - information directly in the view. To override the default presentation in the - view, a debugger must provide an IWorkbenchAdapter or IDeferredWorkbenchAdapter - for the relevant element(s). The debug platform provides default adapters - for the standard debug elements.

                            -

                            Debug elements were always required to implement IAdaptable, and - now must be subclasses of PlatformObject in order for workbench - adapters to be properly registered and retrieved for debug elements.

                            -

                            Abstract Debug Element

                            -

                            An abstract implementation of a debug element is provided in 3.1 - DebugElement. - Clients implementing debug models may choose to subclass this class when implementing - debug models. The class provides convenience methods for firing debug events, - reporting exceptions, and retrieving adapters.

                            -

                            Drop to Frame Platform Action/Interface

                            -

                            The debug platform provides a "drop to frame" action and corresponding - capability interface (IDropToFrame). Debug elements supporting - the capability should implement this new interface to share the global action.

                            -

                            Context Menu Launching in Editors

                            -

                            Launching from the context menu (for example, "Run As > Java Application"), - is now available in editors (In 3.1, this was only available in the package - explorer and resource navigator). To leverage this feature, the editor input - associated with a executable file must have an ILaunchable adapter - registered for it.

                            -

                            Support for Unregistered Launch

                            -

                            The launch framework allows for a launch to be performed without registering - a launch object with the launch manager. An unregistered launch does not appear - in the Debug view. A new launch method has been added to ILaunchConfiguration, - accepting a boolean argument determining whether the launch should be registered - (launch(String mode, IProgressMonitor monitor, boolean build, boolean - register)), and a new method has been added to ILaunchManager - to determine if a launch is registered (isRegistered(ILaunch launch)).

                            -

                            Reusable Breakpoint Ruler Toggle Actions

                            -

                            Providing double-click breakpoint creation in an editor's vertical ruler is - a common feature for debuggers. The debug platform provides two actions to facilitate - this: RulerToggleBreakpointActionDelegate and ToggleBreakpointAction. - A debugger must contribute the RulerToggleBreakpointActionDelegate - to the appropriate editor (see javadoc for more details), and also register - an IToggleBreakpointsTarget adapter with the editor.

                            -

                            Environment Variables Case Preservation

                            -

                            Support has been added to ILaunchManager to retrieve the environment - variables defined in the OS preserving case. This is important on the WIN32 - operating system. Although WIN32 is case insensitive, depending on what you - intend to do with the environment, the lack of normalization may or may not - cause problems. This method getNativeEnvironmentCasePreserved() returns - mixed-case keys using the variable names recorded by the OS. Use getNativeEnvironment() - instead to get a WIN32 system environment where all keys have been normalized - to uppercase.

                            -

                            Closing an Input Stream

                            -

                            An optional extension, IStreamsProxy2, can be implemented by implementations - of IStreamsProxy. When implemented, it allows the input stream - associated with a process to be closed. This is used to allow the user to signal - EOF when typing in the console.

                            -

                            Launch in Debug Mode when Workspace Contains Breakpoints

                            -

                            Since 3.0, The user preference "Launch in debug mode when workspace contains - breakpoints" is used to control whether a launch should use debug mode - even when "run" is pressed by the user, based on the presence of breakpoints - in the workspace. A new method, getBreakpoints(ILaunchConfiguration configuration), - has been added to the abstract implementation of LaunchConfigurationDelegate, - to determine which breakpoints should be considered as relevant for a particular - launch. By default, all breakpoints in the workspace are considered, but subclasses - may override. For example, the Java Application launcher only considers Java - breakpoints.

                            -

                            Case Insensitive Source Lookup and Relative Paths

                            -

                            The debug platform's source lookup facilities now lookup source in folders - and directories in a case insensitive manner on platforms that are case insensitive. - As well, relative path names are supported in folders and directories.

                            -

                            Changes

                            -

                            Debug Event Dispatch

                            -

                            In releases 3.0 and prior, calling DebugPlugin.fireDebugEventSet(DebugEvent[]) - resulted in debug events being fired synchronously in the calling thread. In - 3.1, debug event set listeners are notified of debug events asynchronously in - a different thread than the event is reported in.

                            -

                            Debug Actions and Content in Background Jobs

                            -

                            In 3.1, many actions that call debug element APIs (like "stepOver"), - now create jobs to communicate with debug elements in background threads. This - avoids blocking the UI in the case that a debug element method requires communication - with a debug target that can block, hang, or timeout. Similarly, many of the - debug views populate their content using background jobs to avoid blocking the - UI thread. The net difference is that in 3.1, more than one thread might be - accessing a debug model's APIs where previously only the UI thread was.

                            -

                            Contextual Launch from Top Level Run/Debug Menus

                            -

                            The top level menus no longer support the perspective element, and launch shortcuts - must specify a "contextualLaunch" element to appear in - the Run/Debug cascade menus.

                            -

                             

                            - - diff --git a/org.eclipse.debug.core/r3_2_ buildnotes_platform-debug.html b/org.eclipse.debug.core/r3_2_ buildnotes_platform-debug.html deleted file mode 100644 index fad110670..000000000 --- a/org.eclipse.debug.core/r3_2_ buildnotes_platform-debug.html +++ /dev/null @@ -1,601 +0,0 @@ - - - - - - - Platform Debug Release Notes - - -

                            Eclipse 3.2 Debug Platform Build Notes 

                            - -

                            RC7 - June 2, 2006

                            -

                            Problem Reports Fixed

                            -144551: Collapse All tooltip in the Breakpoint View says "Collapse Al"
                            - -

                            RC6 - May 26, 2006

                            -

                            Problem Reports Fixed

                            -143297: Terminate and Relaunch only works asynchronously
                            -143096: TVT3.2:TCT644: TR: Migrate button truncated
                            -143812: [Memory View] Memory View's tree viewer handles any terminate event
                            - -

                            RC5 - May 19, 2006

                            -

                            Problem Reports Fixed

                            -139839: [source lookup] disconnect from PDE source locator
                            -141908: Memory Leak in debugger
                            -141895: Step keybindings not working in Ant debugger.
                            - -

                            RC4 - May 12, 2006

                            -

                            Problem Reports Fixed

                            -138389: Large memory leak in launch configuration dialog
                            -141324: NPE in JDIDebugTarget.getRootThreadGroups()
                            -141189: No version range specified when requiring bundles
                            - -

                            RC3 - May 05, 2006

                            -

                            Problem Reports Fixed

                            -136223: Suspended thread does not show stackframe/missing thread labels
                            -138527: Actions under the "Run" menu are incorrectly enabled at startup
                            -139530: SWTException when workbench is shut down
                            -139718: Got internal error for "Retrieving labels" when displaying my JSP variable
                            -139853: NPE in asynch tree viewer
                            -139859: selection lost while traversing tree
                            -136416: Terminated threads appearing in debug view
                            -139562: Regression...Launch Dialogs lose default button handling
                            -139576: unable to get the 'value' column back in variables view
                            - -

                            RC2 - April 28, 2006

                            -

                            Problem Reports Fixed

                            -131930: New Variables view is hard to use
                            -136478: IllegalArgumentException in ProcessPropertyPage
                            -138468: special characters should be escaped in var view
                            -138220: Using 0424-0010, I got org.eclipse.core.commands.common.NotDefinedException
                            -123842: IndexedVariablePartition has no children in InspectPopup.
                            -126725: "Find" in virtual trees
                            -126724: Copy Stack/Variables in virtual tree
                            -137782: Index out of bounds exception in clear()
                            -136671: Mnemonic conflict on "Common" Launch Configuration tab
                            -136917: Console view doesn't get opened in the current window
                            -137212: Launch Dialogs won't save data
                            -137511: Launch Dialogs won't close
                            -130201: Debug view doesn't select the last stopped thread
                            -109611: System environment variables are not propagated into External tools
                            -136623: prompt to delete shared configs not needed
                            -137379: Assert error from actions when wrappering JDT debug elements.
                            -135093: 'Errors in Project' dialog should have 'Yes' as default button
                            -134612: shared location dialog does not persist size/location
                            -134287: Junit View autosave class(es) used in test
                            -130208: Widget disposed in AsynchronousTreeModelViewer
                            -137836: Step Filters action do not use StepFiltersAdapter
                            -138186: Deadlock after inspecting a value (Ctrl+Shift+I)
                            -137569: Remove ICU4J dependency for org.eclipse.core.variables
                            -108039: Detail pane setting not remembered if debug views are controlled by context
                            -120620: Static variables show up twice in Find Variables Dialog
                            -133750: Copy variables action should include columns to copy values of variables
                            -137923: Delete Launch Configurations dialog problems
                            -138002: ModelDelta using ArrayList that only contains 1 element
                            -128452: Race Condition on Auto-Removal of terminated Launches
                            -128289: [memory view] added mem block not selected in mem view tree
                            -130572: [Memory View] Do not show Previous and Next Page actions for IMemoryBlock
                            -139051: Remove unused 'background' function in old debug action
                            -120200: Stepping performance deteriorates for testcase with many variables
                            -126725: Find" in virtual trees
                            -134833: Thread Change events not handled properly
                            -136439: Terminate All should be disabled on startup
                            -133422: [Memory View] SwitchMemoryBlock does not list all available memory blocks if the node is collapsed
                            -135275: [Memory View] Formatting sometimes not synchronized
                            -136646: [Memory View] Memory View takes focus whenever a rendering is added
                            -133755: Columns settings not remembered for Registers View
                            -137308: [Memory View] Need changes in table rendering resulted from changes with underlying table viewer
                            -138011: [Memory View] Format causes boundary alignment to be incorrect
                            -139024: Ant JRE tab has clipped widgets on the bottom
                            -138660: [Memory View] Firing state change event for memory block does not update labels
                            -138729: [Memory View] Need to be able to turn off address boundary alignment
                            - -

                            RC1 - April 13, 2006

                            -

                            Problem Reports Fixed

                            -101754: [EditorMgmt] Debug view opens wrong editor if more than one editor is registered for given file type.
                            -135629: undo/redo in variable view details pane
                            -134871: StackOverflowError using AsynchronousViewer
                            -133632: Please add "do not ask again" to "errors in project" dialog
                            -134177: Step Actions still check for IStep interface
                            -134324: infinite "do you wish to save?" dialogs
                            -17360: Should specify default shared config location
                            -134186: [Memory View] Workbench gets really slow after formatting to 1 byte per row
                            -134408: DBCS3.2: errors on the Variables view
                            -110215: Apply button has no effect after having modified launch configuration arguments
                            -135514: BreakpointConditionEditor disposes global action handler
                            -133563: Edit Source Lookup action available on non-existant config
                            -127894: Debug Exception when selecting the launch after refactor
                            -114727: DebugException after renaming a type and switching to debug perspective
                            -135877: Warning in latest nightly build
                            -135770: need to adopt ICU4J APIs
                            -133379: Bad console pattern listener breaks launching
                            -127157: Deleting > 1 project results in > 1 prompt to delete configs
                            -134746: Pressing ENTER key while editing program or VM arguments runs the app and doesn't insert a new line.
                            -131368: [Memory View] AddMemoryBlockAction and GoToAddressAction should get debug context from service
                            -131830: [Memory View] AbstractAsyncTableRendering shows pending forever
                            -133864: [Memory View] Columns not sized properly first memory rendering
                            -134886: [Memory View] Copy and Print actions only copy/print what's visible
                            -135031: [Memory View] Lose last line of buffer for IMemoryBlock after format
                            -135119: [Memory View] Reset does not position the base address to the top of the view
                            -135274: [Memory View] Text rendering should render memory byte-by-byte for invalid data
                            -134092: NPE in LaunchConfigurationsDialog
                            -135897: [Memory View] All tab labels show address if creating more than one rendering at the same time
                            -135914: [Memory View] TableRenderingModel only considers values when marking a byte as changed
                            -133857: Expansion not maintained in Registers View when switching between stackframes
                            -129247: [Memory View] Format Dialog is too small
                            -134603: [Memory View]MonitorMemoryBlockDialog is too small
                            -134348: Footprint fattening from StackFrameSourceDisplayAdapter
                            -131920: Variables view unusably small
                            - -

                            3.2 Milestone 6 - March 31, 2006

                            -

                            Problem Reports Fixed

                            -132896: Improve perspective description and display on launch dialog
                            -133752: Unexpected filtering in the launch configuration dialog
                            -132929: LCD Filtering is whacked
                            -132860: launch config resource filter assumes resource mapping is project
                            -133553: prompt for delete breakpoints and working sets enabled when nothing selected
                            -133705: Error out of date in Launch dialog
                            -133712: Typing in filter text in launch dialog does not work as expected
                            -132936: Resizeable launch configuration migration dialog
                            -130852: NPE from async tree viewer
                            -132342: [Memory View] Need more enhancements in offset mode for GoToAddressAction
                            -133371: [Memory View] SwitchMemoryBlockAction calls model on UI thread
                            -133877: [Memory View] Viewer contribution of AddMemoryRenderingActionDelegate does not work properly
                            -106790: Resume button is incorrectly enabled when the IProcess is selected
                            -131179: Show Column action has no effect in Registers View and Expressions View
                            -132044: ArrayIndexOutOfBound exception in Variables View if show column is off
                            -132150: Suspend action is always disabled
                            -127147: [Memory View] Allow user to enter "go to address" in an address bar from a rendering
                            -105733: TVT 3.1 - TCT 531 - Poor grammar in "Run Eclipse Application" and "Profile Eclipse Application"
                            - -

                            March 21, 2006

                            -

                            Problem Reports Fixed

                            -132953: DBCS3.2: unstable Breakpoint export
                            -131818: [Column Adapters] Widget disposed error closing down workbench
                            -131765: Columns disappear when resumig to breakpoint
                            -131842: Remove workaround for bug 95832
                            -131922: index out of bounds handling cell selection
                            -131587: launch config dialog has different appearance than the rest of eclipse
                            -131173: "show columns" setting not persisted
                            -130534: Need collapse option for launch config management
                            -132054: NPE in JavaBreakpointPropertiesAction
                            -118072: [flex-hierarchy] Setting color to null in label adapter does nothing
                            -127066: debug capability interfaces should be async
                            -106205: [plan item] Enhance the debug platform
                            -131816: [Memory View] Sync properties id need to be defined in AbstractAsyncTableRendering
                            -132027: [Memory View] Rendering View Pane is blank if the tree viewer is hidden
                            - -

                            March 14, 2006

                            -

                            Problem Reports Fixed

                            -131032: org.eclipse.debug.ui.BreakpointOrganizers shutdown problem
                            -131174: background color for changed value should be user pref
                            -131212: Need factory adapter for IModelSelectionPolicyAdapter
                            -103811: cannot delete a breakpoint working set
                            -79713: Persist/restore expansion state in the LCD
                            -125292: red X = delete black X = clear
                            -129757: view menu polishing: use 'Layout' submenu
                            -130750: cheese in LCD
                            -130663: Warn when console pattern matcher missing enablement expression
                            -102943: [Memory View] F1 help for Memory View does not work correctly
                            -108590: [Memory View] Add mnemonic to pull down menu items
                            -99866: [Memory View] Labels on the Memory Monitors Pane is truncated
                            -120758: [Memory View] Non-auto load mode does not load memory properly if row size is not boundary aligned
                            -127327: [Memory View] Rendering shows blank lines when re-synchronizing
                            -130370: [Memory View] Add Layout submenu in Memory View
                            -129761: [Memory View] memory view UI issues
                            -125374: support trees with columns
                            -130775: [Memory View] TableCursor magically appears again
                            -130941: [Memory View] swt exception when debug session is terminated
                            -130953: [Memory View] Create provisional APIs
                            - -

                            March 7, 2006

                            -

                            Problem Reports Fixed

                            -130431: A lot of characters in a line of output crashes Eclipse
                            -129762: initial focus in launch dialog should be on tree, not filter coolbar
                            -124257: LCD insists on saving
                            -128991: NPE in DebugPlugin
                            -127873: Actions incorrectly enabled in Debug view
                            -128685: Resume action enabled after all processes terminated
                            -129577: separate viewer model and widgets
                            -79912: Bad sizing in LaunchConfigurationsDialog
                            -130373: Bad sizing on the LaunchConfigurationPropertiesDialog
                            -129381: LaunchView will never return a ShowInContext
                            -130767: In 3.1/3.2, ExecutionArguments class unexpectedly returns surrounding double-quotes
                            -130828: Breakpoints View go to file icon is gone.
                            -130397: [Memory View] widget disposed exception when debug session terminates
                            -130555: [Memory View] Cursor unexpectedly disappears
                            - -

                            February 28, 2006

                            -

                            Problem Reports Fixed

                            -124799: Discouraged references on legitimate API methods
                            -127926: Discouraged access to "getContainer()" from "FolderSourceContainer"
                            -106406: Preference not saved when launching with compile error
                            -128383: BreakpointOrganzierLabelProvider extends internal UI class but does not use it
                            -128610: DBCS32: exported breakpoints file isn't UTF-8 encoded
                            -128978: Add an "Are You Sure?" check to "Remove All" action in Expressions View
                            -128553: NPE when launching Ant launch config
                            -128534: Use FilteredTree in launch configuration dialog
                            -129351: Mismatched selection in Launch Configuration Dialog after rename
                            -121747: [flex-hierarchy] investigate jface TreeSelection and TreePath
                            -129379: Incorrect logic in BreakpointTypeOrganizer
                            -128494: Organize manifests
                            -127331: [Memory View] Changing color setting has no effect until refresh
                            -127460: [Memory View] Create empty groups in context menu for AbstractAsyncTableRendering
                            -127371: [Memory View] #supportsValueModification calls on UI thread
                            - -

                            3.2 M5 - February 17, 2006

                            -

                            Problem Reports Fixed

                            -123653: Ctrl-Shift-D does not work in dialogs
                            -127914: Export Breakpoints Table does not use Dialog Font
                            -127581: NPE attempting selection
                            -124274: debug keybindings not active on first launch
                            -127067: Instruction pointer images should be API
                            -126630: Deadlock while building
                            -121454: Console synchronization problem
                            -105235: TVT 3.1: TCT479 - mnemonic char in middle of DBCS menu label
                            -117103: Suspending the target manually does not expand it.
                            -126667: Copy stack behavior differs when showing thread groups
                            -68394: [view management] debug view stays when debug session finishes
                            -87612: Automated tests for debug view management
                            -119512: [flex-hierarchy] AsynchronousTreeViewer.add(..) requires UI Thread.
                            -124203: View management with respect to debug context manager
                            -126790: Variables view update problems
                            -117491: Debug event handlers no more
                            -119512: [flex-hierarchy] AsynchronousTreeViewer.add(..) requires UI Thread.
                            -126666: NPE in target on latest code
                            -126726: Show Monitors not working
                            -125236: Missing context help
                            -95791: [view management] Context enablement efficiency
                            -127106: suspend trigger not created for subsequent launches
                            -127130: ConsoleDocumentAdapter.repairLines needs review
                            -66576: perspectives pref page tab does not take activities into accoutn
                            -126963: Terminate action in console context menu
                            -126964: "Remove Launch" action in console context menu
                            -126884: Terminology: 'Perspectives' vs. 'Perspective Switching'
                            -125375: Cancel does not cancel launch
                            -126439: SelectAllExpressionsAction leakage
                            -127334: Turning off filter checked launch configuration types fails
                            -127305: apply revert buttons appear always
                            -127246: NPE in ViewContextService.perspectiveChanged
                            -126733: Debug view toolbar actions initially enabled
                            -127307: empty logical structure dance
                            -127937: Leak: LaunchSuspendTrigger is not disposed properly
                            -127903: Terminate all has no effect
                            -125536: selection not revealed when item not populated
                            -127458: NPE attempting selection
                            -127918: Refresh Tab displaying incorrect error message
                            -127932: Widget is disposed
                            -127473: NPE in Launch View context provider
                            -127190: Duplication of stack in Debug View
                            -127757: missing thread in debug view
                            -127946: Leak: ConsoleView never deregistered from the ConsoleManager
                            -127886: NPE on importing Ant breakpoints
                            -90164: [Memory View] Highlight/Colourize Changed Values
                            -106424: [Memory View] Move memory view update to background thread
                            -120031: [Memory View] Need to allow clients to customize labels in SwitchMemoryBlockAction
                            -120126: [Memory View] RenderingViewPane does not set selection to new memory block
                            -128096: [Memory View] Selection in tree view pane not maintained properly
                            -120443: [Memory View] Reset Monitor action does not run
                            -127368: [Memory View] NPE in synchronization service when Memory View is closed
                            -128292: launch config type viewer is showing private config types
                            -128144: Launch view should support legacy "workbench adapters"
                            -128210: Cannot expand items in the Variables view
                            -128314: NPE after clicking in stack
                            - -

                            February 7, 2006

                            -

                            Problem Reports Fixed

                            -126024: Launch config filter for external tools
                            -126114: Launch Configuraiton dialog filter count does not update
                            -123163: AsynchronousTreeViewer should use SWT.VIRTUAL.
                            -120863: Support Ctrl modifier on console hyperlinks
                            -121106: no need for IModelDelta.CHANGE flag
                            -122743: ToggleBreakpointAction must implement IUpdate
                            -124040: debug/inspect popups require ITextViewer
                            -125490: Debug view not populated when a breakpoint is reached
                            -125771: unable to create method breakpoints in external source
                            -126106: popup dialog API changes
                            -126165: Snipptet editor's 'documentSetup' extension violates spec
                            - -

                            January 31, 2006

                            -

                            Enhancements

                            -
                              -
                            • Added API to consolePatternMatchListeners extension to support the use of - string variable substitution in pattern matchers. See extension point documentation.
                            • -
                            • Added API to delegate watch expression creation to debug model via IWatchExpressionFactoryAdapter. - Allows a debugger to override default watch expression creation based on a - variable's name.
                            • -
                            -

                            Problem Reports Fixed

                            -119488: java stack trace hyperlinks not .java agnostic
                            -124257: LCD insists on saving
                            -125244: ResourceException while running Debug test suite
                            -12134: Closing a project should disable run and debug.
                            -125005: renaming a project prompts for deleting launch configs
                            -115044: Filter launch configurations to current working set
                            -125361: spelling error in Configure Details Area dialog
                            -125054: FIlter menu mnuemonic should be letters not numbers
                            -124160: step actions become disabled
                            - -

                            January 24, 2006

                            -

                            Problem Reports Fixed

                            -124171: Launch configuration filters prefs page: glitches in labels
                            -123861: Selection remains on filtered config
                            -124170: Launch configuration filters: pulldown menu on filter button
                            -124181: Invalid Thread Access in LaunchConfigurationsDialog
                            - -

                            January 17, 2006

                            -

                            Enhancements

                            -
                              -
                            • New API to export and import breakpoints. The new API classes ExportBreakpointsOperation - and ImportBreakpointsOperation can be found in org.eclipse.debug.ui.actions.
                            • -
                            - -

                            Problem Reports Fixed

                            -19521: Launching classes from closed projects
                            -122882: Mnemonic change on debug launch page: "De&bug" conflicts with "&Browse" buttons
                            -114521: Still too hard to customize the coloring of the executing line
                            -123820: typo in AbstractSourceLookupDirector javadoc
                            -113772: removing a project should remove launcher-entry as well
                            -123627: Filter count on LCD not accurate
                            -123630: CCE pressing Aply in Launch config pref page
                            -123635: run/debug latest fails when filtered
                            -123680: FIlter count not updated with action
                            -123858: LCD main page needs updating
                            -123663: Launch history should support Capabilities
                            -123862: keywords for Launch Configurations pref page
                            -123889: LCD not setting dialog font for preferences dialog
                            -123956: Font not propegated to child widgets
                            -123440: DebugPopup and InspectPopup need javadoc/since 3.2
                            -124017: NPE after deleting config from LCD
                            -111530: update dialog size/position persistance
                            -123847: Remote Java App - Debug Run Configuration - throws IndexOutOfBoundsException
                            - -

                            January 10, 2006

                            -

                            Enhancements

                            -
                              -
                            • Insturction pointer annotataions can be overriden in part or whole by having a debug - model presentation implement IInstructionPointerPresentation. This allows - specification of the entire annotation object, and annotation type + text, or an - image + text.
                            • -
                            -

                            Problem Reports Fixed

                            -122908: pref pages missing context help
                            -121681: CCE in breakpoints export wizard.
                            -116316: "Source lookup error" logged
                            -122646: Use IStructuredSelection instead of StructuredSelection
                            -111017: default tab width for MessageConsole changed from 8 to 0 in 3.1
                            -116060: MessageConsoleStream.println synchronization hazard
                            -117946: InstantiationException from ConsoleRemoveLaunchAction
                            -119306: [flex-hierarchy] LaunchView autoExpand() creates TreePath with hard coded hierarchy
                            -122166: Watch does Inspect in 3.2M4
                            -123327: Need API to import / export breakpoints programatically
                            - -

                            3.2 M4

                            -

                            Problem Reports Fixed

                            -120677: Terminating a debug launch does not deactivate the debugging context
                            -108568: Debug console test failure
                            -120028: ConcurrentModificationException in DecorationManager when stepping
                            -121092: DefaultUpdate policy ignores EXPAND and SELECT deltas for unchanged items
                            - -

                            December 12, 2005

                            -

                            Enhancements

                            -
                              -
                            • The "source not found" editor and editor input have become API. - See CommonSourceNotFoundEditor and CommonSourceNotFoundEditorInput.
                            • -
                            • The "changed value color" has become API. See IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR - and DebugUITools.getPreferenceColor(id).
                            • -
                            -

                            Problem Reports Fixed

                            -120683: Please stop using ListenerList from org.eclipse.core.commands
                            -119447: SaveScopeResourcesHandler needs check for Private configs
                            -117098: Thread not selected on class loading breakpoint hit
                            -92901: Popup control should be installed once on each control
                            -106419: [Memory View] Improve user experience for adding new memory blocks
                            -100081: [Memory View] Support for address space in Memory View
                            -106422: [Memory View] Improvement to Memory Monitor View Pane
                            -118075: CommonSourceNotFoundEditor needs to be public
                            -106421: [Memory View] Initial column size preference should be stored by debug target
                            -112412: Make access to change variable colour preference public
                            -117093: [flex-hierarchy] Drop to frame doesn't clear old current line annotations.
                            -117082: [flex-hierarchy] expressions don't show errors
                            -119391: Many NPEs in DebugTargetProxy.containsEvent
                            -120010: combine IModelDelat and IModelDeltaNode
                            -108828: Drag and Drop in Breakpoints view shows misleading drop affordance
                            -120447: prompted to save scrapbook editor before exeucting expression
                            -117072: [flex-hierarchy] suspend event may occurr before proxy installed
                            -113410: null fTabFolderForMemoryBlock in RenderingViewPane.memoryBlocksAdded
                            - -

                            December 6, 2005

                            -

                            Enhancements

                            -
                              -
                            • New API action for enabling/disabling breakpoints in editor ruler - RulerEnableDisableBreakpointActionDelegate.
                            • -
                            • New abstract API action for action working on breakpoints in editor ruler - - RulerBreakpointAction.
                            • -
                            • API to retrieve images and browsers for source containers added to DebugUITools.
                            • -
                            • API for overriding default instruction pointer annotations - see IInstructionPointerPresentation.
                            • -
                            -

                            Problem Reports Fixed

                            -63058: Adding lots of favorites needs busy cursor
                            -97706: [Memory View] Need to make some more Memory View related contants/methods public
                            -88914: [Memory View] Provide UI and API to configure the addressable size.
                            - -

                            November 29, 2005

                            -

                            Enhancements

                            -
                              -
                            • API has been added to retrieve images and browsers for source container - types. See DebugUITools.
                            • -
                            -

                            Problem Reports Fixed

                            -117945: [flexible hierarchy] ClassCastException when trying to get active context
                            -117386: [flex-hierarchy] expand over rides previous expands
                            -112792: NPE in TextConsoleViewer
                            -89429: Make the SourceLookupUIUtils class public
                            -117720: SelectAll and Copy actions not available in Registers View
                            -118082: Deadlock between VariablesViewer and DefaultVariableViewModelProxy
                            - -

                            November 22, 2005

                            -

                            Problem Reports Fixed

                            -114845: 'Terminate and relaunch' action is enabled for non-relaunchable configs
                            -115874: Import and Export icons for Breakpoints are backwards.
                            -117057: [flex-hierarchy] NPE in RemoveAllTerminatedAction
                            -117090: [flex-hierarchy] terminated threads appear in debug view
                            -82850: Variable is not updated in the variables view
                            -106150: Variables view is constantly updating which results in 100% CPU usage
                            -109943: Expressions view calls expensive IValue.getVariables() instead of cheap IValue.hasVariables()
                            -110206: Variables view won't collapse
                            -117101: [flex-hierarchy] select/expand states not cleared from cache
                            -117155: [flex-hierarchy] Threads not updated when target resumed
                            -114617: [Memory View] Tooltip not updated propertly at column 0 in AbstractTableRendering
                            -100273: [Memory View]: Preference Table Renderings UI bug
                            -117095: [flex-hierarchy] resuming one thread does not select next suspended thread
                            -117106: [flex-hierarchy] null tree path with manually expanding thread
                            - -

                            November 8, 2005

                            -

                            Problem Reports Fixed

                            -115195: Debug manifests reference a deprecated header
                            -115155: Link to perspective preferences
                            -90031: [Memory View] Adjust the Number of Columns in the Memory View
                            - -

                            October 31, 2005

                            -

                            Enhancements

                            -
                              -
                            1. Consoles can provide context specfic F1 help. Console implementations should - override AbstractConsole.getHelpContextId() to hook appropriate - help. If not provided, the generic help for the console view is displayed.
                            2. -
                            -

                            Problem Reports Fixed

                            -112625: Launcher : Bad default value with the variable ${string_prompt}
                            -112670: Can't toggle selection of treeitem in variables view
                            -113837: breakpoints import and export wizards should be categorized
                            -112503: Cannot change the background color of the 'Display' view
                            -112553: ConcurrentModificationException in BreakpointManager
                            -112771: Add API to allow specific context help in Text Consoles
                            - -

                            October 25, 2005

                            -

                            Problem Reports Fixed

                            -112648: Breakpoint import/export references java constant
                            -113378: incorrect neumonic on Launching preference page
                            -111633: API clarification needed for getWorkingCopy()
                            -111739: [Contributions] matchesContentType check does not take base-type into account
                            -106567: [Memory View] Provide hover support in table renderings
                            - -

                            October 18, 2005

                            -

                            Problem Reports Fixed

                            -110080: breakpoint import updates breakpoint view for each breakpoint
                            - -

                            October 11, 2005

                            -

                            Problem Reports Fixed

                            -111485: perspective page fails when new launch types are added
                            -103462: Stacktrace-Hyperlink works only for one link per line
                            -111437: hyperlinks not updated
                            -109491: Exception in log
                            - -

                            October 4, 2005

                            -

                            Enhancements

                            -
                              -
                            1. The perspective settings associated with launch configurations have been - centralized on the "Run/Debug > Perspectives" preference page. - Previously the perspective settings were controlled via the launch configuration - dialog. The "Perspectives" tab has been replaced with a "Getting - Started" tab that explains how to create a new configuration.
                            2. -
                            -

                            Problem Reports Fixed

                            -110928: mneumonic conflict on preference page
                            -79709: Centralize launching preferences
                            -110075: Embedded breakpoints view with nested groups does not update check marks properly
                            -111079: debug/run button active with multiple selection
                            - -

                            September 21, 2005

                            -

                            Problem Reports Fixed

                            -110078: acclerator conflict in breakpoint import
                            -110074: Breakpoints are not added to default breakpoint working set
                            - -

                            September 19, 2005

                            -

                            Enhancements

                            -
                              -
                            1. Remove a single console: An action has been added to the console - toolbar to remove the associated launch/console.
                            2. -
                            - -

                            Problem Reports Fixed

                            -109008: breakpoint import/export polish items
                            -103731: breakpoint working set settings lost on project close/open
                            -102270: Console: Close just one window?
                            -109009: Tests for breakpoint import/export
                            -109777: import/export breakpoints test failure
                            -102526: Find/Replace in Console window does not go to proper place of matches when window has fixed width
                            - -

                            September 13, 2005

                            -

                            Enhancements

                            -
                              -
                            1. Breakpoint import and export: Breakpoints can be exported - and imported from the local file system. Actions are available in the context - menu of the Breakpoints view to export/import, as well as in the general import/export - wizard.
                            2. -
                            -

                            Problem Reports Fixed

                            -41057: Option to export and import break points at the Breakpoints view
                            -86114: Breakpoint working set wizard should show breakpoints in hierarchical fashion
                            - -

                            September 6, 2005

                            -

                            Enhancements

                            -
                              -
                            1. System properties as launch variables: A new string variable - "${system_property:name}" was added to the debug platform that resolves - to the value of a system property in the Eclipse SDK runtime. The variable - accepts a system property name as an argument and a selection dialog allows - the user to select from known system properties.
                            2. -
                            - -

                            Problem Reports Fixed

                            -108323: expose system properties as variables in the launching framework
                            - - -

                            Aug 30, 2005

                            - -

                            Problem Reports Fixed

                            -107488: [Memory View] Table rendering stop updating when new memory blocks are added
                            -108307: remove coupling between breakpoints view and content provider
                            -105356: TVT 3.1 - TCT 428 - Mnemonic Error
                            -107383: testCaseSensitiveQualifiedSourceLookup failure
                            -108126: NPE when bringing Registers View to the top
                            -107739: [Memory View] Rendering View Pane does not pin display on first new memory block.
                            - -

                            Aug 8, 2005

                            -

                            Enhancements

                            -
                              -
                            1. API addition: IDebugUIConstants.PREF_MAX_DETAIL_LENGTH. - The user preference controlling the maximum length of strings displayed in - the Variables view detail area has been made public API. In previous builds - the preference was internal.
                            2. -
                            -

                            Problem Reports Fixed

                            -106178: Remove uneccessary NLS tags
                            -89471: [polish] Installed JRE pref page: Source attach & jdoc loc should be configurable in default
                            -104852: Debug View changes focus on removal of terminated launch forcing editor popup
                            -104675: large byte[] variabls expand into too much memory
                            - - -

                            Aug 2, 2005

                            -

                            Enhancements

                            -
                              -
                            1. Added NL support for images.
                            2. -
                            -

                            Problem Reports Fixed

                            -103381: Infinite viewer expand/restore when recursive data structure expanded
                            -105071: Incorrect handling for debugger's continue-launch-despite-compile-errors dialog
                            -105264: [BIDI] need to add $nl$/ to icon paths for reversed icons
                            -104573: Resource Tree Locked error while saving shared Eclipse Application launch config
                            - -

                            July 26, 2005

                            -

                            -Problem Reports Fixed

                            -98147: Variables View does not show all children if same instance is expanded twice
                            -99416: Evaluation in context of superclass fails to resolve instvar in subclass
                            -100543: TextConsoleViewer should not subclass TextViewer
                            -100480: Duplicate launch configuration leads to bogus launch configuration
                            -102537: org.eclipse.ui.console.consolePageParticipants API information
                            -99753: Debug use of new Boolean(boolean)
                            - - diff --git a/org.eclipse.debug.core/r3_3_buildnotes_platform-debug.html b/org.eclipse.debug.core/r3_3_buildnotes_platform-debug.html deleted file mode 100644 index 5c79a75b8..000000000 --- a/org.eclipse.debug.core/r3_3_buildnotes_platform-debug.html +++ /dev/null @@ -1,747 +0,0 @@ - - - - - - - Platform Debug Release Notes - - -

                            Eclipse 3.3 Debug Platform Build Notes 

                            - -

                            Summary of API changes in 3.3

                            -

                            Launching

                            -The launch framework has been enhanced to support the following: -
                              -
                            • Mixed mode launching - for example, allows an application to debugged and - profiled at the same time
                            • -
                            • Multiple launch delegates for the same configuration type and mode combination - - for example, allows multiple Java profilers to exist in the workbench side - by side
                            • -
                            • Contribution of extra tabs to existing tab groups - for example, allows - a profiler to contribute a profile options tab to an existing tab group in - the launch dialog
                            • -
                            • Read-only launch configurations - for example, if a launch configuration - is stored in the file system in a read-only state, the launch configuration - cannot be edited in the launch dialog
                            • -
                            • Nested launch configuration working copies - allows a working copy to be - created from a working copy that saves back to the parent working copy instead - of file system
                            • -
                            -

                            The following extension points have been added:

                            -
                              -
                            • org.eclipse.debug.ui.launchConfigurationTabs - allows a tab - to be contributed to an existing tab group in the launch configuration dialog -
                                -
                              • added extension point identifier constant IDebugUIConstants.EXTENSION_POINT_LAUNCH_TABS -
                              • -
                              -
                            • -
                            -

                            The following extension points have been enhanced:

                            -
                              -
                            • org.eclipse.debug.core.launchDelegates -
                                -
                              • addition of optional name attribute to allow users to select - a launcher when more than one is available
                              • -
                              • addition of optional modeCombination element to specify - supported mixed launch modes
                              • -
                              -
                            • -
                            • org.eclipse.debug.core.launchConfigurationTypes -
                                -
                              • addition of optional icon attribute to allow an icon to - be contributed in the same extension as its type. This can only be used - if the icon is in the same plug-in as the launch configuration type.
                              • -
                              • addition of optional delegateName attribute to allow users - to select a launcher when more than one is available
                              • -
                              -
                            • -
                            -

                            The following types have been added:

                            -
                              -
                            • added interface org.eclipse.debug.core.ILaunchDelegate - provides - access to a launch delegate extensions and attributes
                            • -
                            • added class org.eclipse.debug.ui.AbstractLaunchModeConfigurationTab - abstract - implementation of a launch tab that modifies a configuration's launch mode
                            • -
                            -

                            The following types have been modified in support of launching enhancements:

                            -
                              -
                            • org.eclipse.debug.core.ILaunchConfiguration -
                                -
                              • added method getAttribute(String key, Set defaultValue)
                              • -
                              • added method getModes()
                              • -
                              • added method isReadOnly()
                              • -
                              -
                            • -
                            • org.eclipse.debug.core.ILaunchConfigurationType -
                                -
                              • deprecated method getDelegate(String mode)
                              • -
                              • added method getDelegates(Set modes)
                              • -
                              • added method getPreferredDelegate(Set modes)
                              • -
                              • added method setPreferredDelegate(Set modes)
                              • -
                              • added method supportsModes(Set modes)
                              • -
                              • deprecated method getSupportedModes()
                              • -
                              • added method getSupportedModeCombinations()
                              • -
                              • added method getContributorName()
                              • -
                              • added method getImageDescriptorPath()
                              • -
                              -
                            • -
                            • org.eclipse.debug.core.ILaunchConfigurationWorkingCopy -
                                -
                              • added method addModes(Set modes)
                              • -
                              • added method setModes(Set modes)
                              • -
                              • added method removeModes(Set modes)
                              • -
                              • added method getNestedWorkingCopy()
                              • -
                              • added method getParent()
                              • -
                              -
                            • -
                            • org.eclipse.debug.ui.DebugUITools -
                                -
                              • added method getLastLaunch(String id)
                              • -
                              • added method openLaunchConfigurationEditDialog(Shell shell, ILaunchConfiguration - configuration, String groupIdentifier, IStatus status, boolean showCancel)
                              • -
                              -
                            • -
                            • org.eclipse.debug.ui.AbstractLaunchConfigurationTab -
                                -
                              • added method getId()
                              • -
                              -
                            • -
                            • org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction -
                                -
                              • getHistory()
                              • -
                              • getFavorites()
                              • -
                              -
                            • -
                            -

                            Debug Context Service

                            -

                            A debug context represents the 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. A set - of classes and interfaces have been added allowing clients to respond to and - provide the active debug context.

                            -

                            The package org.eclipse.debug.ui.contexts has been added with - the following types:

                            -
                              -
                            • AbstractDebugContextProvider
                            • -
                            • DebugContextEvent
                            • -
                            • IDebugContextListener
                            • -
                            • IDebugContextManager
                            • -
                            • IDebugContextProvider
                            • -
                            • IDebugContextService
                            • -
                            • ISuspendTrigger
                            • -
                            • ISuspendTriggerListener
                            • -
                            -

                            The following types have been modified

                            -
                              -
                            • org.eclipse.debug.ui.DebugUITools -
                                -
                              • added method getDebugContextManager()
                              • -
                              -
                            • -
                            -

                            Debug Commands

                            -

                            Debug commands represent common debug operations implemented by debuggers - - for example, step over, suspend, resume, and terminate. The debug platform allows - debuggers to provide custom implementations of the operations by implementing - debug command handler interfaces. The platform provides a user interface and - actions that delegate to the command handlers. As well, the platform provides - an implementation of the commands for debuggers that are implementations of - the standard debug model. Debuggers may override the standard implementation - by directly implementing the command handler interfaces in debug model elements - or by registering adapters for the command handler interfaces on debug model - elements. The command handler interfaces are to be implemented in a non-blocking - fashion, and are designed with an asynchronous API, allowing clients to cancel - a command or report failure via the asynchronous request.

                            -

                            The package org.eclipse.debug.core.commands has been added with - the following types:

                            -
                              -
                            • IDebugCommandHandler
                            • -
                            • IDebugCommandRequest
                            • -
                            • IDisconnectHandler
                            • -
                            • IDropToFrameHandler
                            • -
                            • IEnabledStateRequest
                            • -
                            • IResumeHandler
                            • -
                            • IStepFiltersHandler
                            • -
                            • IStepIntoHandler
                            • -
                            • IStepOverHandler
                            • -
                            • IStepReturnHandler
                            • -
                            • ISuspendHandler
                            • -
                            • ITerminateHandler
                            • -
                            -

                            Note that the "use step filters" setting has been moved to the org.eclipse.debug.core - plug-in from org.eclipse.debug.ui. This is to allow the toggle - step filters command to work properly in absence of the UI plug-in. The following - API methods have been added to DebugPlugin:

                            -
                              -
                            • setUseStepFilters(boolean useStepFilters)
                            • -
                            • isUseStepFilters()
                            • -
                            -

                            The same methods that existed in DebugUITools now delegate to - these new methods.

                            -

                            Pluggable Detail Panes

                            -

                            The variables, registers, and expressions views in Eclipse 3.3 support pluggable - detail panes. A new extension point - org.eclipse.debug.ui.detailPaneFactories - - is used to contribute factories that create detail panes for specific selections. - The platform provides a default text details area that displays textual details - based on a debug model presentation's computeDetails(...) method. - Clients can contribute detail pane factories with enablement expressions that - can create one or more detail panes for specific objects/selections. The user - is allowed to choose between available detail panes using a context menu. See - IDetailPaneFactory and IDetailPane.

                            -

                            Source Lookup

                            -

                            Source lookup is driven by the active debug context. When a context is activated - the debug platform displays source for that context. Clients may provide a custom - implementation of source lookup by implementing the source display interface - directly on their debug model elements, or by providing an adapter for the source - display interface. The debug platform provides a standard implementation of - source display for debuggers that are an implementation of the standard debug - model - i.e. implementations of IStackFrame that have an associated - ISourceLocator.

                            -

                            The following interface has been added:

                            -
                              -
                            • org.eclipse.debug.ui.sourcelookup.ISourceDisplay
                            • -
                            -

                            Console

                            -
                              -
                            • Added DebugPlugin.ATTR_CONSOLE_ENCODING - this launch attribute - specifies the encoding used by the console. When unspecified the default system - encoding is used. This constant replaces the now deprecated IDebugUIConstants.ATTR_CONSOLE_ENCODING.
                            • -
                            • Deprecated IDebugUIConstants.ATTR_CONSOLE_ENCODING.
                            • -
                            • Added support to set the background color to text consoles - see new methods - TextConsole.setBackground(Color) and getBackground()
                            • -
                            • Added property constant to indicate background color of a console has changed - - IConsoleConstants.P_BACKGROUND_COLOR.
                            • -
                            • Added preference constant IDebugUIConstants.PREF_CONSOLE_FONT, which is used to specify - what font should be used in the console.
                            • -
                            -

                            Expressions

                            -
                              -
                            • added org.eclipse.debug.ui.actions.IWatchExpressionFactoryAdapterExtension - - this is an interface that can be optionally implemented by IWatchExpressionFactoryAdapter's. - Allows the Create Watch Expression action to be dynamically enabled - based on the selected variables.
                            • -
                            -

                            Breakpoints

                            -
                              -
                            • Added new optional interface for breakpoint organizer extensions. Breakpoint - organizer delegates may optionally implement the IBreakpointOrganizerDelegateExtension - interface. The new interfaces supports add and remove operations on collections - of breakpoints to allow for more efficient drag and drop operations in the - breakpoints view.
                            • -
                            -

                            Memory Renderings

                            -
                              -
                            • Memory renderings can optionally implement the new interface IRepositionableMemoryRendering - to support repositioning. The API allows a memory rendering to be positioned - to a user specified address.
                            • -
                            -

                            Debug Popup Anchor

                            -
                              -
                            • The specifications on the constructor for DebugPopup have been updated to reflect the change allowing -null to be passed as the default anchor point. This change allows consumers of the popup to force a default location -for the popup to appear when an otherwise valid anchor point is not available.
                            • -
                            - -

                            3.3 RC4 - June 8, 2007

                            -

                            Problem Reports Fixed

                            -188404: [doc] Help for default launchers is meaningless
                            -190264: [doc] Add links to command contexts to reference help
                            -190269: [doc] JDT Developer Guide Topics need organizing
                            -190528: [doc] New screenshots needed for debug help
                            -190259: [doc] Check html links in doc plugin
                            -190532: [doc] Variables and Expressions aren't helpful enough
                            -190535: [doc] Run/Debug help doesn't make sense with contextual launching
                            - -

                            3.3 RC3 - June 1, 2007

                            -

                            Problem Reports Fixed

                            -189708: fill contextual launch perf test is yellow
                            -188689: [Memory View] Command Handler conflict when switching to java editor
                            -189665: IProcess label not displayed in debug view
                            -189182: Help contents cannot be fully indexed
                            -189509: Contextual launching glitches
                            -189982: Layout shows "Variables View Only" in Registers View drop-down
                            - -

                            3.3 RC2 - May 25, 2007

                            -

                            Problem Reports Fixed

                            -187746: Conflicting mnemonics on Environment tab of OSGi Framework launcher
                            -188444: Restore Defaults does not work in Launch Preference Page
                            -187905: [doc] console actions are missing help context ids
                            -187684: Slow to show debug drop-down
                            -188315: [doc] Reference help uses incorrect style
                            -188747: [doc] "Realizes" should be replaced with "Opens" in help doc
                            -188919: [doc] Breakpoints view doc needs improvements
                            -189019: [doc] import/export breakpoints topics do not follow style
                            -189024: [doc] import/export breakpoints F1 help needs more topics
                            -189012: Change Value dialogs do not have F1 help
                            - -

                            3.3 RC1 - May 18, 2007

                            -

                            Problem Reports Fixed

                            -186527: F11 (Debug Last Launched) behaves wrong in 3.3m7
                            -186920: TextConsole setBackground method incorrectly spelled as setBackgrond
                            -187171: [Memory View] Reset Monitors action is enabled when there is no monitor
                            -187043: TVT33:TCT179: ja: mnemonic displayed in the hover text (linux only)
                            -183509: [launching] Optimize launcher story for test driven development
                            -187049: Update org.eclipse.jdt.doc.user Memory view user assistance
                            -186595: Non-nls string in StackFrameSourceDisplayAdapter
                            -186622: Deadlock trying to launch two configs at the same time
                            -184934: [breakpoints] double click bp in external source should fail more gracefully
                            -169718: Received ConcurrentModificationException when debugging in RAD6
                            -185553: Strange icon in the launch configuration context menu
                            -169438: [Debug Framework] DefaultVariableCellModifier doesn't call verifyValue
                            -184959: instruction pointer remains when added > 1 editor
                            -185311: typo in detailPaneFactories.exsd
                            -144019: [KeyBindings] Constructed context shows in Keys pref page
                            -185171: LaunchConfigurationTypesViewer is no longer used and should be deleted
                            -184867: Ok is the new Cancel
                            -184898: [breakpoints] AIOOB exception setting default working set
                            -184893: [launching] Restore defaults in Run/Debug settings does nothing
                            -184972: [launching] the Search... button is the new dirty button
                            -184631: no way to remove launches
                            -184864: [help] Help topic for Run/Debug properties pages is wrong
                            -184999: Add/Edit File System Directory Dialog has incorrect F1 help
                            -184873: No F1 help for Registers view
                            -185832: [launching] [favorites] filtered launch configurations show up where they shouldn't
                            -185621: Launching history imposes size limit without message
                            -185688: [KeyBindings] conflict between Run and Debug last launched on Mac
                            -184970: [Memory View] NPE in SwitchMemoryBlockAction
                            -184880: [launching] cannot apply changes editing launch configuration
                            -184901: [breakpoints] Breakpoints get removed for same named resources
                            -184865: [help] help topic for Select Configuration Type dialog
                            -184945: [breakpoints] [refactoring] Moving breakpoints of an anonymous inner type has bad label
                            -185829: [help] The add favorites dialog help is not helpful
                            -184902: Timing problem in variables views' expansion state save/restore logic.
                            -184958: Text from bottom of launch dialog gets cut off
                            -187033: Concurrent modification exception in LaunchManager
                            -173120: [variables] logical structures re-computed for each visible range
                            -187319: TVT33:TCT189: ar: 13.002210 Parenthesis incorrectly displayed
                            -187134: NLS33:default Run application name RTL reading order problem
                            -186921: TVT33:TCT170: zh_TW:the mnemonic should be either removed or placed in the end
                            - -

                            3.3 Milestone 7 - May 4, 2007

                            -

                            Problem Reports Fixed

                            -184896: Concurrent Modification on startup
                            -134863: [Memory View] Cell editors in the table rendering needs to be extensible
                            -176857: [Memory View] View id check in DefaultModelProxyFactory makes rendering not portable
                            -176858: [Memory View] CreateRendering can potentially get left behind
                            -181648: [Memory View] NPE in AbstractAsyncTableRendering when activated
                            -183078: [Memory View] NPE in sync service
                            -183019: [Memory View] Reset does not position the base address to the top
                            -184315: Remove all breakpoint dialog does not honor escape
                            -184320: Color labels for changed values are variables specific
                            -167426: InstructionPointerContext keeps reference to closed editor
                            -183887: NPE in DefaultVariableViewModelProxy
                            -183504: Frames collapse when holding down step over key
                            - -

                            April 24, 2007

                            -

                            Problem Reports Fixed

                            -184108: [Memory View] Address passed to the cell modifier is incorrect for muti-byte addressable size
                            -183621: Ensure plug-in dependencies are correct (versions)
                            -183059: SWTException: Failed to execute runnable (ArrayIndexOutOfBoundsException)
                            -180441: RetargetAction should not update upon text selection change
                            -132385: [Memory View] "Remove Rendering" action not disabled
                            -144467: [jdi] SocketLaunchingConnectorImpl.launch should call Runtime.getRuntime().exec(String [])
                            -173306: When editing source lookup, new source containers should be added at the top of the list.
                            -182657: AssertionFailedException running Ant UI test suite
                            -182324: [launching] When launching a project with errors the warning dialog title says "Errors in Project{0}"
                            -136943: [console] README: Console Deadlock when too much information written
                            -183163: Accessing constants causes DebugUI to be started
                            -182318: context launching should be default launch pref setting
                            -183097: [launching] prompted for which Eclipse Application to launch after workbench restart
                            -177539: [launching] Press on Run/Debug button launches an unexpected configuration
                            -182774: [launching] launch shortcuts have deprecated elements
                            -112081: [launching] Widget is disposed error from launch config window
                            -183275: NPE in TreeModelContentProvider.getPresentationContext
                            -183460: catch up with JFace fixes from bug 172640
                            -183463: Expanded nodes in tree viewer flash on refresh
                            -182901: Better labels for references tracking
                            -183360: [launching] Launching tooltip re-computed for same selection
                            -176471: [launching] debug fails if the default jre is a jdk
                            -181220: Variable text font does not update correctly when columns turned on/off
                            - -

                            April 17, 2007

                            -

                            Problem Reports Fixed

                            -182230: org.eclipse.core.variables version number update
                            -182554: illegal argument exception updating labels
                            -182170: Index out of bounds running test suite
                            -177909: [Variables View/Registers View] Refresh/Scroll issues - Test Case to reproduce
                            -31969: [breakpoints] Method breakpoint icon too wide for editor ruler
                            -177910: [Debug] No stack frame selected when thread has been suspended
                            -178868: run/debug buttons do nothing if exception in shortcut enablement expr
                            -181044: LabelUpdate does not store previous font data
                            -181769: [api] broken api contract in ContextualLaunchAction
                            -181809: [launching] ContextualLaunchAction shuold not hold handle to current selection
                            -182572: [tests] TestAlternateModeTab invalid thread access
                            - -

                            April 10, 2007

                            -

                            Problem Reports Fixed

                            -178106: [detail pane] Find action doesn't scroll to reveal selection
                            -176478: [Registers View] Add font preference for registers view
                            -180618: AbstractLaunchConfigurationTabGroup#setDefaults() no longer gets called
                            -178753: Cannot do anything in Run/Debug>Launching>Default Launcher preference page
                            -74480: [launching] Simplify the launch experience for less technical users of Eclipse
                            -154107: [launching] Enhance launching support
                            -166219: [launching] Run Last Launched fails due to Launch Config Tree filter
                            -180756: Launch config attriubutes should be persisted in consistent order
                            -143711: [views] async update of variables view too granular
                            -177303: [launching] ContextLaunchingResourceManager slows down structured selection changes and part activations
                            -42879: [launching] Common tab does not allow revert when in error state
                            -180971: [breakpoints] export breakpoints dialog scrolled to right
                            -138780: [variables] [vitrual] Detail pane doesn't show value of selected element if it is invisible
                            -181034: Closing the workbench results in Widget is disposed
                            -178526: New menu item "Open Debug Dialog..." is counter intuitive and has bad kbd access key
                            - -

                            April 3, 2007

                            -

                            Problem Reports Fixed

                            -177640: icon attribute from consoleFactory element should be a resource type
                            -164218: [console] IOConsoleInputStream.read() doesn't reduce the amount of data available
                            -179558: [console] Preferences... action should use the new SWTFactory
                            -178356: [launching] launch tabs do not match new presentation
                            -176638: [launching] launch config tree initially scrolled to the right
                            - -

                            Milestone 6 - Mar 23, 2007

                            -

                            Problem Reports Fixed

                            -177788: When hitting a breakpoint from the java perspective, the variable view is not populated
                            -178463: NPE in Launch Configuration Mgr
                            -177988: Launch configurations marked dirty for no reason
                            -175805: Debug wants to migrate scrapbook pages but can't
                            -177165: Context launch chooses Eclipse Application over Test Suite
                            -177349: [launching] ContextLaunchingResourceManager should deregister when not using context launching
                            -176266: a possible null-deference in "org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java"
                            -177036: move 'delete configs' preference to debug.core
                            -177074: Logged errors for out of sync launch configs
                            -176000: NPE when looking at 'All Instances'
                            -177143: remove unused private constant
                            -175723: Errors related to old launch configs on startup
                            -177388: NLS33:translation questions
                            -176902: run/debug hover/behavior incorrect on workspace re-start
                            -177012: separator in menu when not needed
                            -177004: NPE in LaunchConfigurationManager.getHistoryAsXML
                            -176440: Add optional description attribute to launch shortcuts
                            -177298: AFE in context launching for binary type
                            -154135: APIs for custom debugger integration
                            -177913: Wrong javadoc for org.eclipse.debug.ui.AbsractLaunchConfigurationTab.setDirty(...)
                            -178057: details for indexed partition do not update detail pane
                            -178126: Incomplete context-sensitive help text.
                            -178118: [launch view] [actions] the launch view should use new factory
                            - -

                            Mar 13, 2007

                            -

                            Problem Reports Fixed

                            -176957: NPEs from Debug
                            -176890: NLS33:new debug.ui message "LaunchConfigurationAction_0" not enabled for translation properly
                            -176487: org.eclipse.debug.core crashes in headless mode
                            -176430: remove API for set/get default launch config for a resource
                            -174190: Transient test failures not allowed
                            -176841: [launching] preference for launch last vs. launch selection
                            -175862: Selecting text in editor broken
                            -150625: [build path] Cancel project creation ask to delete launch configurations
                            -175332: Run/Debug last actions should conform to contextual launch
                            -165515: [Memory View] Built-in table renderings only write value if it differs from original
                            -166234: [Memory View] More flexible buffer size in table renderings
                            -166691: [Memory View] Need gotoAddress() API
                            -167788: [Memory View] Add shortcut keys for Next Page and Previous Page actions
                            -171753: [Memory View] Reload is incorrect when receiving selected address change event
                            -176962: Inconsistency in labels for browse buttons
                            - -

                            Mar 6, 2007

                            -

                            Problem Reports Fixed

                            -173181: [variables][views] change background colour is hard to work with....
                            -170857: Index out of bound at the SWT level in the debug view
                            - -

                            Feb 27, 2007

                            -

                            Problem Reports Fixed

                            -175541: concurrent modification exception in launch history
                            -175292: new config should be initialized with defaults
                            -56642: [launching] Launching progress
                            -174797: [launching] no longer prompted to delete associated launch configs
                            -174782: firing model delta should notify root delta
                            -166231: [launching] history not updated properly
                            -174527: NLS:questions about LaunchConfigurationsMessages.properties
                            -159981: Add "COLLAPSE" flag to IModelDelta
                            -174819: [history] [launching] launch history/favorites not persisted
                            -174935: "<project> does not exist" in log when selecting launch configuration
                            -172728: [detail pane] detail panes should be available in inspect popup
                            -100478: [Memory View]: Adding 0 memory blocks
                            -174722: [Memory View] a possible out-of-bound array access in "org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java"
                            - -

                            Feb 20, 2007

                            -

                            Problem Reports Fixed

                            -159054: IModelDelta reference ModelDelta
                            -174210: batched updates don't run if last update canceled
                            - -

                            Feb 13, 2007

                            -

                            Problem Reports Fixed

                            -173087: Debug should make use of IWorkingSetElementAdapter API
                            -174233: Allow null anchor point in DebugPopup window
                            -153013: [console] Java console will not open
                            -173896: NPE while debugging
                            -145396: ShowIn LaunchView does not work anymore
                            - -

                            Milestone 5 - Feb 9, 2007

                            -

                            Problem Reports Fixed

                            -166794: [variables] Copy variables shortcut key doesn't work after detail pane gets focus
                            -172556: Skip all Breakpoints option not persisted
                            -170857: Index out of bound at the SWT level in the debug view
                            -132055: [launching] Promote LaunchHistory methods to AbstractLaunchToolbarAction API?
                            -173093: [detail panes] detail pane test failure on linux
                            -114377: [Memory View] Endian in hex view and ASCII view doesn't work
                            -150003: expansion state not maintained when suspending target with thread groups
                            -158537: Variables view: copy variables copies formerly expanded children
                            - -

                            Jan 30, 2007

                            -

                            Problem Reports Fixed

                            -172248: TextConsoleViewer should be checking for disposed text widget
                            -159944: Asynchronous viewer should allow model to set selection after selected object is removed.
                            -172026: [launching] alt+enter shortcut dies when resource adapter cannot be resolved
                            -168733: Manifest and properties file could get some clean up
                            -171700: [launching] changing LCD filtering with last items elected throws exception
                            -171790: Chkpii error in build N20070126-0010
                            - -

                            Jan 23, 2007

                            -

                            Problem Reports Fixed

                            -170766: NPE MultiLaunchGroupFilter.equalModes()
                            -150970: Progress Monitor not handled correctly during launch
                            -166102: RetargetBreakpointAction should use the "resource->launch configuration" association to find the IToggleBreakpointsTarget adapter.
                            -171056: Detail job should stop wait()'ing when canceled
                            -171091: [detail pane] Removing default detail pane results in NPE
                            -170673: [Console] Select all keyboard shortcut marked incorrectly in context menu
                            - -

                            Jan 16, 2007

                            -

                            Problem Reports Fixed

                            -170669: [Launching] Main Tab missing search options under main type
                            -170485: [launching] no useful help in save and launch dialog
                            -170502: [source lookup] [launching] string variables added to the bootpath via the launch dialog do not stay there
                            - -

                            Jan 9, 2006

                            -

                            Problem Reports Fixed

                            -169701: IllegalArgumentException in LaunchConfigurationViewer
                            -169992: Non-externalized string in debug ui plugin.xml
                            -169689: [launching] revert button does not revert config name text
                            -168434: move debug commands to core plug-in
                            -168618: step actions enabled when multiple frames selected
                            -169549: no description for java tab group anymore
                            -165986: [Memory View] Migrate MemoryBlocksTreeViewPane to use new tree viewer
                            -126883: [launching] Allow multi-selection of application types in Perspective Switching preferences
                            -167667: [launching] No visual clue configurations are filtered from dialog
                            -153938: [Memory View] Base address of memory block is not displayed on first rendering's tab label
                            -167292: [Memory View] Icons and labels for Memory view layout menu are mismatched
                            -168768: [Memory View] NPE when shutting down workbench with table rendering
                            -167031: Switching perspectives based on launch delegates
                            - -

                            Dec 19, 2006

                            -

                            Problem Reports Fixed

                            -168525: Loading Debug Core plug-in causes ClassNotFoundException
                            -168428: "Asynchronous viewer update" appears when stepping
                            -170784: org.eclipse.debug.ui plugin.xml uses enablesFor="1+" incorrectly
                            - -

                            3.3 M4 - Dec 15, 2006

                            -

                            Problem Reports Fixed

                            -166659: [launching] Launcher selection dialog layout
                            -167119: [launching] tab icons not decorated consistently
                            - -

                            Dec 11, 2006

                            -

                            Problem Reports Fixed

                            -156441: Scalability enhancement to the flexible hierarchy's IAsynchronousContentAdapter
                            -75852: [variables] Support for custom details view widgets.
                            -166408: VM Capabilities property page shows up unexpectedly
                            -160745: Dangerous use of getActiveShell in Debug
                            - -

                            Dec 5, 2006

                            -

                            Problem Reports Fixed

                            -166683: [plugins] DebugUIPlugin should be a save participant
                            -166525: [launching] Should display error message in LCD when launcher choice required
                            -45061: [launching] LaunchHistory is serialized 9 times on preference change
                            - -

                            Nov 28, 2006

                            -

                            Problem Reports Fixed

                            -166065: Deadlock in DebugCommandAction/DebugCommandActionDelegate
                            -165829: [launching] the source lookup tab is the new apply button
                            -165175: [source lookup] ContainerSourceContainer assumes resource is in local file system
                            -156516: Incorrect popup text in debug icon
                            -165855: Launch Shortcuts shows deprecated example.
                            -165348: [source lookup] source lookup panel is not saving changes to source lookup path
                            -164682: NPE SourceLookupPanel add external archive
                            -166125: [launching] run last no longer runs last
                            - -

                            Nov 21, 2006

                            -

                            Problem Reports Fixed

                            -165174: [viewers] selection is lost in launch view after stepping into sync block
                            -165046: [viewers] launch view loses selection with monitors showing
                            -164953: Watch expression keeps reference to old IDebugTarget object after debug session terminates
                            -164671: NPE updating children in view
                            -164651: [viewers] launch view has duplicate entries
                            -164379: ClassCastException from StackFrameContentProvider
                            -156761: [console] Allow possibility of changing console background color
                            -104369: [breakpoints] drag & drop of many breakpoints is slow
                            -164620: Tree in Debug view should not have border
                            -99709: [breakpoints] Breakpoints dropped to incorrect working set when moved using drag and drop
                            -158280: CCE in JDIObjectValue.getEnclosingObject
                            -163082: Add Memory Rendering Dialog should listen for Memory Rendering Bindings changed event
                            -159359: expressions serialized each time they change state
                            -163130: [breakpoints] select default breakpoint working set dialog throws NPE
                            -164940: Disabled state of Run/Profile/Debug button is not handled properly sometimes
                            - -

                            Nov 14, 2006

                            -

                            Problem Reports Fixed

                            -162802: [launching] launch manager causes exception persisting preferred delegates
                            -163128: org.eclipse.debug.ui plugin needs organizing
                            -160749: Can't set a breakpoint on the first line of an editor
                            -163684: [variables view] Max details pane text length dialog does nothing
                            -162996: NPE in EnvironmentVariableResolver.resolveValue
                            -163988: org.eclipse.debug.ui.console.FileLink missing adaptation, protection
                            -153461: DnD slow in breakpoints view.
                            -163684: [variables view] Max details pane text length dialog does nothing
                            -163400: fileExtension is deprecated but doesn't offer alternatives in schema description
                            -163961: Schema description for launchConfigurationTypes outdated
                            - -

                            3.3 Milestone 3 - Nov 3, 2006

                            -

                            Problem Reports Fixed

                            -159200: Step action should not automatically disable after the action is invoked.
                            -162802: [launching] launch manager causes exception persisting preferred delegates
                            -162667: Javadoc warnings in N20061028-0010
                            -162816: [commands] StepFilterCommand can lead to NPE
                            -162320: Toggle step filters action does not initialize state properly
                            -160932: API for debug context and debug commands
                            -162426: Javadoc warnings in N20061026-0010
                            -162666: Chkpii error in nightly build 20061028-0010
                            -162106: Missing org.eclipse.debug.core.launchOptions extension point
                            -162547: ConcurrentModificationEx in DebugCommandService.postUpdate
                            -160130: Multi-line environment variables are truncated
                            - -

                            Oct 24, 2006

                            -

                            Problem Reports Fixed

                            -161896: Warnings in N20061022-0010
                            -151848: [launching] Write protected launch configurations fails in Launch Configuration Dialog
                            -153789: [launching] Launch configuration dialog: switching filters should not remove multi-selection
                            -154400: [WorkingSets] Select Default Breakpoint Working Set dialog is confusing and can clear default setting accidentally
                            -157915: Delete launch configurations confirmation dialog too small
                            -158232: 'Terminate and relaunch' action is enabled for non-relaunchable configs
                            -161077: [schema] build N20061016-0010 schema errors
                            -161080: [schema] build > N20061016-0010 schema errors
                            -157090: should adopt ICU Collator and use new APIs on StructuredViewer
                            -155552: Debug View has no selection after long step
                            - -

                            Oct 3, 2006

                            -

                            Problem Reports Fixed

                            -158760: Warning in latest nightly build and integration build
                            - -

                            Sep 22, 2006

                            -

                            Problem Reports Fixed

                            -158202: LaunchConfigurationWorkingCopy setAttributes(Map) does not set dirty?
                            -140722: Surface Run/Debug Terminate key mapping
                            -76341: [evaluation] Yellow popup box cannot be moved easily
                            - -

                            Sep 12, 2006

                            -

                            Problem Reports Fixed

                            -155791: Patch to fix jface.text.Assert deprecation
                            -156134: debug.core should re-export dependencies whose API is exposed
                            -155690: Launch shortcuts: Allow 'forcePluginActivation' for expressions
                            -148255: [tests] "should be access" test failure
                            -155055: [views] [actions] Terminate All changed since 3.1.2
                            -156087: NPE in CreateLaunchConfigurationAction#performAction
                            -105574: TVT 3.1 - TCT 466 - Truncated string on Memory monitor
                            - -

                            Aug 22, 2006

                            -

                            Problem Reports Fixed

                            -153929: [Memory View] Shift+F10 does not bring up context menu in table rendering
                            -153964: Need public access to LaunchConfigurationManager.getLastLaunch()
                            -153428: Share a launch configuration: NPE
                            -154025: Unable to create view: Argument not valid---:---Variables view doesn't show variable values in debug mode
                            - -

                            3.3 Milestone 1 - August 10, 2006

                            -

                            Problem Reports Fixed

                            -138976: [console] IOException when closing the application
                            -152794: ConcurrentModificationException disposing consoles from Ant UI test suite
                            -152583: Use proceed label and button id for compile error prompt
                            -152664: Separate workbench part from presentation context id
                            - -

                            July 29, 2006

                            -

                            Problem Reports Fixed

                            -151066: details sash same background color as tree
                            -149728: Detaching from process with many threads takes a long time
                            -142198: [breakpoints] Initial state of breakpoint's 'Enable/Disable Breakpoint' ruler menu is always 'Enable Breakpoint'
                            -138252: [console] Stream closed while debugging
                            -151433: Firing content event on a debug target does not causing the target to be refreshed
                            -148900: IWatchExpressionDelegate needs to be context sensitive
                            -142602: [breakpoints] Default Breakpoint Working Set's setting lost when working set name is changed
                            - -

                            July 18, 2006

                            -

                            Problem Reports Fixed

                            -151006: Expression View menu inconsistent when referring to Detail(s) Pane/Area
                            -149205: AssignValueAction ignores target messages
                            -135170: Terminate All menu option does not do anything
                            -150193: second frame selected instead of top frame after step return
                            -148995: Deadlock while stepping
                            -148897: [Memory View] memory renderings leak menu listener
                            -148923: [Memory View] selection is incorrect after stepping
                            -140102: [breakpoints] Focus cannot be set to "Type", "Line Number" and "Member" fields in the properties dialog of the breakpoint
                            -150569: [help] Add exception dialog show workbench help
                            -149638: [breakpoints] 'Don't ask again' option for 'Remove All Breakpoints'
                            -149176: [Working Sets] UI is blocked when clearing all items in a breakpoint working set
                            -148863: [Memory View] Memory View should clean up command handler for NextMemoryBlock action
                            -148865: [Memory View]Sync service is holding onto rendering after a memory block is removed
                            -149891: SourceLookupFacility should use IEditorMatchingStrategy
                            - -

                            July 11, 2006

                            -

                            Problem Reports Fixed

                            -149069: [preferences] Move USE_STEP_FILTERING pref constant to public API
                            -148776: !MESSAGE NLS unused messages
                            -149076: [preferences] Use step filtering pref is not persisted over workbench restart
                            -148526: Editing a string variable discards last entered character
                            -149021: [tests] testInstructionPointerLeaks failing
                            -139089: [breakpoints] NPE in JavaBreakpoint.fireRemoved () shutting down eclipse with Java Debug session running
                            -144258: The image registry is created twice
                            -144560: [console] NPE in ProcessConsole$InputReadJob
                            -145545: [console] Console can only be associated with IDebugElement instances
                            -148940: [Preferences] Step filter settings broken post-RC7
                            -140561: debug view scrolls to top, loses thread focus
                            - -

                            June 27, 2006

                            -

                            Problem Reports Fixed

                            -142972: [launching] Add "Run" to context menu of shared launch config
                            -148006: [console] deadlock in ConsoleDocument during ant execution in autobuild
                            -148646: [console] current console combo uses CHECK instead of RADIO style buttons
                            -138719: [source lookup] memory leak in DecorationManager
                            -132616: [console] Console corrupts UTF-8
                            -38387: NLS'ing of internal error messages
                            -138473: [breakpoints] BreakpointManager sometimes fails to send a breakpoint-changed notification
                            -142476: TVT3.2:TCT535: Text boxes overlap with borders
                            -89594: [console] typing in the JSTConsole is screwy
                            -137694: [console] scrollbar in empty console
                            - -

                            June 20, 2006

                            -

                            Problem Reports Fixed

                            -67370: [console] F1 help missing - Console view
                            -140487: [launching] The Debug/Run Configurations dialog uses wrong color
                            -140823: [launching] Code clean up
                            -141782: [help] Debug dialogs not offering help
                            -141785: [help] No context help for Debug Dialogs
                            -145634: [view management] Context-Based Debug View Activation only uses last contributed binding per view
                            -147335: [help] Source Tab has no context help topic
                            -147502: [view management] most relevant view should be brought to top
                            -42876: [help] F1 help in the Launch Configuration Dialog
                            -145766: [launching] Launch configuration change dialog appears twice
                            -147464: [view management] debug view does not activate in non-debug perspective
                            - -

                            June 13, 2006

                            -

                            Problem Reports Fixed

                            -132554: keybinding doesn't enable 'Use Step Filters/Step Debug' action
                            -144900: TVT3.2:TCT824: FR : Base - Missing apostrophes in Perspective preferences
                            -120606: [variables] Static variables disappeared after clicking a variable
                            -136085: [variables] view doesn't remember column positions or even which column
                            -140487: [launching] The Debug/Run Configurations dialog uses wrong color
                            -141769: [preferences] Perspectives tab is broken
                            -143569: Debug actions should check status after an action is completed
                            -143805: [viewers] array does not grow when parent not visible
                            -144221: [Memory View] Table rendering fails to show changes after resume
                            -144258: The image registry is created twice
                            -144400: [launching] LaunchManager keeps references on last resource delta
                            -144560: [console] NPE in ProcessConsole$InputReadJob
                            -144900: TVT3.2:TCT824: FR : Base - Missing apostrophes in Perspective preferences
                            -145545: [console] Console can only be associated with IDebugElement instances
                            -145553: [variables] Cannot modify String variable with empty string value with Change Value dialog
                            -134304: Fix broken NLS strings
                            - -

                             

                            - diff --git a/org.eclipse.debug.core/r3_4_buildnotes_platform-debug.html b/org.eclipse.debug.core/r3_4_buildnotes_platform-debug.html deleted file mode 100644 index 623b934c4..000000000 --- a/org.eclipse.debug.core/r3_4_buildnotes_platform-debug.html +++ /dev/null @@ -1,395 +0,0 @@ - - - - - - - Platform Debug Release Notes - - -

                            Eclipse 3.4 Debug Platform Build Notes 

                            - -

                            Summary of API changes in 3.4

                            - -

                            Console Encoding

                            -
                              -
                            • A new method ILaunchManager#getEncoding(ILaunchConfiguration) - was added to allow consumers of the DebugPlugin#ATTR_CONSOLE_ENCODING - preference to get the encoding to use when launching the configuration specified - as the parameter to getEncoding(..). The javadoc for DebugPlugin#ATTR_CONSOLE_ENCODING - has been updated to reflect that a launch configuration now inherits its default - encoding from its associated resource(s) when unspecified.
                            • -
                            -

                            Launching Enhancements

                            -
                              -
                            • added ILaunchShortcut2. The new interface adds extensions to the standard launch shortcut (ILaunchShortcut) to specify how selections and editors should be launched.
                            • -
                            • added "public boolean hasAttribute(String attributeName)" - to ILaunchConfiguration. The method allows clients to determine - if an attribute is present on a launch configuration.
                            • -
                            • added "public Object removeAttribute(String attributeName)" - to ILaunchConfigurationWorkingCopy. The method allows clients - to remove attributes from configurations.
                            • -
                            -

                            Expression Enhancements

                            -
                              -
                            • added IWatchExpressionFactoryAdapter2. The new interface allows the - 'Create Watch Expression' action to operate on arbitrary objects, instead of just - IVariables.
                            • -
                            -

                            Getting Adapters

                            -
                              -
                            • added a new method DebugPlugin#getAdapter(Object element, Class type) that - gets an adapter from an object in the correct manner. Duplicate methods in the platform - were changed to use this convenience method.
                            • -
                            - -

                            Debug Model Presentation

                            -
                              -
                            • A new optional extension interface (IDebugModelPresentationExtension) allows debug model presentations to control whether they are called in the UI thread.
                            • -
                            -

                            Modules View

                            -
                              -
                            • A Modules View has been added to the platform, along with appropriate constants in IDebugUIConstants. -
                                -
                              • ID_MODULE_VIEW - view identifier
                              • -
                              • EMPTY_MODULES_GROUP - menu group identifier
                              • -
                              • MODULES_GROUP - menu group identifier
                              • -
                              -
                            • -
                            - -

                            June 12, 2008

                            -

                            Problem Reports Fixed

                            -Bug 236922: external tool builder does not run
                            - -

                            June 5, 2008

                            -

                            Problem Reports Fixed

                            -Bug 235824: [doc] Help topics missing
                            - -

                            June 2, 2008

                            -

                            Problem Reports Fixed

                            -Bug 234642: [doc] Javadoc of ILaunchesListener should link to ILaunchListener
                            -Bug 234536: JUnit tests fail from time to time because DebugPlugin.getLaunchManager() is not synchronized
                            - -

                            May 28, 2008

                            -

                            Problem Reports Fixed

                            -Bug 208062: First context menu has mysterious Run As/Debug As/Profile As menu entries
                            -Bug 233730: Run control actions not refreshed after event with both CONTENT and STATE flags for parent context issued
                            -Bug 234471: Infinite loop running evaluation tests
                            - -

                            May 28, 2008

                            -

                            Problem Reports Fixed

                            -Bug 233703: Debug plugin and ProcessConsoleManager misses launches
                            - -

                            May 21, 2008

                            -

                            Problem Reports Fixed

                            -Bug 232699: TVT34:TCT330: TVT FR - Space missing before colon sign in French
                            - -

                            May 20, 2008

                            -

                            Problem Reports Fixed

                            -Bug 232832: TVT34:TCT275: KO: 'Import Launch Configurations' in English
                            - -

                            May 14, 2008

                            -

                            Problem Reports Fixed

                            -Bug 225688: DBCS3.4: In expression view, DBCS characters are changed to "?" after restarting eclipse
                            -Bug 228445: 'Create Watch Expression' shows up in every context menu
                            -Bug 224019: Command handler conflict in registers view
                            - -

                            May 13, 2008

                            -

                            Problem Reports Fixed

                            -Bug 229356: Run/Debug settings property page sizes to screen width for long name config
                            - -

                            May 9, 2008

                            -

                            Problem Reports Fixed

                            -Bug 217127: Regression in performance test PerfContextualLaunchMenu#testContextualLaunchMenu()
                            - -

                            May 8, 2008

                            -

                            Problem Reports Fixed

                            -Bug 230969: NPE disposing a model proxy
                            -Bug 223851: Contextual launch not choosing most recent configuration
                            -Bug 209243: Console window with black background
                            - -

                            May 7, 2008

                            -

                            Problem Reports Fixed

                            -Bug 229349: Poor wording in Import breakpoint dialog
                            - -

                            May 6, 2008

                            -

                            Problem Reports Fixed

                            -Bug 229344: AssertionFailedException during "Enable Breakpoint" with access/modification turned off
                            -Bug 229362: filter count on LCD considers PRIVATE configs in total
                            -Bug 229363: Run/Debug settings page should not be visible for .jpage files
                            -Bug 220613: Platform UI now provides a collapse all command
                            -Bug 229344: AssertionFailedException during "Enable Breakpoint" with access/modification turned off
                            -Bug 227477: IModelProxy.init() and installed() are called inside a synchronized() block in ModelContentProvider
                            - -

                            May 5, 2008

                            -

                            Problem Reports Fixed

                            -Bug 222802: NPE if DebugUITools.launch(...) is called on background thread
                            -Bug 225567: [Memory View] Tooltip from rendering stays forever
                            - -

                            3.4 M7 - May 2, 2008

                            -

                            Problem Reports Fixed

                            -Bug 229033: Adding/Editing installed JRE should allow other archive names
                            -Bug 228267: Inspect popup dialog disposes presentation context from variables view
                            -Bug 228264: NPE when copying stack trace.
                            -Bug 220611: Add PageSwitcher command to the Console View
                            -Bug 228716: breakpoints view context activated for any part
                            -Bug 220442: adopt identifier attribute for schemas
                            -Bug 217104: NPE when returning null from force return
                            - -

                            April 22, 2008

                            -

                            Problem Reports Fixed

                            -Bug 220611: Add PageSwitcher command to the Console View
                            -Bug 226203: Invoking Find action in Registers views with large group "hangs" IDE
                            -Bug 203147: NPE while 'copy variables' in Variables view
                            -Bug 198568: Copy Stack doesn't always cancel
                            -Bug 191625: Undefined context while filtering dialog/window contexts
                            - -

                            April 8, 2008

                            -

                            Problem Reports Fixed

                            -Bug 215432: [Memory View] Memory View: real estate & new/remove rendering workflow
                            -Bug 222267: Expressions aren't update correclty (ExpressionEventHandler doesn't preserve event source for CDT change events)
                            -Bug 223992: NPE from "Model Proxy installed notification job"
                            -Bug 225094: Get rid of outdated context Id "org.eclipse.ui.globalScope"
                            -Bug 189786: Invalid thread access stopping Debug UI plugin
                            -Link: enabling breakpoints during debug has poor performance
                            -Bug 225336: [Memory View] MemoryView mistreats small bounded memory blocks
                            -Bug 225366: [Memory View] Rendering view pane is blank when view is re-opened
                            -Bug 225385: [Memory View] Need ability to disable add/remove rendering actions in RenderingViewPane
                            - -

                            3.4 M6 - March 28, 2008

                            -

                            Problem Reports Fixed

                            -Bug 188704: Top index not maintained properly in variables / registers view.
                            -Bug 215489: Stackframe shows as running when suspended
                            -Bug 127770: [variables] Expansion lost in variables view when holding down step key
                            -Bug 221905: clean up javadoc tags
                            -Bug 211158: Add a modules view to the set of standard debugger views.
                            -Bug 223791: Compiler warning in org.eclipse.debug.ui
                            -Bug 224128: LCD title not correct creating a new configuration
                            - -

                            March 11, 2008

                            -

                            Problem Reports Fixed

                            -Bug 219643: Memory: typo EXTENSION_POINT_MEMORY_RENDERIGNS
                            -Bug 219794: NPE in console MatchJob
                            -Bug 222228: Should delegate to platform adapater manager for adapters
                            -Link: LazyStart from Debug plugins
                            - -

                            February 19, 2008

                            -

                            Problem Reports Fixed

                            -Bug 217769: [breakpoints] ToggleBreakpointAction always creates TextSelection with 0 lengh
                            - -

                            February 12, 2008

                            -

                            Problem Reports Fixed

                            -Bug 211920: [DND] Add expression by drag and drop does not honor "Create Watch Expression" enablement
                            -Bug 217951: Missing detail formatter for registers group
                            -Bug 217900: [breakpoints] Breakpoint export dialog does not size well on linux
                            -Bug 218080: [breakpoints] No warning when using an inavlid path in breakpoint export dialog
                            - -

                            3.4 M5 - February 8, 2008

                            -

                            Problem Reports Fixed

                            -Bug 218086: Filtering statics also filters constants
                            -Bug 218240: [expressions] Missing check for delegate and factory when creating watch expression
                            -Bug 213069: Extend PresentationContext to save and restore properties.
                            -Bug 216509: Memory View: typo, s/isMeomryBlockRemoved/isMemoryBlockRemoved
                            -Bug 208062: First context menu has mysterious Run As/Debug As/Profile As menu entries
                            - -

                            January 29, 2008

                            -

                            Problem Reports Fixed

                            -Bug 217279: [launch] Allow ILaunchShortcut2 to provide resource mapping
                            -Bug 216777: [detail panes] widget disposed exception
                            -Bug 209883: Expression view actions use getAdapter() to work with non-standard debug models.
                            -Bug 199915: API Request: DelegatingModelPresentation.isInitialized(...)
                            - -

                            January 22, 2008

                            -

                            Problem Reports Fixed

                            -Bug 215242: Debuggers cannot set the selected frame for Suspend events
                            -Bug 215723: Attempt to reveal the call stack when stopped
                            - -

                            January 8, 2008

                            -

                            Problem Reports Fixed

                            -Bug 214094: i can't edit the run configuration because of an AssertionFailedException
                            -Bug 214359: [launching] clean up launch config filtering
                            -Bug 213719: NPE when closing the Variables view.
                            -Bug 213609: Need a clarification on usage of IElement*Provider interfaces with update arrays.
                            - -

                            December 18, 2007

                            -

                            Problem Reports Fixed

                            -Bug 212638: Always save editors before launch preference should take effect immediately
                            -Bug 213244: VariableAdapterService should also call IAdaptable.getAdapter() for adaptables that implement this method directly.
                            -Bug 213212: ViewerAdapterService should use IAdapterManager
                            -Bug 212314: DebugModelPropertyTester does not use the IDebugModelProvider adapter.
                            - -

                            December 14, 3.4M4

                            -

                            Problem Reports Fixed

                            -Bug 208039: Tweaks to context launching
                            -Bug 208797: SelectedResourceManager.getCurrentSelection0() should use IAdapterManager
                            -Bug 212420: Remove workaround for bug 99234
                            -Bug 212145: [launching] Selection cannot be launched and there are no recent launches
                            -Bug 210023: Another NPE in DefaultWatchExpressionModelProxy
                            -Bug 202678: IViewerUpdate should have a method to return viewer input.
                            -Bug 208034: [launching] Unexpected error when opening launch config dialog from resource properties
                            -Bug 208127: breakpoint import does not work
                            -Bug 211928: ExpressionDropAdapter makes implementation to IWatchExpressionFactoryAdapterExtension mandatory
                            -Bug 212442: Failing import breakpoints tests
                            -Bug 212581: [launching] widget disposed exception launching
                            - -

                            December 4, 2007

                            -

                            Problem Reports Fixed

                            -Bug 198428: Deadlock deleting launch configuration
                            -Bug 211769: NPE in LaunchManager
                            -Bug 211076: Debug annotations could allow all possible text styles
                            - -

                            November 27, 2007

                            -

                            Problem Reports Fixed

                            -Bug 210471: Cannot change the selected detail pane viewer.
                            - -

                            November 20, 2007

                            -

                            Problem Reports Fixed

                            -Bug 209920: While loading class SelectedResourceManager, thread timed out waiting
                            -Bug 209668: The field org.eclipse.debug.core.DebugPlugin#INTERNAL_ERROR has changed value between HEAD and 3.3.0
                            -Bug 184233: Expression view does not support alternative content providers
                            -Bug 146825: [console] NPE in process console participant
                            -Bug 205335: ModelContentProvider does not cancel stale updates when switching viewer input.
                            - -

                            November 13, 2007

                            -

                            Problem Reports Fixed

                            -Bug 208431: [launching] clicking checkbox twice disables OK button
                            -Bug 208109: touching Environment tab makes launch config dirty
                            -Bug 208707: (Console) Remove binding for show console view with CTRL+ALT+Q
                            - -

                            3.4 M3 - November 2, 2007

                            -

                            Problem Reports Fixed

                            -Bug 207600: export configurations page does not update as text typed into export directory
                            -Bug 205980: new artwork for export/import launch configurations
                            -Bug 208084: Error writing to console
                            -Bug 207293: Wrong context help for the builder properties dialog
                            -Bug 85370: [string variables] string_prompt for passwords
                            -Bug 205305: Add perspective extensions for newly moved log view
                            -Bug 206407: AbstractMemoryRendering connect()s the wrong "this"
                            -Bug 207157: Breakpoint Export action disposes shared Label Provider.
                            - -

                            October 23, 2007

                            -

                            Problem Reports Fixed

                            -Bug 198896: Actions "Open Debug Dialog..." and "Open Run Dialog..." labeled incorrectly
                            -Bug 207079: NPE running test suites in I20071016-1215
                            -Bug 206822: Debug views should indicate busy status while there are viewer updates in progress.
                            - -

                            October 16, 2007

                            -

                            Problem Reports Fixed

                            -Bug 12898: [launching] Import/Export of launch configs
                            - -

                            October 9, 2007

                            -

                            Problem Reports Fixed

                            -Bug 205207: [launching] '&' shows in run tooltip if debug plugins not loaded
                            -Bug 204378: An internal error occurred during: "Compute launch button tooltip".
                            - -

                            October 2, 2007

                            -

                            Problem Reports Fixed

                            -Bug 90737: "Terminate All" action should be renamed to "Terminate/Disconnect All"
                            - -

                            September 24, 2007

                            -

                            Problem Reports Fixed

                            -Bug 203907: Run --> External Tools history menus not updated after organize favorites
                            -Bug 203615: TextConsoleViewer leaks Cursors
                            - -

                            3.4 M2 - September 21, 2007

                            -

                            Problem Reports Fixed

                            -Bug 202456: Variable Selection Dialog needs better help
                            -Bug 202798: Breakpoint working set description
                            -Bug 141009: [expressions] Add 'Watch' to the display view context menu
                            -Bug 199125: Improve UI for breakpoint working sets
                            -Bug 203253: Deleting config bring Run and Debug menus out of sync
                            -Bug 202450: [Actions] Empty cascading menus show up as enabled
                            -Bug 173156: [properties] process property page cuts off text
                            -Bug 89178: [launching] Open Properties dialog by clicking "Run As..." with Ctrl key
                            -Bug 188339: [scrapbook] Expressions from scrapbook does not convert to watch expression correctly
                            -Bug 188385: context launch does not work with method in outline selected
                            -Bug 203870: Launch tooltip not in synch with selection
                            -Bug 202564: MessageConsole.clearConsole() flushes output queued up after the clearConsole call
                            -Bug 203850: Expression order not always persisted
                            -Bug 204033: Local configurations auto-deleted when project closed
                            -Bug 204189: Always prompted to save launch configurations
                            - - -

                            September 11, 2007

                            -

                            Problem Reports Fixed

                            -Bug 202059: Run dialogue: switching between read-only or removed launch configurations.
                            -Bug 39875: [launching] Managing invalid launch configs
                            -Bug 198785: Remove launch from Run/Debug drop down
                            - -

                            September 4, 2007

                            -

                            Problem Reports Fixed

                            -Bug 176508: [console] IOConsole Updater error with long output lines
                            -Bug 199294: LaunchManager provokes NPEs when *.launch files are on remote EFS locations
                            -Bug 137769: [launching] Launch history is not updated/Run Last Launched fails due to working set filter
                            -Bug 198896: Actions "Open Debug Dialog..." and "Open Run Dialog..." labeled incorrectly
                            -Bug 200185: Problem highlighting first position of source in debug mode.
                            - -

                            August 28, 2007

                            -

                            Problem Reports Fixed

                            -Bug 198545: Debug Core should use EMPTY_STRING constant
                            -Bug 200831: Dragging text to bad location in expressions view does not update cursor
                            -Bug 201239: Javadoc of ILaunchesListener should mention ILaunchesListener2
                            - -

                            August 21, 2007

                            -

                            Problem Reports Fixed

                            -Bug 200168: Keybindings on the Mac conflict with reserved OS bindings
                            -Bug 200105: auto expand does not work in the async tree viewer
                            -Bug 199500: Usability Problem in 'Save and Launch' Dialog
                            -Bug 176627: [Registers view] Switching stack frames: Unnecessary scrolling to top and group closing
                            -Bug 168574: Support for IElementMementoProvider on each element in a viewer
                            -Bug 200595: reduce duplication of #getAdapter code for viewers
                            - -

                            3.4 M1 - August 10, 2007

                            -

                            Problem Reports Fixed

                            -190873: [launching] Environment tab grows wider on each config selection
                            -198437: EMPTY_STRING constant not used
                            -177554: [messages] remove internal error messages from translations
                            - -

                            July 31, 2007

                            -

                            Problem Reports Fixed

                            -198248: NPE at org.eclipse.debug.ui.CommonTab.getDefaultSharedConfigLocation
                            -197998: Workbench refuses to show Run or Debug dialog
                            -197834: Expression Evaluation Failure with Generics
                            -197145: [launching] Changing AutoSelect in LaunchConfigurationViewer from a LaunchConfigurationTab
                            -197645: [launching] selection of encoding does twice as much work
                            -197532: NPE in DefaultWatchExpressionModelProxy
                            -185196: Debug selection dialogs should subclass AbstractDebugSelectionDialog
                            -194598: 44% of time closing projects spent in LaunchManager#resourceChanged
                            -194303: [launching] CME during "Compute launch button tooltip"
                            -197000: [launching] Auto Launch Configuration deletion should be resource specific
                            -174020: Background colour makes variable value unreadable in variables view
                            -197698: [launching] Deleting launch config from LCD does not remove config
                            -191379: Console encoding does not match workspace encoding
                            -191382: JVM file encoding does not match console encoding
                            - -

                            July 17, 2007

                            -

                            Problem Reports Fixed

                            -191515: Some run menu actions are missing help context ids
                            -193175: inconsistent action names for "Open Run/Debug/Profile Dialog..."
                            -177554: [messages] remove internal error messages from translations
                            - -

                            July 10, 2007

                            -

                            Problem Reports Fixed

                            -175584: [expressions] Allow re-ordering of expressions in the Expressions View
                            -195232: Outdated Run Toolbar tool tip
                            -191723: A lot more classes being loaded than in 3.1
                            -195461: calling dispose on LaunchConfigurationTabGroupWrapper can get a NullPointerException
                            -48197: [Dialogs] Add Folders Selection Dialog should not list closed projects.
                            -191071: Delete Unused Debug Help Context ID Constants
                            -194458: CCE when dragging to Breakpoints View
                            -193595: ProcessConsole is internal API but states that "Clients may instantiate this class." in the javadocs
                            -47931: Copies of serializeDocument(Document)
                            -66983: [evaluation] EmptyStackException from invalid condition
                            -192212: Screenshots out of date in isv doc
                            -193179: Should there be an 'add' button in the expression view toolbar?
                            -191974: Concurrent modification exception
                            -191636: [breakpoints] import breakpoints causes exception
                            -189328: [Accessibility] Run dialog (Common tab) - controls do not provide labels
                            -191388: TVT33:TCT635: pl: truncations in Perspective preferences panel
                            -193432: Clicking link in Ant console should ensure resulting editor is visible
                            -184057: Add drag and drop to expression view.
                            - -

                             

                            - - diff --git a/org.eclipse.debug.core/r3_5_buildnotes_platform-debug.html b/org.eclipse.debug.core/r3_5_buildnotes_platform-debug.html deleted file mode 100755 index 6eb664edd..000000000 --- a/org.eclipse.debug.core/r3_5_buildnotes_platform-debug.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - Platform Debug Release Notes - - -

                            Eclipse 3.5 Debug Platform Build Notes

                            - -

                            Summary of API changes in 3.5

                            - -

                            Breakpoint Import Participants

                            -The breakpoints framework has been further enhanced to support breakpoint import -participants, which allows contributors to participate in the importing process -for any given breakpoint type. Participants can contribute in the decision of whether -a breakpoint should be imported and in the verification process once a breakpoint has -been imported. -

                            The API to support this feature includes:

                            -
                              -
                            • org.eclipse.debug.breakpointImportParticipants extension point - - Allows a client to register their participant for a given breakpoint type. -
                            • -
                            • IBreakpointImportParticipant interface - - Required implementing interface for all participants. -
                            • -
                            • org.eclipse.debug.core.DebugPlugin#EXTENSION_POINT_BREAKPOINT_IMPORT_PARTICIPANTS constant - - Constant providing the id of the new extension point to clients. -
                            • -
                            • org.eclipse.debug.core.IBreakpointManager#getImportParticipants(id) - - convenience method for getting all registered breakpoint participants for the given breakpoint - type id. If there are no matching participants a default participant will be returned. -
                            • -
                            - -

                            Breakpoints

                            -The breakpoints framework has been enhanced to support different breakpoint -types to be created within the same part. This effectively allows different -debuggers to share a common editor and views where breakpoints are created. -Debuggers can also use this mechanism to let users quickly change what -breakpoint type is created by default (e.g.: software, hardware, -thread-filtered, etc.). -

                            The API to support this feature includes:

                            -
                              -
                            • org.eclipse.debug.ui.toggleBreakpointsTargetFactories - extension point - Allows a debugger to register a factory of - IToggleBreakpointsTarget adapters, which are used by toggle - breakpoint actions to create breakpoints. -
                            • -
                            • IToggleBreakpointsTargetFactory interface - Factory API - for IToggleBreakpointTarget adapters to be implemented by debuggers. -
                            • -
                            • RulerBreakpointTypesActionDelegate action - Editor gutter - action to select the active breakpoint types. -
                            • -
                            - -

                            ILaunchConfiguration.getLocation() can return null

                            -

                            What is affected: Clients that call ILaunchConfiguration.getLocation()

                            -

                            Description: In release 3.4 and earlier, ILaunchConfiguration.getLocation() was not specified -to return null. Since 3.5, launch configuration infrastructure has been enhanced to support storage -on external file systems (EFS). The #getLocation() method returns a location in the local file system - however, since -an external file system may not map to a local location, null can now be returned.

                            -

                            Action required: Clients that call ILaunchConfiguration.getLocation() should update -code to handle a null result. The #getLocation() method has been deprecated since the return -value is no longer reliable.

                            - -

                            Access to current source lookup participant

                            -

                            What is affected: Method addition: AbstractSourceLookupDirector#getCurrentParticipant()

                            -

                            Description: Since 3.5, the AbstractSourceLookupDirector provides access to the ISourceLookupParticipant currently looking up source via the new method #getCurrentParticipant(). The implementation of AbstractSourceContainer has been enhanced to ask the current participant if duplicate source files should be found when looking up source. To maintain backwards compatibility, the participant delegates whether duplicates should be found to the source lookup director. A custom implementation of a source lookup participant could override the default behavior to control whether duplicate source files should be found.

                            -

                            Action required: This is a backwards compatible change. No action required.

                            - -

                            debugContext evaluation variable

                            -

                            What is affected: -

                              -
                            • Evaluation service variable addition: debugContext
                            • -
                            • Method addition: DebugUITools.getDebugContextForEvent(EvalutationEvent)
                            • -
                            • Method addition: DebugUITools.getDebugContextForEventChecked(EvalutationEvent)
                            • -
                            • Constant addition: IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME
                            • -
                            -

                            -

                            Description:The command framework allows menu and toolbar items to be controlled using powerful standard expressions. However many debugger related commands require access to the current debug context in order to properly evaluate their enabled or visible state. This addition allows command handlers and their expressions to use the debugContext variable to access the current debug context applicable to the given handler.

                            -

                            Action required: This is a backwards compatible change. No action required.

                            - -

                            Detail pane selection provider

                            -

                            What is affected: -

                              -
                            • Interface addition: IDetailPane2
                            • -
                            • Interface addition: IDetailPaneContainer2
                            • -
                            -

                            -

                            Description:The original detail pane design does not allow a detail pane implementation to properly supply a selection provider for a view (see bug 254442). These addition allows a detail pane to overcome this limitation.

                            -

                            Action required:This is a backwards compatible change, so no action is required. However, detail pane implementations which need to drive the active view selection, should implement the new IDetailPane2 interface.

                            -

                             

                            - -

                            Variables views' preference constants

                            -

                            What is affected: Clients that use the variable font, detail pane font, and changed value background preferences. The new constants are: -

                              -
                            • Constant addition: IDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND
                            • -
                            • Constant addition: IDebugUIConstants.PREF_VARIABLE_TEXT_FONT
                            • -
                            • Constant addition: IDebugUIConstants.PREF_DETAIL_PANE_FONT
                            • -
                            -

                            -

                            Description: Some clients needed to access preference settings for display attributes in the variables -view which were defined in an internal interface. This change moves these constants to the IDebugUIConstants interface. -

                            Action required: Clients which may have copied these constants or (gasp!) have referenced the internal interface, -should instead reference the new API constants.

                            - -

                            May 26, 2009

                            -

                            Problem Reports Fixed

                            -Bug 277869: NPE copying empty list of variables
                            - -

                            May 25, 2009

                            -

                            Problem Reports Fixed

                            -Bug 76481: [doc] In the doc for org.eclipse.debug.ui.AbstractLaunchConfigurationTab, setDirty is badly described
                            - -

                            May 20, 2009

                            -

                            Problem Reports Fixed

                            -Bug 276908: Mnemonic collision on debug preference page
                            - -

                            May 19, 2009

                            -

                            Problem Reports Fixed

                            -Bug 276377: [doc] Minor minor minor Javadoc bug: IRuntimeClasspathProvider
                            -Bug 276948: [examples] org,eclipse.debug.examples.ui should use J2SE-1.4 compiler options
                            -Bug 269182: [breakpoints] Breakpoint does not have an associated marker error in the .log file
                            - -

                            May 13, 2009

                            -

                            Problem Reports Fixed

                            -Bug 241394: [Console] Can not get input text properly in eclipse console panel
                            - -

                            May 12, 2009

                            -

                            Problem Reports Fixed

                            -Bug 275700: Internal errors when expanding thread groups.
                            - -

                            May 11, 2009

                            -

                            Problem Reports Fixed

                            -Bug 275614: REGRESSION: threads no longer expanded if Debug view not visible
                            - -

                            May 8, 2009

                            -

                            Problem Reports Fixed

                            -Bug 273929: NPE in ToggleBreakpointObjectActionDelegate
                            - -

                            May 5, 2009

                            -

                            Problem Reports Fixed

                            -Bug 273498: Launch history generation could be more robust
                            -Bug 274358: Show Thread Group option not propery updated in debug view
                            - -

                            April 27, 2009

                            -

                            Problem Reports Fixed

                            -Bug 273082: BreakpointsView-Group By sub-menu contains extra mnemonics
                            -Bug 220657: Teminate All in ConsoleView.
                            -Bug 272489: Debug view: "View Mode" menu misses mnemonics
                            -Bug 272367: "Show Type Names" attribute is not available in the IPresentationContext properties
                            -Bug 273178: Repeated expressions in expressions window
                            -Bug 273617: property tester expression doesn't check selected element's type
                            - -

                            April 20, 2009

                            -

                            Problem Reports Fixed

                            -Bug 268978: Build before launch should use one top level workspace runnable
                            -Bug 233040: ConsoleTerminateAction performed in UI thread, occasionally lags
                            -Bug 212798: Thread collapsed unexpectedly as threads are terminated
                            - -

                            April 7, 2009

                            -

                            Problem Reports Fixed

                            -Bug 271055: Risk of deleting a launch configuration multiple times
                            -Bug 271113: !MESSAGE NLS unused message: BreakpointTypesContribution_noBreakpointsActive_menuItem
                            -Bug 269961: [launching] Confusing "Discard Changes?" dialog when trying to filter with pending changes
                            -Bug 233233: [launching] Default Launchers -- description does not update when click on the checkbox
                            -Bug 267957: [launching] Prompted about text search when close is pressed
                            - -

                            March 24, 2009

                            -

                            Problem Reports Fixed

                            -Bug 236435: add 'do not ask again' option for 'remove all expressions'
                            -Bug 270467: Enable to navigate to breakpoints
                            -Bug 199288: Expressions view should support paste
                            -Bug 269287: Content assist handler not disabled when the conditional breakpoint properties page is hidden
                            - -

                            March 17, 2009

                            -

                            Problem Reports Fixed

                            -Bug 262850: [launch modes] When a launch delegate is not selected, the "Multiple launchers available" label should have an error decorator.
                            -Bug 268876: [launching] OK button disabled in Select Preferred Launcher dialog
                            -Bug 102766: [launching] Shared launch configurations not displayed in favorites when importing/opening containing project
                            -Bug 268130: Labels on 'JRE' launch tab does not use sentence style
                            - -

                            March 10, 2009

                            -

                            Problem Reports Fixed

                            -Bug 258891: [Memory View] AbstractAsyncTableRendering.removeListeners susceptible to an NPE
                            -Bug 262705: [Memory View] CreateRendering "New Rendering..." tab is missing Enter key binding
                            -Bug 262845: [breadcrumb] breadcrumb causes performance degradation in stepping
                            -Bug 266162: Duplicates in prompt to save dirty resources before launching
                            -Bug 262811: [breadcrumb] Provide hooks to setup debugging in other perspectives
                            -Bug 266162: Duplicates in prompt to save dirty resources before launching
                            -Bug 262849: [launching] Select Preferred Launcher dialog is somewhat confusing.
                            -Bug 267438: IInernalDebugUIConstants.PREF_CHANGED_VALUE_BACKGROUND should be public.
                            -Bug 262845: [breadcrumb] breadcrumb causes performance degradation in stepping
                            -Bug 265376: [breadcrumb] Breadcrumb doesn't update layout after the view is resized.
                            - -

                            February 10, 2009

                            -

                            Problem Reports Fixed

                            -Bug 267251: [launching] Add a RefreshTab.getID() implementation.
                            -Bug 262261: [breadcrumb] Add actions to Debug view to switch between tree view, breadcrumb, or automatic modes.
                            -Bug 262262: [breadcrumb] Add actions to quickly switch between contexts in Debug view.
                            -Bug 262870: [breadcrumb] When debug view is activated no item has focus.
                            -Bug 262837: No more handle exception when working in Debug Perspective
                            - - -

                            February 10, 2009

                            -

                            Problem Reports Fixed

                            -Bug 262844: [launching] Launch tab group with no tabs leads to NPEs
                            -Bug 262848: [launching] If a tab is contributed and it does not have a placement specified, it should go in front.
                            -Bug 263307: [launching] Preferred launch delegates preference should be more transparent
                            -Bug 255722: IWorkspaceRoot.findContainersForLocation(IPath) is deprecated
                            -Bug 208484: variables should be available for headless operation when possible
                            -Bug 263881: SourceLookupFacility selects editor region when stack frame provides CharStart value > -1
                            -Bug 262814: Class Cast exception when Expression view has expressions defined by non-Java debug session
                            -Bug 221234: [console] Programs with lots of output cause major eclipse unresponsiveness with large console buffer
                            - -

                            3.5 M5 - January 30, 2009

                            -

                            Problem Reports Fixed

                            -Bug 262369: NPE in viewer test
                            -Bug 262819: 'process model delta' job appears in progress view/status bar
                            -Bug 260802: Retargetable debug actions do not enable when an adapter is first loaded.
                            -Bug 247990: [breakpoints] Breakpoint working set not updated properly after import
                            -Bug 255644: chkpii error in N20081117-2000
                            -Bug 256569: Possibly broken code in LaunchConfigurationTabGroupViewer.setSelection(ISelection, boolean)
                            - -

                            January 20, 2009

                            -

                            Problem Reports Fixed

                            -Bug 261567: [launching] ILaunchConfiguration's getLocation returns different values at different times
                            -Bug 261214: Console view: Opening drop-down of console switcher button already switches consoles
                            - -

                            January 6, 2008

                            -

                            Problem Reports Fixed

                            -Bug 259839: Typo in TerminateAndRelaunchAction
                            -Bug 259107: [console] Console Deadlock when too much information written
                            -Bug 253955: Hitting breakpoint gives focus to workbench instead of dialog
                            -Bug 245314: Populating variables view with logical structures is really slow
                            -Bug 253257: Source lookup job data getting overwritten while running
                            - -

                            December 16, 2008

                            -

                            Problem Reports Fixed

                            -Bug 258235: Switch LaunchConfigurationFilteredTree to new look of FilteredTree
                            -Bug 258058: Buttons not greyed out in Organize Favorites dialog
                            -Bug 255153: Select All does not fire selection change event
                            -Bug 49730: [source lookup] Call stack editor annotation ambiguous
                            -Bug 254442: "Create Watch Expression" action does not appear consistently
                            -Bug 257717: Errors in Workspace dialog on launch is contains incorrect text
                            - -

                            Milestone 4 - December 12, 2008

                            -

                            Problem Reports Fixed

                            -Bug 234854: synchronize remaining 3 public get*Manager() methods from DebugPlugin
                            -Bug 136741: [Memory View] Base address not initially scrolled into view with built-in renderings
                            -Bug 257546: Console view: Open Console button should open menu
                            -Bug 257537: ConsolePlugin should consider modifying its getStandardDisplay() method
                            -Bug 240330: [Memory View] Items per row should not be limited to 16
                            -Bug 212605: [launching] Mac OS X launcher should not hide the necessary -XstartOnFirstThread
                            -Bug 257970: SWT Exception shutting down Eclipse
                            -Bug 236296: "update the classpath settings" feature sets wrong project compiler compliance level
                            -Bug 244059: [breakpoints] Allow breakpoints to specify when they should be overwritten on import
                            - -

                            December 2, 2008

                            -

                            Problem Reports Fixed

                            -Bug 257103: modify execution environment tests to not break real environments
                            -Bug 256181: [Flex-Hierarchy] State restore logic can get into a cycle.
                            -Bug 255267: OSGi min 1.2 EE is not recognized as subset of J2SE 1.4 and Foundation 1.1
                            - -

                            November 11, 2008

                            -

                            Problem Reports Fixed

                            -Bug 253966: Support to configure resource based variables
                            -Bug 252992: Move {workspace_loc} to debug.core plug-in
                            - -

                            November 4, 2008

                            -

                            Problem Reports Fixed

                            -Bug 252445: toggle breakpoint jobs should have a priority
                            -Bug 252360: Can not place breakpoint in inner class of an annotation
                            -Bug 252387: context launch offers to launch configs that have no associated project
                            - -

                            Milestone 3 - October 31, 2008

                            -

                            Problem Reports Fixed

                            -Bug 251711: Select All should not select invisible items
                            -Bug 229219: Track debugContext with the window evaluation context.
                            -Bug 247575: [flex-hierarchy] TreeModelLabelProvider should coalesce label updates
                            -Bug 234908: [Expressions View] Expression view can show wrong data if selection is changed rapidly
                            -Bug 250954: NPE in LaunchManager
                            -Bug 252141: Compile warnings in official build
                            -Bug 252609: Transient ConsoleLineTracker test failures
                            -Bug 213074: "Run to line" action cannot be used with non-standard debug models.
                            - -

                            October 21, 2008

                            -

                            Problem Reports Fixed

                            -Bug 251265: Rollback changes to IOConsolePartition
                            -Bug 250928: Debug serversocket nulled out
                            -Bug 250048: DebugUIPlugin.start() pollutes SWT Display
                            -Bug 250008: Keybinding conflicts occurred. CTRL+SHIFT+P, jface NullPointerException
                            -Bug 248054: Can't set breakpoint annotation as Highlighted
                            -Bug 182974: [breakpoints] Removing a breakpoint causes two independent resource deltas
                            - -

                            October 7, 2008

                            -

                            Problem Reports Fixed

                            -Bug 249364: NPE getting file store
                            - -

                            September 30, 2008

                            -

                            Problem Reports Fixed

                            -Bug 246278: NPE in DefaultDetailPane.java:264
                            -Bug 248520: NPE selecting launch config
                            -Bug 247977: ISourceLookupParticipant should be able to influence whether ISourceContainer returns multiple source elements
                            - -

                            September 22, 2008

                            -

                            Problem Reports Fixed

                            -Bug 236980: [launching] Support ILaunchConfigurations on EFS
                            -Bug 244920: Two Breakpoints in one line. Saving of class not possible (NPE).
                            - -

                            Aug 26, 2008

                            -

                            Problem Reports Fixed

                            -Bug 244694: Conflicting mnemonics in breakpoints export wizard
                            - -

                            Aug 19, 2008

                            -

                            Problem Reports Fixed

                            -Bug 243053: Tabs added via launchConfigurationTabs cannot be placed after each other
                            -Bug 111818: new launch config arguments field should let Ctrl+Enter engage dialog's default button
                            -Bug 231790: NPE when opening Run Configuration Dialog on linux/gtk
                            - -

                            Aug 12, 2008

                            -

                            Problem Reports Fixed

                            -Bug 243606: [Debug View] Stackframe does not get focus with multiple debug targets
                            - -

                            Aug 5, 2008

                            -

                            Problem Reports Fixed

                            -Bug 242685: StringVariableManager - Variable contributions may silently override existing variables
                            - -

                            July 29, 2008

                            -

                            Problem Reports Fixed

                            -Bug 236049: [console] 'Clear' context menu item enable when no text is available to be cleared
                            - -

                            July 22, 2008

                            -

                            Problem Reports Fixed

                            -Bug 239856: Launches corrupted in I20080702-0939
                            -Bug 233008: User consistent naming to create watch expressions
                            -Bug 240985: NPE adding org.eclipse.ui.console.consolePageParticipants extension without enablement clause
                            - -

                            July 8, 2008

                            -

                            Problem Reports Fixed

                            -Bug 239512: MessageConsole hides IOConsole constructor taking consoleType
                            -Bug 239446: org.eclipse.debug LaunchConfigurationsDialog fails to load when PlatformUI SHOW_FILTERED_TEXTS is false
                            -Bug 239794: CommonTab source uses wrong launch group
                            - -

                            June 24, 2008

                            -

                            Problem Reports Fixed

                            -Bug 236076: [launching] Run and Debug History menus not updated after reorganize favorites
                            - -

                             

                            - - diff --git a/org.eclipse.debug.core/schema/breakpointImportParticipants.exsd b/org.eclipse.debug.core/schema/breakpointImportParticipants.exsd deleted file mode 100644 index e9ae55279..000000000 --- a/org.eclipse.debug.core/schema/breakpointImportParticipants.exsd +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - - - - This extension point allows contributors to explicitly define how breakpoints should be compared when being imported into the workspace, and how they should be updated if a similar breakpoint already exists in the workspace. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Describes one import participant - - - - - - - The class that participates in the breakpoint importing - - - - - - - - - - The id of the marker backing the breakpoint type this participant cares about. For example 'org.eclipse.jdt.debug.javaLineBreakpointMarker', the id of the backing marker for the Java line breakpoint - - - - - - - - - - - - - - - 3.5 - - - - - - - - - The following is an example of the breakpoint participant extension: -<p> -<pre> -<extension point="org.eclipse.debug.core.breakpointImportParticipants"> - <importParticipant - participant="x.y.z.BreakpointImportParticipant" - type="org.eclipse.jdt.debug.javaLineBreakpointMarker"> - </importParticipant> -</extension> -</pre> -</p> -In the above example the participant cares about Java line breakpoints: where <code>org.eclipse.jdt.debug.javaLineBreakpointMarker</code> -is a breakpoint type defined using the <code>org.eclipse.debug.core.breakpoints</code> extension point in <code>org.eclipse.jdt.debug</code> - - - - - - - - - The <code>type</code> attribute is the id of the marker backing the breakpoint type this participant cares about. The type needs to be the exact marker id of the breakpoint this participant cares about, marker hierarchies are not considered. For example 'org.eclipse.jdt.debug.javaLineBreakpointMarker', the id of the backing marker for the Java line breakpoint -The <code>participant</code> attribute must specify a Java class that implements the <code>org.eclipse.debug.core.model.IBreakpointImportParticipant</code> interface. - - - - - - - - - Platform Debug supplies a default implemementation for breakpoints in general which compares breakpoints the way they were compared prior to the participant support: based on breakpoint type and line number information. - - - - - - - - - Copyright (c) 2008 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/breakpoints.exsd b/org.eclipse.debug.core/schema/breakpoints.exsd deleted file mode 100644 index cd5d0f23d..000000000 --- a/org.eclipse.debug.core/schema/breakpoints.exsd +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - This extension point defines a mechanism for defining new types of breakpoints. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - specifies a unique identifier for this breakpoint type. - - - - - - - specifies the fully qualified identifier (id) of the corresponding marker definition for breakpoints of this type. - - - - - - - - - - specifies the fully qualified name of the Java class that implements <code>IBreakpoint</code>. - - - - - - - - - - specifies a user-presentable name for this breakpoint type. For example, "Java Line Breakpoint". This attribute was added in 3.1 to support automatic grouping of breakpoints by breakpoint type. When this attribute is unspecified, breakpoints of this type cannot be automatically grouped by type. - - - - - - - - - - - - - - - The following is an example of a launch configuration type extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.breakpoints"> - <breakpoint - id="com.example.ExampleBreakpoint" - markerType="com.example.ExampleBreakpointMarker" - class="com.example.ExampleBreakpointImpl"> - </breakpoint> - </extension> -</pre> -</p> - -In the example above, the specified type of breakpoint is implemented by the class "com.example.BreakpointImpl". -There is an associated marker definition for "com.example.ExampleBreakpointMarker", defining the attributes of this breakpoint. - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.IBreakpoint</b>. - - - - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/launchConfigurationComparators.exsd b/org.eclipse.debug.core/schema/launchConfigurationComparators.exsd deleted file mode 100644 index d0fe6b060..000000000 --- a/org.eclipse.debug.core/schema/launchConfigurationComparators.exsd +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - - This extension point provides a configurable mechanism for comparing specific attributes of a launch configuration. -In general, launch configuration attributes can be compared for equality via the default implementation of <samp>java.lang.Object.equals(Object)</samp>. -However, attributes that require special handling should implement this extension point. -For example, when an attribute is stored as XML, it is possible that two strings representing an equivalent attribute have different whitespace formatting. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - specifies a unique identifier for this extension. - - - - - - - specifies the launch configuration attribute name that this comparator compares. - - - - - - - specifies a fully-qualified name of a class that implements <code>java.util.Comparator</code>. - - - - - - - - - - - - - - - The following is an example of a launch configuration comparator extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.launchConfigurationComparators"> - <launchConfigurationComparator - id="com.example.ExampleIdentifier" - attribute="com.example.ExampleAttributeName" - class="com.example.ComparatorImplementation"> - </launchConfigurationComparator> - </extension> -</pre> -</p> - -In the example above, the specified type of launch configuration comparator will be consulted when comparing the equality of attributes keyed with name <samp>com.example.ExampleAttributeName</samp>. - - - - - - - - - Value of the attribute <b>class</b> must be a fully-qualified name of a Java class that implements the interface <b>java.util.Comparator</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd b/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd deleted file mode 100644 index aa2db7717..000000000 --- a/org.eclipse.debug.core/schema/launchConfigurationTypes.exsd +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - This extension point provides a configurable mechanism for launching applications. -Each launch configuration type has a name, supports one or more modes (run and/or debug), and specifies a delegate -responsible for the implementation of launching an application. - -As of 3.2 the types can also define a migration delegate that can be used to set resource mappings between projects and the launch configurations that launch them. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - - - - - - specifies a unique identifier for this launch configuration type. - - - - - - - specifies the fully qualified name of the Java class that implements <code>ILaunchConfigurationDelegate</code>. -Launch configuration instances of this type will delegate to instances of this class to perform launching. Launch delegates can also be contributed for a launch configuration type via the <code>launchDelegates</code> extension. The launch delegate specified by a <code>launchConfigurationType</code> extension is responsible for launching in all modes specified by the same extension. To extend the launching capabilities of an existing configuration type, or when different delegates are required for different launch mode combinations, the <code>launchDelegates</code> extension should be used to contribute a launch delegate. - - - - - - - - - - specifies a comma-separated list of the modes this type of lauch configuration supports - "run" and/or "debug". Launch modes can also be contributed for a launch configuration type via the <code>launchDelegates</code> extension. - - - - - - - specifies a human-readable name for this type of launch configuration. - - - - - - - - - - specifies whether this launch configuration type is accessible by users. Defaults to <code>true</code> if not specified. - - - - - - - an optional attribute that specifies this launch configuration type's category. The default value is unspecified (<code>null</code>). Categories are client defined. This attribute was added in the 2.1 release. - - - - - - - The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. This atttribute was added in the 3.0 release. - -Since 3.3, the <code>sourcePathComputerId</code> can also be specified via the <code>launchDelegates</code> extension point. - - - - - - - - - - The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. This atttribute was added in the 3.0 release. - -Since 3.3, the <code>sourceLocatorId</code> can also be specified via the <code>launchDelegates</code> extension point. - - - - - - - - - - specifies the fully qualified name of a Java class that implements <code>org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate</code>. Optional delegate used to migrate launch configurations of this type to be compatible with current tooling, since 3.2 - - - - - - - - - - A human readable name for the associated launch delegate - for example, "Eclipse JDT Launcher". This name is presented to the user when more than one launcher is available for a launch configuration and the user must choose a preferred launcher. This attribute was added in the 3.3 release. - - - - - - - - - - A description of this type's launch delegate - for example "The Eclipse JDT Java Application Launcher supports running and debugging local Java applications". This description is presented to the user when more than one launcher is available for a launch configuration and the user must choose a preferred launcher. This attribute was added in the 3.3 release. - - - - - - - - - - - - - - - - This element is no longer used. Instead, use the <code>org.eclipse.debug.ui.launchShortcuts</code> extension point. - - - - - - - specifies a file extension that this launch configuration type can be used for. - - - - - - - specifies whether this launch configuration type should be the default launch configuration type for the specified file extension. Defaults to <code>false</code> if not specified. - - - - - - - - - - - - <p> -The following is an example of a launch configuration type extension point: -</p> - -<p> -<pre> - <extension point="org.eclipse.debug.core.launchConfigurationTypes"> - <launchConfigurationType - id="com.example.ExampleIdentifier" - delegate="com.example.ExampleLaunchConfigurationDelegate" - modes="run,debug" - name="Example Application" - migrationDelegate="com.example.migrationDelegate" - sourceLocatorId="com.example.sourceLookupDirector" - sourcePathComputerId="com.example.sourcePathComputer" - delegateName="Example Application Launch Tooling" - delegateDescription="This example tooling will run or debug example code."> - </launchConfigurationType> - </extension> -</pre> -</p> - -<p> -In the example above, the specified type of launch configuration supports both run and debug modes. -The specified type also has an associated migration delegate, a source locator id, a source path computer, and launch delegate name and description. -</p> - - - - - - - - - <p> -Value of the attribute <b>delegate</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.ILaunchConfigurationDelegate</b>. - -The value of the attribute <b>migrationDelegate</b> must be a fully qualified name of a Java class that implements <b>org.eclipse.debug.core.ILaunchConfigurationMigrationDelegate</b>. -</p> - - - - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/launchDelegates.exsd b/org.eclipse.debug.core/schema/launchDelegates.exsd deleted file mode 100644 index e574d7d8c..000000000 --- a/org.eclipse.debug.core/schema/launchDelegates.exsd +++ /dev/null @@ -1,218 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for contributing a launch delegate to an existing launch configuration type for one or more launch modes. Since launch modes are extensible, it may be neccessary to contribute additional launch delegates to an existing launch configuration type. Each launch delegate is contributed for a specific launch configuration type. A launch delegate supports one or more launch modes, and specifies a delegate responsible for the implementation of launching. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - specifies a unique identifier for this launch delegate. - - - - - - - A human readable name for this delegate - for example, "Eclipse JDT Launcher". This name is presented to the user when more than one launcher is available for a launch configuration and the user must choose a preferred launcher. This attribute was added in the 3.3. release. - - - - - - - - - - specifies the fully qualified name of the Java class that implements <code>ILaunchConfigurationDelegate</code>. -Launch configuration instances of this delegate's type will delegate to instances of this class to perform launching in the modes this launch delegate supports - see the <code>modes</code> attribute and the <code>modeCombination</code> element. - - - - - - - - - - A comma-separated list of the <b>individual</b> launch modes this delegate supports. -<p> -This attribute should be used when a launch delegate supports single launch modes - for example launching in run mode or debug mode. When a launch delegate supports launching in mixed mode (for example, debug and profile), the <code>modeCombination</code> element should be used to specify supported launch mode combinations. -</p> -<p> -This attribute can be used in conjunction with <code>modeCombination</code> elements. It is suggested practice to provide one or the other (either a comma seperated listing in the <code>modes</code> attribute, or <code>modeCombinations</code>). Specifying 'run,debug' in the modes attribute is analogous to specifying two <code>modeCombination</code> contributions, one for 'run' and another for 'debug'. -</p> - - - - - - - identifier of an existing launch configuration type that this launch delegate is capable of launching. - - - - - - - - - - The unique identifier of a sourcePathComputer extension that is used to compute a default source lookup path for launch configurations of this type. Since 3.1, this attribute cab be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source path computer can be specified per launch configuration type. - - - - - - - - - - The unique identifier of a sourceLocator extension that is used to create the source locator for sessions launched using launch configurations of this type. Since 3.1, this attribute can be specified in a launchDelegate extension when unspecified in the assocaited launchConfigurationType extension. Only one source locater can be specified per launch configuration type. - - - - - - - - - - A description of this launch delegate - for example "The Eclipse JDT Java Application Launcher supports running and debugging local Java applications". This description is presented to the user when more than one launcher is available for a launch configuration and the user must choose a preferred launcher. This attribute was added in the 3.3 release. - - - - - - - - - - This element specifies a launch mode combination this delegate supports. Each <code>modeCombination</code> element specifies a comma seperated list of modes specifying a supported mixed launch mode. For example, a delegate that supports debugging, profiling and code coverage at the same time would specify a <code>modes</code> element of consisting of 'debug, profile, coverage'. This element can also be used to specify single launch modes that are supported - for example a <code>modes</code> attribute of 'debug'. This element was added in the 3.3 release. - - - - - - - a comma seperated list specifying a combination of modes the associated delegate supportes. - -<p> -Unlike the modes attribute of the <code>launchDeleaget</code> element definition, this comma seperated list represents a mixed launch mode rather than the single supported launch modes. For example: a <code>modeCombination</code> element specifying <code>modes</code> of 'profile,debug' indicates the delegate can debug and profile at the same time. In contrast, if 'profile,debug' was specified by the <code>modes</code> attribute of the <code>launchDelegate</code> element, it would indicate the delegate could debug or profile, but not at the same time. -</p> - - - - - - - a string representing the id of a persepctive to switch to when launching. - - - - - - - - - - - - 3.0 - - - - - - - - - The following is an example of a launch delegate extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.launchDelegates"> - <launchDelegate - id="com.example.ExampleProfileDelegate" - delegate="com.example.ExampleProfileDelegate" - type="org.eclipse.jdt.launching.localJavaApplication" - name="Eclipse JDT Java Profile Tooling"> - <modeCombination - modes="run, profile"> - perspective="com.example.Perspective"> - </modeCombination> - <modeCombination modes="debug, profile, coverage"></modeCombination> - </launchDelegate> - </extension> -</pre> -</p> - -In the example above, the specified launch delegate is contributed to launch Java applications in profile mode. The delegate supports mixed mode launching. The delegate supports profiling when launching in run or debug mode, with code coverage in debug mode only. When the mode combination or run and profile is used, in this example, the perspective com.example.Perspective can also be opened. - - - - - - - - - Value of the attribute <b>delegate</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.ILaunchConfigurationDelegate</b>. - - - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/launchModes.exsd b/org.eclipse.debug.core/schema/launchModes.exsd deleted file mode 100644 index b7adefa92..000000000 --- a/org.eclipse.debug.core/schema/launchModes.exsd +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for contributing launch modes to the debug platform. The debug platform defines modes for "run", "debug", and "profile". - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - - - - - - - - - - - specifies a unique identifier for this launch mode. The launch modes contributed by the debug plaform are "run", "debug", and "profile". - - - - - - - A human-readable label that describes the launch mode - - - - - - - - - - A human-readable label to be used in a launch cascade menu. For example "Run As". This attribute was added in 3.2 to allow the label to be properly externalized. When unspecified, a default label is created via concatenation. - - - - - - - - - - - - - - - 3.0 - - - - - - - - - The following is an example of a launch delegate extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.launchModes"> - <launchMode - mode="profile" - label="Profile"> - </launchMode> - </extension> -</pre> -</p> - -In the example above, the profile launch mode is contributed. - - - - - - - - - - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/launchers.exsd b/org.eclipse.debug.core/schema/launchers.exsd deleted file mode 100644 index 2a90cdf03..000000000 --- a/org.eclipse.debug.core/schema/launchers.exsd +++ /dev/null @@ -1,230 +0,0 @@ - - - - - - - - - This extension point has been replaced by the launchConfigurationTypes extension point. Extensions of this type are obsolete as of release 2.0 and are ignored. This extension point was used to contribute launchers. -A launcher was responsible for initiating a debug session -or running a program and registering the result with the -launch manager. - - - - - - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - - - a unique identifier that can be used to reference -this launcher. - - - - - - - fully qualified name of the Java class that implements -<code>org.eclipse.debug.core.model.ILauncherDelegate</code>. - - - - - - - - - - A comma separated list of modes this launcher supports. -The two supported modes are "run" and "debug" - -as defined in <code>org.eclipse.debug.core.ILaunchManager</code>. -A launcher may be capable of launching in one or both modes. - - - - - - - a label to use for the launcher. This attribute is used by the debug UI. - - - - - - - - - - fully qualified name of the class that implements -<code>org.eclipse.debug.ui.ILaunchWizard</code>. -This attribute is used by the debug UI. A launcher -may contribute a wizard that allows users to configure -and launch specific attributes. - - - - - - - - - - whether a launcher is publically visible in the debug UI. -If <code>true</code>, the launcher will be available from the -debug UI - the launcher will appear as a choice -for a default launcher, launches created by this -launcher will appear in the launch history, and the -launcher will be available from the drop-down run/debug -toolbar actions. - - - - - - - a description of the launcher. Currently only used -if the wizard attribute is specified. - - - - - - - - - - the identifier of the perspective that will be switched -to on a successful launch. Default value is the -identifier for the debug perspective. This attribute -is used by the debug UI. - - - - - - - a relative path of an icon that will represent the launcher -in the UI if specified. - - - - - - - - - - - - - - - The following is an example of a launcher extension point: -<p> -<pre> - <extension - point = "org.eclipse.debug.core.launchers"> - <launcher - id = "com.example.ExampleLauncher" - class = "com.example.launchers.ExampleLauncher" - modes = "run, debug" - label = "Example Launcher" - wizard = "com.example.launchers.ui.ExampleLaunchWizard" - public = "true" - description = "Launches example programs" - perspective= "com.example.JavaPerspective"> - </launcher> - </extension> -</pre> -</p> -In the example above, the specified launcher supports -both run and debug modes. Following a successful launch, -the debug UI will change to the Java perspective. When -the debug UI presents the user with a list of launchers -to choose from, "Example Launcher" will appear as one of -the choices with the "Launches example programs" as the -description, and the wizard specified by -<samp>com.example.launchers.ui.ExampleLaunchWizard</samp> -will be used to configure any launch specific details. - - - - - - - - - Value of the attribute <samp>class</samp> must be a fully -qualified class name of a Java class that implements -the interface -<samp>org.eclipse.debug.core.ILauncherDelegate</samp>. -Value of the attribute <samp>wizard</samp> must be a -fully qualified class name of a Java class that -implements <samp>org.eclipse.debug.ui.ILaunchWizard</samp>. - - - - - - - - - - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/logicalStructureProviders.exsd b/org.eclipse.debug.core/schema/logicalStructureProviders.exsd deleted file mode 100644 index d3a2fffc6..000000000 --- a/org.eclipse.debug.core/schema/logicalStructureProviders.exsd +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - This extension point allows contributors to provide multiple logical structure types for a value. -This is an extension of the logical structure support provided by the extension point <code>org.eclipse.debug.core.logicalStructureTypes</code>, which allows one logical structure type per value. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - fully qualified name of a Java class that implements <code>ILogicalStructureProvider</code>. - - - - - - - - - - identifier of the debug model this logical structure provider is associated with - - - - - - - - - - - - 3.1 - - - - - - - - - The following is an example of a logical structure type extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.logicalStructureProviders"> - <logicalStructureProvider - class="com.example.ExampleLogicalStructureProvider" - modelIdentifier="com.example.debug.model"> - </logicalStructureProvider> - </extension> -</pre> -</p> - -In the example above, the specified logical structure provider will be consulted for alternative logical structures for values from the <code>com.example.debug.model</code> debug model as they are displayed in the variables view. - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.ILogicalStructureProvider</b>. - - - - - - - - - Copyright (c) 2004, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/logicalStructureTypes.exsd b/org.eclipse.debug.core/schema/logicalStructureTypes.exsd deleted file mode 100644 index 242bd7e14..000000000 --- a/org.eclipse.debug.core/schema/logicalStructureTypes.exsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - This extension point allows debuggers to present alternative logical structures of values. Often, complex data structures are more convenient to navigate in terms of their logical structure, rather than in terms of their implementation. For example, no matter how a list is implemented (linked, array, etc.), a user may simply want to see the elements in the list in terms of an ordered collection. This extension point allows the contribution of logical structure types, to provide translations from a raw implementation value to a logical value. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - a unique identifier for this logical structure type - - - - - - - a description of this logical structure. Since 3.1, this attribute is optional. When unspecified, a logical structure type delegate must also implement <code>ILogicalStructureTypeDelegate2</code> to provide descriptions for values that logical structures are provided for. - - - - - - - - - - fully qualified name of a Java class that implements <code>ILogicalStructureTypeDelegate</code>. The class may optionally implement <code>ILogicalStructureTypeDelegate2</code>. - - - - - - - - - - identifier of the debug model this logical structure type is associated with - - - - - - - - - - - - 3.0 - - - - - - - - - The following is an example of a logical structure type extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.logicalStructureTypes"> - <logicalStructureType - id="com.example.ExampleLogicalStructure" - class="com.example.ExampleLogicalStructureDelegate" - modelIdentifier="com.example.debug.model" - description="Ordered Collection"> - </logicalStructureType> - </extension> -</pre> -</p> - -In the example above, the specified logical structure type will be consulted for alternative logical values for values from the <code>com.example.debug.model</code> debug model as they are displayed in the variables view. - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.ILogicalStructureTypeDelegate</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/processFactories.exsd b/org.eclipse.debug.core/schema/processFactories.exsd deleted file mode 100644 index 8f5106f31..000000000 --- a/org.eclipse.debug.core/schema/processFactories.exsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for specifying a process factory to be used with a launch configuration to create the appropriate instance of <b>IProcess</b>. - The launch configuration will require the <b>DebugPlugin.ATTR_PROCESS_FACTORY_ID</b> attribute set to the appropriate process factory ID that will be - used to create the <b>IProcess</b> - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - - - specifies a unique identifier for this process factory. - - - - - - - specifies the fully qualified name of the Java class that implements <code>IProcessFactory</code>. - - - - - - - - - - - - - - - 3.0 - - - - - - - - - The following is an example of a process factory extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.processFactories"> - <processFactory - id="com.example.ExampleIdentifier" - class="com.example.ExampleProcessFactory"> - </processFactory> - </extension> -</pre> -</p> - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.IProcessFactory</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/sourceContainerTypes.exsd b/org.eclipse.debug.core/schema/sourceContainerTypes.exsd deleted file mode 100644 index 596557952..000000000 --- a/org.eclipse.debug.core/schema/sourceContainerTypes.exsd +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - This extension point allows for an extensible set of source container types to be contributed by the debug platform - source lookup facilities. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - The unique id used to refer to this type - - - - - - - The name of this source container type used for presentation purposes. - - - - - - - - - - A class that implements <code>ISourceContainerTypeDelegate</code> - - - - - - - - - - A short description of this source container for presentation purposes. - - - - - - - - - - - - - - - 3.0 - - - - - - - - - 3.0 - - - - - - - - - The following is an example of a source container type definition: -<pre> -<extension point="org.eclipse.debug.core.sourceContainerTypes"> - <sourceContainerType - name="Project" - class="org.eclipse.debug.internal.core.sourcelookup.containers.ProjectSourceContainerType" - id="org.eclipse.debug.core.containerType.project" - description="A project in the workspace"> - </sourceContainerType> -</extension> -</pre> - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>ISourceContainerType</b>. - - - - - - - - - - - - - - - - - - Copyright (c) 2003, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/sourceLocators.exsd b/org.eclipse.debug.core/schema/sourceLocators.exsd deleted file mode 100644 index f06ee77b5..000000000 --- a/org.eclipse.debug.core/schema/sourceLocators.exsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - This extension point provides a mechanism specifying a source locator to be used with a launch configuration. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - - - specifies a unique identifier for this source locator. - - - - - - - specifies the fully qualified name of the Java class that implements <code>IPersistableSourceLocator</code>. - - - - - - - - - - a human-readable name, describing the type of this source locator. - - - - - - - - - - - - - - - The following is an example of a source locator extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.sourceLocators"> - <sourceLocator - id="com.example.ExampleIdentifier" - class="com.example.ExampleSourceLocator" - name="Example Source Locator"> - </sourceLocator> - </extension> -</pre> -</p> - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.IPersistableSourceLocator</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/sourcePathComputers.exsd b/org.eclipse.debug.core/schema/sourcePathComputers.exsd deleted file mode 100644 index 48f8289b4..000000000 --- a/org.eclipse.debug.core/schema/sourcePathComputers.exsd +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - Defines an extension point to register a computer that can describe a default source lookup path for - a launch configuration. Source path computers are associated with launch configuration types via the - launchConfigurationTypes extension point. As well, a source path computer can be associated with a - specific launch configuration via the launch configuration attribute ATTR_SOURCE_PATH_COMPUTER_ID. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - Defines an extension point to register a computer that can describe a default source lookup path - for a launch configuration. - - - - - - - The unique id used to refer to this computer. - - - - - - - A class that implements <code>ISourcePathComputerDelegate</code>. - - - - - - - - - - - - - - - 3.0 - - - - - - - - - 3.0 - - - - - - - - - Following is an example source path computer definition: -<pre> - <extension point="org.eclipse.debug.core.sourcePathComputers"> - <sourcePathComputer - id="org.eclipse.example.exampleSourcePathComputer" - class="org.eclipse.example.SourcePathComputer"> - </sourcePathComputer> - </extension> -</pre> - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>ISourcePathComputer</b>. - - - - - - - - - - - - - - - - - - Copyright (c) 2003, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/statusHandlers.exsd b/org.eclipse.debug.core/schema/statusHandlers.exsd deleted file mode 100644 index a2feb316f..000000000 --- a/org.eclipse.debug.core/schema/statusHandlers.exsd +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for separating the generation and resolution of an error. -The interaction between the source of the error and the resolution is client-defined. -It is a client responsibility to look up and delegate to status handlers when an error condition occurs. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - specifies a unique identifier for this status handler. - - - - - - - specifies the fully qualified name of the Java class that implements <code>IStatusHandler</code>. - - - - - - - - - - Plug-in identifier that corresponds to the plug-in of the status this handler is registered for. (i.e. <code>IStatus.getPlugin()</code>). - - - - - - - specifies the status code this handler is registered for. - - - - - - - - - - - - The following is an example of a status handler extension point: - -<p> -<pre> - <extension point="org.eclipse.debug.core.statusHandlers"> - <statusHandler - id="com.example.ExampleIdentifier" - class="com.example.ExampleStatusHandler" - plugin="com.example.ExamplePluginId" - code="123"> - </statusHandler> - </extension> -</pre> -</p> - -In the example above, the specified status handler will be registered for to handle status objects with a plug-in identifier of -<samp>com.example.ExamplePluginId</samp> and a status code of <samp>123</samp>. - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.IStatusHandler</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/schema/watchExpressionDelegates.exsd b/org.eclipse.debug.core/schema/watchExpressionDelegates.exsd deleted file mode 100644 index 44e55d4d9..000000000 --- a/org.eclipse.debug.core/schema/watchExpressionDelegates.exsd +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - This extension provides a mechanism for providing delegates to evaluate watch expressions on a per debug model basis. Watch expression delegates perform evaluations for watch expressions and report the results asynchronously. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - specifies the id of the debug model that this delegate provides evaluations for - - - - - - - specifies a Java class which implements <code>org.eclipse.debug.core.model.IWatchExpressionDelegate</code>, which is used to evaluate the value of an expression. - - - - - - - - - - - - - - - 3.0 - - - - - - - - - 3.0 - - - - - - - - - <pre> -The following is the definition of a watch expression delegate for the com.example.foo plug-in: - <extension point="org.eclipse.debug.core.watchExpressionDelegates"> - <watchExpressionDelegate - debugModel="org.eclipse.jdt.debug" - delegateClass="org.eclipse.jdt.internal.debug.ui.JavaWatchExpressionDelegate"/> - </extension> -</pre> - - - - - - - - - Value of the attribute <b>delegateClass</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.debug.core.model.IWatchExpressionDelegate</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.debug.core/scripts/exportplugin.xml b/org.eclipse.debug.core/scripts/exportplugin.xml deleted file mode 100644 index c29eada53..000000000 --- a/org.eclipse.debug.core/scripts/exportplugin.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.examples.core/.classpath b/org.eclipse.debug.examples.core/.classpath deleted file mode 100644 index 9f8cf0e63..000000000 --- a/org.eclipse.debug.examples.core/.classpath +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.eclipse.debug.examples.core/.cvsignore b/org.eclipse.debug.examples.core/.cvsignore deleted file mode 100644 index ba077a403..000000000 --- a/org.eclipse.debug.examples.core/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/org.eclipse.debug.examples.core/.project b/org.eclipse.debug.examples.core/.project deleted file mode 100644 index b1f1fe3ee..000000000 --- a/org.eclipse.debug.examples.core/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.debug.examples.core - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index d6de6c150..000000000 --- a/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,47 +0,0 @@ -#Mon Jan 24 20:23:34 CST 2005 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 diff --git a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF deleted file mode 100644 index a7f7a8a56..000000000 --- a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF +++ /dev/null @@ -1,21 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Example Debug Core Plug-in -Bundle-SymbolicName: org.eclipse.debug.examples.core;singleton:=true -Bundle-Version: 1.2.0.qualifier -Bundle-Activator: org.eclipse.debug.examples.core.pda.DebugCorePlugin -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.core.variables, - org.eclipse.debug.core, - org.apache.ant;bundle-version="1.7.0";resolution:=optional -Eclipse-LazyStart: true -Export-Package: org.eclipse.debug.examples.core.midi.launcher, - org.eclipse.debug.examples.core.pda, - org.eclipse.debug.examples.core.pda.breakpoints, - org.eclipse.debug.examples.core.pda.launcher, - org.eclipse.debug.examples.core.pda.model, - org.eclipse.debug.examples.core.pda.protocol, - org.eclipse.debug.examples.core.pda.sourcelookup -Bundle-RequiredExecutionEnvironment: J2SE-1.4 -Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.debug.examples.core/about.html b/org.eclipse.debug.examples.core/about.html deleted file mode 100644 index 460233046..000000000 --- a/org.eclipse.debug.examples.core/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

                            About This Content

                            - -

                            June 2, 2006

                            -

                            License

                            - -

                            The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

                            - -

                            If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

                            - - - \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/build.properties b/org.eclipse.debug.examples.core/build.properties deleted file mode 100644 index ebe0689d6..000000000 --- a/org.eclipse.debug.examples.core/build.properties +++ /dev/null @@ -1,22 +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 -############################################################################### -source.. = src/,\ - src_ant/,\ - pdavm/src/ -output.. = bin/ -bin.includes = plugin.xml,\ - pdavm/,\ - META-INF/,\ - about.html,\ - .,\ - readme.html,\ - samples/ -src.includes = about.html diff --git a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java b/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java deleted file mode 100644 index e140e1085..000000000 --- a/org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java +++ /dev/null @@ -1,1427 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 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: - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.pdavm; - -import java.io.BufferedReader; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintStream; -import java.io.StringWriter; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.StringTokenizer; -import java.util.TreeSet; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Push Down Automata interpreter. - * - * @since 3.5 - */ -public class PDAVirtualMachine { - - static class Stack extends LinkedList { - private static final long serialVersionUID = 1L; - - public Object pop() { - return isEmpty() ? new Integer(0) : remove(size() - 1); - } - - public void push(Object value) { - add(value); - } - } - - static class Register { - Register(String name) { - fName = name; - } - String fName; - String fGroup = ""; - boolean fIsWriteable = true; - Map fBitFields = new LinkedHashMap(0); - int fValue; - } - - static class BitField { - BitField(String name) { - fName = name; - } - String fName; - int fBitOffset; - int fBitCount; - Map fMnemonics = new LinkedHashMap(0); - } - - Map fRegisters = new LinkedHashMap(0); - - class Args { - final String[] fArgs; - - int next = 0; - - Args(String[] args) { - fArgs = args; - } - - boolean hasNextArg() { - return fArgs.length > next; - } - - String getNextStringArg() { - if (fArgs.length > next) { - return fArgs[next++]; - } - return ""; - } - - int getNextIntArg() { - String arg = getNextStringArg(); - try { - return Integer.parseInt(arg); - } catch (NumberFormatException e) { - } - return 0; - } - - boolean getNextBooleanArg() { - String arg = getNextStringArg(); - try { - return Boolean.getBoolean(arg); - } catch (NumberFormatException e) { - } - return false; - } - - Object getNextIntOrStringArg() { - String arg = getNextStringArg(); - try { - return new Integer(arg); - } catch (NumberFormatException e) { - } - return arg; - } - - PDAThread getThreadArg() { - int id = getNextIntArg(); - return (PDAThread)fThreads.get( new Integer(id) ); - } - } - - class PDAThread { - final int fID; - - /** The push down automata data stack (the data stack). */ - final Stack fStack = new Stack(); - - /** - * PDAThread copy of the code. It can differ from the program if - * performing an evaluation. - */ - String[] fThreadCode; - - /** PDAThread copy of the labels. */ - Map fThreadLabels; - - /** The stack of stack frames (the control stack) */ - final List fFrames = new LinkedList(); - - /** Current stack frame (not includced in fFrames) */ - Frame fCurrentFrame; - - /** - * The run flag is true if the thread is running. If the run flag is - * false, the thread exits the next time the main instruction loop runs. - */ - boolean fRun = true; - - String fSuspend = null; - - boolean fStep = false; - - boolean fStepReturn = false; - - int fSavedPC; - - boolean fPerformingEval = false; - - PDAThread(int id, String function, int pc) { - fID = id; - fCurrentFrame = new Frame(function, pc); - fThreadCode = fCode; - fThreadLabels = fLabels; - } - } - - final Map fThreads = new LinkedHashMap(); - - int fNextThreadId = 1; - - boolean fStarted = true; - /** - * The code is stored as an array of strings, each line of the source file - * being one entry in the array. - */ - final String[] fCode; - - /** A mapping of labels to indicies in the code array */ - final Map fLabels; - - /** Each stack frame is a mapping of variable names to values. */ - class Frame { - final Map fLocalVariables = new LinkedHashMap(); - - /** - * The name of the function in this frame - */ - final String fFunction; - - /** - * The current program counter in the frame the pc points to the next - * instruction to be executed - */ - int fPC; - - Frame(String function, int pc) { - fFunction = function; - fPC = pc; - } - - void set(String name, Object value) { - if (name.startsWith("$")) { - setRegisterValue(name, value); - } else { - fLocalVariables.put(name, value); - } - } - - Object get(String name) { - if (name.startsWith("$")) { - return getRegisterValue(name); - } else { - return fLocalVariables.get(name); - } - } - } - - void setRegisterValue(String name, Object value) { - Register reg = (Register)fRegisters.get(getRegisterPartOfName(name)); - if (reg == null) return; - String bitFieldName = getBitFieldPartOfName(name); - if (bitFieldName != null) { - BitField bitField = (BitField)reg.fBitFields.get(bitFieldName); - if (bitField == null) return; - Integer intValue = null; - if (value instanceof Integer) { - intValue = (Integer)value; - } else if (value instanceof String) { - intValue = (Integer)bitField.fMnemonics.get(value); - } - if (intValue != null) { - int bitFieldMask = 2^(bitField.fBitCount - 1); - int registerMask = ~(bitFieldMask << bitField.fBitOffset); - int bitFieldValue = intValue.intValue() & bitFieldMask; - reg.fValue = (reg.fValue & registerMask) | (bitFieldValue << bitField.fBitOffset); - } - } else if (value instanceof Integer) { - reg.fValue = ((Integer)value).intValue(); - } - } - - Object getRegisterValue(String name) { - Register reg = (Register)fRegisters.get(getRegisterPartOfName(name)); - if (reg == null) return null; - String bitFieldName = getBitFieldPartOfName(name); - if (bitFieldName != null) { - BitField bitField = (BitField)reg.fBitFields.get(bitFieldName); - if (bitField == null) return null; - int bitFieldMask = 2^(bitField.fBitCount - 1); - int registerMask = bitFieldMask << bitField.fBitOffset; - return new Integer( (reg.fValue & registerMask) >> bitField.fBitOffset ); - } else { - return new Integer(reg.fValue); - } - } - - /** - * Breakpoints are stored per each each line of code. The boolean indicates - * whether the whole VM should suspend or just the triggering thread. - */ - final Map fBreakpoints = new HashMap(); - - /** - * The suspend flag is true if the VM should suspend running the program and - * just listen for debug commands. - */ - String fSuspendVM; - - /** Flag indicating whether the debugger is performing a step. */ - boolean fStepVM = false; - - /** Flag indicating whether the debugger is performing a step return */ - boolean fStepReturnVM = false; - - int fSteppingThread = 0; - - /** Name of the pda program being debugged */ - final String fFilename; - - /** The command line argument to start a debug session. */ - final boolean fDebug; - - /** The port to listen for debug commands on */ - final int fCommandPort; - - /** - * Command socket for receiving debug commands and sending command responses - */ - Socket fCommandSocket; - - /** Command socket reader */ - BufferedReader fCommandReceiveStream; - - /** Command socket write stream. */ - OutputStream fCommandResponseStream; - - /** The port to send debug events to */ - final int fEventPort; - - /** Event socket */ - Socket fEventSocket; - - /** Event socket and write stream. */ - OutputStream fEventStream; - - /** The eventstops table holds which events cause suspends and which do not. */ - final Map fEventStops = new HashMap(); - { - fEventStops.put("unimpinstr", Boolean.FALSE); - fEventStops.put("nosuchlabel", Boolean.FALSE); - } - - /** - * The watchpoints table holds watchpoint information. - *

                            - * variablename_stackframedepth => N - *

                              - *
                            • N = 0 is no watch
                            • - *
                            • N = 1 is read watch
                            • - *
                            • N = 2 is write watch
                            • - *
                            • N = 3 is both, etc.
                            • - */ - final Map fWatchpoints = new HashMap(); - - public static void main(String[] args) { - String programFile = args.length >= 1 ? args[0] : null; - if (programFile == null) { - System.err.println("Error: No program specified"); - return; - } - - String debugFlag = args.length >= 2 ? args[1] : ""; - boolean debug = "-debug".equals(debugFlag); - int commandPort = 0; - int eventPort = 0; - - if (debug) { - String commandPortStr = args.length >= 3 ? args[2] : ""; - try { - commandPort = Integer.parseInt(commandPortStr); - } catch (NumberFormatException e) { - System.err.println("Error: Invalid command port"); - return; - } - - String eventPortStr = args.length >= 4 ? args[3] : ""; - try { - eventPort = Integer.parseInt(eventPortStr); - } catch (NumberFormatException e) { - System.err.println("Error: Invalid event port"); - return; - } - } - - PDAVirtualMachine pdaVM = null; - try { - pdaVM = new PDAVirtualMachine(programFile, debug, commandPort, eventPort); - pdaVM.startDebugger(); - } catch (IOException e) { - System.err.println("Error: " + e.toString()); - return; - } - pdaVM.run(); - } - - PDAVirtualMachine(String inputFile, boolean debug, int commandPort, int eventPort) throws IOException { - fFilename = inputFile; - - // Load all the code into memory - FileReader fileReader = new FileReader(inputFile); - StringWriter stringWriter = new StringWriter(); - List code = new LinkedList(); - int c = fileReader.read(); - while (c != -1) { - if (c == '\n') { - code.add(stringWriter.toString().trim()); - stringWriter = new StringWriter(); - } else { - stringWriter.write(c); - } - c = fileReader.read(); - } - code.add(stringWriter.toString().trim()); - fCode = (String[])code.toArray(new String[code.size()]); - - fLabels = mapLabels(fCode); - - fDebug = debug; - fCommandPort = commandPort; - fEventPort = eventPort; - } - - /** - * Initializes the labels map - */ - Map mapLabels(String[] code) { - Map labels = new HashMap(); - for (int i = 0; i < code.length; i++) { - if (code[i].length() != 0 && code[i].charAt(0) == ':') { - labels.put(code[i].substring(1), new Integer(i)); - } - } - return labels; - } - - void sendCommandResponse(String response) { - try { - fCommandResponseStream.write(response.getBytes()); - fCommandResponseStream.flush(); - } catch (IOException e) { - } - } - - void sendDebugEvent(String event, boolean error) { - if (fDebug) { - try { - fEventStream.write(event.getBytes()); - fEventStream.write('\n'); - fEventStream.flush(); - } catch (IOException e) { - System.err.println("Error: " + e); - System.exit(1); - } - } else if (error) { - System.err.println("Error: " + event); - } - } - - void startDebugger() throws IOException { - if (fDebug) { - System.out.println("-debug " + fCommandPort + " " + fEventPort); - } - - ServerSocket commandServerSocket = new ServerSocket(fCommandPort); - fCommandSocket = commandServerSocket.accept(); - fCommandReceiveStream = new BufferedReader(new InputStreamReader(fCommandSocket.getInputStream())); - fCommandResponseStream = new PrintStream(fCommandSocket.getOutputStream()); - commandServerSocket.close(); - - ServerSocket eventServerSocket = new ServerSocket(fEventPort); - fEventSocket = eventServerSocket.accept(); - fEventStream = new PrintStream(fEventSocket.getOutputStream()); - eventServerSocket.close(); - - System.out.println("debug connection accepted"); - - fSuspendVM = "client"; - } - - void run() { - int id = fNextThreadId++; - sendDebugEvent("vmstarted", false); - fThreads.put(new Integer(id), new PDAThread(id, "main", 0)); - if (fDebug) { - sendDebugEvent("started " + id, false); - } - - boolean allThreadsSuspended = false; - while (!fThreads.isEmpty()) { - checkForBreakpoint(); - - if (fSuspendVM != null) { - debugUI(); - } else { - yieldToDebug(allThreadsSuspended); - if (fSuspendVM != null) { - // Received a command to suspend VM, skip executing threads. - continue; - } - } - - PDAThread[] threadsCopy = (PDAThread[])fThreads.values().toArray(new PDAThread[fThreads.size()]); - allThreadsSuspended = true; - for (int i = 0; i < threadsCopy.length; i++) { - PDAThread thread = threadsCopy[i]; - if (thread.fSuspend == null) { - allThreadsSuspended = false; - - String instruction = thread.fThreadCode[thread.fCurrentFrame.fPC]; - thread.fCurrentFrame.fPC++; - doOneInstruction(thread, instruction); - if (thread.fCurrentFrame.fPC >= thread.fThreadCode.length) { - // Thread reached end of code, exit from the thread. - thread.fRun = false; - } else if (thread.fStepReturn) { - // If this thread is in a step-return operation, check - // if we've returned from a call. - instruction = thread.fThreadCode[thread.fCurrentFrame.fPC]; - if ("return".equals(instruction)) { - // Note: this will only be triggered if the current - // thread also has the fStepReturn flag set. - if (fStepReturnVM) { - fSuspendVM = thread.fID + " step"; - } else { - thread.fSuspend = "step"; - } - } - } - if (!thread.fRun) { - sendDebugEvent("exited " + thread.fID, false); - fThreads.remove(new Integer(thread.fID)); - } else if (thread.fSuspend != null) { - sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); - thread.fStep = thread.fStepReturn = thread.fPerformingEval = false; - } - } - } - - // Force thread context switch to avoid starving out other - // processes in the system. - Thread.yield(); - } - - sendDebugEvent("vmterminated", false); - if (fDebug) { - try { - fCommandReceiveStream.close(); - fCommandResponseStream.close(); - fCommandSocket.close(); - fEventStream.close(); - fEventSocket.close(); - } catch (IOException e) { - System.out.println("Error: " + e); - } - } - - } - - void doOneInstruction(PDAThread thread, String instr) { - StringTokenizer tokenizer = new StringTokenizer(instr); - String op = tokenizer.nextToken(); - List tokens = new LinkedList(); - while (tokenizer.hasMoreTokens()) { - tokens.add(tokenizer.nextToken()); - } - Args args = new Args( (String[])tokens.toArray(new String[tokens.size()]) ); - - boolean opValid = true; - if (op.equals("add")) iAdd(thread, args); - else if (op.equals("branch_not_zero")) iBranchNotZero(thread, args); - else if (op.equals("call")) iCall(thread, args); - else if (op.equals("dec")) iDec(thread, args); - else if (op.equals("def")) iDef(thread, args); - else if (op.equals("dup")) iDup(thread, args); - else if (op.equals("exec")) iExec(thread, args); - else if (op.equals("halt")) iHalt(thread, args); - else if (op.equals("output")) iOutput(thread, args); - else if (op.equals("pop")) iPop(thread, args); - else if (op.equals("push")) iPush(thread, args); - else if (op.equals("return")) iReturn(thread, args); - else if (op.equals("var")) iVar(thread, args); - else if (op.equals("xyzzy")) iInternalEndEval(thread, args); - else if (op.startsWith(":")) {} // label - else if (op.startsWith("#")) {} // comment - else { - opValid = false; - } - - if (!opValid) { - sendDebugEvent("unimplemented instruction " + op, true); - if ( ((Boolean)fEventStops.get("unimpinstr")).booleanValue() ) { - fSuspendVM = thread.fID + " event unimpinstr"; - thread.fCurrentFrame.fPC--; - } - } else if (thread.fStep) { - if (fStepVM) { - fSuspendVM = thread.fID + " step"; - fStepVM = false; - } else { - thread.fSuspend = "step"; - } - thread.fStep = false; - } - } - - void checkForBreakpoint() { - if (fDebug) { - for (Iterator itr = fThreads.values().iterator(); itr.hasNext();) { - PDAThread thread = (PDAThread)itr.next(); - Integer pc = new Integer(thread.fCurrentFrame.fPC); - // Suspend for breakpoint if: - // - the VM is not yet set to suspend, for e.g. as a result of step end, - // - the thread is not yet suspended and is not performing an evaluation - // - the breakpoints table contains a breakpoint for the given line. - if (fSuspendVM == null && - thread.fSuspend == null && !thread.fPerformingEval && - fBreakpoints.containsKey(pc)) - { - if ( ((Boolean)fBreakpoints.get(pc)).booleanValue() ) { - fSuspendVM = thread.fID + " breakpoint " + pc; - } else { - thread.fSuspend = "breakpoint " + pc; - thread.fStep = thread.fStepReturn = false; - sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); - } - } - } - } - } - - /** - * After each instruction, we check the debug command channel for control input. If - * there are commands, process them. - */ - void yieldToDebug(boolean allThreadsSuspended) { - if (fDebug) { - String line = ""; - try { - if (allThreadsSuspended || fCommandReceiveStream.ready()) { - line = fCommandReceiveStream.readLine(); - processDebugCommand(line); - } - } catch (IOException e) { - System.err.println("Error: " + e); - System.exit(1); - } - } - } - - /** - * Service the debugger commands while the VM is suspended - */ - void debugUI() { - if (!fStarted) { - sendDebugEvent("vmsuspended " + fSuspendVM, false); - } else { - fStarted = false; - } - - // Clear all stepping flags. In case the VM suspended while - // a step operation was being performed for the VM or some thread. - fStepVM = fStepReturnVM = false; - for (Iterator itr = fThreads.values().iterator(); itr.hasNext();) { - PDAThread thread = (PDAThread)itr.next(); - thread.fSuspend = null; - thread.fStep = thread.fStepReturn = thread.fPerformingEval = false; - } - - while (fSuspendVM != null) { - String line = ""; - try { - line = fCommandReceiveStream.readLine(); - } catch (IOException e) { - System.err.println("Error: " + e); - System.exit(1); - return; - } - processDebugCommand(line); - } - - if (fStepVM || fStepReturnVM) { - sendDebugEvent("vmresumed step", false); - } else { - sendDebugEvent("vmresumed client", false); - } - } - - void processDebugCommand(String line) { - StringTokenizer tokenizer = new StringTokenizer(line.trim()); - if (line.length() == 0) { - return; - } - - String command = tokenizer.nextToken(); - List tokens = new LinkedList(); - while (tokenizer.hasMoreTokens()) { - tokens.add(tokenizer.nextToken()); - } - Args args = new Args( (String[])tokens.toArray(new String[tokens.size()])); - - if ("children".equals(command)) debugChildren(args); - else if ("clear".equals(command)) debugClearBreakpoint(args); - else if ("data".equals(command)) debugData(args); - else if ("drop".equals(command)) debugDropFrame(args); - else if ("eval".equals(command)) debugEval(args); - else if ("eventstop".equals(command)) debugEventStop(args); - else if ("frame".equals(command)) debugFrame(args); - else if ("groups".equals(command)) debugGroups(args); - else if ("popdata".equals(command)) debugPopData(args); - else if ("pushdata".equals(command)) debugPushData(args); - else if ("registers".equals(command)) debugRegisters(args); - else if ("restart".equals(command)) debugRestart(args); - else if ("resume".equals(command)) debugResume(args); - else if ("set".equals(command)) debugSetBreakpoint(args); - else if ("setdata".equals(command)) debugSetData(args); - else if ("setvar".equals(command)) debugSetVariable(args); - else if ("stack".equals(command)) debugStack(args); - else if ("stackdepth".equals(command)) debugStackDepth(args); - else if ("state".equals(command)) debugState(args); - else if ("step".equals(command)) debugStep(args); - else if ("stepreturn".equals(command)) debugStepReturn(args); - else if ("suspend".equals(command)) debugSuspend(args); - else if ("terminate".equals(command)) debugTerminate(); - else if ("threads".equals(command)) debugThreads(); - else if ("var".equals(command)) debugVar(args); - else if ("vmresume".equals(command)) debugVMResume(); - else if ("vmsuspend".equals(command)) debugVMSuspend(); - else if ("watch".equals(command)) debugWatch(args); - else { - sendCommandResponse("error: invalid command\n"); - } - } - - void debugChildren(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - int sfnumber = args.getNextIntArg(); - String var = args.getNextStringArg(); - - Frame frame = sfnumber >= thread.fFrames.size() - ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber); - - String varDot = var + "."; - List children = new ArrayList(); - for (Iterator itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) { - String localVar = (String)itr.next(); - if (localVar.startsWith(varDot) && localVar.indexOf('.', varDot.length() + 1) == -1) { - children.add(localVar); - } - } - - StringBuffer result = new StringBuffer(); - for (Iterator itr = children.iterator(); itr.hasNext();) { - result.append(itr.next()); - result.append('|'); - } - result.append('\n'); - - sendCommandResponse(result.toString()); - } - - void debugClearBreakpoint(Args args) { - int line = args.getNextIntArg(); - - fBreakpoints.remove( new Integer(line) ); - sendCommandResponse("ok\n"); - } - - private static Pattern fPackPattern = Pattern.compile("%([a-fA-F0-9][a-fA-F0-9])"); - - void debugData(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - StringBuffer result = new StringBuffer(); - for (Iterator itr = thread.fStack.iterator(); itr.hasNext();) { - result.append(itr.next()); - result.append('|'); - } - result.append('\n'); - sendCommandResponse(result.toString()); - } - - void debugDropFrame(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - if (!thread.fFrames.isEmpty()) { - thread.fCurrentFrame = (Frame)thread.fFrames.remove(thread.fFrames.size() - 1); - } - thread.fCurrentFrame.fPC--; - sendCommandResponse("ok\n"); - if (fSuspendVM != null) { - sendDebugEvent("vmresumed drop", false); - sendDebugEvent("vmsuspended " + thread.fID + " drop", false); - } else { - sendDebugEvent("resumed " + thread.fID + " drop", false); - sendDebugEvent("suspended " + thread.fID + " drop", false); - } - } - - void debugEval(Args args) { - if (fSuspendVM != null) { - sendCommandResponse("error: cannot evaluate while vm is suspended\n"); - return; - } - - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - if (thread.fSuspend == null) { - sendCommandResponse("error: thread running\n"); - return; - } - - StringTokenizer tokenizer = new StringTokenizer(args.getNextStringArg(), "|"); - tokenizer.countTokens(); - - int numEvalLines = tokenizer.countTokens(); - thread.fThreadCode = new String[fCode.length + numEvalLines + 1]; - System.arraycopy(fCode, 0, thread.fThreadCode, 0, fCode.length); - for (int i = 0; i < numEvalLines; i++) { - String line = tokenizer.nextToken(); - StringBuffer lineBuf = new StringBuffer(line.length()); - Matcher matcher = fPackPattern.matcher(line); - int lastMatchEnd = 0; - while (matcher.find()) { - lineBuf.append(line.substring(lastMatchEnd, matcher.start())); - String charCode = line.substring(matcher.start() + 1, matcher.start() + 3); - try { - lineBuf.append((char) Integer.parseInt(charCode, 16)); - } catch (NumberFormatException e) { - } - lastMatchEnd = matcher.end(); - } - if (lastMatchEnd < line.length()) { - lineBuf.append(line.substring(lastMatchEnd)); - } - thread.fThreadCode[fCode.length + i] = lineBuf.toString(); - } - thread.fThreadCode[fCode.length + numEvalLines] = "xyzzy"; - thread.fThreadLabels = mapLabels(fCode); - - thread.fSavedPC = thread.fCurrentFrame.fPC; - thread.fCurrentFrame.fPC = fCode.length; - thread.fPerformingEval = true; - - thread.fSuspend = null; - - sendCommandResponse("ok\n"); - - sendDebugEvent("resumed " + thread.fID + " eval", false); - } - - void debugEventStop(Args args) { - String event = args.getNextStringArg(); - int stop = args.getNextIntArg(); - fEventStops.put(event, new Boolean(stop > 0)); - sendCommandResponse("ok\n"); - } - - void debugTerminate() { - sendCommandResponse("ok\n"); - sendDebugEvent("vmterminated", false); - System.exit(0); - } - - void debugFrame(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - int sfnumber = args.getNextIntArg(); - Frame frame = null; - if (sfnumber >= thread.fFrames.size()) { - frame = thread.fCurrentFrame; - } else { - frame = (Frame)thread.fFrames.get(sfnumber); - } - sendCommandResponse(printFrame(frame) + "\n"); - } - - void debugGroups(Args args) { - TreeSet groups = new TreeSet(); - for (Iterator itr = fRegisters.values().iterator(); itr.hasNext();) { - Register reg = (Register)itr.next(); - groups.add(reg.fGroup); - } - StringBuffer response = new StringBuffer(); - for (Iterator itr = groups.iterator(); itr.hasNext();) { - response.append(itr.next()); - response.append('|'); - } - response.append('\n'); - sendCommandResponse(response.toString()); - } - - void debugPopData(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - thread.fStack.pop(); - sendCommandResponse("ok\n"); - } - - void debugPushData(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - Object val = args.getNextIntOrStringArg(); - thread.fStack.push(val); - sendCommandResponse("ok\n"); - } - - void debugRegisters(Args args) { - String group = args.getNextStringArg(); - - StringBuffer response = new StringBuffer(); - for (Iterator itr = fRegisters.values().iterator(); itr.hasNext();) { - Register reg = (Register)itr.next(); - if (group.equals(reg.fGroup)) { - response.append(reg.fName); - response.append(' '); - response.append(reg.fIsWriteable); - for (Iterator itr2 = reg.fBitFields.values().iterator(); itr2.hasNext();) { - BitField bitField = (BitField)itr2.next(); - response.append('|'); - response.append(bitField.fName); - response.append(' '); - response.append(bitField.fBitOffset); - response.append(' '); - response.append(bitField.fBitCount); - response.append(' '); - for (Iterator itr3 = bitField.fMnemonics.entrySet().iterator(); itr3.hasNext();) { - Map.Entry mnemonicEntry = (Map.Entry)itr3.next(); - response.append(mnemonicEntry.getKey()); - response.append(' '); - response.append(mnemonicEntry.getValue()); - response.append(' '); - } - } - - response.append('#'); - } - } - response.append('\n'); - sendCommandResponse(response.toString()); - } - - void debugRestart(Args args) { - fSuspendVM = "restart"; - - for (Iterator itr = fThreads.keySet().iterator(); itr.hasNext();) { - Integer id = (Integer)itr.next(); - sendDebugEvent("exited " + id, false); - } - fThreads.clear(); - - int id = fNextThreadId++; - fThreads.put(new Integer(id), new PDAThread(id, "main", 0)); - sendDebugEvent("started " + id, false); - - fRegisters.clear(); - - sendCommandResponse("ok\n"); - } - - void debugResume(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - if (fSuspendVM != null) { - sendCommandResponse("error: cannot resume thread when vm is suspended\n"); - return; - } - if (thread.fSuspend == null) { - sendCommandResponse("error: thread already running\n"); - return; - } - - thread.fSuspend = null; - sendDebugEvent("resumed " + thread.fID + " client", false); - - sendCommandResponse("ok\n"); - } - - void debugSetBreakpoint(Args args) { - int line = args.getNextIntArg(); - int stopVM = args.getNextIntArg(); - - fBreakpoints.put(new Integer(line), new Boolean(stopVM != 0)); - sendCommandResponse("ok\n"); - } - - void debugSetData(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - int offset = args.getNextIntArg(); - Object val = args.getNextIntOrStringArg(); - - if (offset < thread.fStack.size()) { - thread.fStack.set(offset, val); - } else { - thread.fStack.add(0, val); - } - sendCommandResponse("ok\n"); - } - - void debugSetVariable(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - int sfnumber = args.getNextIntArg(); - String var = args.getNextStringArg(); - Object val = args.getNextIntOrStringArg(); - while (args.hasNextArg()) { - val = val.toString() + " " + args.getNextStringArg(); - } - - if (sfnumber >= thread.fFrames.size()) { - thread.fCurrentFrame.set(var, val); - } else { - ((Frame)thread.fFrames.get(sfnumber)).set(var, val); - } - sendCommandResponse("ok\n"); - } - - void debugStack(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - StringBuffer result = new StringBuffer(); - - for (Iterator itr = thread.fFrames.iterator(); itr.hasNext();) { - Frame frame = (Frame)itr.next(); - result.append(printFrame(frame)); - result.append('#'); - } - result.append(printFrame(thread.fCurrentFrame)); - result.append('\n'); - sendCommandResponse(result.toString()); - } - - void debugStackDepth(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - sendCommandResponse( Integer.toString(thread.fFrames.size() + 1) + "\n" ); - } - - - /** - * The stack frame output is: frame # frame # frame ... where each frame is: - * filename | line number | function name | var | var | var | var ... - */ - private String printFrame(Frame frame) { - StringBuffer buf = new StringBuffer(); - buf.append(fFilename); - buf.append('|'); - buf.append(frame.fPC); - buf.append('|'); - buf.append(frame.fFunction); - for (Iterator itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) { - String var = (String)itr.next(); - if (var.indexOf('.') == -1) { - buf.append('|'); - buf.append(var); - } - } - return buf.toString(); - } - - void debugState(Args args) { - PDAThread thread = args.getThreadArg(); - String response = null; - if (thread == null) { - response = fSuspendVM == null ? "running" : fSuspendVM; - } else if (fSuspendVM != null) { - response = "vm"; - } else { - response = thread.fSuspend == null ? "running" : thread.fSuspend; - } - sendCommandResponse(response + "\n"); - } - - void debugStep(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - // Set suspend to null to allow the debug loop to exit back to the - // instruction loop and thus run an instruction. However, we want to - // come back to the debug loop right away, so the step flag is set to - // true which will cause the suspend flag to get set to true when we - // get to the next instruction. - if (fSuspendVM != null) { - // All threads are suspended, so suspend all threads again when - // step completes. - fSuspendVM = null; - fStepVM = true; - // Also mark the thread that initiated the step to mark it as - // the triggering thread when suspending. - thread.fStep = true; - } else { - if (thread.fSuspend == null) { - sendCommandResponse("error: thread already running\n"); - return; - } - thread.fSuspend = null; - thread.fStep = true; - sendDebugEvent("resumed " + thread.fID + " step", false); - } - sendCommandResponse("ok\n"); - } - - void debugStepReturn(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - if (fSuspendVM != null) { - fSuspendVM = null; - fStepReturnVM = true; - thread.fStepReturn = true; - } else { - if (thread.fSuspend == null) { - sendCommandResponse("error: thread running\n"); - return; - } - thread.fSuspend = null; - thread.fStepReturn = true; - sendDebugEvent("resumed " + thread.fID + " step", false); - } - sendCommandResponse("ok\n"); - } - - void debugSuspend(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - if (fSuspendVM != null) { - sendCommandResponse("error: vm already suspended\n"); - return; - } - if (thread.fSuspend != null) { - sendCommandResponse("error: thread already suspended\n"); - return; - } - - thread.fSuspend = "client"; - sendDebugEvent("suspended " + thread.fID + " client", false); - sendCommandResponse("ok\n"); - } - - void debugThreads() { - StringBuffer response = new StringBuffer(); - for (Iterator itr = fThreads.keySet().iterator(); itr.hasNext();) { - response.append(itr.next()); - response.append(' '); - } - sendCommandResponse(response.toString().trim() + "\n"); - } - - void debugVar(Args args) { - PDAThread thread = args.getThreadArg(); - if (thread == null) { - sendCommandResponse("error: invalid thread\n"); - return; - } - - int sfnumber = args.getNextIntArg(); - String var = args.getNextStringArg(); - - Frame frame = sfnumber >= thread.fFrames.size() - ? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber); - - Object val = frame.get(var); - if (val == null) { - sendCommandResponse("error: variable undefined\n"); - } else { - sendCommandResponse(val.toString() + "\n"); - } - } - - void debugVMResume() { - if (fSuspendVM == null) { - sendCommandResponse("error: vm already running\n"); - return; - } - - fSuspendVM = null; - sendCommandResponse("ok\n"); - } - - void debugVMSuspend() { - if (fSuspendVM != null) { - sendCommandResponse("error: vm already suspended\n"); - return; - } - - fSuspendVM = "client"; - sendCommandResponse("ok\n"); - } - - void debugWatch(Args args) { - String funcAndVar = args.getNextStringArg(); - int flags = args.getNextIntArg(); - fWatchpoints.put(funcAndVar, new Integer(flags)); - sendCommandResponse("ok\n"); - } - - void iAdd(PDAThread thread, Args args) { - Object val1 = thread.fStack.pop(); - Object val2 = thread.fStack.pop(); - if (val1 instanceof Integer && val2 instanceof Integer) { - int intVal1 = ((Integer) val1).intValue(); - int intVal2 = ((Integer) val2).intValue(); - thread.fStack.push( new Integer(intVal1 + intVal2) ); - } else { - thread.fStack.push( new Integer(-1) ); - } - } - - void iBranchNotZero(PDAThread thread, Args args) { - Object val = thread.fStack.pop(); - if (val instanceof Integer && ((Integer) val).intValue() != 0) { - String label = args.getNextStringArg(); - if (thread.fThreadLabels.containsKey(label)) { - thread.fCurrentFrame.fPC = ((Integer)thread.fThreadLabels.get(label)).intValue(); - } else { - sendDebugEvent("no such label " + label, true); - if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) { - fSuspendVM = thread.fID + " event nosuchlabel"; - thread.fStack.push(val); - thread.fCurrentFrame.fPC--; - } - } - } - } - - void iCall(PDAThread thread, Args args) { - String label = args.getNextStringArg(); - if (thread.fThreadLabels.containsKey(label)) { - thread.fFrames.add(thread.fCurrentFrame); - thread.fCurrentFrame = new Frame(label, ((Integer)thread.fThreadLabels.get(label)).intValue()); - } else { - sendDebugEvent("no such label " + label, true); - if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) { - fSuspendVM = thread.fID + " event nosuchlabel"; - thread.fCurrentFrame.fPC--; - } - } - } - - void iDec(PDAThread thread, Args args) { - Object val = thread.fStack.pop(); - if (val instanceof Integer) { - val = new Integer(((Integer) val).intValue() - 1); - } - thread.fStack.push(val); - } - - void iDef(PDAThread thread, Args args) { - String type = args.getNextStringArg(); - - String name = args.getNextStringArg(); - String regName = getRegisterPartOfName(name); - String bitFieldName = getBitFieldPartOfName(name); - - if ("register".equals(type)) { - Register reg = new Register(regName); - reg.fGroup = args.getNextStringArg(); - fRegisters.put(regName, reg); - reg.fIsWriteable = args.getNextBooleanArg(); - } else if ("bitfield".equals(type)) { - Register reg = (Register)fRegisters.get(regName); - if (reg == null) return; - BitField bitField = new BitField(bitFieldName); - bitField.fBitOffset = args.getNextIntArg(); - bitField.fBitCount = args.getNextIntArg(); - reg.fBitFields.put(bitFieldName, bitField); - } else if ("mnemonic".equals(type)) { - Register reg = (Register)fRegisters.get(regName); - if (reg == null) return; - BitField bitField = (BitField)reg.fBitFields.get(bitFieldName); - if (bitField == null) return; - bitField.fMnemonics.put(args.getNextStringArg(), new Integer(args.getNextIntArg())); - } - sendDebugEvent("registers", false); - } - - private String getRegisterPartOfName(String name) { - if (name.startsWith("$")) { - int end = name.indexOf('.'); - end = end != -1 ? end : name.length(); - return name.substring(1, end); - } - return null; - } - - private String getBitFieldPartOfName(String name) { - int start = name.indexOf('.'); - if (name.startsWith("$") && start != -1) { - return name.substring(start + 1, name.length()); - } - return null; - } - - void iDup(PDAThread thread, Args args) { - Object val = thread.fStack.pop(); - thread.fStack.push(val); - thread.fStack.push(val); - } - - void iExec(PDAThread thread, Args args) { - String label = args.getNextStringArg(); - if (fLabels.containsKey(label)) { - int id = fNextThreadId++; - fThreads.put( new Integer(id), new PDAThread(id, label, ((Integer)fLabels.get(label)).intValue()) ); - sendDebugEvent("started " + id, false); - } else { - sendDebugEvent("no such label " + label, true); - if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) { - thread.fSuspend = "event nosuchlabel"; - thread.fCurrentFrame.fPC--; - } - } - } - - void iHalt(PDAThread thread, Args args) { - thread.fRun = false; - } - - void iOutput(PDAThread thread, Args args) { - System.out.println(thread.fStack.pop()); - } - - void iPop(PDAThread thread, Args args) { - String arg = args.getNextStringArg(); - if (arg.startsWith("$")) { - String var = arg.substring(1); - thread.fCurrentFrame.set(var, thread.fStack.pop()); - String key = thread.fCurrentFrame.fFunction + "::" + var; - if ( fWatchpoints.containsKey(key) && (((Integer)fWatchpoints.get(key)).intValue() & 2) != 0 ) { - fSuspendVM = thread.fID + " watch write " + key; - } - } else { - thread.fStack.pop(); - } - } - - void iPush(PDAThread thread, Args args) { - String arg = args.getNextStringArg(); - while (arg.length() != 0) { - if (arg.startsWith("$")) { - String var = arg.substring(1); - Object val = thread.fCurrentFrame.get(var); - if (val == null) val = ""; - thread.fStack.push(val); - String key = thread.fCurrentFrame.fFunction + "::" + var; - if (fWatchpoints.containsKey(key) && (((Integer)fWatchpoints.get(key)).intValue() & 1) != 0) { - fSuspendVM = thread.fID + " watch read " + key; - } - } else { - Object val = arg; - if (args.hasNextArg()) { - while (args.hasNextArg()) { - val = val.toString() + " " + args.getNextStringArg(); - } - } else { - try { - val = new Integer(arg); - } catch (NumberFormatException e) { - } - } - thread.fStack.push(val); - } - - arg = args.getNextStringArg(); - } - } - - void iReturn(PDAThread thread, Args args) { - if (!thread.fFrames.isEmpty()) { - thread.fCurrentFrame = (Frame)thread.fFrames.remove(thread.fFrames.size() - 1); - } else { - // Execution returned from the top frame, which means this thread - // should exit. - thread.fRun = false; - } - } - - void iVar(PDAThread thread, Args args) { - String var = args.getNextStringArg(); - thread.fCurrentFrame.set(var, new Integer(0)); - } - - void iInternalEndEval(PDAThread thread, Args args) { - Object result = thread.fStack.pop(); - thread.fThreadCode = fCode; - thread.fThreadLabels = fLabels; - thread.fCurrentFrame.fPC = thread.fSavedPC; - sendDebugEvent("evalresult " + result, false); - thread.fSuspend = "eval"; - thread.fPerformingEval = false; - } - -} diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda deleted file mode 100644 index 837277f5f..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest10.pda +++ /dev/null @@ -1,38 +0,0 @@ -def register $reg1 group1 true -def register $reg2 group1 false -def register $reg3 group2 true -def bitfield $reg1.field1 0 2 -def bitfield $reg1.field2 2 2 -def mnemonic $reg1.field2 zero 0 -def mnemonic $reg1.field2 one 1 -def mnemonic $reg1.field2 two 2 -def mnemonic $reg1.field2 three 3 -push 1 -pop $$reg1 -push $$reg1 -output -push 2 -pop $$reg1.field1 -push $$reg1.field1 -output -push 4 -pop $$reg1.field1 -push $$reg1.field1 -output -push 1 -pop $$reg1.field2 -push $$reg1 -output -push zero -pop $$reg1.field2 -push $$reg1.field2 -output -push $$reg1 -output -push 2 -pop $$reg1.field2 -push $$reg1.field2 -output -push $$reg1 -output -halt \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda deleted file mode 100644 index 95a35f04f..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest2.pda +++ /dev/null @@ -1,48 +0,0 @@ -push 6 -push 7 -push 8 -push 9 -push 10 -call sub1 -output -call sub3 -call sub5 -push 3 -halt -:sub2 -push 27 -return -:sub1 -var m -var n -call sub2 -pop $n -pop $m -push $n -push $m -return -# zero-based line 23 -:sub3 -push 1 -call sub4 -push 2 -call sub4 -push 3 -return -:sub4 -push 4 -return -# zero-based line 34 -:sub5 -var a -var b -var c -pop $c -pop $b -call sub6 -push $a -return -:sub6 -var b -pop $b -return diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda deleted file mode 100644 index 5aecdc5e6..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest3.pda +++ /dev/null @@ -1,13 +0,0 @@ -push 1 -push 2 -push 3 -foobar swish -push 4 -add -add -call zippy -add -output -push 1 -branch_not_zero swishy -halt diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda deleted file mode 100644 index d90a960cf..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest6.pda +++ /dev/null @@ -1,31 +0,0 @@ -var a -var b -push 1 -pop $a -push 2 -pop $b -push 3 -push 4 -# -call inner -# -push $a -push 2 -add -pop $b -output -# -halt -# -:inner -var a -var c -pop $a -pop $c -push $a -push $a -add -return -:other -push 15 -return \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda deleted file mode 100644 index 7729409c2..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest8.pda +++ /dev/null @@ -1,14 +0,0 @@ -var a -call inner -push 1 -output -halt -:inner -var b -call inner2 -push 2 -return -:inner2 -var c -push 3 -return diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda deleted file mode 100644 index 336a251d9..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest9.pda +++ /dev/null @@ -1,23 +0,0 @@ -push 5 -:thread_create -exec foo -dec -dup -branch_not_zero thread_create -push finished -output -halt -:foo -push thread_created -output -call inner -halt -:inner -var b -call inner2 -push 2 -return -:inner2 -var c -push 3 -return diff --git a/org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda b/org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda deleted file mode 100644 index b0bbd163d..000000000 --- a/org.eclipse.debug.examples.core/pdavm/tests/vmtest_children.pda +++ /dev/null @@ -1,8 +0,0 @@ -var a -var a.b -var a.c -push 1 -pop $a.b -push $a.b -output -halt diff --git a/org.eclipse.debug.examples.core/plugin.xml b/org.eclipse.debug.examples.core/plugin.xml deleted file mode 100644 index dadb0fe8f..000000000 --- a/org.eclipse.debug.examples.core/plugin.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.examples.core/readme.html b/org.eclipse.debug.examples.core/readme.html deleted file mode 100644 index 2a7cb9df3..000000000 --- a/org.eclipse.debug.examples.core/readme.html +++ /dev/null @@ -1,11 +0,0 @@ -

                              Debug Examples ReadMe Notes

                              -

                              PDA Debugger Example

                              -

                              In order to actually run the PDA debugger example, you will need a Perl interpreter. - Linux®™ comes with Perl. For Microsoft® Windows®, we use either - ActivePerl (http://www.activeperl.com/) or Indigo Perl - (http://www.indigostar.com/). You also - have to set the string substitution variable named “perlExecutable” - to the complete path to your Perl interpreter. (For example, ours was C:\perl\bin\perl.exe) - To set a string substitution variable, use the Windows > Preferences > - Run/Debug > String Substitution preferences page.
                              -

                              diff --git a/org.eclipse.debug.examples.core/samples/counter.pda b/org.eclipse.debug.examples.core/samples/counter.pda deleted file mode 100644 index 9b2b73100..000000000 --- a/org.eclipse.debug.examples.core/samples/counter.pda +++ /dev/null @@ -1,11 +0,0 @@ -push 0 -:main -var n -pop $n -push $n -push 1 -add -dup -push $n -output -branch_not_zero main \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/samples/drop.pda b/org.eclipse.debug.examples.core/samples/drop.pda deleted file mode 100644 index 84f60fee0..000000000 --- a/org.eclipse.debug.examples.core/samples/drop.pda +++ /dev/null @@ -1,12 +0,0 @@ -call one -:one -call two -:two -call three -:three -call four -:four -push DONE -output - - diff --git a/org.eclipse.debug.examples.core/samples/example.pda b/org.eclipse.debug.examples.core/samples/example.pda deleted file mode 100644 index a95886358..000000000 --- a/org.eclipse.debug.examples.core/samples/example.pda +++ /dev/null @@ -1,35 +0,0 @@ -push "hello" -output -call foobar -push 3 -:label -dup -push 4 -push 5 -add -add -output -dec -dup -branch_not_zero label -call foobar -push "end" -output -halt -:foobar -var a -var b -call barfoo -push "first" -push "second" -pop $a -pop $b -push $a -push $b -output -output -return -:barfoo -push "barfoo" -output -return diff --git a/org.eclipse.debug.examples.core/samples/fibonacci.pda b/org.eclipse.debug.examples.core/samples/fibonacci.pda deleted file mode 100644 index e39595a98..000000000 --- a/org.eclipse.debug.examples.core/samples/fibonacci.pda +++ /dev/null @@ -1,32 +0,0 @@ -push 6 -call fibonacci -output -halt -# -# f(n) = f(n-1) + f(n-2) -# f(0) = 1 -# f(1) = 1 -# -:fibonacci -var n -pop $n -push $n -branch_not_zero gt0 -push 1 -return -:gt0 -push $n -dec -branch_not_zero gt1 -push 1 -return -:gt1 -push $n -dec -call fibonacci -push $n -dec -dec -call fibonacci -add -return diff --git a/org.eclipse.debug.examples.core/samples/registers.pda b/org.eclipse.debug.examples.core/samples/registers.pda deleted file mode 100644 index 97fd8d409..000000000 --- a/org.eclipse.debug.examples.core/samples/registers.pda +++ /dev/null @@ -1,72 +0,0 @@ -def register $pc General true -def register $sp General true -def register $status General true -def bitfield $status.BITS_00_07 0 8 -def bitfield $status.BITS_08_15 8 8 -def bitfield $status.BITS_16_23 16 8 -def bitfield $status.BITS_24_31 24 8 -def mnemonic $status.BITS_24_31 three 3 -def mnemonic $status.BITS_24_31 twelve 12 -def mnemonic $status.BITS_24_31 fourty_eight 48 -def mnemonic $status.BITS_24_31 one_nighty_two 192 -def register $stackdepth General true -def register $stack[0] General true -def register $stack[1] General true -def register $stack[2] General true -def register $stack[3] General true -def register $stack[4] General true -push 103 -pop $$pc -push 306 -push 2 -pop $$sp -push 400 -pop $$status -push 5 -pop $$stackdepth -push 12 -pop $$stack[0] -push 45 -pop $$stack[1] -push 146 -pop $$stack[2] -push 215 -pop $$stack[3] -push 251 -pop $$stack[4] -push 306 -pop $$stack[5] -def register $total-instructions Analysis false -def register $add-instructions Analysis false -def register $call-instructions Analysis false -def register $dec-instructions Analysis false -def register $dup-instructions Analysis false -def register $halt-instructions Analysis false -def register $output-instructions Analysis false -def register $pop-instructions Analysis false -def register $push-instructions Analysis false -def register $return-instructions Analysis false -def register $var-instructions Analysis false -push 1046 -pop $$total-instructions -push 12 -pop $$add-instructions -push 24 -pop $$call-instructions -push 36 -pop $$dec-instructions -push 50 -pop $$dup-instructions -push 62 -pop $$halt-instructions -push 74 -pop $$output-instructions -push 106 -pop $$pop-instructions -push 120 -pop $$push-instructions -push 132 -pop $$return-instructions -push 144 -pop $$var-instructions -halt \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/samples/stack.pda b/org.eclipse.debug.examples.core/samples/stack.pda deleted file mode 100644 index c7fa1628b..000000000 --- a/org.eclipse.debug.examples.core/samples/stack.pda +++ /dev/null @@ -1,21 +0,0 @@ -push 5 -:thread_create -exec stack -dec -dup -branch_not_zero thread_create -push finished -output -halt -:stack -push 100 -:inner -dup -output -dup -branch_not_zero descend -return -:descend -dec -call inner -return \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/samples/structures.pda b/org.eclipse.debug.examples.core/samples/structures.pda deleted file mode 100644 index 4cc881728..000000000 --- a/org.eclipse.debug.examples.core/samples/structures.pda +++ /dev/null @@ -1,29 +0,0 @@ -push a -push b -push c -push x -push y -push z -push one two three -push 1 2 3 -push I II III -var x -var x.a -var x.b -var y -var y.c -var y.d -var y.d.1 -var y.d.2 -var y.d.3 -pop $x -pop $x.a -pop $x.b -pop $y -pop $y.c -pop $y.d -pop $y.d.1 -pop $y.d.2 -pop $y.d.3 -push Done -output \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/scripts/build.xml b/org.eclipse.debug.examples.core/scripts/build.xml deleted file mode 100644 index df434e655..000000000 --- a/org.eclipse.debug.examples.core/scripts/build.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - Debug Tutorial Exercises - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java deleted file mode 100644 index 639f1acf5..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java +++ /dev/null @@ -1,93 +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.examples.core.midi.launcher; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; - -/** - * Controls the location of the sequencer in microseconds. - * - * @since 1.0 - */ -public class ClockControl extends TimeControl { - - /** - * @param launch - */ - public ClockControl(MidiLaunch launch) { - super("Time" , launch); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.TimeControl#getTimeValue() - */ - protected long getTimeValue() { - return getSequencer().getMicrosecondPosition(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable() - */ - public boolean isEditable() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String) - */ - public IStatus setValue(String newValue) { - try { - long value = getLong(newValue); - getSequencer().setMicrosecondPosition(value); - fireEvent(new DebugEvent(this, DebugEvent.CHANGE)); - return Status.OK_STATUS; - } catch (CoreException e) { - return e.getStatus(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String) - */ - public IStatus validateValue(String value) { - try { - getLong(value); - return Status.OK_STATUS; - } catch (CoreException e) { - return e.getStatus(); - } - } - - /** - * Returns a float for the string. - * - * @param value string - * @return float - * @throws CoreException if not a valid value - */ - protected long getLong(String value) throws CoreException { - try { - if (value.indexOf(':') == -1) { - long secs = Long.parseLong(value); - return secs * 1000000; - } - } catch (NumberFormatException e) { - throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, "Time must be an integer (seconds) or 00:00 (minutes:seconds) format", e)); - } - return 0L; - } - - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java deleted file mode 100644 index 3a754c91a..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java +++ /dev/null @@ -1,36 +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.examples.core.midi.launcher; - - -/** - * Describes the length of the sequence in microseconds. - * - * @since 1.0 - */ -public class LengthControl extends TimeControl { - - /** - * @param launch - */ - public LengthControl(MidiLaunch launch) { - super("Duration" , launch); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.TimeControl#getTimeValue() - */ - protected long getTimeValue() { - return getSequencer().getMicrosecondLength(); - } - - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java deleted file mode 100644 index 75801ecea..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java +++ /dev/null @@ -1,165 +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.examples.core.midi.launcher; - -import javax.sound.midi.MidiFileFormat; -import javax.sound.midi.Sequencer; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.Launch; -import org.eclipse.debug.core.model.ISuspendResume; - -/** - * A launch containing a MIDI sequencer. - * - * @since 1.0 - */ -public class MidiLaunch extends Launch implements ISuspendResume { - - /** - * MIDI Sequencer - */ - private Sequencer fSequencer; - - /** - * MIDI file format - */ - private MidiFileFormat fFormat; - - /** - * Constructs a new MIDI launch. - * - * @param launchConfiguration configuration to play - * @param mode mode to play in - */ - public MidiLaunch(ILaunchConfiguration launchConfiguration, String mode) { - super(launchConfiguration, mode, null); - } - - /** - * Sets the sequencer used to play MIDI files. - * - * @param sequencer - */ - public void setSequencer(Sequencer sequencer) { - fSequencer = sequencer; - fireChanged(); - } - - /** - * Sets the format of the sequence - * @param format - */ - public void setFormat(MidiFileFormat format) { - fFormat = format; - } - - /** - * Returns the file format of the sequence. - * - * @return file format - */ - public MidiFileFormat getFormat() { - return fFormat; - } - /** - * Returns the sequencer used to play MIDI files. - * - * @return the sequencer used to play MIDI files - */ - public Sequencer getSequencer() { - return fSequencer; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.Launch#canTerminate() - */ - public boolean canTerminate() { - return getSequencer().isOpen(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.Launch#isTerminated() - */ - public boolean isTerminated() { - if (fSequencer != null) { - return !fSequencer.isOpen(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.Launch#terminate() - */ - public void terminate() throws DebugException { - getSequencer().stop(); - getSequencer().close(); - fireTerminate(); - DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent(getSequencer(), DebugEvent.TERMINATE)}); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() { - return isSuspended(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() { - if (fSequencer != null) { - return fSequencer.isRunning(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() { - if (fSequencer != null) { - return fSequencer.isOpen() & !fSequencer.isRunning(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException { - getSequencer().start(); - fireChanged(); - fireEvent(new DebugEvent(getSequencer(), DebugEvent.RESUME, DebugEvent.CLIENT_REQUEST)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException { - getSequencer().stop(); - fireChanged(); - fireEvent(new DebugEvent(getSequencer(), DebugEvent.SUSPEND, DebugEvent.CLIENT_REQUEST)); - } - - /** - * Fires a debug event. - * - * @param event debug event to fire - */ - protected void fireEvent(DebugEvent event) { - DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event}); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java deleted file mode 100644 index b5538a787..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java +++ /dev/null @@ -1,126 +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.examples.core.midi.launcher; - -import java.io.BufferedInputStream; -import java.io.IOException; - -import javax.sound.midi.InvalidMidiDataException; -import javax.sound.midi.MidiFileFormat; -import javax.sound.midi.MidiSystem; -import javax.sound.midi.MidiUnavailableException; -import javax.sound.midi.Sequencer; - -import org.eclipse.core.resources.IFile; -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.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.LaunchConfigurationDelegate; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; - -/** - * Creates and starts a MIDI sequencer. - * - * @since 1.0 - */ -public class MidiLaunchDelegate extends LaunchConfigurationDelegate { - - /** - * Identifier for the MIDI launch configuration type - * (value midi.launchType) - */ - public static final String ID_MIDI_LAUNCH_CONFIGURATION_TYPE = "midi.launchType"; - - /** - * Launch configuration attribute for the MIDI file to play - * (value midi.file) - */ - public static final String ATTR_MIDI_FILE = "midi.file"; - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) - */ - public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - String fileName = configuration.getAttribute(ATTR_MIDI_FILE, (String)null); - if (fileName == null) { - abort("MIDI file not specified.", null); - } - IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); - IFile file = root.getFile(new Path(fileName)); - if (!file.exists()) { - abort("MIDI file does not exist.", null); - } - Sequencer sequencer = null; - MidiFileFormat fileFormat = null; - try { - sequencer = MidiSystem.getSequencer(); - sequencer.open(); - IPath location = file.getLocation(); - if (location != null) { - fileFormat = MidiSystem.getMidiFileFormat(location.toFile()); - } - } catch (MidiUnavailableException e) { - abort("Cannot initialize sequencer.", e); - } catch (InvalidMidiDataException e) { - abort("Invalid MIDI file.", e); - } catch (IOException e) { - abort("Error reading MIDI file.", e); - } - BufferedInputStream stream = new BufferedInputStream(file.getContents()); - try { - sequencer.setSequence(stream); - } catch (IOException e) { - abort("Error reading MIDI file", e); - } catch (InvalidMidiDataException e) { - abort("Inavlid MIDI file.", e); - } - MidiLaunch midiLaunch = (MidiLaunch)launch; - midiLaunch.setSequencer(sequencer); - midiLaunch.setFormat(fileFormat); - sequencer.start(); - } - - /** - * Throws an exception with a new status containing the given - * message and optional exception. - * - * @param message error message - * @param e underlying exception - * @throws CoreException - */ - private void abort(String message, Throwable e) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, 0, message, e)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String) - */ - public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException { - return new MidiLaunch(configuration, mode); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - return false; - } - - - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java deleted file mode 100644 index 3274582cc..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java +++ /dev/null @@ -1,132 +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.examples.core.midi.launcher; - -import javax.sound.midi.Sequencer; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugPlugin; - -/** - * Controls some aspect of a MIDI sequencer. - * - * @since 1.0 - */ -public abstract class SequencerControl { - - /** - * The launch - */ - private MidiLaunch fLaunch; - - /** - * Control name - */ - private String fName; - - /** - * Constructs a control with the given name. - */ - public SequencerControl(String name, MidiLaunch launch) { - fName = name; - fLaunch = launch; - } - - /** - * Returns the launch this control is associated with. - * - * @return MIDI launch - */ - public MidiLaunch getLaunch() { - return fLaunch; - } - - /** - * Returns the sequencer associated with this control. - * - * @return associated sequencer - */ - public Sequencer getSequencer() { - return fLaunch.getSequencer(); - } - - /** - * Returns the name of this control. - * - * @return control name - */ - public String getName() { - return fName; - } - - /** - * Returns this controls current value. - * - * @return current value - */ - public abstract String getValue(); - - /** - * Whether this contol's value can be modified. - * - * @return Whether this contol's value can be modified - */ - public abstract boolean isEditable(); - - /** - * Returns a status indicating if the given value is - * a valid value for this control to accept. - * - * @param value new value - * @return whether the value is valid - */ - public abstract IStatus validateValue(String value); - - /** - * Sets the value of this control to the given value - * and returns a status indicating if the value was - * successfully set. - * - * @param newValue value - * @return whether successful - */ - public abstract IStatus setValue(String newValue); - - /** - * Fires a debug event. - * - * @param event debug event to fire - */ - public void fireEvent(DebugEvent event) { - DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {event}); - } - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (obj != null) { - if (getClass().equals(obj.getClass())) { - return ((SequencerControl)obj).getSequencer().equals(getSequencer()); - - } - } - return false; - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getSequencer().hashCode() + getClass().hashCode(); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java deleted file mode 100644 index feb3b32e4..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java +++ /dev/null @@ -1,89 +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.examples.core.midi.launcher; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; - -/** - * Controls the tempo of a sequencer. - * - * @since 1.0 - */ -public class TempoControl extends SequencerControl { - - /** - * Constructs a tempo control for the given launch. - */ - public TempoControl(MidiLaunch launch) { - super("Tempo (BPM)", launch); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#getValue() - */ - public String getValue() { - float bpm = getSequencer().getTempoInBPM(); - return Float.toString(bpm); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable() - */ - public boolean isEditable() { - return getSequencer().isOpen(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String) - */ - public IStatus setValue(String newValue) { - try { - float value = getFloat(newValue); - getSequencer().setTempoInBPM(value); - fireEvent(new DebugEvent(this, DebugEvent.CHANGE)); - return Status.OK_STATUS; - } catch (CoreException e) { - return e.getStatus(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String) - */ - public IStatus validateValue(String value) { - try { - getFloat(value); - return Status.OK_STATUS; - } catch (CoreException e) { - return e.getStatus(); - } - } - - /** - * Returns a float for the string. - * - * @param value string - * @return float - * @throws CoreException if not a valid value - */ - protected float getFloat(String value) throws CoreException { - try { - return Float.parseFloat(value); - } catch (NumberFormatException e) { - throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, "Tempo must be a number", e)); - } - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java deleted file mode 100644 index 93aa54df4..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.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.examples.core.midi.launcher; - -import org.eclipse.core.runtime.IStatus; - -/** - * Displays a time value based on underlying microsecond value - * - * @since 1.0 - */ -public abstract class TimeControl extends SequencerControl { - - /** - * Constructs a time control with the given name for the - * given launch. - * - * @param name - * @param launch - */ - public TimeControl(String name, MidiLaunch launch) { - super(name, launch); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#getValue() - */ - public String getValue() { - long position = getTimeValue(); - int milli = (int) (position & 0x3F); - int sec = (int) (position / 1000000); - int min = sec / 60; - sec = sec % 60; - StringBuffer clock = new StringBuffer(); - clock.append(min); - while (clock.length() < 2) { - clock.insert(0, 0); - } - clock.append(':'); - clock.append(sec); - while (clock.length() < 5) { - clock.insert(3, 0); - } - clock.append(':'); - clock.append(milli); - while (clock.length() < 8) { - clock.insert(6, 0); - } - return clock.toString(); - } - - /** - * Provided by subclasses for the control. - * - * @return time in microseconds - */ - protected abstract long getTimeValue(); - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable() - */ - public boolean isEditable() { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String) - */ - public IStatus setValue(String newValue) { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String) - */ - public IStatus validateValue(String value) { - return null; - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java deleted file mode 100644 index be74eb78a..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java +++ /dev/null @@ -1,133 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.Plugin; -import org.osgi.framework.BundleContext; - -import java.io.File; -import java.io.IOException; -import java.net.URL; -import java.util.*; - -/** - * The main plugin class to be used in the desktop. - */ -public class DebugCorePlugin extends Plugin { - //The shared instance. - private static DebugCorePlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - /** - * Unique identifier for the PDA debug model (value - * pda.debugModel). - */ - public static final String ID_PDA_DEBUG_MODEL = "pda.debugModel"; - - /** - * Name of the string substitution variable that resolves to the - * location of a local Perl executable (value perlExecutable). - */ - public static final String VARIALBE_PERL_EXECUTABLE = "perlExecutable"; - /** - * Launch configuration attribute key. Value is a path to a perl - * program. The path is a string representing a full path - * to a perl program in the workspace. - */ - public static final String ATTR_PDA_PROGRAM = ID_PDA_DEBUG_MODEL + ".ATTR_PDA_PROGRAM"; - - /** - * Identifier for the PDA launch configuration type - * (value pda.launchType) - */ - public static final String ID_PDA_LAUNCH_CONFIGURATION_TYPE = "pda.launchType"; - - /** - * Plug-in identifier. - */ - public static final String PLUGIN_ID = "org.eclipse.debug.examples.core"; - - /** - * The constructor. - */ - public DebugCorePlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - super.start(context); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - resourceBundle = null; - } - - /** - * Returns the shared instance. - */ - public static DebugCorePlugin getDefault() { - return plugin; - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = DebugCorePlugin.getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - try { - if (resourceBundle == null) - resourceBundle = ResourceBundle.getBundle("org.eclipse.debug.examples.core.pda.DebugCorePluginResources"); - } catch (MissingResourceException x) { - resourceBundle = null; - } - return resourceBundle; - } - - /** - * Return a java.io.File object that corresponds to the specified - * IPath in the plugin directory, or null if none. - */ - public static File getFileInPlugin(IPath path) { - try { - URL installURL = - new URL(getDefault().getDescriptor().getInstallURL(), path.toString()); - URL localURL = Platform.asLocalURL(installURL); - return new File(localURL.getFile()); - } catch (IOException ioe) { - return null; - } - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java deleted file mode 100644 index 45f2a06b4..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java +++ /dev/null @@ -1,206 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.breakpoints; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.LineBreakpoint; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.model.IPDAEventListener; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.debug.examples.core.pda.protocol.PDAClearBreakpointCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDARunControlEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDASetBreakpointCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDASuspendedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent; - - -/** - * PDA line breakpoint - */ -public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListener { - - // target currently installed in - private PDADebugTarget fTarget; - - /** - * Default constructor is required for the breakpoint manager - * to re-create persisted breakpoints. After instantiating a breakpoint, - * the setMarker(...) method is called to restore - * this breakpoint's attributes. - */ - public PDALineBreakpoint() { - } - - /** - * Constructs a line breakpoint on the given resource at the given - * line number. The line number is 1-based (i.e. the first line of a - * file is line number 1). The PDA VM uses 0-based line numbers, - * so this line number translation is done at breakpoint install time. - * - * @param resource file on which to set the breakpoint - * @param lineNumber 1-based line number of the breakpoint - * @throws CoreException if unable to create the breakpoint - */ - public PDALineBreakpoint(final IResource resource, final int lineNumber) throws CoreException { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); - setMarker(marker); - marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); - marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); - marker.setAttribute(IMarker.MESSAGE, "Line Breakpoint: " + resource.getName() + " [line: " + lineNumber + "]"); - } - }; - run(getMarkerRule(resource), runnable); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier() - */ - public String getModelIdentifier() { - return DebugCorePlugin.ID_PDA_DEBUG_MODEL; - } - - /** - * Returns whether this breakpoint is a run-to-line breakpoint - * - * @return whether this breakpoint is a run-to-line breakpoint - */ - public boolean isRunToLineBreakpoint() { - return false; - } - - /** - * Installs this breakpoint in the given interprettor. - * Registeres this breakpoint as an event listener in the - * given target and creates the breakpoint specific request. - * - * @param target PDA interprettor - * @throws CoreException if installation fails - */ - public void install(PDADebugTarget target) throws CoreException { - fTarget = target; - target.addEventListener(this); - createRequest(target); - } - - /** - * Create the breakpoint specific request in the target. Subclasses - * should override. - * - * @param target PDA interprettor - * @throws CoreException if request creation fails - */ - protected void createRequest(PDADebugTarget target) throws CoreException { - //#ifdef ex3 -//# // TODO: Exercise 3 - create breakpoint request in interpreter - //#else - target.sendCommand(new PDASetBreakpointCommand((getLineNumber() - 1), false)); - //#endif - } - - /** - * Removes this breakpoint's event request from the target. Subclasses - * should override. - * - * @param target PDA interprettor - * @throws CoreException if clearing the request fails - */ - protected void clearRequest(PDADebugTarget target) throws CoreException { - //#ifdef ex3 -//# // TODO: Exercise 3 - clear breakpoint request in interpreter - //#else - target.sendCommand(new PDAClearBreakpointCommand((getLineNumber() - 1))); - //#endif - } - - /** - * Removes this breakpoint from the given interprettor. - * Removes this breakpoint as an event listener and clears - * the request for the interprettor. - * - * @param target PDA interprettor - * @throws CoreException if removal fails - */ - public void remove(PDADebugTarget target) throws CoreException { - target.removeEventListener(this); - clearRequest(target); - fTarget = null; - - } - - /** - * Returns the target this breakpoint is installed in or null. - * - * @return the target this breakpoint is installed in or null - */ - protected PDADebugTarget getDebugTarget() { - return fTarget; - } - - /** - * Notify's the PDA interprettor that this breakpoint has been hit. - */ - protected void notifyThread(int threadId) { - if (fTarget != null) { - PDAThread thread = fTarget.getThread(threadId); - if (thread != null) { - thread.suspendedBy(this); - } - } - } - - /* (non-Javadoc) - * - * Subclasses should override to handle their breakpoint specific event. - * - * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String) - */ - public void handleEvent(PDAEvent event) { - if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) { - PDARunControlEvent rcEvent = (PDARunControlEvent)event; - if (rcEvent.fReason.equals("breakpoint")) { - handleHit(rcEvent); - } - } - } - - /** - * Determines if this breakpoint was hit and notifies the thread. - * - * @param event breakpoint event - */ - private void handleHit(PDARunControlEvent event) { - int lastSpace = event.fMessage.lastIndexOf(' '); - if (lastSpace > 0) { - String line = event.fMessage.substring(lastSpace + 1); - int lineNumber = Integer.parseInt(line); - // breakpoints event line numbers are 0 based, model objects are 1 based - lineNumber++; - try { - if (getLineNumber() == lineNumber) { - notifyThread(event.fThreadId); - } - } catch (CoreException e) { - } - } - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java deleted file mode 100644 index b861fff20..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java +++ /dev/null @@ -1,70 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.breakpoints; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -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.debug.core.DebugException; -import org.eclipse.debug.core.model.IBreakpoint; - -/** - * A run to line breakpoint. - */ -public class PDARunToLineBreakpoint extends PDALineBreakpoint { - - private IFile fSourceFile; - - /** - * Constructs a run-to-line breakpoint in the given PDA program. - * - * @param resource PDA source file - * @param lineNumber line to run to - * @exception DebugException if unable to create the breakpoint - */ - public PDARunToLineBreakpoint(final IFile resource, final int lineNumber) throws DebugException { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - // associate with workspace root to avoid drawing in editor ruler - IMarker marker = ResourcesPlugin.getWorkspace().getRoot().createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); - setMarker(marker); - marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); - marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); - marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); - setRegistered(false); - fSourceFile = resource; - } - }; - run(getMarkerRule(resource), runnable); - } - - /** - * Returns whether this breakpoint is a run-to-line breakpoint - * - * @return whether this breakpoint is a run-to-line breakpoint - */ - public boolean isRunToLineBreakpoint() { - return true; - } - - /** - * Returns the source file this breakpoint is contained in. - * - * @return the source file this breakpoint is contained in - */ - public IFile getSourceFile() { - return fSourceFile; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java deleted file mode 100644 index f013f8327..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java +++ /dev/null @@ -1,231 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.breakpoints; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspaceRunnable; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IWatchpoint; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -import org.eclipse.debug.examples.core.pda.protocol.PDAEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDARunControlEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDASuspendedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand; - - -/** - * A watchpoint. - */ -public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint { - - // 'read' or 'write' depending on what caused the last suspend for this watchpoint - private String fLastSuspendType; - - // marker attributes - public static final String ACCESS = "ACCESS"; - public static final String MODIFICATION = "MODIFICATION"; - public static final String FUNCTION_NAME = "FUNCTION_NAME"; - public static final String VAR_NAME = "VAR_NAME"; - - /** - * Default constructor is required for the breakpoint manager - * to re-create persisted breakpoints. After instantiating a breakpoint, - * the setMarker(...) method is called to restore - * this breakpoint's attributes. - */ - public PDAWatchpoint() { - } - /** - * Constructs a line breakpoint on the given resource at the given - * line number. The line number is 1-based (i.e. the first line of a - * file is line number 1). The PDA VM uses 0-based line numbers, - * so this line number translation is done at breakpoint install time. - * - * @param resource file on which to set the breakpoint - * @param lineNumber 1-based line number of the breakpoint - * @param functionName function name the variable is defined in - * @param varName variable name that watchpoint is set on - * @param access whether this is an access watchpoint - * @param modification whether this in a modification watchpoint - * @throws CoreException if unable to create the watchpoint - */ - public PDAWatchpoint(final IResource resource, final int lineNumber, final String functionName, final String varName, final boolean access, final boolean modification) throws CoreException { - IWorkspaceRunnable runnable = new IWorkspaceRunnable() { - public void run(IProgressMonitor monitor) throws CoreException { - IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.watchpoint"); - setMarker(marker); - setEnabled(true); - ensureMarker().setAttribute(IMarker.LINE_NUMBER, lineNumber); - ensureMarker().setAttribute(IBreakpoint.ID, getModelIdentifier()); - setAccess(access); - setModification(modification); - setVariable(functionName, varName); - marker.setAttribute(IMarker.MESSAGE, "Watchpoint: " + resource.getName() + " [line: " + lineNumber + "]"); - } - }; - run(getMarkerRule(resource), runnable); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchpoint#isAccess() - */ - public boolean isAccess() throws CoreException { - return getMarker().getAttribute(ACCESS, true); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchpoint#setAccess(boolean) - */ - public void setAccess(boolean access) throws CoreException { - setAttribute(ACCESS, access); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchpoint#isModification() - */ - public boolean isModification() throws CoreException { - return getMarker().getAttribute(MODIFICATION, true); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchpoint#setModification(boolean) - */ - public void setModification(boolean modification) throws CoreException { - setAttribute(MODIFICATION, modification); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchpoint#supportsAccess() - */ - public boolean supportsAccess() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IWatchpoint#supportsModification() - */ - public boolean supportsModification() { - return true; - } - - /** - * Sets the variable and function names the watchpoint is set on. - * - * @param functionName function name - * @param variableName variable name - * @throws CoreException if an exception occurrs setting marker attribtues - */ - protected void setVariable(String functionName, String variableName) throws CoreException { - setAttribute(VAR_NAME, variableName); - setAttribute(FUNCTION_NAME, functionName); - } - - /** - * Returns the name of the variable this watchpoint is set on. - * - * @return the name of the variable this watchpoint is set on - * @throws CoreException if unable to access the attribute - */ - public String getVariableName() throws CoreException { - return getMarker().getAttribute(VAR_NAME, (String)null); - } - - /** - * Returns the name of the function the variable associted with this watchpoint is defined in. - * - * @return the name of the function the variable associted with this watchpoint is defined in - * @throws CoreException if unable to access the attribute - */ - public String getFunctionName() throws CoreException { - return getMarker().getAttribute(FUNCTION_NAME, (String)null); - } - - /** - * Sets the type of event that causes the last suspend event. - * - * @param description one of 'read' or 'write' - */ - public void setSuspendType(String description) { - fLastSuspendType = description; - } - - /** - * Returns the type of event that caused the last suspend. - * - * @return 'read', 'write', or null if undefined - */ - public String getSuspendType() { - return fLastSuspendType; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint#createRequest(org.eclipse.debug.examples.core.pda.model.PDADebugTarget) - */ - protected void createRequest(PDADebugTarget target) throws CoreException { - int flag = 0; - if (isAccess()) { - flag = flag | 1; - } - if (isModification()) { - flag = flag | 2; - } - target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), flag)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint#clearRequest(org.eclipse.debug.examples.core.pda.model.PDADebugTarget) - */ - protected void clearRequest(PDADebugTarget target) throws CoreException { - target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), 0)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String) - */ - public void handleEvent(PDAEvent event) { - if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) { - PDARunControlEvent rcEvent = (PDARunControlEvent)event; - if (rcEvent.fReason.equals("watch")) { - handleHit(rcEvent); - } - } - } - - /** - * Determines if this breakpoint was hit and notifies the thread. - * - * @param event breakpoint event - */ - private void handleHit(PDARunControlEvent event) { - String[] strings = event.fMessage.split(" "); - if (strings.length == 4) { - String fv = strings[3]; - int j = fv.indexOf("::"); - if (j > 0) { - String fcn = fv.substring(0, j); - String var = fv.substring(j + 2); - try { - if (getVariableName().equals(var) && getFunctionName().equals(fcn)) { - setSuspendType(strings[2]); - notifyThread(event.fThreadId); - } - } catch (CoreException e) { - } - } - } - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java deleted file mode 100644 index cebc2091f..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java +++ /dev/null @@ -1,152 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.launcher; - -import java.io.File; -import java.io.IOException; -import java.net.ServerSocket; -import java.text.MessageFormat; -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.CoreException; -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.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.model.LaunchConfigurationDelegate; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; - - -/** - * Launches PDA program on a PDA interpretter written in Perl - */ -public class PDALaunchDelegate extends LaunchConfigurationDelegate { - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) - */ - public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - //#ifdef ex1 -//# // TODO: Exercise 1 - Launch a command shell as a system process to echo "foo" - //#elseif ex1_answer -//# Process process = DebugPlugin.exec(new String[]{"cmd", "/C", "\"echo foo\""}, null); -//# new RuntimeProcess(launch, process, "Hello", null); - //#else - - List commandList = new ArrayList(); - - // Get Java VM path - String javaVMHome = System.getProperty("java.home"); - String javaVMExec = javaVMHome + File.separatorChar + "bin" + File.separatorChar + "java"; - if (File.separatorChar == '\\') { - javaVMExec += ".exe"; - } - File exe = new File(javaVMExec); - if (!exe.exists()) { - abort(MessageFormat.format("Specified java VM executable {0} does not exist.", new Object[]{javaVMExec}), null); - } - commandList.add(javaVMExec); - - commandList.add("-cp"); - commandList.add(File.pathSeparator + DebugCorePlugin.getFileInPlugin(new Path("bin"))); - - commandList.add("org.eclipse.debug.examples.pdavm.PDAVirtualMachine"); - - // program name - String program = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null); - if (program == null) { - abort("Perl program unspecified.", null); - } - - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(program)); - if (!file.exists()) { - abort(MessageFormat.format("Perl program {0} does not exist.", new String[] {file.getFullPath().toString()}), null); - } - - commandList.add(file.getLocation().toOSString()); - - // if in debug mode, add debug arguments - i.e. '-debug requestPort eventPort' - int requestPort = -1; - int eventPort = -1; - if (mode.equals(ILaunchManager.DEBUG_MODE)) { - requestPort = findFreePort(); - eventPort = findFreePort(); - if (requestPort == -1 || eventPort == -1) { - abort("Unable to find free port", null); - } - commandList.add("-debug"); - commandList.add("" + requestPort); - commandList.add("" + eventPort); - } - - String[] commandLine = (String[]) commandList.toArray(new String[commandList.size()]); - Process process = DebugPlugin.exec(commandLine, null); - IProcess p = DebugPlugin.newProcess(launch, process, javaVMExec); - // if in debug mode, create a debug target - if (mode.equals(ILaunchManager.DEBUG_MODE)) { - IDebugTarget target = new PDADebugTarget(launch, p, requestPort, eventPort); - launch.addDebugTarget(target); - } - //#endif - } - - /** - * Throws an exception with a new status containing the given - * message and optional exception. - * - * @param message error message - * @param e underlying exception - * @throws CoreException - */ - private void abort(String message, Throwable e) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.getDefault().getDescriptor().getUniqueIdentifier(), 0, message, e)); - } - - /** - * Returns a free port number on localhost, or -1 if unable to find a free port. - * - * @return a free port number on localhost, or -1 if unable to find a free port - */ - public static int findFreePort() { - ServerSocket socket= null; - try { - socket= new ServerSocket(0); - return socket.getLocalPort(); - } catch (IOException e) { - } finally { - if (socket != null) { - try { - socket.close(); - } catch (IOException e) { - } - } - } - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor) - */ - public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException { - return false; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java deleted file mode 100644 index 257c4185e..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/IPDAEventListener.java +++ /dev/null @@ -1,44 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.examples.core.pda.protocol.PDAEvent; - -/** - * Listeners are notified of events occurring in a PDA program - * being interpreted. - * - * @see org.eclipse.debug.examples.core.protocol.PDAVMStarted - * @see org.eclipse.debug.examples.core.protocol.PDAVMTerminated - * @see org.eclipse.debug.examples.core.protocol.PDAVMSuspneded - * @see org.eclipse.debug.examples.core.protocol.PDAVMResumed - * @see org.eclipse.debug.examples.core.protocol.PDAStarted - * @see org.eclipse.debug.examples.core.protocol.PDAExited - * @see org.eclipse.debug.examples.core.protocol.PDASuspended - * @see org.eclipse.debug.examples.core.protocol.PDAResumed - * @see org.eclipse.debug.examples.core.pda.protocol.PDAUnimplementedInstructionEvent - * @see org.eclipse.debug.examples.core.pda.protocol.PDARegisterData - * @see org.eclipse.debug.examples.core.pda.protocol.PDANoSuchLabelEvent - * @see org.eclipse.debug.examples.core.pda.protocol.PDAEvalResultEvent - */ -public interface IPDAEventListener { - - /** - * Notification the given event occurred in the target program - * being interpreted. - * - * @param event the event - */ - public void handleEvent(PDAEvent event); - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java deleted file mode 100644 index bcc07ba35..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java +++ /dev/null @@ -1,51 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IVariable; - -public class PDAArray extends PDAValue { - - /** - * An array splits a value into its words - * - * @param value existing value - * @throws DebugException - */ - public PDAArray(PDAValue value) throws DebugException { - super(value.getVariable(), value.getValueString()); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#hasVariables() - */ - public boolean hasVariables() throws DebugException { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getVariables() - */ - public IVariable[] getVariables() throws DebugException { - String string = getValueString(); - String[] words = string.split("\\W+"); - IVariable[] variables = new IVariable[words.length]; - for (int i = 0; i < words.length; i++) { - String word = words[i]; - variables[i] = new PDAArrayEntry(getPDADebugTarget(), i, new PDAValue(getVariable(), word)); - } - return variables; - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java deleted file mode 100644 index 9ff3ca74e..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; - -public class PDAArrayEntry extends PDADebugElement implements IVariable { - - private IValue fValue; - private int fIndex; - - /** - * Constructs a new array entry - * - * @param target debug target - * @param index index in the array - * @param value value of the entry - */ - public PDAArrayEntry(IDebugTarget target, int index, IValue value) { - super(target); - fValue = value; - fIndex = index; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getValue() - */ - public IValue getValue() throws DebugException { - return fValue; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getName() - */ - public String getName() throws DebugException { - return "[" + fIndex + "]"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException { - return "String"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#hasValueChanged() - */ - public boolean hasValueChanged() throws DebugException { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String) - */ - public void setValue(String expression) throws DebugException { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue) - */ - public void setValue(IValue value) throws DebugException { - } - - /* (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) throws DebugException { - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue) - */ - public boolean verifyValue(IValue value) throws DebugException { - return false; - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java deleted file mode 100644 index fb854ba15..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java +++ /dev/null @@ -1,109 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.model.DebugElement; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.protocol.PDACommand; -import org.eclipse.debug.examples.core.pda.protocol.PDACommandResult; - - -/** - * Common function for PDA debug elements. - */ -public class PDADebugElement extends DebugElement { - - /** - * Constructs a new debug element in the given target. - * - * @param target debug target - */ - public PDADebugElement(IDebugTarget target) { - super(target); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() - */ - public String getModelIdentifier() { - return DebugCorePlugin.ID_PDA_DEBUG_MODEL; - } - - /** - * Sends a request to the PDA interpreter, waits for and returns the reply. - * - * @param request command - * @return reply - * @throws DebugException if the request fails - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDATerminateCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAVMResumeCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDASuspendCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAResumeCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAStepCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDADropFrameCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDASetBreakpointCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAClearBreakpointCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAWatchCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDADataCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDASetDataCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAPopDataCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAPushDataCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDAEvalCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDAEventStopCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAStackDepthCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAFrameCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDASetVarCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAVarCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDAChildrenCommand - * - * @see org.eclipse.debug.examples.core.pda.protocol.PDAGroupsCommand - * @see org.eclipse.debug.examples.core.pda.protocol.PDARegistersCommand - * - * @since 3.5 - */ - public PDACommandResult sendCommand(PDACommand command) throws DebugException { - return getPDADebugTarget().sendCommand(command); - } - - /** - * Returns the debug target as a PDA target. - * - * @return PDA debug target - */ - protected PDADebugTarget getPDADebugTarget() { - return (PDADebugTarget) getDebugTarget(); - } - - /** - * Returns the breakpoint manager - * - * @return the breakpoint manager - */ - protected IBreakpointManager getBreakpointManager() { - return DebugPlugin.getDefault().getBreakpointManager(); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java deleted file mode 100644 index 92a5a9955..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java +++ /dev/null @@ -1,582 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.Socket; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IMarkerDelta; -import org.eclipse.core.resources.IResource; -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.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.IBreakpointManager; -import org.eclipse.debug.core.IBreakpointManagerListener; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.core.model.IMemoryBlock; -import org.eclipse.debug.core.model.IProcess; -import org.eclipse.debug.core.model.IThread; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint; -import org.eclipse.debug.examples.core.pda.breakpoints.PDARunToLineBreakpoint; -import org.eclipse.debug.examples.core.pda.protocol.PDACommand; -import org.eclipse.debug.examples.core.pda.protocol.PDACommandResult; -import org.eclipse.debug.examples.core.pda.protocol.PDAEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAEventStopCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAExitedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDARestartCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAStartedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDATerminateCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMResumeCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMResumedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMStartedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMTerminatedEvent; - - -/** - * PDA Debug Target - */ -public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBreakpointManagerListener, IPDAEventListener { - - // associated system process (VM) - private IProcess fProcess; - - // containing launch object - private ILaunch fLaunch; - - // sockets to communicate with VM - private Socket fRequestSocket; - private PrintWriter fRequestWriter; - private BufferedReader fRequestReader; - private Socket fEventSocket; - private BufferedReader fEventReader; - - // suspended state - private boolean fVMSuspended = false; - - // terminated state - private boolean fTerminated = false; - - // threads - private Map fThreads = Collections.synchronizedMap(new LinkedHashMap()); - - // event dispatch job - private EventDispatchJob fEventDispatch; - - // event listeners - private List fEventListeners = Collections.synchronizedList(new ArrayList()); - - /** - * Listens to events from the PDA VM and fires corresponding - * debug events. - */ - class EventDispatchJob extends Job { - - public EventDispatchJob() { - super("PDA Event Dispatch"); - setSystem(true); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor) - */ - protected IStatus run(IProgressMonitor monitor) { - String message = ""; - while (!isTerminated() && message != null) { - try { - message = fEventReader.readLine(); - if (message != null) { - PDAEvent event = null; - try { - event = PDAEvent.parseEvent(message); - } - catch (IllegalArgumentException e) { - DebugCorePlugin.getDefault().getLog().log( - new Status (IStatus.ERROR, "org.eclipse.debug.examples.core", "Error parsing PDA event", e)); - continue; - } - Object[] listeners = fEventListeners.toArray(); - for (int i = 0; i < listeners.length; i++) { - ((IPDAEventListener)listeners[i]).handleEvent(event); - } - } - } catch (IOException e) { - vmTerminated(); - } - } - return Status.OK_STATUS; - } - - } - - /** - * Registers the given event listener. The listener will be notified of - * events in the program being interpretted. Has no effect if the listener - * is already registered. - * - * @param listener event listener - */ - public void addEventListener(IPDAEventListener listener) { - synchronized(fEventListeners) { - if (!fEventListeners.contains(listener)) { - fEventListeners.add(listener); - } - } - } - - /** - * Deregisters the given event listener. Has no effect if the listener is - * not currently registered. - * - * @param listener event listener - */ - public void removeEventListener(IPDAEventListener listener) { - fEventListeners.remove(listener); - } - - /** - * Constructs a new debug target in the given launch for the - * associated PDA VM process. - * - * @param launch containing launch - * @param process PDA VM - * @param requestPort port to send requests to the VM - * @param eventPort port to read events from - * @exception CoreException if unable to connect to host - */ - public PDADebugTarget(ILaunch launch, IProcess process, int requestPort, int eventPort) throws CoreException { - super(null); - fLaunch = launch; - fProcess = process; - addEventListener(this); - try { - // give interpreter a chance to start - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - } - fRequestSocket = new Socket("localhost", requestPort); - fRequestWriter = new PrintWriter(fRequestSocket.getOutputStream()); - fRequestReader = new BufferedReader(new InputStreamReader(fRequestSocket.getInputStream())); - // give interpreter a chance to open next socket - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - } - fEventSocket = new Socket("localhost", eventPort); - fEventReader = new BufferedReader(new InputStreamReader(fEventSocket.getInputStream())); - } catch (UnknownHostException e) { - requestFailed("Unable to connect to PDA VM", e); - } catch (IOException e) { - requestFailed("Unable to connect to PDA VM", e); - } - fEventDispatch = new EventDispatchJob(); - fEventDispatch.schedule(); - IBreakpointManager breakpointManager = getBreakpointManager(); - breakpointManager.addBreakpointListener(this); - breakpointManager.addBreakpointManagerListener(this); - // initialize error hanlding to suspend on 'unimplemented instructions' - // and 'no such label' errors - sendCommand(new PDAEventStopCommand(PDAEventStopCommand.UNIMPINSTR, true)); - sendCommand(new PDAEventStopCommand(PDAEventStopCommand.NOSUCHLABEL, true)); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#getProcess() - */ - public IProcess getProcess() { - return fProcess; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#getThreads() - */ - public IThread[] getThreads() throws DebugException { - synchronized (fThreads) { - return (IThread[])fThreads.values().toArray(new IThread[fThreads.size()]); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#hasThreads() - */ - public boolean hasThreads() throws DebugException { - return fThreads.size() > 0; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#getName() - */ - public String getName() throws DebugException { - return "PDA"; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint) - */ - public boolean supportsBreakpoint(IBreakpoint breakpoint) { - if (!isTerminated() && breakpoint.getModelIdentifier().equals(getModelIdentifier())) { - try { - String program = getLaunch().getLaunchConfiguration().getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null); - if (program != null) { - IResource resource = null; - if (breakpoint instanceof PDARunToLineBreakpoint) { - PDARunToLineBreakpoint rtl = (PDARunToLineBreakpoint) breakpoint; - resource = rtl.getSourceFile(); - } else { - IMarker marker = breakpoint.getMarker(); - if (marker != null) { - resource = marker.getResource(); - } - } - if (resource != null) { - IPath p = new Path(program); - return resource.getFullPath().equals(p); - } - } - } catch (CoreException e) { - } - } - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() - */ - public IDebugTarget getDebugTarget() { - return this; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() - */ - public ILaunch getLaunch() { - return fLaunch; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() { - return getProcess().canTerminate(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public synchronized boolean isTerminated() { - return fTerminated || getProcess().isTerminated(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException { -//#ifdef ex2 -//# // TODO: Exercise 2 - send termination request to interpreter -//#else - sendCommand(new PDATerminateCommand()); -//#endif - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() { - return !isTerminated() && isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() { - return !isTerminated() && !isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public synchronized boolean isSuspended() { - return !isTerminated() && fVMSuspended; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException { - sendCommand(new PDAVMResumeCommand()); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException { - sendCommand(new PDAVMSuspendCommand()); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse.debug.core.model.IBreakpoint) - */ - public void breakpointAdded(IBreakpoint breakpoint) { - if (supportsBreakpoint(breakpoint)) { - try { - if ((breakpoint.isEnabled() && getBreakpointManager().isEnabled()) || !breakpoint.isRegistered()) { - PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint; - pdaBreakpoint.install(this); - } - } catch (CoreException e) { - } - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta) - */ - public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) { - if (supportsBreakpoint(breakpoint)) { - try { - PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint)breakpoint; - pdaBreakpoint.remove(this); - } catch (CoreException e) { - } - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta) - */ - public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) { - if (supportsBreakpoint(breakpoint)) { - try { - if (breakpoint.isEnabled() && getBreakpointManager().isEnabled()) { - breakpointAdded(breakpoint); - } else { - breakpointRemoved(breakpoint, null); - } - } catch (CoreException e) { - } - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDisconnect#canDisconnect() - */ - public boolean canDisconnect() { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDisconnect#disconnect() - */ - public void disconnect() throws DebugException { - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IDisconnect#isDisconnected() - */ - public boolean isDisconnected() { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval() - */ - public boolean supportsStorageRetrieval() { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long) - */ - public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException { - return null; - } - - /** - * Notification we have connected to the VM and it has started. - * Resume the VM. - */ - private void vmStarted(PDAVMStartedEvent event) { - fireCreationEvent(); - installDeferredBreakpoints(); - try { - resume(); - } catch (DebugException e) { - } - } - - /** - * Install breakpoints that are already registered with the breakpoint - * manager. - */ - private void installDeferredBreakpoints() { - IBreakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getModelIdentifier()); - for (int i = 0; i < breakpoints.length; i++) { - breakpointAdded(breakpoints[i]); - } - } - - /** - * Called when this debug target terminates. - */ - private void vmTerminated() { - setTerminated(true); - fThreads.clear(); - IBreakpointManager breakpointManager = getBreakpointManager(); - breakpointManager.removeBreakpointListener(this); - breakpointManager.removeBreakpointManagerListener(this); - fireTerminateEvent(); - removeEventListener(this); - } - - private void vmResumed(PDAVMResumedEvent event) { - setVMSuspended(false); - fireResumeEvent(calcDetail(event.fReason)); - } - - private void vmSuspended(PDAVMSuspendedEvent event) { - setVMSuspended(true); - fireSuspendEvent(calcDetail(event.fReason)); - } - - private int calcDetail(String reason) { - if (reason.equals("breakpoint") || reason.equals("watch")) { - return DebugEvent.BREAKPOINT; - } else if (reason.equals("step")) { - return DebugEvent.STEP_OVER; - } else if (reason.equals("drop")) { - return DebugEvent.STEP_RETURN; - } else if (reason.equals("client")) { - return DebugEvent.CLIENT_REQUEST; - } else if (reason.equals("event")) { - return DebugEvent.BREAKPOINT; - } else { - return DebugEvent.UNSPECIFIED; - } - } - - private void started(PDAStartedEvent event) { - PDAThread newThread = new PDAThread(this, event.fThreadId); - fThreads.put(new Integer(event.fThreadId), newThread); - newThread.start(); - } - - private void exited(PDAExitedEvent event) { - PDAThread thread = (PDAThread)fThreads.remove(new Integer(event.fThreadId)); - if (thread != null) { - thread.exit(); - } - } - - private synchronized void setVMSuspended(boolean suspended) { - fVMSuspended = suspended; - } - - private synchronized void setTerminated(boolean terminated) { - fTerminated = terminated; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.pda.model.PDADebugElement#sendRequest(java.lang.String) - */ - private String sendRequest(String request) throws DebugException { - synchronized (fRequestSocket) { - fRequestWriter.println(request); - fRequestWriter.flush(); - try { - // wait for reply - String retVal = fRequestReader.readLine(); - if (retVal == null) { - requestFailed("Request failed: " + request + ". Debugger connection closed.", null); - } - return retVal; - } catch (IOException e) { - requestFailed("Request failed: " + request, e); - } - } - // Should never reach this satement. - return null; - } - - public PDACommandResult sendCommand(PDACommand command) throws DebugException { - String response = sendRequest(command.getRequest()); - return command.createResult(response); - } - - /** - * When the breakpoint manager disables, remove all registered breakpoints - * requests from the VM. When it enables, reinstall them. - */ - public void breakpointManagerEnablementChanged(boolean enabled) { - IBreakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getModelIdentifier()); - for (int i = 0; i < breakpoints.length; i++) { - if (enabled) { - breakpointAdded(breakpoints[i]); - } else { - breakpointRemoved(breakpoints[i], null); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String) - */ - public void handleEvent(PDAEvent event) { - if (event instanceof PDAStartedEvent) { - started((PDAStartedEvent)event); - } else if (event instanceof PDAExitedEvent) { - exited((PDAExitedEvent)event); - } else if (event instanceof PDAVMStartedEvent) { - vmStarted((PDAVMStartedEvent)event); - } else if (event instanceof PDAVMTerminatedEvent) { - vmTerminated(); - } else if (event instanceof PDAVMSuspendedEvent) { - vmSuspended((PDAVMSuspendedEvent)event); - } else if (event instanceof PDAVMResumedEvent) { - vmResumed((PDAVMResumedEvent)event); - } - } - - /** - * Returns this debug target's single thread, or null - * if terminated. - * - * @param threadId ID of the thread to return, or 0 - * to return the first available thread - * @return this debug target's single thread, or null - * if terminated - */ - public PDAThread getThread(int threadId) { - if (threadId > 0) { - return (PDAThread)fThreads.get(new Integer(threadId)); - } else { - synchronized(fThreads) { - if (fThreads.size() > 0) { - return (PDAThread)fThreads.values().iterator().next(); - } - } - } - return null; - } - - /** - * Restarts the current debug session - * - * @throws DebugException - */ - public void restart() throws DebugException { - sendCommand(new PDARestartCommand()); - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java deleted file mode 100644 index b235690f3..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java +++ /dev/null @@ -1,260 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.debug.core.DebugException; -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.examples.core.pda.protocol.PDAFrameData; - -/** - * PDA stack frame. - */ -public class PDAStackFrame extends PDADebugElement implements IStackFrame { - - private PDAThread fThread; - private String fName; - private int fPC; - private IPath fFilePath; - private int fId; - - /** - * Constructs a stack frame in the given thread with the given - * frame data. - * - * @param thread - * @param data frame data - * @param id stack frame id (0 is the bottom of the stack) - */ - public PDAStackFrame(PDAThread thread, PDAFrameData data, int id) { - super(thread.getPDADebugTarget()); - fId = id; - fThread = thread; - init(data); - } - - /** - * Initializes this frame based on its data - * - * @param data - */ - private void init(PDAFrameData data) { - fFilePath = data.fFilePath; - fPC = data.fPC + 1; - fName = data.fFunction; - IVariable[] vars = new IVariable[data.fVariables.length]; - for (int i = 0; i < data.fVariables.length; i++) { - vars[i] = new PDAVariable(this, data.fVariables[i]); - } - fThread.setVariables(this, vars); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getThread() - */ - public IThread getThread() { - return fThread; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getVariables() - */ - public IVariable[] getVariables() throws DebugException { - return fThread.getVariables(this); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#hasVariables() - */ - public boolean hasVariables() throws DebugException { - return getVariables().length > 0; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getLineNumber() - */ - public int getLineNumber() throws DebugException { - return fPC; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getCharStart() - */ - public int getCharStart() throws DebugException { - return -1; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getCharEnd() - */ - public int getCharEnd() throws DebugException { - return -1; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getName() - */ - public String getName() throws DebugException { - return fName; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups() - */ - public IRegisterGroup[] getRegisterGroups() throws DebugException { - return null; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups() - */ - public boolean hasRegisterGroups() throws DebugException { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepInto() - */ - public boolean canStepInto() { - return getThread().canStepInto(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepOver() - */ - public boolean canStepOver() { - return getThread().canStepOver(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepReturn() - */ - public boolean canStepReturn() { - return getThread().canStepReturn(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#isStepping() - */ - public boolean isStepping() { - return getThread().isStepping(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepInto() - */ - public void stepInto() throws DebugException { - getThread().stepInto(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepOver() - */ - public void stepOver() throws DebugException { - getThread().stepOver(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepReturn() - */ - public void stepReturn() throws DebugException { - getThread().stepReturn(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() { - return getThread().canResume(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() { - return getThread().canSuspend(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() { - return getThread().isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException { - getThread().resume(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException { - getThread().suspend(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() { - return getThread().canTerminate(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() { - return getThread().isTerminated(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException { - getThread().terminate(); - } - - /** - * Returns the name of the source file this stack frame is associated - * with. - * - * @return the name of the source file this stack frame is associated - * with - */ - public String getSourceName() { - return fFilePath.lastSegment(); - } - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - if (obj instanceof PDAStackFrame) { - PDAStackFrame sf = (PDAStackFrame)obj; - return sf.getThread().equals(getThread()) && - sf.getSourceName().equals(getSourceName()) && - sf.fId == fId; - } - return false; - } - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return getSourceName().hashCode() + fId; - } - - /** - * Returns this stack frame's unique identifier within its thread - * - * @return this stack frame's unique identifier within its thread - */ - protected int getIdentifier() { - return fId; - } - - /** - * Returns the stack frame's thread's unique identifier - * - * @return this stack frame's thread's unique identifier - * - * @since 3.5 - */ - protected int getThreadIdentifier() { - return fThread.getIdentifier(); - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java deleted file mode 100644 index a7909d485..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java +++ /dev/null @@ -1,92 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; - -/** - * A value on the data stack - */ -public class PDAStackValue extends PDADebugElement implements IValue { - - final private PDAThread fThread; - final private String fValue; - final private int fIndex; - - /** - * Constructs a value that appears on the data stack - * - * @param target debug target - * @param value value on the stack - * @param index index on the stack - */ - public PDAStackValue(PDAThread thread, String value, int index) { - super(thread.getDebugTarget()); - fThread = thread; - fValue = value; - fIndex = index; - } - - public PDAThread getThread() { - return fThread; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getValueString() - */ - public String getValueString() throws DebugException { - return fValue; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#isAllocated() - */ - public boolean isAllocated() throws DebugException { - return true; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getVariables() - */ - public IVariable[] getVariables() throws DebugException { - return new IVariable[0]; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#hasVariables() - */ - public boolean hasVariables() throws DebugException { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException { - return null; - } - /* - * (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return obj instanceof PDAStackValue && - ((PDAStackValue)obj).fValue.equals(fValue) && - ((PDAStackValue)obj).fIndex == fIndex; - } - /* - * (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return super.hashCode() + fIndex; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java deleted file mode 100644 index 8d92f129c..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -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.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.debug.examples.core.pda.protocol.PDADataCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDADropFrameCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAListResult; -import org.eclipse.debug.examples.core.pda.protocol.PDANoSuchLabelEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAPopDataCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAPushDataCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAResumeCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAResumedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDARunControlEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAStackCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAStackCommandResult; -import org.eclipse.debug.examples.core.pda.protocol.PDAStepCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDASuspendCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDASuspendedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAUnimplementedInstructionEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMResumedEvent; -import org.eclipse.debug.examples.core.pda.protocol.PDAVMSuspendedEvent; - -/** - * A PDA thread. A PDA VM is single threaded. - */ -public class PDAThread extends PDADebugElement implements IThread, IPDAEventListener { - - /** - * ID of this thread as reported by PDA. - */ - private final int fThreadId; - - /** - * Breakpoint this thread is suspended at or null - * if none. - */ - private IBreakpoint fBreakpoint; - - /** - * Whether this thread is stepping - */ - private boolean fStepping = false; - - /** - * Whether this thread is suspended - */ - private boolean fSuspended = false; - - /** - * Most recent error event or null - */ - private String fErrorEvent; - - /** - * Table mapping stack frames to current variables - */ - private Map fVariables = Collections.synchronizedMap(new HashMap()); - - /** - * Constructs a new thread for the given target - * - * @param target VM - */ - public PDAThread(PDADebugTarget target, int threadId) { - super(target); - fThreadId = threadId; - } - - /** - * Called by the debug target after the thread is created. - * - * @since 3.5 - */ - void start() { - fireCreationEvent(); - getPDADebugTarget().addEventListener(this); - } - - /** - * Called by the debug target before the thread is removed. - * - * @since 3.5 - */ - void exit() { - getPDADebugTarget().removeEventListener(this); - fireTerminateEvent(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getStackFrames() - */ - public IStackFrame[] getStackFrames() throws DebugException { - if (isSuspended()) { - PDAStackCommandResult result = (PDAStackCommandResult)sendCommand(new PDAStackCommand(fThreadId)); - IStackFrame[] frames = new IStackFrame[result.fFrames.length]; - for (int i = 0; i < result.fFrames.length; i++) { - frames[frames.length - i - 1] = new PDAStackFrame(this, result.fFrames[i], i); - } - return frames; - } - return new IStackFrame[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#hasStackFrames() - */ - public boolean hasStackFrames() throws DebugException { - return isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getPriority() - */ - public int getPriority() throws DebugException { - return 0; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getTopStackFrame() - */ - public IStackFrame getTopStackFrame() throws DebugException { - IStackFrame[] frames = getStackFrames(); - if (frames.length > 0) { - return frames[0]; - } - return null; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getName() - */ - public String getName() { - return "Main thread"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IThread#getBreakpoints() - */ - public synchronized IBreakpoint[] getBreakpoints() { - if (fBreakpoint == null) { - return new IBreakpoint[0]; - } - return new IBreakpoint[]{fBreakpoint}; - } - - /** - * Notifies this thread it has been suspended by the given breakpoint. - * - * @param breakpoint breakpoint - */ - public synchronized void suspendedBy(IBreakpoint breakpoint) { - fBreakpoint = breakpoint; - suspended(DebugEvent.BREAKPOINT); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canResume() - */ - public boolean canResume() { - return isSuspended() && !getDebugTarget().isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#canSuspend() - */ - public boolean canSuspend() { - return !isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#isSuspended() - */ - public boolean isSuspended() { - if (getDebugTarget().isTerminated()) { - return false; - } - if (getDebugTarget().isSuspended()) { - return true; - } - synchronized (this) { - return fSuspended; - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#resume() - */ - public void resume() throws DebugException { - //#ifdef ex2 -//# // TODO: Exercise 2 - send resume request to interpreter - //#else - sendCommand(new PDAResumeCommand(fThreadId)); - //#endif - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ISuspendResume#suspend() - */ - public void suspend() throws DebugException { - //#ifdef ex2 -//# // TODO: Exercise 2 - send suspend request to interpreter - //#else - sendCommand(new PDASuspendCommand(fThreadId)); - //#endif - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepInto() - */ - public boolean canStepInto() { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepOver() - */ - public boolean canStepOver() { - return isSuspended(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#canStepReturn() - */ - public boolean canStepReturn() { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#isStepping() - */ - public boolean isStepping() { - return fStepping; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepInto() - */ - public void stepInto() throws DebugException { - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepOver() - */ - public void stepOver() throws DebugException { - sendCommand(new PDAStepCommand(fThreadId)); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IStep#stepReturn() - */ - public void stepReturn() throws DebugException { - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#canTerminate() - */ - public boolean canTerminate() { - return !isTerminated(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#isTerminated() - */ - public boolean isTerminated() { - return getDebugTarget().isTerminated(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ITerminate#terminate() - */ - public void terminate() throws DebugException { - getDebugTarget().terminate(); - } - - /** - * Sets whether this thread is stepping - * - * @param stepping whether stepping - */ - private synchronized void setStepping(boolean stepping) { - fStepping = stepping; - } - - /** - * Sets whether this thread is suspended - * - * @param suspended whether suspended - */ - private synchronized void setSuspended(boolean suspended) { - fSuspended = suspended; - } - - /** - * Sets the most recent error event encountered, or null - * to clear the most recent error - * - * @param event one of 'unimpinstr' or 'nosuchlabel' or null - */ - private synchronized void setError(String event) { - fErrorEvent = event; - } - - /** - * Returns the most recent error event encountered since the last - * suspend, or null if none. - * - * @return the most recent error event encountered since the last - * suspend, or null if none - */ - public Object getError() { - return fErrorEvent; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String) - */ - public void handleEvent(PDAEvent _event) { - if (_event instanceof PDARunControlEvent && fThreadId == ((PDARunControlEvent)_event).fThreadId) { - PDARunControlEvent event = (PDARunControlEvent)_event; - // clear previous state - fBreakpoint = null; - setStepping(false); - - // handle events - if (event instanceof PDAResumedEvent || event instanceof PDAVMResumedEvent) { - setSuspended(false); - if ("step".equals(event.fReason)) { - setStepping(true); - resumed(DebugEvent.STEP_OVER); - //#ifdef ex2 - //# } - //# // TODO: Exercise 2 - handle/fire "client" resume event - //#else - } else if ("client".equals(event.fReason)) { - resumed(DebugEvent.CLIENT_REQUEST); - } - //#endif - //#ifdef ex5 - //# // TODO: Exercise 5 - handle start of drop event - //#else - else if ("drop".equals(event.fReason)) { - resumed(DebugEvent.STEP_RETURN); - } - //#endif - } else if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) { - setSuspended(true); - //#ifdef ex2 - //# // TODO: Exercise 2 - handle/fire "client" suspend event - //# if (event.endsWith("step")) { - //# suspended(DebugEvent.STEP_END); - //# } else if (event.startsWith("suspended event") && getError() != null) { - //# exceptionHit(); - //# } - //#else - if ("client".equals(event.fReason)) { - suspended(DebugEvent.CLIENT_REQUEST); - } else if ("step".equals(event.fReason)) { - suspended(DebugEvent.STEP_END); - } else if ("event".equals(event.fReason) && getError() != null) { - exceptionHit(); - } - //#endif - //#ifdef ex5 - //# // TODO: Exercise 5 - handle end of drop event - //#else - else if ("drop".equals(event.fReason)) { - suspended(DebugEvent.STEP_END); - } - //#endif - } else if (_event instanceof PDANoSuchLabelEvent || - _event instanceof PDAUnimplementedInstructionEvent) - { - setError(event.fMessage); - } - } - } - - /** - * Notification the target has resumed for the given reason. - * Clears any error condition that was last encountered and - * fires a resume event, and clears all cached variables - * for stack frames. - * - * @param detail reason for the resume - */ - private void resumed(int detail) { - setError(null); - fVariables.clear(); - fireResumeEvent(detail); - } - - /** - * Notification the target has suspended for the given reason - * - * @param detail reason for the suspend - */ - private void suspended(int detail) { - fireSuspendEvent(detail); - } - - /** - * Notification an error was encountered. Fires a breakpoint - * suspend event. - */ - private void exceptionHit() { - suspended(DebugEvent.BREAKPOINT); - } - - /** - * Sets the current variables for the given stack frame. Called - * by PDA stack frame when it is created. - * - * @param frame - * @param variables - */ - protected void setVariables(IStackFrame frame, IVariable[] variables) { - synchronized (fVariables) { - fVariables.put(frame, variables); - } - } - - /** - * Returns the current variables for the given stack frame, or - * null if none. - * - * @param frame stack frame - * @return variables or null - */ - protected IVariable[] getVariables(IStackFrame frame) { - synchronized (fVariables) { - IVariable[] variables = (IVariable[]) fVariables.get(frame); - if (variables == null) { - return new IVariable[0]; - } - return variables; - } - } - - /** - * Pops the top frame off the callstack. - * - * @throws DebugException - * - * @since 3.5 - */ - public void popFrame() throws DebugException { - //#ifdef ex5 -//# // TODO: Exercise 5 - send drop request - //#else - sendCommand(new PDADropFrameCommand(fThreadId)); - //#endif - } - - /** - * Returns whether this thread can pop the top stack frame. - * - * @return whether this thread can pop the top stack frame - * - * @since 3.5 - */ - public boolean canPopFrame() { - //#ifdef ex5 -//# // TODO: Exercise 5 - allow pop if there is more than 1 frame on the stack - //#else - try { - return getStackFrames().length > 1; - } catch (DebugException e) { - } - //#endif - return false; - } - - /** - * Returns the values on the data stack (top down) - * - * @return the values on the data stack (top down) - * - * @since 3.5 - */ - public IValue[] getDataStack() throws DebugException { - PDAListResult result = (PDAListResult)sendCommand(new PDADataCommand(fThreadId)); - if (result.fValues.length > 0) { - IValue[] values = new IValue[result.fValues.length]; - for (int i = 0; i < result.fValues.length; i++) { - values[values.length - i - 1] = new PDAStackValue(this, result.fValues[i], i); - } - return values; - } - return new IValue[0]; - } - - /** - * Returns whether popping the data stack is currently permitted - * - * @return whether popping the data stack is currently permitted - * - * @since 3.5 - */ - public boolean canPopData() { - try { - return !isTerminated() && isSuspended() && getDataStack().length > 0; - } catch (DebugException e) { - } - return false; - } - - /** - * Pops and returns the top of the data stack - * - * @return the top value on the stack - * @throws DebugException if the stack is empty or the request fails - * - * @since 3.5 - */ - public IValue popData() throws DebugException { - IValue[] dataStack = getDataStack(); - if (dataStack.length > 0) { - sendCommand(new PDAPopDataCommand(fThreadId)); - return dataStack[0]; - } - requestFailed("Empty stack", null); - return null; - } - - /** - * Returns whether pushing a value is currently supported. - * - * @return whether pushing a value is currently supported - * - * @since 3.5 - */ - public boolean canPushData() { - return !isTerminated() && isSuspended(); - } - - /** - * Pushes a value onto the stack. - * - * @param value value to push - * @throws DebugException on failure - * - * @since 3.5 - */ - public void pushData(String value) throws DebugException { - sendCommand(new PDAPushDataCommand(fThreadId, value)); - } - - /** - * Returns this thread's unique identifier - * - * @return this thread's unique identifier - * - * @since 3.5 - */ - public int getIdentifier() { - return fThreadId; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java deleted file mode 100644 index a4c6cc7e2..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java +++ /dev/null @@ -1,109 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.debug.examples.core.pda.protocol.PDAChildrenCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAListResult; - -/** - * Value of a PDA variable. - */ -public class PDAValue extends PDADebugElement implements IValue { - - final private PDAVariable fVariable; - final private String fValue; - - public PDAValue(PDAVariable variable, String value) { - super(variable.getStackFrame().getPDADebugTarget()); - fVariable = variable; - fValue = value; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException { - try { - Integer.parseInt(fValue); - } catch (NumberFormatException e) { - return "text"; - } - return "integer"; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getValueString() - */ - public String getValueString() throws DebugException { - return fValue; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#isAllocated() - */ - public boolean isAllocated() throws DebugException { - return true; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#getVariables() - */ - public IVariable[] getVariables() throws DebugException { - PDAStackFrame frame = fVariable.getStackFrame(); - PDAListResult result = (PDAListResult) sendCommand( - new PDAChildrenCommand(frame.getThreadIdentifier(), frame.getIdentifier(), fVariable.getName()) ); - - IVariable[] children = new IVariable[result.fValues.length]; - for(int i = 0; i < result.fValues.length; i++) { - children[i] = new PDAVariable(frame, result.fValues[i]); - } - return children; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValue#hasVariables() - */ - public boolean hasVariables() throws DebugException { - if (getVariables().length != 0) { - return true; - } - // Value with multiple words can be show as an array using logical - // structures. If the value has multiple words, it needs to indicate - // that it has children even if logical structures are not turned on. - return fValue.split("\\W+").length > 1; - } - /* - * (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return obj instanceof PDAValue && ((PDAValue)obj).fValue.equals(fValue); - } - /* - * (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return fValue.hashCode(); - } - - /** - * Returns the variable that this value was created for. - * - * @return The variable that this value was created for. - * - * @since 3.5 - */ - public PDAVariable getVariable() { - return fVariable; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java deleted file mode 100644 index 2329b584d..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.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 - * Bjorn Freeman-Benson - initial API and implementation - * Wind River Systems - added support for IToggleBreakpointsTargetFactory - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.debug.examples.core.pda.protocol.PDACommandResult; -import org.eclipse.debug.examples.core.pda.protocol.PDASetVarCommand; -import org.eclipse.debug.examples.core.pda.protocol.PDAVarCommand; - -/** - * A variable in a PDA stack frame - */ -public class PDAVariable extends PDADebugElement implements IVariable { - - // name & stack frmae - private String fName; - private PDAStackFrame fFrame; - - /** - * Constructs a variable contained in the given stack frame - * with the given name. - * - * @param frame owning stack frame - * @param name variable name - */ - public PDAVariable(PDAStackFrame frame, String name) { - super(frame.getPDADebugTarget()); - fFrame = frame; - fName = name; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getValue() - */ - public IValue getValue() throws DebugException { - PDACommandResult result = sendCommand(new PDAVarCommand( - fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName())); - return new PDAValue(this, result.fResponseText); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getName() - */ - public String getName() throws DebugException { - return fName; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName() - */ - public String getReferenceTypeName() throws DebugException { - return "Thing"; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IVariable#hasValueChanged() - */ - public boolean hasValueChanged() throws DebugException { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String) - */ - public void setValue(String expression) throws DebugException { - sendCommand(new PDASetVarCommand( - fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName(), expression)); - fireChangeEvent(DebugEvent.CONTENT); - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue) - */ - public void setValue(IValue value) throws DebugException { - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#supportsValueModification() - */ - public boolean supportsValueModification() { - return true; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String) - */ - public boolean verifyValue(String expression) throws DebugException { - return true; - } - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue) - */ - public boolean verifyValue(IValue value) throws DebugException { - return false; - } - - /** - * Returns the stack frame owning this variable. - * - * @return the stack frame owning this variable - */ - public PDAStackFrame getStackFrame() { - return fFrame; - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java deleted file mode 100644 index dbb06cb22..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java +++ /dev/null @@ -1,53 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.model; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate; -import org.eclipse.debug.core.model.IValue; - -/** - * Logical stucture to translate a string into its words. - */ -public class WordStructureDelegate implements ILogicalStructureTypeDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#providesLogicalStructure(org.eclipse.debug.core.model.IValue) - */ - public boolean providesLogicalStructure(IValue value) { - //#ifdef ex6 -//# // TODO: Exercise 6 - provide logical structures if the value has multiple words - //#else - try { - String string = value.getValueString(); - String[] words = string.split("\\W+"); - return words.length > 1; - } catch (DebugException e) { - } - //#endif - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#getLogicalStructure(org.eclipse.debug.core.model.IValue) - */ - public IValue getLogicalStructure(IValue value) throws CoreException { - //#ifdef ex6 -//# // TODO: Exercise 6 - create an array from the given value -//# return null; - //#else - return new PDAArray((PDAValue)value); - //#endif - } - -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java deleted file mode 100644 index a1cf5e3de..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java +++ /dev/null @@ -1,41 +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.examples.core.pda.protocol; - -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.StringTokenizer; - -/** - * Object representing a bit field in the stack command results. - * - * @see PDARegistersCommand - */ -public class PDABitFieldData { - - final public String fName; - final public int fOffset; - final public int fCount; - final public Map fMnemonics; - - PDABitFieldData(String bitFieldString) { - StringTokenizer st = new StringTokenizer(bitFieldString, " "); - - fName = st.nextToken(); - fOffset = Integer.parseInt(st.nextToken()); - fCount = Integer.parseInt(st.nextToken()); - - fMnemonics = new LinkedHashMap(0); - while (st.hasMoreTokens()) { - fMnemonics.put(st.nextToken(), st.nextToken()); - } - } -} \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java deleted file mode 100644 index f9a3f001e..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java +++ /dev/null @@ -1,34 +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.examples.core.pda.protocol; - - -/** - * Retrieves data stack information - * - *
                              - *    C: children {thread_id} {frame_id} {variable_name}
                              - *    R: {child variable 1}|{child variable 2}|{child variable 3}|...|
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ -public class PDAChildrenCommand extends PDACommand { - - public PDAChildrenCommand(int threadId, int frameId, String name ) { - super("children " + threadId + " " + frameId + " " + name); - } - - public PDACommandResult createResult(String resultText) { - return new PDAListResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java deleted file mode 100644 index 07dba5b96..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java +++ /dev/null @@ -1,31 +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.examples.core.pda.protocol; - - -/** - * Clears any breakpoint set on given line - * - *
                              - *    C: clear {line}
                              - *    R: ok
                              - * 
                              - */ -public class PDAClearBreakpointCommand extends PDACommand { - - public PDAClearBreakpointCommand(int line) { - super("clear " + line); - } - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java deleted file mode 100644 index 9aa2bfb15..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommand.java +++ /dev/null @@ -1,40 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 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.examples.core.pda.protocol; - - -/** - * Base class for PDA commands. Sub-classes should format the request string - * and implement the method to create the proper result object. - */ -abstract public class PDACommand { - - final private String fRequest; - - public PDACommand(String request) { - fRequest = request; - } - - /** - * Returns the request to be sent to PDA. - */ - public String getRequest() { - return fRequest; - } - - /** - * Returns the command result based on the given PDA response. This command - * uses the class type parameter as the return type to allow the compiler to - * enforce the correct command result. This class must be implemented by - * each command to create the concrete result type. - */ - abstract public PDACommandResult createResult(String resultText); -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java deleted file mode 100644 index 9991b0115..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDACommandResult.java +++ /dev/null @@ -1,27 +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.examples.core.pda.protocol; - - - -/** - * Basic command result object. This command result simply allows access to the - * PDA response. Sub-classes may override to optionally parse the response text - * and return higher-level objects. - */ -public class PDACommandResult { - - final public String fResponseText; - - public PDACommandResult(String response) { - fResponseText = response; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java deleted file mode 100644 index 66ba35a35..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java +++ /dev/null @@ -1,35 +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.examples.core.pda.protocol; - - -/** - * Return the contents of the data stack; reply is the data from oldest to newest - * as a single string - * - *
                              - *    C: data {thread_id}
                              - *    R: {value 1}|{value 2}|{value 3}|...|
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ -public class PDADataCommand extends PDACommand { - - public PDADataCommand(int threadId) { - super("data " + threadId); - } - - public PDACommandResult createResult(String resultText) { - return new PDAListResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java deleted file mode 100644 index 2204fa177..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java +++ /dev/null @@ -1,44 +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.examples.core.pda.protocol; - - -/** - * Pops the top stack frame off the call stack setting the instruction pointer to - * the calling statement in the calling frame - * - *
                              - * If VM running:
                              - *    C: drop {thread_id}
                              - *    R: ok
                              - *    E: resumed {thread_id} drop
                              - *    E: suspended {thread_id} drop
                              - *    
                              - * If VM suspended:
                              - *    C: drop {thread_id}
                              - *    R: ok
                              - *    E: vmresumed drop
                              - *    E: vmsuspended {thread_id} drop
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ -public class PDADropFrameCommand extends PDACommand { - - public PDADropFrameCommand(int threadId) { - super("drop " + threadId); - } - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java deleted file mode 100644 index bb0bdc6b9..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java +++ /dev/null @@ -1,43 +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.examples.core.pda.protocol; - - -/** - * Causes the interperter to execute the given set of instructions. At the end - * of the evaluation the top value is poped off the stack and returned in the - * evaluation result. - * - *
                              - *    C: eval {thread_id} {instruction}%20{parameter}|{instruction}%20{parameter}|...
                              - *    R: ok
                              - *    E: resumed {thread_id} client
                              - *    E: evalresult result
                              - *    E: suspended {thread_id} eval
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - *    error: cannot evaluate while vm is suspended
                              - *    error: thread running        
                              - * 
                              - * - * Where event_name could be unimpinstr or nosuchlabel. - */ -public class PDAEvalCommand extends PDACommand { - - public PDAEvalCommand(int threadId, String operation) { - super("eval " + threadId + " " + operation); - } - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java deleted file mode 100644 index 720147697..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalResultEvent.java +++ /dev/null @@ -1,32 +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.examples.core.pda.protocol; - -/** - * Eval result event generated when an evaluation has completed. - * - *
                              - *    E: evalresult {result}
                              - * 
                              - */ -public class PDAEvalResultEvent extends PDAEvent { - - public final String fResult; - - public PDAEvalResultEvent(String message) { - super(message); - fResult = message.substring(getName(message).length() + 1); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("evalresult"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java deleted file mode 100644 index ab841bf13..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvent.java +++ /dev/null @@ -1,75 +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.examples.core.pda.protocol; - -/** - * Base class for PDA events. - */ -public class PDAEvent { - public final String fMessage; - public final String fName; - - public PDAEvent(String message) { - fMessage = message; - fName = getName(message); - } - - protected String getName(String message) { - int nameEnd = message.indexOf(' '); - nameEnd = nameEnd == -1 ? message.length() : nameEnd; - return message.substring(0, nameEnd); - } - - public static PDAEvent parseEvent(String message) { - if (PDAEvalResultEvent.isEventMessage(message)) { - return new PDAEvalResultEvent(message); - } - else if (PDAExitedEvent.isEventMessage(message)) { - return new PDAExitedEvent(message); - } - else if (PDANoSuchLabelEvent.isEventMessage(message)) { - return new PDANoSuchLabelEvent(message); - } - else if (PDARegistersEvent.isEventMessage(message)) { - return new PDARegistersEvent(message); - } - else if (PDAResumedEvent.isEventMessage(message)) { - return new PDAResumedEvent(message); - } - else if (PDAStartedEvent.isEventMessage(message)) { - return new PDAStartedEvent(message); - } - else if (PDASuspendedEvent.isEventMessage(message)) { - return new PDASuspendedEvent(message); - } - else if (PDATerminatedEvent.isEventMessage(message)) { - return new PDATerminatedEvent(message); - } - else if (PDAUnimplementedInstructionEvent.isEventMessage(message)) { - return new PDAUnimplementedInstructionEvent(message); - } - else if (PDAVMResumedEvent.isEventMessage(message)) { - return new PDAVMResumedEvent(message); - } - else if (PDAVMStartedEvent.isEventMessage(message)) { - return new PDAVMStartedEvent(message); - } - else if (PDAVMSuspendedEvent.isEventMessage(message)) { - return new PDAVMSuspendedEvent(message); - } - else if (PDAExitedEvent.isEventMessage(message)) { - return new PDAExitedEvent(message); - } - else { - return new PDAEvent(message); - } - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java deleted file mode 100644 index f538c0d65..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java +++ /dev/null @@ -1,48 +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.examples.core.pda.protocol; - - -/** - * Optionally stop the interpreter when an error event event_name - * is encountered; {0|1} specifies stop (1) or - * continue (0). The possible events are unimpinstr and - * nosuchlabel. Reply is ok. When an event is encountered, - * the interpreter sends the error event (for example unimlpemented instruction - * foo) and corresponding suspend event (for example suspended event - * unimpinstr). - * - *
                              - *    C: eventstop {event_name} {0|1}
                              - *    R: ok
                              - *    ...
                              - *    E: suspended event {event_name}
                              - * 
                              - * - * Where event_name could be unimpinstr or nosuchlabel. - */ - -public class PDAEventStopCommand extends PDACommand { - - public static final int UNIMPINSTR = 0; - public static final int NOSUCHLABEL = 1; - - public PDAEventStopCommand(int event, boolean enable) { - super("eventstop " + - (event == UNIMPINSTR ? "unimpinstr " : "nosuchlabel ") + - (enable ? "1" : "0")); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java deleted file mode 100644 index f452e8138..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAExitedEvent.java +++ /dev/null @@ -1,29 +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.examples.core.pda.protocol; - -/** - * Exited event generated when a thread has exited. - * - *
                              - *    E: started {thread_id}
                              - * 
                              - */ -public class PDAExitedEvent extends PDARunControlEvent { - - public PDAExitedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("exited"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java deleted file mode 100644 index c2a83af3c..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java +++ /dev/null @@ -1,36 +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.examples.core.pda.protocol; - - -/** - * Retrieves command stack frame information for frame frame_number - * (stack frames are indexed from 0, 0 being the oldest). - * - *
                              - *    C: stack {thread_id} {frame_number}
                              - *    R: {file}|{line}|{function}|{var_1}|{var_2}|...
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ -public class PDAFrameCommand extends PDACommand { - - public PDAFrameCommand(int threadId, int frameNum) { - super("frame " + threadId + " " + frameNum); - } - - - public PDACommandResult createResult(String resultText) { - return new PDAFrameCommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java deleted file mode 100644 index f52af48c0..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommandResult.java +++ /dev/null @@ -1,30 +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.examples.core.pda.protocol; - - - -/** - * @see PDAFrameCommand - */ - -public class PDAFrameCommandResult extends PDACommandResult { - - /** - * Frame data return by the frame command. - */ - final public PDAFrameData fFrame; - - PDAFrameCommandResult(String response) { - super(response); - fFrame = new PDAFrameData(response); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java deleted file mode 100644 index d3f9bbc9e..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java +++ /dev/null @@ -1,46 +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.examples.core.pda.protocol; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; - -/** - * Object representing a frame in the stack command results. - * - * @see PDAStackCommand - */ - -public class PDAFrameData { - - final public IPath fFilePath; - final public int fPC; - final public String fFunction; - final public String[] fVariables; - - PDAFrameData(String frameString) { - StringTokenizer st = new StringTokenizer(frameString, "|"); - - fFilePath = new Path(st.nextToken()); - fPC = Integer.parseInt(st.nextToken()); - fFunction = st.nextToken(); - - List variablesList = new ArrayList(); - while (st.hasMoreTokens()) { - variablesList.add(st.nextToken()); - } - fVariables = (String[])variablesList.toArray(new String[variablesList.size()]); - } -} \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java deleted file mode 100644 index 4e6f1eb5b..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java +++ /dev/null @@ -1,33 +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.examples.core.pda.protocol; - - -/** - * Retrieves register groups information - * - *
                              - *    C: groups
                              - *    R: {group 1}|{group 2}|{group 3}|...|
                              - * 
                              - */ - -public class PDAGroupsCommand extends PDACommand { - - public PDAGroupsCommand() { - super("groups"); - } - - - public PDACommandResult createResult(String resultText) { - return new PDAListResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java deleted file mode 100644 index 4abab970a..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java +++ /dev/null @@ -1,43 +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.examples.core.pda.protocol; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - - -/** - * @see PDADataCommand - */ - -public class PDAListResult extends PDACommandResult { - - final public String[] fValues; - - PDAListResult(String response) { - super(response); - StringTokenizer st = new StringTokenizer(response, "|"); - List valuesList = new ArrayList(); - - while (st.hasMoreTokens()) { - String token = st.nextToken(); - if (token.length() != 0) { - valuesList.add(token); - } - } - - fValues = new String[valuesList.size()]; - for (int i = 0; i < valuesList.size(); i++) { - fValues[i] = (String)valuesList.get(i); - } - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java deleted file mode 100644 index b85ca868e..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.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.examples.core.pda.protocol; - -/** - * No Such Label event generated when the PDA program encounters an call to a - * non-existant label in a PDA program. - * - *
                              - *    E: no such label {label}
                              - * 
                              - */ -public class PDANoSuchLabelEvent extends PDAEvent { - - public final String fLabel; - - public PDANoSuchLabelEvent(String message) { - super(message); - fLabel = message.substring(getName(message).length() + 1); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("no such label"); - } - - protected String getName(String message) { - if (isEventMessage(message)) { - return "no such label"; - } - throw new IllegalArgumentException("Invalid event: " + message); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java deleted file mode 100644 index be04801e2..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java +++ /dev/null @@ -1,34 +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.examples.core.pda.protocol; - - -/** - * Pops the top value from the data stack - * - *
                              - *    C: popdata {thread_id}
                              - *    R: ok
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ -public class PDAPopDataCommand extends PDACommand { - - public PDAPopDataCommand(int threadId) { - super("popdata " + threadId); - } - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java deleted file mode 100644 index 10837ea16..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java +++ /dev/null @@ -1,36 +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.examples.core.pda.protocol; - - -/** - * Pushes the given value on top of the data stack. - * - *
                              - *    C: pushdata {thread_id} {value}
                              - *    R: ok
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ - -public class PDAPushDataCommand extends PDACommand { - - public PDAPushDataCommand(int threadId, String value) { - super("pushdata " + threadId + " " + value); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java deleted file mode 100644 index 81be71016..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java +++ /dev/null @@ -1,43 +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.examples.core.pda.protocol; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - -/** - * Object representing a register in the registers command results. - * - * @see PDARCommand - */ - -public class PDARegisterData { - - final public String fName; - final public boolean fWritable; - final public PDABitFieldData[] fBitFields; - - PDARegisterData(String regString) { - StringTokenizer st = new StringTokenizer(regString, "|"); - - String regInfo = st.nextToken(); - StringTokenizer regSt = new StringTokenizer(regInfo, " "); - fName = regSt.nextToken(); - fWritable = Boolean.getBoolean(regSt.nextToken()); - - List bitFieldsList = new ArrayList(); - while (st.hasMoreTokens()) { - bitFieldsList.add(new PDABitFieldData(st.nextToken())); - } - fBitFields = (PDABitFieldData[])bitFieldsList.toArray(new PDABitFieldData[bitFieldsList.size()]); - } -} \ No newline at end of file diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java deleted file mode 100644 index 2e766ca1d..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java +++ /dev/null @@ -1,33 +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.examples.core.pda.protocol; - - -/** - * Retrieves registers definition information - * - *
                              - *    C: registers {group name}
                              - *    R: {register name} {true|false}|{bit field name} {start bit} {bit count} {mnemonic 1} {mnemonic 2} ...#{register name} ...
                              - * 
                              - */ - -public class PDARegistersCommand extends PDACommand { - - public PDARegistersCommand(String group) { - super("registers " + group); - } - - - public PDACommandResult createResult(String resultText) { - return new PDARegistersCommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java deleted file mode 100644 index f5d4cd983..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java +++ /dev/null @@ -1,39 +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.examples.core.pda.protocol; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - - -/** - * @see PDARegistersCommand - */ - -public class PDARegistersCommandResult extends PDACommandResult { - - /** - * Array of registers returned by the registers commands. - */ - final public PDARegisterData[] fRegisters; - - PDARegistersCommandResult(String response) { - super(response); - StringTokenizer st = new StringTokenizer(response, "#"); - List regList = new ArrayList(); - - while (st.hasMoreTokens()) { - regList.add(new PDARegisterData(st.nextToken())); - } - fRegisters = (PDARegisterData[])regList.toArray(new PDARegisterData[regList.size()]); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java deleted file mode 100644 index 9212273b5..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersEvent.java +++ /dev/null @@ -1,30 +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.examples.core.pda.protocol; - -/** - * Registers event generated when the registers' definitions are changed in a - * program. - * - *
                              - *    E: registers
                              - * 
                              - */ -public class PDARegistersEvent extends PDAEvent { - - public PDARegistersEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("registers"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java deleted file mode 100644 index 21e58c430..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java +++ /dev/null @@ -1,35 +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.examples.core.pda.protocol; - - -/** - * Restarts the debug session. All threads exit and the main threads starts - * - *
                              - *    C: restart
                              - *    E: exited 0
                              - *    E: started 1
                              - *    R: ok
                              - * 
                              - */ - -public class PDARestartCommand extends PDACommand { - - public PDARestartCommand() { - super("restart"); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java deleted file mode 100644 index bf65d40e5..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java +++ /dev/null @@ -1,40 +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.examples.core.pda.protocol; - - -/** - * Resumes the execution of a single thread. Can be issued only if the virtual - * machine is running. - * - *
                              - *    C: resume {thread_id}
                              - *    R: ok
                              - *    E: resumed {thread_id} client
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - *    error: cannot resume thread when vm is suspended
                              - *    error: thread already running
                              - * 
                              - */ - -public class PDAResumeCommand extends PDACommand { - - public PDAResumeCommand(int threadId) { - super("resume " + threadId); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java deleted file mode 100644 index 36f89ed0d..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumedEvent.java +++ /dev/null @@ -1,29 +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.examples.core.pda.protocol; - -/** - * Resumed event generated when a thread is resumed. - * - *
                              - *    E: resumed {thread_id} [reason]
                              - * 
                              - */ -public class PDAResumedEvent extends PDARunControlEvent { - - public PDAResumedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("resumed"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java deleted file mode 100644 index e3af4eb5e..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.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.examples.core.pda.protocol; - - -/** - * Base class for run-control events. - */ -public class PDARunControlEvent extends PDAEvent { - - public final int fThreadId; - public final String fReason; - - public PDARunControlEvent(String message) { - super(message); - fThreadId = getThreadId(message); - fReason = getStateChangeReason(message); - } - - protected int getThreadId(String message) { - int nameEnd = getName(message).length(); - if ( Character.isDigit(message.charAt(nameEnd + 1)) ) { - int threadIdEnd = message.indexOf(' ', nameEnd + 1); - threadIdEnd = threadIdEnd == -1 ? message.length() : threadIdEnd; - try { - return Integer.parseInt(message.substring(nameEnd + 1, threadIdEnd)); - } catch (NumberFormatException e) { - throw new IllegalArgumentException("Invalid event: " + message); - } - } else { - return -1; - } - } - - protected String getStateChangeReason(String message) { - int idx = getName(message).length(); - if ( Character.isDigit(message.charAt(idx + 1)) ) { - idx = message.indexOf(' ', idx + 1); - idx = idx == -1 ? message.length() : idx + 1; - } else { - idx++; - } - if (idx >= message.length()) { - return ""; - } - - int endIdx = message.indexOf(' ', idx); - endIdx = endIdx == -1 ? message.length() : endIdx; - return message.substring(idx, endIdx); - } - - protected String getName(String message) { - int nameEnd = message.indexOf(' '); - nameEnd = nameEnd == -1 ? message.length() : nameEnd; - return message.substring(0, nameEnd); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("started"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java deleted file mode 100644 index 1abb7fa8c..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java +++ /dev/null @@ -1,46 +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.examples.core.pda.protocol; - - -/** - * Sets a breakpoint at given line - * - *
                              - * Suspend a single thread:
                              - *    C: set {line_number} 0
                              - *    R: ok
                              - *    C: resume {thread_id}
                              - *    E: resumed {thread_id} client
                              - *    E: suspended {thread_id} breakpoint line_number
                              - *    
                              - * Suspend the VM:
                              - *    C: set {line_number} 1
                              - *    R: ok
                              - *    C: vmresume
                              - *    E: vmresumed client
                              - *    E: vmsuspended {thread_id} breakpoint line_number
                              - * 
                              - */ - -public class PDASetBreakpointCommand extends PDACommand { - - public PDASetBreakpointCommand(int line, boolean stopVM) { - super("set " + - line + " " + - (stopVM ? "1" : "0")); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java deleted file mode 100644 index e0c22db45..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java +++ /dev/null @@ -1,36 +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.examples.core.pda.protocol; - - -/** - * Sets a data value in the data stack at the given location (the data stack is - * indexed from 0, 0 being the oldest). - * - *
                              - *    C: setdata {thread_id} {index} {value}
                              - *    R: ok
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ -public class PDASetDataCommand extends PDACommand { - - public PDASetDataCommand(int threadId, int index, String value) { - super("setdata " + threadId + " " + index + " " + value); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java deleted file mode 100644 index c5f6b090f..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java +++ /dev/null @@ -1,38 +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.examples.core.pda.protocol; - - -/** - * Set the contents of variable variable from the control stack - * frame_number to value value (the control stack is - * indexed from 0, 0 being the oldest). - * - *
                              - *    C: setvar {thread_id} {frame_number} {variable} {value}
                              - *    R: ok
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ - -public class PDASetVarCommand extends PDACommand { - - public PDASetVarCommand(int threadId, int frame, String variable, String value) { - super("setvar " + threadId + " " + frame + " " + variable + " " + value); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java deleted file mode 100644 index 84545feb1..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java +++ /dev/null @@ -1,39 +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.examples.core.pda.protocol; - - -/** - * Return the contents of the control stack (program counters, function and - * variable names). The reply is control stack from oldest to newest as a single string - * frame#frame#frame...#frame, where each frame is a string - * "filename|pc|function name|variable name|variable name|...|variable name". - * - *
                              - *    C: stack {thread_id}
                              - *    R: {file}|{line}|{function}|{var_1}|{var_2}|...#{file}|{line}|{function}|{var_1}|{var_2}|...#...
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ - -public class PDAStackCommand extends PDACommand { - - public PDAStackCommand(int threadId) { - super("stack " + threadId); - } - - - public PDACommandResult createResult(String resultText) { - return new PDAStackCommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java deleted file mode 100644 index e22aa12b0..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java +++ /dev/null @@ -1,40 +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.examples.core.pda.protocol; - -import java.util.ArrayList; -import java.util.List; -import java.util.StringTokenizer; - - -/** - * @see PDAStackCommand - */ - -public class PDAStackCommandResult extends PDACommandResult { - - /** - * Array of frames return by the stack commands. The frames are ordered - * with the highest-level frame first. - */ - final public PDAFrameData[] fFrames; - - PDAStackCommandResult(String response) { - super(response); - StringTokenizer st = new StringTokenizer(response, "#"); - List framesList = new ArrayList(); - - while (st.hasMoreTokens()) { - framesList.add(new PDAFrameData(st.nextToken())); - } - fFrames = (PDAFrameData[])framesList.toArray(new PDAFrameData[framesList.size()]); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java deleted file mode 100644 index 6c04530c2..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java +++ /dev/null @@ -1,36 +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.examples.core.pda.protocol; - - -/** - * Retrieves command stack depth - * - *
                              - *    C: stackdepth {thread_id}
                              - *    R: {depth}
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ - -public class PDAStackDepthCommand extends PDACommand { - - public PDAStackDepthCommand(int threadId) { - super("stackdepth " + threadId); - } - - - public PDACommandResult createResult(String resultText) { - return new PDAStackDepthCommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java deleted file mode 100644 index e5ca2b969..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommandResult.java +++ /dev/null @@ -1,31 +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.examples.core.pda.protocol; - - - -/** - * @see PDADataCommand - */ - -public class PDAStackDepthCommandResult extends PDACommandResult { - - final public int fDepth; - - PDAStackDepthCommandResult(String response) { - super(response); - int depth = 1; // default to something that won't cause NPEs - try { - depth = Integer.parseInt(response); - } catch (NumberFormatException e) {} - fDepth = depth; - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java deleted file mode 100644 index 6b980e105..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStartedEvent.java +++ /dev/null @@ -1,30 +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.examples.core.pda.protocol; - -/** - * Started event generated when a new thread is started. A started event - * is always sent for the first thread when a PDA program is started. - * - *
                              - *    E: started {thread_id}
                              - * 
                              - */ -public class PDAStartedEvent extends PDARunControlEvent { - - public PDAStartedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("started"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java deleted file mode 100644 index 3a21492ad..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java +++ /dev/null @@ -1,45 +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.examples.core.pda.protocol; - - -/** - * Executes next instruction - * - *
                              - * If VM running:
                              - *    C: step {thread_id}
                              - *    R: ok
                              - *    E: resumed {thread_id} step
                              - *    E: suspended {thread_id} step
                              - *    
                              - * If VM suspended:
                              - *    C: step {thread_id}
                              - *    R: ok
                              - *    E: vmresumed step
                              - *    E: vmsuspended {thread_id} step
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ - -public class PDAStepCommand extends PDACommand { - - public PDAStepCommand(int threadId) { - super("step " + threadId); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java deleted file mode 100644 index 2a7fd9505..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java +++ /dev/null @@ -1,46 +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.examples.core.pda.protocol; - - -/** - * Single step forward until the next return op code. Stop before - * executing the return . - * - *
                              - * If VM running:
                              - *    C: stepreturn {thread_id}
                              - *    R: ok
                              - *    E: resumed {thread_id} client
                              - *    E: suspended {thread_id} step
                              - *    
                              - * If VM suspended:
                              - *    C: stepreturn {thread_id}
                              - *    R: ok
                              - *    E: vmresumed client
                              - *    E: vmsuspended {thread_id} step
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - * 
                              - */ - -public class PDAStepReturnCommand extends PDACommand { - - public PDAStepReturnCommand(int threadId) { - super("stepreturn " + threadId); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java deleted file mode 100644 index fb124d3e0..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java +++ /dev/null @@ -1,40 +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.examples.core.pda.protocol; - - -/** - * Suspends execution of a single thread. Can be issued only if the virtual - * machine is running. - * - *
                              - *    C: suspend {thread_id}
                              - *    R: ok
                              - *    E: suspended {thread_id} client
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              -      error: vm already suspended
                              - *    error: thread already suspended
                              - * 
                              - */ - -public class PDASuspendCommand extends PDACommand { - - public PDASuspendCommand(int threadId) { - super("suspend " + threadId); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java deleted file mode 100644 index b226347c3..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendedEvent.java +++ /dev/null @@ -1,43 +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.examples.core.pda.protocol; - -/** - * Suspended event generated when a thread is suspended. - * - *
                              - *    E: suspended {thread_id} [reason]
                              - * 
                              - * - * [reason] is the cause of the suspension and it's optional: - *
                                - *
                              • breakpoint N - a breakpoint at line N was hit
                              • - *
                              • client - a client request to suspend has completed
                              • - *
                              • drop - a client request to drop a frame has completed
                              • - *
                              • event E - an error was encountered, where E is one - * of unimpinstr or nosuchlabel
                              • - *
                              • step - a step request has completed
                              • - *
                              • watch A F::V - a watchpoint was hit for reason A - * (read or write), on variable V in - * function F
                              • - *
                              - - */ -public class PDASuspendedEvent extends PDARunControlEvent { - - public PDASuspendedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("suspended"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java deleted file mode 100644 index 3e91596f1..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java +++ /dev/null @@ -1,34 +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.examples.core.pda.protocol; - - -/** - * Instructs the debugger to terminate. - * - *
                              - *    C: terminate
                              - *    R: ok
                              - *    E: vmterminated
                              - * 
                              - */ - -public class PDATerminateCommand extends PDACommand { - - public PDATerminateCommand() { - super("terminate"); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java deleted file mode 100644 index 648e838ab..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminatedEvent.java +++ /dev/null @@ -1,29 +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.examples.core.pda.protocol; - -/** - * Terminated event generated when the PDA program has ended execution. - * - *
                              - *    E: termianted
                              - * 
                              - */ -public class PDATerminatedEvent extends PDAEvent { - - public PDATerminatedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("terminated"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java deleted file mode 100644 index 7a0ce54ba..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java +++ /dev/null @@ -1,41 +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.examples.core.pda.protocol; - -/** - * Unimplemented Instruction event generated when the PDA program encounters - * an instruction that it does not recognize. This event is usually followed - * by a VM Suspended event. - * - *
                              - *    E: unimplemented instruction {label}
                              - * 
                              - */ -public class PDAUnimplementedInstructionEvent extends PDAEvent { - - public final String fOperation; - - public PDAUnimplementedInstructionEvent(String message) { - super(message); - fOperation = message.substring(getName(message).length() + 1); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("unimplemented instruction"); - } - - protected String getName(String message) { - if (isEventMessage(message)) { - return "unimplemented instruction"; - } - throw new IllegalArgumentException("Invalid event: " + message); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java deleted file mode 100644 index 85ca473ab..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java +++ /dev/null @@ -1,37 +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.examples.core.pda.protocol; - - -/** - * Resumes the execution of the whole virtual machine - * - *
                              - *    C: vmresume
                              - *    R: ok
                              - *    E: vmresumed client
                              - *    
                              - * Errors:
                              - *    error: vm already running
                              - * 
                              - */ - -public class PDAVMResumeCommand extends PDACommand { - - public PDAVMResumeCommand() { - super("vmresume"); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java deleted file mode 100644 index 74801c6c5..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumedEvent.java +++ /dev/null @@ -1,36 +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.examples.core.pda.protocol; - -/** - * VM Resumed event generated when the whole virtual machine is resumed. When - * the VM is resumed all previously suspended threads are resumed as well. - * - *
                              - *    E: vmresumed [reason]
                              - * 
                              - * - * [reason] is the cause of the resume: and it's optional: - *
                                - *
                              • step - a step request has been initiated
                              • - *
                              • client - a client request to resume has been initiated
                              • - *
                              - */ -public class PDAVMResumedEvent extends PDARunControlEvent { - - public PDAVMResumedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("vmresumed"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java deleted file mode 100644 index ff5f1dc0f..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMStartedEvent.java +++ /dev/null @@ -1,30 +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.examples.core.pda.protocol; - -/** - * VM started event generated when the the interpreter has started (guaranteed - * to be the first event sent) - * - *
                              - *    E: vmstarted
                              - * 
                              - */ -public class PDAVMStartedEvent extends PDAEvent { - - public PDAVMStartedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("vmstarted"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java deleted file mode 100644 index ad62d3321..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java +++ /dev/null @@ -1,37 +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.examples.core.pda.protocol; - - -/** - * Suspends the execution of the whole virtual machine - * - *
                              - *    C: vmsuspend
                              - *    R: ok
                              - *    E: vmsuspended client
                              - *    
                              - * Errors:
                              - *    error: thread already suspended
                              - * 
                              - */ - -public class PDAVMSuspendCommand extends PDACommand { - - public PDAVMSuspendCommand() { - super("vmsuspend"); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java deleted file mode 100644 index 0e36297ec..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendedEvent.java +++ /dev/null @@ -1,44 +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.examples.core.pda.protocol; - -/** - * VM Suspended event generated when the virtual machine is suspended. If the VM - * is suspended as a result of a thread event (e.g. thread hitting a breakpoint), - * then the thread_id is included in the event. - * - *
                              - *    E: vmsuspended [thread_id] {reason}
                              - * 
                              - * - * {reason} is the cause of the suspension: - *
                                - *
                              • breakpoint N - a breakpoint at line N was hit
                              • - *
                              • client - a client request to suspend has completed
                              • - *
                              • drop - a client request to drop a frame has completed
                              • - *
                              • event E - an error was encountered, where E is one - * of unimpinstr or nosuchlabel
                              • - *
                              • step - a step request has completed
                              • - *
                              • watch A F::V - a watchpoint was hit for reason A - * (read or write), on variable V in - * function F
                              • - *
                              - */ -public class PDAVMSuspendedEvent extends PDARunControlEvent { - - public PDAVMSuspendedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("vmsuspended"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java deleted file mode 100644 index 348778625..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMTerminatedEvent.java +++ /dev/null @@ -1,29 +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.examples.core.pda.protocol; - -/** - * Terminated event generated when the PDA program has ended execution. - * - *
                              - *    E: termianted
                              - * 
                              - */ -public class PDAVMTerminatedEvent extends PDAEvent { - - public PDAVMTerminatedEvent(String message) { - super(message); - } - - public static boolean isEventMessage(String message) { - return message.startsWith("vmterminated"); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java deleted file mode 100644 index 5e2f34c03..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java +++ /dev/null @@ -1,39 +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.examples.core.pda.protocol; - - -/** - * Return the contents of variable variable_name in the control - * stack frame frame_number (stack frames are indexed from 0, 0 - * being the oldest). - * - *
                              - *    C: var  {thread_id} {frame_number} {variable_name}
                              - *    R: {variable_value}
                              - *    
                              - * Errors:
                              - *    error: invalid thread
                              - *    error: variable undefined
                              - * 
                              - */ - -public class PDAVarCommand extends PDACommand { - - public PDAVarCommand(int threadId, int frameId, String name) { - super("var " + threadId + " " + frameId + " " + name); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java deleted file mode 100644 index 4bd8af72c..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java +++ /dev/null @@ -1,43 +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.examples.core.pda.protocol; - - -/** - * Set a watchpoint on variable variable_name in function - * function to magic value watch_operation. The magic - * value is a bit flag corresponding to read access (1), write access (2), or - * both (3); the magic value 0 clears the watchpoint. - * - *
                              - *    C: watch {function}::{variable_name} {watch_operation}
                              - *    R: ok
                              - *    C: vmresume
                              - *    R: vmresumed client
                              - *    E: vmsuspended {thread_id} watch {watch_operation} {function}::{variable_name}
                              - * 
                              - */ -public class PDAWatchCommand extends PDACommand { - - public static final int READ = 1; - public static final int WRITE = 2; - public static final int BOTH = READ | WRITE; - public static final int NONE = 0; - - public PDAWatchCommand(String function, String variable, int operation) { - super("watch " + function+ "::" + variable + " " + operation); - } - - - public PDACommandResult createResult(String resultText) { - return new PDACommandResult(resultText); - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html deleted file mode 100644 index 90bdaae51..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/package.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - -PDA Interpreter Debug Protocol - - - - -

                              Provides classes representing PDA protocol commands, command results and events

                              - -

                              Package Specification

                              - -

                              Virtual Machine execution control

                              -

                              Commands

                              -
                                -
                              • {@link PDATerminateCommand}
                              • -
                              • {@link PDAVMSuspendCommand}
                              • -
                              • {@link PDAVMResumeCommand}
                              • -
                              • {@link PDAEventStopCommand}
                              • -
                              -

                              Events

                              -
                                -
                              • {@link PDAVMStarted}
                              • -
                              • {@link PDAVMTerminated}
                              • -
                              • {@link PDAVMSuspneded}
                              • -
                              • {@link PDAVMResumed}
                              • -
                              • {@link PDAUnimplementedInstructionEvent}
                              • -
                              • {@link PDANoSuchLabelEvent}
                              • -
                              - -

                              Thread execution control

                              -

                              Commands

                              -
                                -
                              • {@link PDASuspendCommand}
                              • -
                              • {@link PDAResumeCommand}
                              • -
                              • {@link PDAStepCommand}
                              • -
                              • {@link PDADropFrameCommand}
                              • -
                              -

                              Events

                              -
                                -
                              • {@link PDAStarted}
                              • -
                              • {@link PDAExited}
                              • -
                              • {@link PDASuspended}
                              • -
                              • {@link PDAResumed}
                              • -
                              - -

                              Breakpoints

                              -

                              Commands

                              -
                                -
                              • {@link PDASetBreakpointCommand}
                              • -
                              • {@link PDAClearBreakpointCommand}
                              • -
                              • {@link PDAWatchCommand}
                              • -
                              - -

                              Data stack

                              -

                              Commands

                              -
                                -
                              • {@link PDADataCommand}
                              • -
                              • {@link PDASetDataCommand}
                              • -
                              • {@link PDAPopDataCommand}
                              • -
                              • {@link PDAPushDataCommand}
                              • -
                              - -

                              Expression evaluation

                              -

                              Commands

                              -
                                -
                              • {@link PDAEvalCommand}
                              • -
                              -

                              Events

                              -
                                -
                              • {@link PDAEvalResultEvent}
                              • -
                              - -

                              Execution control stack

                              -

                              Commands

                              -
                                -
                              • {@link PDAStackCommand}
                              • -
                              • {@link PDAStackDepthCommand}
                              • -
                              • {@link PDAFrameCommand}
                              • -
                              • {@link PDAVarCommand}
                              • -
                              • {@link PDASetVarCommand}
                              • -
                              • {@link PDAChildrenCommand}
                              • -
                              - -

                              Registers

                              -

                              Commands

                              -
                                -
                              • {@link PDAGroupsCommand}
                              • -
                              • {@link PDARegistersCommand}
                              • -
                              -

                              Events

                              -
                                -
                              • {@link PDARegistersEvent}
                              • -
                              - - - diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java deleted file mode 100644 index f975cf7c3..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java +++ /dev/null @@ -1,32 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.sourcelookup; - -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; -import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; - -/** - * PDA source lookup director. For PDA source lookup there is one source - * lookup participant. - */ -public class PDASourceLookupDirector extends AbstractSourceLookupDirector { - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#initializeParticipants() - */ - public void initializeParticipants() { - //#ifdef ex4 -//# // TODO: Exercise 4 - add our participant to this director - //#else - addParticipants(new ISourceLookupParticipant[]{new PDASourceLookupParticipant()}); - //#endif - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java deleted file mode 100644 index 0d07ce78d..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java +++ /dev/null @@ -1,38 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.sourcelookup; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; - - -/** - * The PDA source lookup participant knows how to translate a - * PDA stack frame into a source file name - */ -public class PDASourceLookupParticipant extends AbstractSourceLookupParticipant { - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant#getSourceName(java.lang.Object) - */ - public String getSourceName(Object object) throws CoreException { - //#ifdef ex4 -//# // TODO: Exercise 4 - return the name of the source file for the given stack frame -//# return null; - //#else - if (object instanceof PDAStackFrame) { - return ((PDAStackFrame)object).getSourceName(); - } - return null; - //#endif - } -} diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java deleted file mode 100644 index d91b3f245..000000000 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.core.pda.sourcelookup; - -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.sourcelookup.ISourceContainer; -import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate; -import org.eclipse.debug.core.sourcelookup.containers.FolderSourceContainer; -import org.eclipse.debug.core.sourcelookup.containers.ProjectSourceContainer; -import org.eclipse.debug.core.sourcelookup.containers.WorkspaceSourceContainer; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; - - -/** - * Computes the default source lookup path for a PDA launch configuration. - * The default source lookup path is the folder or project containing - * the PDA program being launched. If the program is not specified, the workspace - * is searched by default. - */ -public class PDASourcePathComputerDelegate implements ISourcePathComputerDelegate { - - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor) - */ - public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException { - String path = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null); - ISourceContainer sourceContainer = null; - if (path != null) { - IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path)); - if (resource != null) { - //#ifdef ex4 -//# // TODO: Exercise 4 - seed the source lookup path - //#else - IContainer container = resource.getParent(); - if (container.getType() == IResource.PROJECT) { - sourceContainer = new ProjectSourceContainer((IProject)container, false); - } else if (container.getType() == IResource.FOLDER) { - sourceContainer = new FolderSourceContainer(container, false); - } - //#endif - } - } - if (sourceContainer == null) { - sourceContainer = new WorkspaceSourceContainer(); - } - return new ISourceContainer[]{sourceContainer}; - } -} diff --git a/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java b/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java deleted file mode 100644 index 59baccb85..000000000 --- a/org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java +++ /dev/null @@ -1,295 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ant.tasks; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.io.IOException; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import java.util.Vector; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.apache.tools.ant.BuildException; -import org.apache.tools.ant.DirectoryScanner; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.types.FileSet; -import org.apache.tools.ant.util.FileUtils; - -/** - * Java preprocessor for code examples. Used to export source code for - * example plug-ins with parts of code missing/inserted etc., for - * various exercises. - *

                              - * The preprocessor looks for #ifdef statements in java comments, and is - * run with a set of symbols. For example: - *

                              - * //#ifdef ex1
                              - * ... code to insert when 'ex1' symbol is on
                              - * //#else
                              - * ... code to insert when not 'ex1'
                              - * //#endif
                              - * 
                              - *

                              - */ -public class PreProcessor extends Task { - - private Vector fFileSets = new Vector(); - private File fDestDir = null; - private Set fSymbols = new HashSet(); - private FileUtils fUtils = FileUtils.getFileUtils(); - - // possible states - private static final int STATE_OUTSIDE_CONDITION = 0; - private static final int STATE_TRUE_CONDITION = 1; - private static final int STATE_FALSE_CONDITION = 2; - private static final int STATE_POST_TRUE_CONDITION = 3; - - // matchers - private Matcher IF_DEF_MATCHER = Pattern.compile("#ifdef\\s+\\w+").matcher(""); - private Matcher ELSE_IF_MATCHER = Pattern.compile("#elseif\\s+\\w+").matcher(""); - private Matcher ELSE_MATCHER = Pattern.compile("#else$|#else\\W+").matcher(""); - private Matcher END_MATCHER = Pattern.compile("#endif").matcher(""); - - - /** - * Constructs a new preprocessor task - */ - public PreProcessor() { - } - - /** - * Adds a set of files to process. - * - * @param set a set of files to process - */ - public void addFileset(FileSet set) { - fFileSets.addElement(set); - } - - /** - * Sets the destination directory for processed files. - * - * @param destDir destination directory for processed files - */ - public void setDestdir(File destDir) { - fDestDir = destDir; - } - - /** - * Sets the symbols that are "on" for the preprocessing. - * - * @param symbols symbols that are "on" for the preprocessing - */ - public void setSymbols(String symbols) { - String[] strings = symbols.split(","); - for (int i = 0; i < strings.length; i++) { - String string = strings[i].trim(); - if (string.length() > 0) { - fSymbols.add(string); - } - } - } - - public void execute() throws BuildException { - if (fSymbols.size() == 0) { - throw new BuildException("No symbols specified for preprocessor"); - } - if (fFileSets.isEmpty()) { - throw new BuildException("No filesets specified for processing"); - } - if (!fDestDir.exists()) { - throw new BuildException("destdir does not exist: " + fDestDir.getAbsolutePath()); - } - StringBuffer buf = new StringBuffer("Symbols: "); - String[] symbols = (String[]) fSymbols.toArray(new String[fSymbols.size()]); - for (int i = 0; i < symbols.length; i++) { - String symbol = symbols[i]; - buf.append(symbol); - if(i < (symbols.length -1)) { - buf.append(", "); - } - } - log(buf.toString()); - - Iterator fileSets = fFileSets.iterator(); - while (fileSets.hasNext()) { - FileSet fileSet = (FileSet) fileSets.next(); - DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject()); - String[] includedFiles = scanner.getIncludedFiles(); - File baseDir = fileSet.getDir(getProject()); - for (int i = 0; i < includedFiles.length; i++) { - String fileName = includedFiles[i]; - processFile(baseDir, fileName, fDestDir); - } - } - - } - - /** - * Process the file - * @param baseDir base directory source file is relative to - * @param fileName source file name - * @param destDir root destination directory - */ - private void processFile(File baseDir, String fileName, File destDir) throws BuildException { - File destFile = new File(destDir, fileName); - File srcFile = new File(baseDir, fileName); - File dir = destFile.getParentFile(); - if (!dir.exists()) { - dir.mkdirs(); - } - String contents = null; - if (fileName.endsWith(".java")) { - contents = preProcessFile(srcFile, "//#"); - } else if (fileName.equals("plugin.xml")) { - contents = preProcessFile(srcFile, null); - } - if (contents == null) { - // no change, just copy file - try { - fUtils.copyFile(srcFile, destFile); - } catch (IOException e) { - throw new BuildException(e); - } - } else { - // write new file - FileWriter writer; - try { - writer = new FileWriter(destFile); - writer.write(contents); - writer.close(); - } catch (IOException e) { - throw new BuildException(e); - } - - } - } - - /** - * Preprocesses a file - * - * @param srcFile the file to process - * @param strip chars to stip off lines in a true condition, or null - * @return - */ - public String preProcessFile(File srcFile, String strip) { - try { - FileReader fileReader = new FileReader(srcFile); - BufferedReader reader = new BufferedReader(fileReader); - StringBuffer buffer = new StringBuffer(); - String line = reader.readLine(); - String activeSymbol = null; - int state = STATE_OUTSIDE_CONDITION; - boolean changed = false; - while (line != null) { - boolean ifdef = IF_DEF_MATCHER.reset(line).find(); - boolean elseif = ELSE_IF_MATCHER.reset(line).find(); - boolean elze = ELSE_MATCHER.reset(line).find(); - boolean endif = END_MATCHER.reset(line).find(); - boolean commandLine = ifdef || elseif || elze || endif; - boolean written = false; - switch (state) { - case STATE_OUTSIDE_CONDITION: - if (ifdef) { - String condition = line.substring(IF_DEF_MATCHER.start(), IF_DEF_MATCHER.end()); - String[] strings = condition.split("\\s+"); - activeSymbol = strings[1].trim(); - if (fSymbols.contains(activeSymbol)) { - state = STATE_TRUE_CONDITION; - } else { - state = STATE_FALSE_CONDITION; - } - } else if (elseif) { - throw new BuildException("#elseif encountered without corresponding #ifdef"); - } else if (elze) { - throw new BuildException("#else encountered without corresponding #ifdef (" + srcFile.getPath() + ")"); - } else if (endif) { - throw new BuildException("#endif encountered without corresponding #ifdef"); - } - break; - case STATE_TRUE_CONDITION: - if (elze || elseif) { - state = STATE_POST_TRUE_CONDITION; - break; - } else if (endif) { - state = STATE_OUTSIDE_CONDITION; - break; - } else if (ifdef) { - throw new BuildException("illegal nested #ifdef"); - } - break; - case STATE_FALSE_CONDITION: - if (elseif) { - String condition = line.substring(ELSE_IF_MATCHER.start(), ELSE_IF_MATCHER.end()); - String[] strings = condition.split("\\s+"); - activeSymbol = strings[1].trim(); - if (fSymbols.contains(activeSymbol)) { - state = STATE_TRUE_CONDITION; - } else { - state = STATE_FALSE_CONDITION; - } - } else if (elze) { - state = STATE_TRUE_CONDITION; - break; - } else if (endif) { - state = STATE_OUTSIDE_CONDITION; - break; - } else if (ifdef) { - throw new BuildException("illegal nested #ifdef"); - } - break; - case STATE_POST_TRUE_CONDITION: - if (endif) { - state = STATE_OUTSIDE_CONDITION; - break; - } else if (ifdef) { - throw new BuildException("illegal nested #ifdef"); - } - break; - } - if (!commandLine) { - if (state == STATE_OUTSIDE_CONDITION || state == STATE_TRUE_CONDITION) { - if (state == STATE_TRUE_CONDITION && strip != null) { - if (line.startsWith(strip)) { - line = line.substring(strip.length()); - } - } - buffer.append(line); - buffer.append("\n"); - written = true; - } - } - changed = changed || !written; - line = reader.readLine(); - } - if (!changed) { - return null; - } - return buffer.toString(); - } catch (IOException e) { - throw new BuildException(e); - } - } - - public static void main(String[] args) { - PreProcessor processor = new PreProcessor(); - processor.setSymbols("ex2"); - String string = processor.preProcessFile(new File("c:\\eclipse3.1\\dev\\example.debug.core\\src\\example\\debug\\core\\launcher\\PDALaunchDelegate.java"), "//#"); - //String string = processor.preProcessFile(new File("c:\\eclipse3.1\\dev\\example.debug.core\\plugin.xml"), null); - System.out.println(string); - } -} diff --git a/org.eclipse.debug.examples.ui/.classpath b/org.eclipse.debug.examples.ui/.classpath deleted file mode 100644 index b7464f3ca..000000000 --- a/org.eclipse.debug.examples.ui/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.debug.examples.ui/.cvsignore b/org.eclipse.debug.examples.ui/.cvsignore deleted file mode 100644 index ba077a403..000000000 --- a/org.eclipse.debug.examples.ui/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/org.eclipse.debug.examples.ui/.project b/org.eclipse.debug.examples.ui/.project deleted file mode 100644 index 4b906e693..000000000 --- a/org.eclipse.debug.examples.ui/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.debug.examples.ui - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 438fd6eba..000000000 --- a/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,47 +0,0 @@ -#Tue May 19 11:43:28 CDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 diff --git a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF deleted file mode 100644 index e6dba7270..000000000 --- a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF +++ /dev/null @@ -1,30 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Example Debug UI Plug-in -Bundle-SymbolicName: org.eclipse.debug.examples.ui;singleton:=true -Bundle-Version: 1.2.0.qualifier -Bundle-Activator: org.eclipse.debug.examples.ui.pda.DebugUIPlugin -Require-Bundle: org.eclipse.core.runtime, - org.eclipse.core.resources, - org.eclipse.debug.core, - org.eclipse.ui, - org.eclipse.debug.ui, - org.eclipse.jface.text, - org.eclipse.ui.editors, - org.eclipse.ui.workbench.texteditor, - org.eclipse.ui.ide, - org.eclipse.debug.examples.core, - org.eclipse.core.expressions -Eclipse-LazyStart: true -Export-Package: org.eclipse.debug.examples.ui.midi.adapters, - org.eclipse.debug.examples.ui.midi.detailpanes, - org.eclipse.debug.examples.ui.midi.launcher, - org.eclipse.debug.examples.ui.pda, - org.eclipse.debug.examples.ui.pda.adapters, - org.eclipse.debug.examples.ui.pda.breakpoints, - org.eclipse.debug.examples.ui.pda.editor, - org.eclipse.debug.examples.ui.pda.launcher, - org.eclipse.debug.examples.ui.pda.presentation, - org.eclipse.debug.examples.ui.pda.views -Bundle-RequiredExecutionEnvironment: J2SE-1.4 -Bundle-ActivationPolicy: lazy diff --git a/org.eclipse.debug.examples.ui/about.html b/org.eclipse.debug.examples.ui/about.html deleted file mode 100644 index 460233046..000000000 --- a/org.eclipse.debug.examples.ui/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

                              About This Content

                              - -

                              June 2, 2006

                              -

                              License

                              - -

                              The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

                              - -

                              If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

                              - - - \ No newline at end of file diff --git a/org.eclipse.debug.examples.ui/build.properties b/org.eclipse.debug.examples.ui/build.properties deleted file mode 100644 index b18c60771..000000000 --- a/org.eclipse.debug.examples.ui/build.properties +++ /dev/null @@ -1,20 +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 -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = plugin.xml,\ - bin/,\ - about.html,\ - META-INF/,\ - .,\ - icons/ -src.includes = about.html,\ - icons/ diff --git a/org.eclipse.debug.examples.ui/icons/full/dlcl16/pop.gif b/org.eclipse.debug.examples.ui/icons/full/dlcl16/pop.gif deleted file mode 100644 index 559e46298..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/dlcl16/pop.gif and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/icons/full/dlcl16/push.gif b/org.eclipse.debug.examples.ui/icons/full/dlcl16/push.gif deleted file mode 100644 index f7e6cc089..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/dlcl16/push.gif and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/icons/full/elcl16/pop.gif b/org.eclipse.debug.examples.ui/icons/full/elcl16/pop.gif deleted file mode 100644 index 2cd9c5444..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/elcl16/pop.gif and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/icons/full/elcl16/push.gif b/org.eclipse.debug.examples.ui/icons/full/elcl16/push.gif deleted file mode 100644 index a5ac28d4c..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/elcl16/push.gif and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/icons/full/obj16/clef.png b/org.eclipse.debug.examples.ui/icons/full/obj16/clef.png deleted file mode 100644 index 5036eb5f0..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/obj16/clef.png and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/icons/full/obj16/note.gif b/org.eclipse.debug.examples.ui/icons/full/obj16/note.gif deleted file mode 100644 index 7bc1e0813..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/obj16/note.gif and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/icons/full/obj16/pda.gif b/org.eclipse.debug.examples.ui/icons/full/obj16/pda.gif deleted file mode 100644 index 04c5052b2..000000000 Binary files a/org.eclipse.debug.examples.ui/icons/full/obj16/pda.gif and /dev/null differ diff --git a/org.eclipse.debug.examples.ui/plugin.xml b/org.eclipse.debug.examples.ui/plugin.xml deleted file mode 100644 index 8129e2156..000000000 --- a/org.eclipse.debug.examples.ui/plugin.xml +++ /dev/null @@ -1,458 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ---> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java deleted file mode 100644 index 31d375ab8..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java +++ /dev/null @@ -1,39 +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.examples.ui.midi.adapters; - -import javax.sound.midi.MidiEvent; -import javax.sound.midi.Track; - -import org.eclipse.debug.examples.ui.pda.views.CheckboxView; -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; - -public class CheckboxModelProxyFactory implements IModelProxyFactory { - private MidiEventModelProxy fMidiEventProxy = new MidiEventModelProxy(); - - /* (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) { - if (CheckboxView.ID.equals(context.getId())) { - if (element instanceof Track) { - return new TrackModelProxy((Track) element); - } else if (element instanceof MidiEvent) { - return fMidiEventProxy; - } - } - - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java deleted file mode 100644 index 100f20e5a..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java +++ /dev/null @@ -1,67 +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.examples.ui.midi.adapters; - -import org.eclipse.debug.examples.core.midi.launcher.SequencerControl; -import org.eclipse.jface.viewers.ICellModifier; - -/** - * A cell modifier for a sequencer control. Provides current - * values of controls and updates control values in the sequencer - * as they are changed in the UI. - * - * @since 1.0 - */ -public class ControlCellModifier 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 (SequencerColumnPresentation.COL_VALUE.equals(property)) { - if (element instanceof SequencerControl) { - return ((SequencerControl) element).isEditable(); - } - } - 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 (SequencerColumnPresentation.COL_VALUE.equals(property)) { - if (element instanceof SequencerControl) { - SequencerControl control = (SequencerControl) element; - return control.getValue(); - } - } - 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 (SequencerColumnPresentation.COL_VALUE.equals(property)) { - if (element instanceof SequencerControl) { - if (value instanceof String) { - SequencerControl control = (SequencerControl) element; - control.setValue((String) value); - } - } - } - } - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEditor.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEditor.java deleted file mode 100644 index ecb05ae8b..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEditor.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.examples.ui.midi.adapters; - -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; - -/** - * Provides cell editors and modifiers for sequencer controls. - * - * @since 1.0 - */ -public class ControlEditor 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 ControlCellModifier(); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java deleted file mode 100644 index a09df84d3..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java +++ /dev/null @@ -1,116 +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.examples.ui.midi.adapters; - -import java.util.Timer; -import java.util.TimerTask; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.examples.core.midi.launcher.ClockControl; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -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.update.DebugEventHandler; - -/** - * Listens to events from sequencer controls and fires corresponding - * deltas to update the viewer. - * - * @since 1.0 - */ -public class ControlEventHandler extends DebugEventHandler { - - /** - * Associated launch - */ - private MidiLaunch fLaunch; - - /** - * Timer used to update clock - */ - private Timer fTimer; - - /** - * @param proxy - */ - public ControlEventHandler(SequencerControlsModelProxy proxy) { - super(proxy); - fLaunch = proxy.getMidiLaunch(); - } - - protected void init() { - if (!fLaunch.isSuspended() && !fLaunch.isTerminated() && !fLaunch.isDisconnected()) { - startTimer(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent) - */ - protected boolean handlesEvent(DebugEvent event) { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#dispose() - */ - public synchronized void dispose() { - super.dispose(); - if (fTimer != null) { - fTimer.cancel(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#refreshRoot(org.eclipse.debug.core.DebugEvent) - */ - protected void refreshRoot(DebugEvent event) { - ModelDelta delta = new ModelDelta(fLaunch, IModelDelta.CONTENT); - fireDelta(delta); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handleResume(org.eclipse.debug.core.DebugEvent) - */ - protected void handleResume(DebugEvent event) { - super.handleResume(event); - startTimer(); - } - - /** - * Starts a timer to update the clock - */ - private void startTimer() { - fTimer = new Timer(true); - fTimer.schedule(new TimerTask() { - public void run() { - ModelDelta delta = new ModelDelta(fLaunch, IModelDelta.NO_CHANGE); - delta = delta.addNode(new ClockControl(fLaunch), IModelDelta.STATE | IModelDelta.CONTENT); - fireDelta(delta); - } - }, 0, 100); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handleSuspend(org.eclipse.debug.core.DebugEvent) - */ - protected void handleSuspend(DebugEvent event) { - super.handleSuspend(event); - if (fTimer != null) { - fTimer.cancel(); - fTimer = null; - } - } - - - - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlLabelProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlLabelProvider.java deleted file mode 100644 index f54234bf8..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlLabelProvider.java +++ /dev/null @@ -1,40 +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.examples.ui.midi.adapters; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.examples.core.midi.launcher.SequencerControl; -import org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.jface.viewers.TreePath; - -/** - * Label provider for a sequencer control. - * - * @since 1.0 - */ -public class ControlLabelProvider extends ElementLabelProvider { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String) - */ - protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException { - SequencerControl control = (SequencerControl) elementPath.getLastSegment(); - if (SequencerColumnPresentation.COL_NAME.equals(columnId)) { - return control.getName(); - } - if (SequencerColumnPresentation.COL_VALUE.equals(columnId)) { - return control.getValue(); - } - return ""; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlsMementoProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlsMementoProvider.java deleted file mode 100644 index 6df637fc8..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlsMementoProvider.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.examples.ui.midi.adapters; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -import org.eclipse.debug.examples.core.midi.launcher.TempoControl; -import org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; - -/** - * Provides mementos for sequencer elements. - * - * @since 1.0 - */ -public class ControlsMementoProvider 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 MidiLaunch) { - return "SEQUENCER"; - } - if (element instanceof TempoControl) { - return "TEMPO_CONTROL"; - } - return null; - } - - - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java deleted file mode 100644 index 9ddbf24df..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java +++ /dev/null @@ -1,110 +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 - * Patrick Chuong (Texas Instruments) - Checkbox support for Flexible Hierachy view (Bug 286310) - *******************************************************************************/ -package org.eclipse.debug.examples.ui.midi.adapters; - -import javax.sound.midi.MidiEvent; -import javax.sound.midi.Track; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.debug.core.commands.IStepOverHandler; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -import org.eclipse.debug.examples.core.midi.launcher.SequencerControl; -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; - -/** - * Adapter factory for MIDI elements. - * - * @since 1.0 - */ -public class MidiAdapterFactory implements IAdapterFactory { - - private static IElementContentProvider fgSequencerContentProvider = new SequencerContentProvider(); - private static IElementContentProvider fgTackContentProvider = new TrackContentProvider(); - - private static IElementLabelProvider fgTrackLabelProvider = new TrackLabelProvider(); - private static IElementLabelProvider fgControlLabelProvider = new ControlLabelProvider(); - private static IElementLabelProvider fgMidiEventLabelProvdier = new MidiEventLabelProvider(); - - private static IColumnPresentationFactory fgSequencerColumnFactory = new SequencerColumnFactory(); - private static IColumnPresentationFactory fgTrackColumnFactory = new TrackColumnFactory(); - - private static IModelProxyFactory fgSequencerModelProxyFactory = new SequencerModelProxyFactory(); - - private static IElementMementoProvider fgMementoProvider = new ControlsMementoProvider(); - - private static IStepOverHandler fgStepOverHandler = new MidiStepOverHandler(); - - private static IModelProxyFactory fgCheckboxModelProxyFactory = new CheckboxModelProxyFactory(); - - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (IElementContentProvider.class.equals(adapterType)) { - if (adaptableObject instanceof MidiLaunch) { - return fgSequencerContentProvider; - } - if (adaptableObject instanceof Track) { - return fgTackContentProvider; - } - } - if (IElementLabelProvider.class.equals(adapterType)) { - if (adaptableObject instanceof Track) { - return fgTrackLabelProvider; - } - if (adaptableObject instanceof SequencerControl) { - return fgControlLabelProvider; - } - if (adaptableObject instanceof MidiEvent) { - return fgMidiEventLabelProvdier; - } - } - - if (IColumnPresentationFactory.class.equals(adapterType)) { - if (adaptableObject instanceof MidiLaunch) { - return fgSequencerColumnFactory; - } - if (adaptableObject instanceof Track) { - return fgTrackColumnFactory; - } - } - if (IElementEditor.class.equals(adapterType)) { - if (adaptableObject instanceof SequencerControl) { - return new ControlEditor(); - } - } - - if (IModelProxyFactory.class.equals(adapterType)) { - if (adaptableObject instanceof MidiLaunch) { - return fgSequencerModelProxyFactory; - } else if (adaptableObject instanceof Track) { - return fgCheckboxModelProxyFactory; - } else if (adaptableObject instanceof MidiEvent) { - return fgCheckboxModelProxyFactory; - } - } - if (IElementMementoProvider.class.equals(adapterType)) { - return fgMementoProvider; - } - if (IStepOverHandler.class.equals(adapterType)) { - return fgStepOverHandler; - } - - return null; - } - - public Class[] getAdapterList() { - return new Class[]{IElementContentProvider.class, IElementLabelProvider.class, IStepOverHandler.class,}; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java deleted file mode 100644 index 6ea60ef96..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java +++ /dev/null @@ -1,85 +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 - * Patrick Chuong (Texas Instruments) - Checkbox support for Flexible Hierachy view (Bug 286310) - *******************************************************************************/ -package org.eclipse.debug.examples.ui.midi.adapters; - -import javax.sound.midi.MidiEvent; -import javax.sound.midi.MidiMessage; -import javax.sound.midi.ShortMessage; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.jface.viewers.TreePath; - -/** - * Provides labels for MIDI tracks. - * - * @since 1.0 - */ -public class MidiEventLabelProvider extends ElementLabelProvider { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String) - */ - protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException { - MidiEvent event = (MidiEvent) elementPath.getLastSegment(); - MidiMessage message = event.getMessage(); - if (TrackColumnPresentation.COL_TICK.equals(columnId)) { - return Long.toString(event.getTick()); - } else if (TrackColumnPresentation.COL_BYTES.equals(columnId)) { - byte[] bytes = message.getMessage(); - StringBuffer buffer = new StringBuffer(); - for (int i = 0; i < message.getLength(); i++) { - buffer.append(' '); - appendByte(buffer, bytes[i]); - } - return buffer.toString(); - } else if (TrackColumnPresentation.COL_COMMAND.equals(columnId)) { - if (message instanceof ShortMessage) { - ShortMessage sm = (ShortMessage) message; - StringBuffer buf = new StringBuffer(); - appendByte(buf, (byte)sm.getCommand()); - return buf.toString(); - } - } else if (TrackColumnPresentation.COL_CHANNEL.equals(columnId)) { - if (message instanceof ShortMessage) { - return Integer.toString(((ShortMessage)message).getChannel()); - } - } - return ""; - } - - - /* - * (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getChecked(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext) - */ - public boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException { - Boolean result = (Boolean) MidiEventModelProxy.gChecked.get(path); - return result == null ? false : result.booleanValue(); - } - - /** - * Appends a byte to the buffer with 2 hex characters. - * - * @param buffer - * @param b - */ - private void appendByte(StringBuffer buffer, byte b) { - String hex = Integer.toHexString(b & 0xFF).toUpperCase(); - for (int i = hex.length(); i < 2; i++) { - buffer.append('0'); - } - buffer.append(hex); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventModelProxy.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventModelProxy.java deleted file mode 100644 index b535c3d2d..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventModelProxy.java +++ /dev/null @@ -1,34 +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.examples.ui.midi.adapters; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; -import org.eclipse.jface.viewers.TreePath; - -public class MidiEventModelProxy extends AbstractModelProxy implements ICheckboxModelProxy { - static Map gChecked = new HashMap(); - - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy#setChecked(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.Object, org.eclipse.jface.viewers.TreePath, boolean) - */ - public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) { - System.out.println("TrackCheckListener.setChecked() element = " + path.getLastSegment() + " checked = " + checked); - gChecked.put(path, Boolean.valueOf(checked)); - return true; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiStepOverHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiStepOverHandler.java deleted file mode 100644 index fb2bdaafa..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiStepOverHandler.java +++ /dev/null @@ -1,46 +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.examples.ui.midi.adapters; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.commands.IDebugCommandRequest; -import org.eclipse.debug.core.commands.IEnabledStateRequest; -import org.eclipse.debug.core.commands.IStepOverHandler; - -/** - * Provides an example command handler for the step over action. - * On execute, it simply returns a status that is opened in an - * error dialog. - */ -public class MidiStepOverHandler implements IStepOverHandler { - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandHandler#canExecute(org.eclipse.debug.core.commands.IEnabledStateRequest) - */ - public void canExecute(IEnabledStateRequest request) { - // We could create a job here, schedule it, then return to be asynchronous - request.setEnabled(request.getElements().length > 0); - request.done(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.commands.IDebugCommandHandler#execute(org.eclipse.debug.core.commands.IDebugCommandRequest) - */ - public boolean execute(IDebugCommandRequest request) { - // We could create a job to do this work, schedule it, then return to be asynchronous - // If running asynchronously, remember to return the enablement you want the action to have while this action is run - request.setStatus(new Status(IStatus.WARNING,"org.eclipse.debug.examples.ui","This is an example command handler overriding the default using an adapter on " + request.getElements()[0].getClass().getName())); - request.done(); - return true; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnFactory.java deleted file mode 100644 index 5a9fc55b1..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnFactory.java +++ /dev/null @@ -1,47 +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 - * Patrick Chuong (Texas Instruments) - Checkbox support for Flexible Hierachy view (Bug 286310) - *******************************************************************************/ -package org.eclipse.debug.examples.ui.midi.adapters; - -import org.eclipse.debug.examples.ui.pda.views.CheckboxView; -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; - -/** - * Column presentation factory for a sequencer. - * - * @since 1.0 - */ -public class SequencerColumnFactory implements IColumnPresentationFactory { - - /* (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) { - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) { - return new SequencerColumnPresentation(); - } - 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) { - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) { - return SequencerColumnPresentation.ID; - } - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnPresentation.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnPresentation.java deleted file mode 100644 index 4542f844e..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnPresentation.java +++ /dev/null @@ -1,79 +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.examples.ui.midi.adapters; - -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractColumnPresentation; - -/** - * Columns for sequencer in the variables view. - * - * @since 1.0 - */ -public class SequencerColumnPresentation extends AbstractColumnPresentation { - - /** - * Column identifiers - */ - public static final String COL_NAME = "NAME"; - public static final String COL_VALUE = "VALUE"; - - /** - * All columns - */ - public static final String[] COLUMN_IDS = new String[]{COL_NAME, COL_VALUE}; - - /** - * Column presentation ID. - */ - public static final String ID = "org.eclipse.debug.examples.ui.midi.columnPresentation"; - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getAvailableColumns() - */ - public String[] getAvailableColumns() { - return COLUMN_IDS; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getHeader(java.lang.String) - */ - public String getHeader(String id) { - if (COL_NAME.equals(id)) { - return "Control"; - } - if (COL_VALUE.equals(id)) { - return "Value"; - } - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getId() - */ - public String getId() { - return ID; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getInitialColumns() - */ - public String[] getInitialColumns() { - return COLUMN_IDS; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#isOptional() - */ - public boolean isOptional() { - return false; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java deleted file mode 100644 index 348e854e2..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java +++ /dev/null @@ -1,97 +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.examples.ui.midi.adapters; - -import javax.sound.midi.Sequencer; -import javax.sound.midi.Track; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.examples.core.midi.launcher.ClockControl; -import org.eclipse.debug.examples.core.midi.launcher.LengthControl; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -import org.eclipse.debug.examples.core.midi.launcher.SequencerControl; -import org.eclipse.debug.examples.core.midi.launcher.TempoControl; -import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Provides content for a MIDI sequencer element (MIDI launch). - * - * @since 1.0 - */ -public class SequencerContentProvider extends ElementContentProvider { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) - */ - protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { - return getTracks((MidiLaunch) element).length; - } else if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId())) { - if (((MidiLaunch)element).isTerminated()) { - return 0; - } - return 3; - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) - */ - protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { - return getElements(getTracks((MidiLaunch) parent), index, length); - } else if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId())) { - return getElements(getControls((MidiLaunch) parent), index, length); - } - return EMPTY; - } - - /** - * Returns the controls for this sequencer. - * - * @param launch midi launch - * @return controls - */ - public SequencerControl[] getControls(MidiLaunch launch) { - return new SequencerControl[]{ - new TempoControl(launch), - new ClockControl(launch), - new LengthControl(launch) - }; - } - - /** - * Returns all tracks in the sequence. - * - * @param launch MIDI launch - *@return tracks - */ - public Track[] getTracks(MidiLaunch launch) { - Sequencer sequencer = launch.getSequencer(); - if (sequencer != null && sequencer.isOpen()) { - return sequencer.getSequence().getTracks(); - } - return new Track[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String) - */ - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_DEBUG_VIEW.equals(id) - || IDebugUIConstants.ID_VARIABLE_VIEW.equals(id); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java deleted file mode 100644 index 3faf1c4f0..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java +++ /dev/null @@ -1,96 +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.examples.ui.midi.adapters; - -import javax.sound.midi.Sequencer; - -import org.eclipse.debug.core.DebugEvent; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -import org.eclipse.debug.examples.core.midi.launcher.SequencerControl; -import org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler; -import org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy; -import org.eclipse.jface.viewers.Viewer; - -/** - * Model proxy for a sequencer in the variables view. Listens - * to events from controls to update the viewer when the user - * changes a control's value. - * - * @since 1.0 - */ -public class SequencerControlsModelProxy extends EventHandlerModelProxy { - - /** - * Associated launch - */ - private MidiLaunch fLaunch; - - /** - * Event handler - */ - private ControlEventHandler fHandler; - - /** - * Constructs a model proxy to update based on changes in controls - * for the associated sequencer. - * - * @param launch MIDI launch - */ - public SequencerControlsModelProxy(MidiLaunch launch) { - fLaunch = launch; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer) - */ - public void installed(Viewer viewer) { - super.installed(viewer); - fHandler.init(); - } - - /** - * Returns the launch assocaited with this proxy. - * - * @return MIDI launch - */ - protected MidiLaunch getMidiLaunch() { - return fLaunch; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers() - */ - protected DebugEventHandler[] createEventHandlers() { - fHandler = new ControlEventHandler(this); - return new DebugEventHandler[]{fHandler}; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent) - */ - protected boolean containsEvent(DebugEvent event) { - if (event.getSource() instanceof SequencerControl) { - return ((SequencerControl)event.getSource()).getLaunch().equals(fLaunch); - } - if (event.getSource() instanceof Sequencer) { - return fLaunch.getSequencer().equals(event.getSource()); - } - if (event.getSource().equals(fLaunch)) { - return true; - } - return false; - } - - - - - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerModelProxyFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerModelProxyFactory.java deleted file mode 100644 index 52e48c1e7..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerModelProxyFactory.java +++ /dev/null @@ -1,46 +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.examples.ui.midi.adapters; - -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -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.update.LaunchProxy; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Factory to create a model proxy for sequencer controls in - * the variables view. - * - * @since 1.0 - */ -public class SequencerModelProxyFactory implements IModelProxyFactory { - - /* (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) { - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId())) { - if (element instanceof MidiLaunch) { - return new SequencerControlsModelProxy((MidiLaunch)element); - } - } - if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { - if (element instanceof MidiLaunch) { - return new LaunchProxy((ILaunch)element); - } - } - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnFactory.java deleted file mode 100644 index 66b9063e1..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnFactory.java +++ /dev/null @@ -1,47 +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 - * Patrick Chuong (Texas Instruments) - Checkbox support for Flexible Hierachy view (Bug 286310) - *******************************************************************************/ -package org.eclipse.debug.examples.ui.midi.adapters; - -import org.eclipse.debug.examples.ui.pda.views.CheckboxView; -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; - -/** - * Column presentation factory for a track. - * - * @since 1.0 - */ -public class TrackColumnFactory implements IColumnPresentationFactory { - - /* (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) { - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) { - return new TrackColumnPresentation(); - } - 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) { - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) { - return TrackColumnPresentation.ID; - } - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnPresentation.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnPresentation.java deleted file mode 100644 index 05713db26..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnPresentation.java +++ /dev/null @@ -1,92 +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.examples.ui.midi.adapters; - -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractColumnPresentation; - -/** - * Columns for sequencer in the variables view. - * - * @since 1.0 - */ -public class TrackColumnPresentation extends AbstractColumnPresentation { - - /** - * Column identifiers - */ - public static final String COL_TICK = "TICK"; - public static final String COL_BYTES = "BYTES"; - public static final String COL_COMMAND = "COMMAND"; - public static final String COL_CHANNEL = "CHANNEL"; - - /** - * All columns - */ - public static final String[] COLUMN_IDS = new String[]{COL_TICK, COL_BYTES, COL_COMMAND, COL_CHANNEL}; - - /** - * Initial columns - */ - public static final String[] COLUMN_INITIAL = new String[]{COL_TICK, COL_BYTES}; - - /** - * Column presentation ID. - */ - public static final String ID = "org.eclipse.debug.examples.ui.midi.trackColumns"; - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getAvailableColumns() - */ - public String[] getAvailableColumns() { - return COLUMN_IDS; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getHeader(java.lang.String) - */ - public String getHeader(String id) { - if (COL_TICK.equals(id)) { - return "Tick"; - } - if (COL_BYTES.equals(id)) { - return "Bytes"; - } - if (COL_CHANNEL.equals(id)) { - return "Channel"; - } - if (COL_COMMAND.equals(id)) { - return "Command"; - } - return ""; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getId() - */ - public String getId() { - return ID; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getInitialColumns() - */ - public String[] getInitialColumns() { - return COLUMN_INITIAL; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#isOptional() - */ - public boolean isOptional() { - return false; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackContentProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackContentProvider.java deleted file mode 100644 index 1606038d0..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackContentProvider.java +++ /dev/null @@ -1,65 +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 - * Patrick Chuong (Texas Instruments) - Checkbox support for Flexible Hierachy view (Bug 286310) - *******************************************************************************/ -package org.eclipse.debug.examples.ui.midi.adapters; - -import javax.sound.midi.MidiEvent; -import javax.sound.midi.Track; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.examples.ui.pda.views.CheckboxView; -import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Content provider for track in the variables view. Returns MIDI events - * in the track. - * - * @since 1.0 - */ -public class TrackContentProvider extends ElementContentProvider { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) - */ - protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - Track track = (Track) element; - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId()) ) { - return track.size(); - } - return 0; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) - */ - protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) { - Track track = (Track) parent; - MidiEvent[] events= new MidiEvent[length]; - for (int i = 0; i < length; i++) { - events[i] = track.get(i+index); - } - return events; - } - return EMPTY; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String) - */ - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) || CheckboxView.ID.equals(id); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java deleted file mode 100644 index fa8f891fb..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java +++ /dev/null @@ -1,50 +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.examples.ui.midi.adapters; - -import javax.sound.midi.Track; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunch; -import org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.jface.viewers.TreePath; - -/** - * Provides labels for MIDI tracks. - * - * @since 1.0 - */ -public class TrackLabelProvider extends ElementLabelProvider { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String) - */ - protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException { - Track track = (Track) elementPath.getLastSegment(); - MidiLaunch launch = (MidiLaunch) elementPath.getSegment(0); - Track[] tracks = launch.getSequencer().getSequence().getTracks(); - int i = 0; - for (i = 0; i < tracks.length; i++) { - if (track.equals(tracks[i])) { - break; - } - } - StringBuffer buf = new StringBuffer(); - buf.append("Track "); - buf.append(i); - buf.append(" ["); - buf.append(track.size()); - buf.append(" events]"); - return buf.toString(); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackModelProxy.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackModelProxy.java deleted file mode 100644 index 4fe083c60..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackModelProxy.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 maintenance and enhancements - *****************************************************************/ -package org.eclipse.debug.examples.ui.midi.adapters; - -import javax.sound.midi.Track; - -import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; -import org.eclipse.jface.viewers.Viewer; - -public class TrackModelProxy extends AbstractModelProxy { - protected Track fTrack; - - public TrackModelProxy(Track track) { - fTrack = track; - } - - public void installed(Viewer viewer) { - super.installed(viewer); - - ModelDelta delta = new ModelDelta(fTrack, IModelDelta.NO_CHANGE); - for (int i = 0; i < fTrack.size(); ++i) { - delta.addNode(fTrack.get(i), IModelDelta.INSTALL); - } - - fireModelChanged(delta); - } - - public synchronized void dispose() { - super.dispose(); - MidiEventModelProxy.gChecked.clear(); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ClockSliderDetailPane.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ClockSliderDetailPane.java deleted file mode 100644 index 234618f4a..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ClockSliderDetailPane.java +++ /dev/null @@ -1,111 +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.examples.ui.midi.detailpanes; - -import org.eclipse.debug.examples.core.midi.launcher.ClockControl; -import org.eclipse.debug.ui.IDetailPane; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Slider; -import org.eclipse.ui.IWorkbenchPartSite; - -/** - * A slider to control the clock position. - * - * @since 1.0 - */ -public class ClockSliderDetailPane implements IDetailPane { - - private Slider fSlider; - private ClockControl fControl; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite) - */ - public Control createControl(Composite parent) { - fSlider = new Slider(parent, SWT.HORIZONTAL); - fSlider.setMinimum(0); - fSlider.setMaximum(1000); - fSlider.addSelectionListener(new SelectionAdapter(){ - public void widgetSelected(SelectionEvent e) { - int selection = fSlider.getSelection(); - if (fControl != null) { - fControl.setValue(Integer.toString(selection)); - } - } - }); - return fSlider; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection) - */ - public void display(IStructuredSelection selection) { - fControl = null; - if (selection == null || selection.isEmpty()) { - fSlider.setEnabled(false); - } else { - fSlider.setEnabled(true); - fControl = (ClockControl) selection.getFirstElement(); - int max = (int)fControl.getSequencer().getMicrosecondLength() / 1000000; - long micro = fControl.getSequencer().getMicrosecondPosition(); - int seconds = (int) micro / 1000000; - fSlider.setMaximum(max); - fSlider.setSelection(seconds); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#dispose() - */ - public void dispose() { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#getDescription() - */ - public String getDescription() { - return "Location (seconds)"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#getID() - */ - public String getID() { - return ControlDetailPaneFactory.ID_CLOCK_SLIDER; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#getName() - */ - public String getName() { - return "Clock Slider (seconds)"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite) - */ - public void init(IWorkbenchPartSite partSite) { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#setFocus() - */ - public boolean setFocus() { - fSlider.setFocus(); - return true; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ControlDetailPaneFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ControlDetailPaneFactory.java deleted file mode 100644 index 10353fd57..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ControlDetailPaneFactory.java +++ /dev/null @@ -1,111 +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.examples.ui.midi.detailpanes; - -import java.util.HashSet; -import java.util.Set; - -import org.eclipse.debug.examples.core.midi.launcher.ClockControl; -import org.eclipse.debug.examples.core.midi.launcher.TempoControl; -import org.eclipse.debug.ui.IDetailPane; -import org.eclipse.debug.ui.IDetailPaneFactory; -import org.eclipse.jface.viewers.IStructuredSelection; - -/** - * Creates detail panes for sequencer controls. - * - * @since 1.0 - */ -public class ControlDetailPaneFactory implements IDetailPaneFactory { - - /** - * Identifier for the tempo slider detail pane - */ - public static final String ID_TEMPO_SLIDER = "TEMPO_SLIDER"; - - /** - * Identifier for the clock slider detail pane - */ - public static final String ID_CLOCK_SLIDER = "CLOCK_SLIDER"; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPaneFactory#createDetailPane(java.lang.String) - */ - public IDetailPane createDetailPane(String paneID) { - if (ID_TEMPO_SLIDER.equals(paneID)) { - return new TempoSliderDetailPane(); - } - if (ID_CLOCK_SLIDER.equals(paneID)) { - return new ClockSliderDetailPane(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(org.eclipse.jface.viewers.IStructuredSelection) - */ - public String getDefaultDetailPane(IStructuredSelection selection) { - if (selection.size() == 1) { - Object element = selection.getFirstElement(); - if (element instanceof TempoControl) { - return ID_TEMPO_SLIDER; - } - if (element instanceof ClockControl) { - return ID_CLOCK_SLIDER; - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneDescription(java.lang.String) - */ - public String getDetailPaneDescription(String paneID) { - if (ID_TEMPO_SLIDER.equals(paneID)) { - return "Tempo Slider"; - } - if (ID_CLOCK_SLIDER.equals(paneID)) { - return "Clock Slider"; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneName(java.lang.String) - */ - public String getDetailPaneName(String paneID) { - if (ID_TEMPO_SLIDER.equals(paneID)) { - return "Tempo Slider"; - } - if (ID_CLOCK_SLIDER.equals(paneID)) { - return "Clock Slider"; - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneTypes(org.eclipse.jface.viewers.IStructuredSelection) - */ - public Set getDetailPaneTypes(IStructuredSelection selection) { - Set set = new HashSet(); - if (selection.size() == 1) { - Object element = selection.getFirstElement(); - if (element instanceof TempoControl) { - set.add(ID_TEMPO_SLIDER); - } - if (element instanceof ClockControl) { - set.add(ID_CLOCK_SLIDER); - } - } - return set; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/TempoSliderDetailPane.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/TempoSliderDetailPane.java deleted file mode 100644 index d5e1c7bb7..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/TempoSliderDetailPane.java +++ /dev/null @@ -1,108 +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.examples.ui.midi.detailpanes; - -import org.eclipse.debug.examples.core.midi.launcher.TempoControl; -import org.eclipse.debug.ui.IDetailPane; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Slider; -import org.eclipse.ui.IWorkbenchPartSite; - -/** - * A slider to control tempo. - * - * @since 1.0 - */ -public class TempoSliderDetailPane implements IDetailPane { - - private Slider fSlider; - private TempoControl fControl; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite) - */ - public Control createControl(Composite parent) { - fSlider = new Slider(parent, SWT.HORIZONTAL); - fSlider.setMinimum(20); - fSlider.setMaximum(500); - fSlider.addSelectionListener(new SelectionAdapter(){ - public void widgetSelected(SelectionEvent e) { - int selection = fSlider.getSelection(); - if (fControl != null) { - fControl.setValue(Integer.toString(selection)); - } - } - }); - return fSlider; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection) - */ - public void display(IStructuredSelection selection) { - fControl = null; - if (selection == null || selection.isEmpty()) { - fSlider.setEnabled(false); - } else { - fSlider.setEnabled(true); - fControl = (TempoControl) selection.getFirstElement(); - int bpm = (int)fControl.getSequencer().getTempoInBPM(); - fSlider.setSelection(bpm); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#dispose() - */ - public void dispose() { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#getDescription() - */ - public String getDescription() { - return "Tempo (beats per minute)"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#getID() - */ - public String getID() { - return ControlDetailPaneFactory.ID_TEMPO_SLIDER; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#getName() - */ - public String getName() { - return "Tempo Slider (BPM)"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite) - */ - public void init(IWorkbenchPartSite partSite) { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDetailPane#setFocus() - */ - public boolean setFocus() { - fSlider.setFocus(); - return true; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiLaunchShortcut.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiLaunchShortcut.java deleted file mode 100644 index 3421dd217..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiLaunchShortcut.java +++ /dev/null @@ -1,163 +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 - *******************************************************************************/ -package org.eclipse.debug.examples.ui.midi.launcher; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.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.examples.core.midi.launcher.MidiLaunchDelegate; -import org.eclipse.debug.examples.ui.pda.DebugUIPlugin; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.ILaunchShortcut; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; - -/** - * Launch shortcut for a MIDI file. - * - * @since 1.0 - */ -public class MidiLaunchShortcut implements ILaunchShortcut { - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String) - */ - public void launch(ISelection selection, String mode) { - if (selection instanceof IStructuredSelection) { - IStructuredSelection ss = (IStructuredSelection) selection; - if (ss.size() == 1) { - Object element = ss.getFirstElement(); - if (element instanceof IFile) { - IFile file = (IFile) element; - ILaunchConfiguration configuration = getConfiguration(file); - if (configuration != null) { - DebugUITools.launch(configuration, mode); - } - } - } - } - } - - /** - * Returns a MIDI configuration to use for the given file or - * null to cancel. Creates a new configuration - * if required. - * - * @param file file - * @return associated launch configuration or null - */ - private ILaunchConfiguration getConfiguration(IFile file) { - List candiates = new ArrayList(); - try { - ILaunchConfiguration[] configurations = getLaunchManager().getLaunchConfigurations(getLaunchType()); - for (int i = 0; i < configurations.length; i++) { - ILaunchConfiguration configuration = configurations[i]; - IResource[] resources = configuration.getMappedResources(); - if (resources != null && resources.length == 1 && - resources[0].equals(file)) { - candiates.add(configuration); - } - } - } catch (CoreException e) { - } - if (!candiates.isEmpty()) { - return chooseConfiguration(candiates); - } - return newConfiguration(file); - } - - /** - * Returns the MIDI launch configuration type. - * - * @return the MIDI launch configuration type - */ - private ILaunchConfigurationType getLaunchType() { - ILaunchManager manager = getLaunchManager(); - ILaunchConfigurationType type = manager.getLaunchConfigurationType(MidiLaunchDelegate.ID_MIDI_LAUNCH_CONFIGURATION_TYPE); - return type; - } - - /** - * Returns the launch manager. - * - * @return launch manager - */ - private ILaunchManager getLaunchManager() { - ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager(); - return manager; - } - - /** - * Returns a configuration from the given collection of configurations that should be launched, - * or null to cancel. - * - * @param configList list of configurations to choose from - * @return configuration to launch or null to cancel - */ - private ILaunchConfiguration chooseConfiguration(List configList) { - if (configList.size() == 1) { - return (ILaunchConfiguration) configList.get(0); - } - IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation(); - ElementListSelectionDialog dialog= new ElementListSelectionDialog(DebugUIPlugin.getActiveWorkbenchShell(), labelProvider); - dialog.setElements(configList.toArray()); - dialog.setTitle("Select Configuraiton"); - dialog.setMessage("&Select an existing configuration:"); - dialog.setMultipleSelection(false); - int result = dialog.open(); - labelProvider.dispose(); - if (result == Window.OK) { - return (ILaunchConfiguration) dialog.getFirstResult(); - } - return null; - } - - /** - * Creates and returns a new MIDI launch configuration for the - * given file. - * - * @param file MIDI file - * @return new launch configuration - */ - private ILaunchConfiguration newConfiguration(IFile file) { - ILaunchConfigurationType type = getLaunchType(); - try { - ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, getLaunchManager(). - generateLaunchConfigurationName( - "[" + file.getProject().getName() + "] " + file.getName())); - workingCopy.setAttribute(MidiLaunchDelegate.ATTR_MIDI_FILE, file.getFullPath().toString()); - workingCopy.setMappedResources(new IResource[]{file}); - return workingCopy.doSave(); - } catch (CoreException e) { - e.printStackTrace(); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String) - */ - public void launch(IEditorPart editor, String mode) { - // nothing - currently no editor - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiMainTab.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiMainTab.java deleted file mode 100644 index fca24e5b4..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiMainTab.java +++ /dev/null @@ -1,177 +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.examples.ui.midi.launcher; - - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.examples.core.midi.launcher.MidiLaunchDelegate; -import org.eclipse.debug.examples.ui.pda.DebugUIPlugin; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.jface.window.Window; -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.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.dialogs.ResourceListSelectionDialog; - - -/** - * Tab to specify the MIDI file to play. - * - * @since 1.0 - */ -public class MidiMainTab extends AbstractLaunchConfigurationTab { - - private Text fFileText; - private Button fFileButton; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Font font = parent.getFont(); - - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - GridLayout topLayout = new GridLayout(); - topLayout.verticalSpacing = 0; - topLayout.numColumns = 3; - comp.setLayout(topLayout); - comp.setFont(font); - - createVerticalSpacer(comp, 3); - - Label programLabel = new Label(comp, SWT.NONE); - programLabel.setText("&Midi File:"); - GridData gd = new GridData(GridData.BEGINNING); - programLabel.setLayoutData(gd); - programLabel.setFont(font); - - fFileText = new Text(comp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fFileText.setLayoutData(gd); - fFileText.setFont(font); - fFileText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - fFileButton = createPushButton(comp, "&Browse...", null); //$NON-NLS-1$ - fFileButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - browseMidiFiles(); - } - }); - } - - /** - * Open a resource chooser to select a MIDI file - */ - protected void browseMidiFiles() { - ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE); - dialog.setTitle("MIDI File"); - dialog.setMessage("Select MIDI File"); - if (dialog.open() == Window.OK) { - Object[] files = dialog.getResult(); - IFile file = (IFile) files[0]; - fFileText.setText(file.getFullPath().toString()); - } - - } - /* (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) { - try { - String file = null; - file = configuration.getAttribute(MidiLaunchDelegate.ATTR_MIDI_FILE, (String)null); - if (file != null) { - fFileText.setText(file); - } - } catch (CoreException e) { - setErrorMessage(e.getMessage()); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - String file = fFileText.getText().trim(); - if (file.length() == 0) { - file = null; - } - IResource[] resources = null; - if (file!= null) { - IPath path = new Path(file); - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path); - if (res != null) { - resources = new IResource[]{res}; - } - } - configuration.setAttribute(MidiLaunchDelegate.ATTR_MIDI_FILE, file); - configuration.setMappedResources(resources); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return "Main"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration launchConfig) { - setErrorMessage(null); - setMessage(null); - String text = fFileText.getText(); - if (text.length() > 0) { - IPath path = new Path(text); - if (ResourcesPlugin.getWorkspace().getRoot().findMember(path) == null) { - setErrorMessage("File does not exist"); - return false; - } - } else { - setMessage("Select a MIDI file"); - } - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return DebugUIPlugin.getDefault().getImageRegistry().get(DebugUIPlugin.IMG_OBJ_MIDI); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiTabGroup.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiTabGroup.java deleted file mode 100644 index 52e8b9dbd..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiTabGroup.java +++ /dev/null @@ -1,33 +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.examples.ui.midi.launcher; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; - -/** - * Tab group for a MIDI file. - * - * @since 1.0 - */ -public class MidiTabGroup extends AbstractLaunchConfigurationTabGroup { - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - setTabs(new ILaunchConfigurationTab[] { - new MidiMainTab(), - new CommonTab() - }); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java deleted file mode 100644 index f46234338..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java +++ /dev/null @@ -1,212 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda; - -import java.net.URL; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; -import java.util.Map.Entry; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.RGB; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.internal.util.BundleUtility; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The main plugin class to be used in the desktop. - */ -public class DebugUIPlugin extends AbstractUIPlugin { - //The shared instance. - private static DebugUIPlugin plugin; - //Resource bundle. - private ResourceBundle resourceBundle; - - private final static String ICONS_PATH = "icons/full/";//$NON-NLS-1$ - private final static String PATH_OBJECT = ICONS_PATH + "obj16/"; //Model object icons //$NON-NLS-1$ - private final static String PATH_ELOCALTOOL = ICONS_PATH + "elcl16/"; //Enabled local toolbar icons //$NON-NLS-1$ - private final static String PATH_DLOCALTOOL = ICONS_PATH + "dlcl16/"; //Disabled local toolbar icons //$NON-NLS-1$ - - /** - * Toolbar action to pop data stack - */ - public final static String IMG_ELCL_POP = "IMG_ELCL_POP"; - public final static String IMG_DLCL_POP = "IMG_DLCL_POP"; - - /** - * Toolbar action to push onto data stack - */ - public final static String IMG_ELCL_PUSH = "IMG_ELCL_PUSH"; - public final static String IMG_DLCL_PUSH = "IMG_DLCL_PUSH"; - - /** - * PDA program image - */ - public final static String IMG_OBJ_PDA = "IMB_OBJ_PDA"; - - /** - * MIDI file image - */ - public final static String IMG_OBJ_MIDI = "IMB_OBJ_MIDI"; - - /** - * Keyword color - */ - public final static RGB KEYWORD = new RGB(0,0,255); - public final static RGB LABEL = new RGB(128, 128, 0); - - /** - * Managed colors - */ - private Map fColors = new HashMap(); - - /** - * The constructor. - */ - public DebugUIPlugin() { - super(); - plugin = this; - } - - /** - * This method is called upon plug-in activation - */ - public void start(BundleContext context) throws Exception { - super.start(context); -// Toggles single threaded adapter example -// IAdapterManager adapterManager = Platform.getAdapterManager(); -// IAdapterFactory factory = new AdapterFactory(); -// adapterManager.registerAdapters(factory, PDADebugTarget.class); - } - - /** - * This method is called when the plug-in is stopped - */ - public void stop(BundleContext context) throws Exception { - super.stop(context); - plugin = null; - resourceBundle = null; - Iterator colors = fColors.entrySet().iterator(); - while (colors.hasNext()) { - Map.Entry entry = (Entry) colors.next(); - ((Color)entry.getValue()).dispose(); - } - } - - /** - * Returns the shared instance. - */ - public static DebugUIPlugin getDefault() { - return plugin; - } - - /** - * Returns the string from the plugin's resource bundle, - * or 'key' if not found. - */ - public static String getResourceString(String key) { - ResourceBundle bundle = DebugUIPlugin.getDefault().getResourceBundle(); - try { - return (bundle != null) ? bundle.getString(key) : key; - } catch (MissingResourceException e) { - return key; - } - } - - /** - * Returns the plugin's resource bundle, - */ - public ResourceBundle getResourceBundle() { - try { - if (resourceBundle == null) - resourceBundle = ResourceBundle.getBundle("org.eclipse.debug.examples.ui.pda.DebugUIPluginResources"); - } catch (MissingResourceException x) { - resourceBundle = null; - } - return resourceBundle; - } - - - /* (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry) - */ - protected void initializeImageRegistry(ImageRegistry reg) { - declareImage(IMG_OBJ_PDA, PATH_OBJECT + "pda.gif"); - declareImage(IMG_OBJ_MIDI, PATH_OBJECT + "note.gif"); - declareImage(IMG_ELCL_POP, PATH_ELOCALTOOL + "pop.gif"); - declareImage(IMG_DLCL_POP, PATH_DLOCALTOOL + "pop.gif"); - declareImage(IMG_ELCL_PUSH, PATH_ELOCALTOOL + "push.gif"); - declareImage(IMG_DLCL_PUSH, PATH_DLOCALTOOL + "push.gif"); - } - - /** - * Declares a workbench image given the path of the image file (relative to - * the workbench plug-in). This is a helper method that creates the image - * descriptor and passes it to the main declareImage method. - * - * @param symbolicName the symbolic name of the image - * @param path the path of the image file relative to the base of the workbench - * plug-ins install directory - * false if this is not a shared image - */ - private void declareImage(String key, String path) { - URL url = BundleUtility.find("org.eclipse.debug.examples.ui", path); - ImageDescriptor desc = ImageDescriptor.createFromURL(url); - getImageRegistry().put(key, desc); - } - - /** - * Returns the color described by the given RGB. - * - * @param rgb - * @return color - */ - public Color getColor(RGB rgb) { - Color color = (Color) fColors.get(rgb); - if (color == null) { - color= new Color(Display.getCurrent(), rgb); - fColors.put(rgb, color); - } - return color; - } - - /** - * Returns the active workbench window - * - * @return the active workbench window - */ - public static IWorkbenchWindow getActiveWorkbenchWindow() { - return getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - /** - * Returns the active workbench shell or null if none - * - * @return the active workbench shell or null if none - */ - public static Shell getActiveWorkbenchShell() { - IWorkbenchWindow window = getActiveWorkbenchWindow(); - if (window != null) { - return window.getShell(); - } - return null; - } - - } diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java deleted file mode 100644 index 3e4153fd5..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.adapters; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory; - - -/** - * - * @since 3.2 - * - */ -public class AdapterFactory implements IAdapterFactory { - - private static IElementContentProvider fgTargetAdapter = new PDADebugTargetContentProvider(); - private static IModelProxyFactory fgFactory = new ModelProxyFactory(); - - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (IElementContentProvider.class.equals(adapterType)) { - if (adaptableObject instanceof PDADebugTarget) { - return fgTargetAdapter; - } - } - if (IModelProxyFactory.class.equals(adapterType)) { - if (adaptableObject instanceof PDADebugTarget) { - return fgFactory; - } - } - return null; - } - - public Class[] getAdapterList() { - return new Class[]{IElementContentProvider.class, IModelProxyFactory.class}; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java deleted file mode 100644 index 3375fb088..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.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.examples.ui.pda.adapters; - -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.debug.core.commands.IRestartHandler; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; - -/** - * Adapter factory that provides debug command handler adapters for the - * PDA debugger. - * - * @since 3.6 - */ -public class CommandAdapterFactory implements IAdapterFactory { - - private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand(); - - public Object getAdapter(Object adaptableObject, Class adapterType) { - if (IRestartHandler.class.equals(adapterType)) { - if (adaptableObject instanceof PDADebugTarget) { - return fgRestartHandler; - } - } - return null; - } - - public Class[] getAdapterList() { - return new Class[]{IRestartHandler.class}; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/ModelProxyFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/ModelProxyFactory.java deleted file mode 100644 index a8e5959f1..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/ModelProxyFactory.java +++ /dev/null @@ -1,32 +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.examples.ui.pda.adapters; - -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -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 ModelProxyFactory implements IModelProxyFactory { - - public IModelProxy createModelProxy(Object element, IPresentationContext context) { - if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) { - if (element instanceof PDADebugTarget){ - return new PDADebugTargetProxy((IDebugTarget) element); - } - } - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java deleted file mode 100644 index ed0c069ee..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java +++ /dev/null @@ -1,71 +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) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ - -package org.eclipse.debug.examples.ui.pda.adapters; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.debug.internal.ui.model.elements.ElementContentProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.ui.IDebugUIConstants; - - -public class PDADebugTargetContentProvider extends ElementContentProvider { - - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) - */ - protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - PDAThread thread = ((PDADebugTarget) element).getThread(0); - if (thread != null) { - if (thread.hasStackFrames()) { - return thread.getStackFrames().length; - } - } - return 0; - } - - /* (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 { - PDAThread thread = ((PDADebugTarget) element).getThread(0); - if (thread != null) { - return thread.hasStackFrames(); - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate) - */ - protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException { - if (context.getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) { - PDAThread thread = ((PDADebugTarget) parent).getThread(0); - if (thread != null) { - return getElements(thread.getStackFrames(), index, length); - } - } - return EMPTY; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String) - */ - protected boolean supportsContextId(String id) { - return IDebugUIConstants.ID_DEBUG_VIEW.equals(id); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetProxy.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetProxy.java deleted file mode 100644 index e905e12fe..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetProxy.java +++ /dev/null @@ -1,38 +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.examples.ui.pda.adapters; - -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler; -import org.eclipse.debug.internal.ui.viewers.update.DebugTargetEventHandler; -import org.eclipse.debug.internal.ui.viewers.update.DebugTargetProxy; - -/** - * @since 3.2 - * - */ -public class PDADebugTargetProxy extends DebugTargetProxy { - - /** - * @param target - */ - public PDADebugTargetProxy(IDebugTarget target) { - super(target); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.update.DebugTargetProxy#createEventHandlers() - */ - protected DebugEventHandler[] createEventHandlers() { - return new DebugEventHandler[] { new DebugTargetEventHandler(this), new PDAThreadEventHandler(this) }; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java deleted file mode 100644 index 7bb788b24..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.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.examples.ui.pda.adapters; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.IRequest; -import org.eclipse.debug.core.commands.AbstractDebugCommand; -import org.eclipse.debug.core.commands.IEnabledStateRequest; -import org.eclipse.debug.core.commands.IRestartHandler; -import org.eclipse.debug.core.model.IDebugTarget; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; - -/** - * Restart debug command handler. It restarts the current debug session. - */ -public class PDARestartDebugCommand extends AbstractDebugCommand implements IRestartHandler { - - protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException { - for (int i = 0; i < targets.length; i++) { - ((PDADebugTarget)targets[i]).restart(); - monitor.worked(1); - } - } - - protected Object getTarget(Object element) { - IDebugTarget target = (IDebugTarget)getAdapter(element, IDebugTarget.class); - if (target instanceof PDADebugTarget) { - return target; - } - return null; - } - - protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) - throws CoreException - { - for (int i = 0; i < targets.length; i++) { - if (((PDADebugTarget)targets[i]).isTerminated()) { - return false; - } - monitor.worked(1); - } - return true; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java deleted file mode 100644 index f7bc12359..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java +++ /dev/null @@ -1,147 +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.examples.ui.pda.adapters; - -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.examples.core.pda.model.PDAThread; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; -import org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler; - - -/** - * @since 3.2 - */ -public class PDAThreadEventHandler extends DebugEventHandler { - - private IStackFrame fPrev = null; - - /** - * Constructs and event handler for a threads in the given viewer. - * - * @param viewer - */ - public PDAThreadEventHandler(AbstractModelProxy proxy) { - super(proxy); - } - - protected void handleSuspend(DebugEvent event) { - IThread thread = (IThread) event.getSource(); - int extras = IModelDelta.STATE; - if (event.getDetail() == DebugEvent.BREAKPOINT | event.getDetail() == DebugEvent.CLIENT_REQUEST) { - extras = IModelDelta.EXPAND; - } - fireDeltaUpdatingTopFrame(thread, IModelDelta.NO_CHANGE | extras); - } - - 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 = (IThread) event.getSource(); - fireDeltaAndClearTopFrame(thread, IModelDelta.STATE | IModelDelta.CONTENT); - } - - protected void handleCreate(DebugEvent event) { - fireDeltaAndClearTopFrame((IThread) event.getSource(), IModelDelta.ADDED); - } - - protected void handleTerminate(DebugEvent event) { - fireDeltaAndClearTopFrame((IThread) event.getSource(), IModelDelta.REMOVED); - } - - protected void handleChange(DebugEvent event) { - fireDeltaUpdatingTopFrame((IThread) event.getSource(), IModelDelta.STATE); - } - - protected void handleLateSuspend(DebugEvent suspend, DebugEvent resume) { - IThread thread = (IThread) suspend.getSource(); - fireDeltaUpdatingTopFrame(thread, IModelDelta.CONTENT | IModelDelta.EXPAND); - } - - protected void handleSuspendTimeout(DebugEvent event) { - IThread thread = (IThread) event.getSource(); - fireDeltaAndClearTopFrame(thread, IModelDelta.CONTENT); - } - - private ModelDelta buildRootDelta() { - return new ModelDelta(getLaunchManager(), IModelDelta.NO_CHANGE); - } - - private ILaunchManager getLaunchManager() { - return DebugPlugin.getDefault().getLaunchManager(); - } - - protected ModelDelta addTarget(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 numFrames = -1; - try { - numFrames = thread.getStackFrames().length; - } catch (DebugException e) { - } - return delta.addNode(debugTarget, indexOf(children, debugTarget), IModelDelta.NO_CHANGE, numFrames); - } - - private void fireDeltaAndClearTopFrame(IThread thread, int flags) { - ModelDelta delta = buildRootDelta(); - addTarget(delta, thread); - synchronized (this) { - fPrev = null; - } - fireDelta(delta); - } - - private void fireDeltaUpdatingTopFrame(IThread thread, int flags) { - ModelDelta delta = buildRootDelta(); - ModelDelta node = addTarget(delta, thread); - synchronized (this) { - IStackFrame prev = fPrev; - IStackFrame frame = null; - try { - frame = thread.getTopStackFrame(); - } catch (DebugException e) { - } - if (isEqual(frame, prev)) { - node.setFlags(flags); - } else { - node.setFlags(flags | IModelDelta.CONTENT); - } - if (frame != null) { - node.addNode(frame, 0, IModelDelta.STATE | IModelDelta.SELECT, 0); - } - fPrev = frame; - } - fireDelta(delta); - } - - protected boolean handlesEvent(DebugEvent event) { - return event.getSource() instanceof PDAThread; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java deleted file mode 100644 index 0f2639f7c..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java +++ /dev/null @@ -1,227 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Wind River Systems - added support for IToggleBreakpointsTargetFactory - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.breakpoints; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.ILineBreakpoint; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint; -import org.eclipse.debug.examples.core.pda.breakpoints.PDAWatchpoint; -import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.ITextEditor; - - -/** - * Adapter to create breakpoints in PDA files. - */ -public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension { - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { - ITextEditor textEditor = getEditor(part); - if (textEditor != null) { - IResource resource = (IResource) textEditor.getEditorInput().getAdapter(IResource.class); - ITextSelection textSelection = (ITextSelection) selection; - int lineNumber = textSelection.getStartLine(); - IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugCorePlugin.ID_PDA_DEBUG_MODEL); - for (int i = 0; i < breakpoints.length; i++) { - IBreakpoint breakpoint = breakpoints[i]; - if (breakpoint instanceof ILineBreakpoint && resource.equals(breakpoint.getMarker().getResource())) { - if (((ILineBreakpoint)breakpoint).getLineNumber() == (lineNumber + 1)) { - // remove - breakpoint.delete(); - return; - } - } - } - // create line breakpoint (doc line numbers start at 0) - PDALineBreakpoint lineBreakpoint = new PDALineBreakpoint(resource, lineNumber + 1); - DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(lineBreakpoint); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) { - return getEditor(part) != null; - } - - /** - * Returns the editor being used to edit a PDA file, associated with the - * given part, or null if none. - * - * @param part workbench part - * @return the editor being used to edit a PDA file, associated with the - * given part, or null if none - */ - private ITextEditor getEditor(IWorkbenchPart part) { - if (part instanceof ITextEditor) { - ITextEditor editorPart = (ITextEditor) part; - IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class); - if (resource != null) { - String extension = resource.getFileExtension(); - if (extension != null && extension.equals("pda")) { - return editorPart; - } - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void toggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public boolean canToggleMethodBreakpoints(IWorkbenchPart part, ISelection selection) { - return false; - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException { - String[] variableAndFunctionName = getVariableAndFunctionName(part, selection); - if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) { - ITextEditor editorPart = (ITextEditor)part; - int lineNumber = ((ITextSelection)selection).getStartLine(); - IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class); - String var = variableAndFunctionName[0]; - String fcn = variableAndFunctionName[1]; - toggleWatchpoint(resource, lineNumber, fcn, var, true, true); - } - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) { - return getVariableAndFunctionName(part, selection) != null; - } - - protected void toggleWatchpoint(IResource resource, int lineNumber, String fcn, String var, boolean access, - boolean modification) throws CoreException - { - // look for existing watchpoint to delete - IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(DebugCorePlugin.ID_PDA_DEBUG_MODEL); - for (int i = 0; i < breakpoints.length; i++) { - IBreakpoint breakpoint = breakpoints[i]; - if (breakpoint instanceof PDAWatchpoint && resource.equals(breakpoint.getMarker().getResource())) { - PDAWatchpoint watchpoint = (PDAWatchpoint)breakpoint; - String otherVar = watchpoint.getVariableName(); - String otherFcn = watchpoint.getFunctionName(); - if (otherVar.equals(var) && otherFcn.equals(fcn)) { - breakpoint.delete(); - return; - } - } - } - // create watchpoint - PDAWatchpoint watchpoint = new PDAWatchpoint(resource, lineNumber + 1, fcn, var, access, modification); - DebugPlugin.getDefault().getBreakpointManager().addBreakpoint(watchpoint); - } - - /** - * Returns the variable and function names at the current line, or null if none. - * - * @param part text editor - * @param selection text selection - * @return the variable and function names at the current line, or null if none. - * The array has two elements, the first is the variable name, the second is the function name. - */ - protected String[] getVariableAndFunctionName(IWorkbenchPart part, ISelection selection) { - ITextEditor editor = getEditor(part); - if (editor != null && selection instanceof ITextSelection) { - ITextSelection textSelection = (ITextSelection) selection; - IDocumentProvider documentProvider = editor.getDocumentProvider(); - try { - documentProvider.connect(this); - IDocument document = documentProvider.getDocument(editor.getEditorInput()); - IRegion region = document.getLineInformationOfOffset(textSelection.getOffset()); - String string = document.get(region.getOffset(), region.getLength()).trim(); - if (string.startsWith("var ")) { - String varName = string.substring(4).trim(); - String fcnName = getFunctionName(document, varName, document.getLineOfOffset(textSelection.getOffset())); - return new String[] {varName, fcnName}; - } - } catch (CoreException e) { - } catch (BadLocationException e) { - } finally { - documentProvider.disconnect(this); - } - } - return null; - } - - /** - * Returns the name of the function containing the given variable defined at the given - * line number in the specified document. - * - * @param document PDA source file - * @param varName variable name - * @param line line numbner at which the variable is defined - * @return name of function defining the variable - */ - private String getFunctionName(IDocument document, String varName, int line) { - // This is a simple guess at the function name - look for the labels preceeding - // the variable definition, and then see if there are any 'calls' to that - // label. If none, assumet the variable is in the "_main_" function - String source = document.get(); - int lineIndex = line - 1; - while (lineIndex >= 0) { - try { - IRegion information = document.getLineInformation(lineIndex); - String lineText = document.get(information.getOffset(), information.getLength()); - if (lineText.startsWith(":")) { - String label = lineText.substring(1); - if (source.indexOf("call " + label) >= 0) { - return label; - } - } - lineIndex--; - } catch (BadLocationException e) { - } - } - return "_main_"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#toggleBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { - if (canToggleWatchpoints(part, selection)) { - toggleWatchpoints(part, selection); - } else { - toggleLineBreakpoints(part, selection); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#canToggleBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection) { - return canToggleLineBreakpoints(part, selection) || canToggleWatchpoints(part, selection); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java deleted file mode 100644 index c67200a40..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java +++ /dev/null @@ -1,57 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.breakpoints; - -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.IAdapterFactory; -import org.eclipse.debug.examples.ui.pda.editor.PDAEditor; -import org.eclipse.debug.ui.actions.IRunToLineTarget; -import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; -import org.eclipse.ui.texteditor.ITextEditor; - - -/** - * Creates a toggle breakpoint adapter - */ -public class PDAEditorAdapterFactory 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 (adaptableObject instanceof PDAEditor) { - ITextEditor editorPart = (ITextEditor) adaptableObject; - IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class); - if (resource != null) { - String extension = resource.getFileExtension(); - if (extension != null && extension.equals("pda")) { - if (adapterType.equals(IToggleBreakpointsTarget.class)) { - return new PDABreakpointAdapter(); - } - //#ifdef ex7 -//# // TODO: Exercise 7 - create run to line adapter - //#else - if (adapterType.equals(IRunToLineTarget.class)) { - return new PDARunToLineAdapter(); - } - //#endif - } - } - } - return null; - } - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() - */ - public Class[] getAdapterList() { - return new Class[]{IToggleBreakpointsTarget.class}; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java deleted file mode 100644 index 3d5fa42d0..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java +++ /dev/null @@ -1,76 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.breakpoints; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.NullProgressMonitor; -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.ISuspendResume; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.breakpoints.PDARunToLineBreakpoint; -import org.eclipse.debug.ui.actions.IRunToLineTarget; -import org.eclipse.debug.ui.actions.RunToLineHandler; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.texteditor.ITextEditor; - - -/** - * Run to line target for the Java debugger - */ -public class PDARunToLineAdapter implements IRunToLineTarget { - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IRunToLineTarget#runToLine(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection, org.eclipse.debug.core.model.ISuspendResume) - */ - public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException { - IEditorPart editorPart = (IEditorPart)part; - ITextEditor textEditor = (ITextEditor)editorPart; - ITextSelection textSelection = (ITextSelection) selection; - int lineNumber = textSelection.getStartLine() + 1; - if (lineNumber > 0) { - if (target instanceof IAdaptable) { - IDebugTarget debugTarget = (IDebugTarget) ((IAdaptable)target).getAdapter(IDebugTarget.class); - if (debugTarget != null) { - //#ifdef ex7 -//# // TODO: Exercise 7 - perform the run-to-line with a run-to-line breakpoint and handler - //#else - IFile resource = (IFile) textEditor.getEditorInput().getAdapter(IResource.class); - IBreakpoint breakpoint= new PDARunToLineBreakpoint(resource, lineNumber); - RunToLineHandler handler = new RunToLineHandler(debugTarget, target, breakpoint); - handler.run(new NullProgressMonitor()); - //#endif - } - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IRunToLineTarget#canRunToLine(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection, org.eclipse.debug.core.model.ISuspendResume) - */ - public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) { - //#ifdef ex7 -//# // TODO: Exercise 7 - ensure the target is a PDA target -//# return false; - //#else - return target instanceof IDebugElement && - ((IDebugElement)target).getModelIdentifier().equals(DebugCorePlugin.ID_PDA_DEBUG_MODEL); - //#endif - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java deleted file mode 100644 index 4c51afeb9..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java +++ /dev/null @@ -1,168 +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.examples.ui.pda.breakpoints; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.debug.core.model.ISourceLocator; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAVariable; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.text.ITextSelection; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.progress.WorkbenchJob; -import org.eclipse.ui.texteditor.ITextEditor; - - -/** - * Adapter to create specialized watchpoints in PDA files and the variables views. - */ -public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter { - - final private boolean fAccessModeEnabled; - final private boolean fModificationModeEnabled; - - PDAToggleWatchpointsTarget(boolean access, boolean modification) { - fAccessModeEnabled = access; - fModificationModeEnabled = modification; - } - - public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) { - if (super.canToggleWatchpoints(part, selection)) { - return true; - } else { - if (selection instanceof IStructuredSelection) { - IStructuredSelection ss = (IStructuredSelection)selection; - return ss.getFirstElement() instanceof PDAVariable; - } - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException { - String[] variableAndFunctionName = getVariableAndFunctionName(part, selection); - - if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) { - // Selection inside text editor. Create a watchpoint based on - // current source line. - ITextEditor editorPart = (ITextEditor)part; - int lineNumber = ((ITextSelection)selection).getStartLine(); - IResource resource = (IResource) editorPart.getEditorInput().getAdapter(IResource.class); - String var = variableAndFunctionName[0]; - String fcn = variableAndFunctionName[1]; - toggleWatchpoint(resource, lineNumber, fcn, var, fAccessModeEnabled, fModificationModeEnabled); - } else if (selection instanceof IStructuredSelection && - ((IStructuredSelection)selection).getFirstElement() instanceof PDAVariable ) - { - // Selection is inside a variables view. Create a watchpoint - // using information from the variable. Retrieving information - // from the model requires performing source lookup which should be - // done on a background thread. - final PDAVariable var = (PDAVariable)((IStructuredSelection)selection).getFirstElement(); - final PDAStackFrame frame = var.getStackFrame(); - final Shell shell = part.getSite().getShell(); - - new Job("Toggle PDA Watchpoint") { - { setSystem(true); } - - protected IStatus run(IProgressMonitor monitor) { - try { - IFile file = getResource(var.getStackFrame()); - String varName = var.getName(); - int line = findLine(file, varName); - toggleWatchpoint(file, line, frame.getName(), varName, - fAccessModeEnabled, fModificationModeEnabled); - } catch (final CoreException e) { - // Need to switch back to the UI thread to show the error - // dialog. - new WorkbenchJob(shell.getDisplay(), "Toggle PDA Watchpoint") { - { setSystem(true); } - - public IStatus runInUIThread(IProgressMonitor monitor) { - ErrorDialog.openError(shell, "Failed to create PDA watchpoint", "Failed to create PDA watchpoint.\n", e.getStatus()); - return Status.OK_STATUS; - } - }.schedule(); - } - return Status.OK_STATUS; - } - }.schedule(); - } - } - - private IFile getResource(PDAStackFrame frame) { - ISourceLocator locator = frame.getLaunch().getSourceLocator(); - Object sourceElement = locator.getSourceElement(frame); - if (sourceElement instanceof IFile) { - return (IFile)sourceElement; - } - return null; - } - - private int findLine(IFile file, String var) throws CoreException { - BufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents())); - - int lineNum = 0; - try { - while(true) { - String line = reader.readLine().trim(); - if (line.startsWith("var")) { - String varName = line.substring("var".length()).trim(); - if (varName.equals(var)) { - break; - } - } - lineNum++; - } - } catch (IOException e) { - // end of file reached and line wasn't found - return -1; - } finally { - try { - reader.close(); - } catch (IOException e) {} - } - return lineNum; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#toggleBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException { - if (canToggleWatchpoints(part, selection)) { - toggleWatchpoints(part, selection); - } else { - toggleLineBreakpoints(part, selection); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension#canToggleBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) - */ - public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection) { - return canToggleLineBreakpoints(part, selection) || canToggleWatchpoints(part, selection); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java deleted file mode 100644 index 9c9ebd9cc..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java +++ /dev/null @@ -1,84 +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.examples.ui.pda.breakpoints; - -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.Map; -import java.util.Set; - -import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; -import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetFactory; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.ui.IWorkbenchPart; - -/** - * Toggle breakpoints target factory for creating PDA watchpoints. It allows the - * user the select the type of watchpoint that will be created when the watchpoint - * is toggles inside the editor or variables view. - */ -public class PDAToggleWatchpointsTargetFactory implements IToggleBreakpointsTargetFactory { - - private static final String TOGGLE_WATCHPOINT_TARGET_ACCESS = "org.eclipse.debug.examples.ui.pda.watchpoint_access"; - private static final String TOGGLE_WATCHPOINT_TARGET_MODIFICATION = "org.eclipse.debug.examples.ui.pda.watchpoint_modification"; - private static final String TOGGLE_WATCHPOINT_TARGET_BOTH = "org.eclipse.debug.examples.ui.pda.watchpoint_both"; - - private static Set TOGGLE_WATCHPOINTS_TARGETS = new LinkedHashSet(); - - private Map fToggleWatchpointTargets = new HashMap(3); - - static { - TOGGLE_WATCHPOINTS_TARGETS.add(TOGGLE_WATCHPOINT_TARGET_BOTH); - TOGGLE_WATCHPOINTS_TARGETS.add(TOGGLE_WATCHPOINT_TARGET_ACCESS); - TOGGLE_WATCHPOINTS_TARGETS.add(TOGGLE_WATCHPOINT_TARGET_MODIFICATION); - } - - public IToggleBreakpointsTarget createToggleTarget(String targetID) { - IToggleBreakpointsTarget target = (IToggleBreakpointsTarget)fToggleWatchpointTargets.get(targetID); - if (target == null) { - if (TOGGLE_WATCHPOINT_TARGET_BOTH.equals(targetID)) { - target = new PDAToggleWatchpointsTarget(true, true); - } else if (TOGGLE_WATCHPOINT_TARGET_ACCESS.equals(targetID)) { - target = new PDAToggleWatchpointsTarget(true, false); - } else if (TOGGLE_WATCHPOINT_TARGET_MODIFICATION.equals(targetID)) { - target = new PDAToggleWatchpointsTarget(false, true); - } else { - return null; - } - fToggleWatchpointTargets.put(targetID, target); - } - return target; - } - - public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) { - return TOGGLE_WATCHPOINT_TARGET_BOTH; - } - - public Set getToggleTargets(IWorkbenchPart part, ISelection selection) { - return TOGGLE_WATCHPOINTS_TARGETS; - } - - public String getToggleTargetName(String targetID) { - if (TOGGLE_WATCHPOINT_TARGET_BOTH.equals(targetID)) { - return "Watchpoints (Read/Write)"; - } else if (TOGGLE_WATCHPOINT_TARGET_ACCESS.equals(targetID)) { - return "Watchpoints (Read)"; - } else if (TOGGLE_WATCHPOINT_TARGET_MODIFICATION.equals(targetID)) { - return "Watchpoints (Write)"; - } else { - return null; - } - } - - public String getToggleTargetDescription(String targetID) { - return getToggleTargetName(targetID); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/AnnotationHover.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/AnnotationHover.java deleted file mode 100644 index 6b79056b7..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/AnnotationHover.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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import java.util.Iterator; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.Annotation; -import org.eclipse.jface.text.source.IAnnotationHover; -import org.eclipse.jface.text.source.IAnnotationModel; -import org.eclipse.jface.text.source.ISourceViewer; - -/** - * Returns hover for breakpoints. - */ -public class AnnotationHover implements IAnnotationHover { - - public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) { - IAnnotationModel annotationModel = sourceViewer.getAnnotationModel(); - Iterator iterator = annotationModel.getAnnotationIterator(); - while (iterator.hasNext()) { - Annotation annotation = (Annotation) iterator.next(); - Position position = annotationModel.getPosition(annotation); - try { - int lineOfAnnotation = sourceViewer.getDocument().getLineOfOffset(position.getOffset()); - if (lineNumber == lineOfAnnotation) { - return annotation.getText(); - } - } catch (BadLocationException e) { - } - } - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java deleted file mode 100644 index 5d7089472..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java +++ /dev/null @@ -1,102 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.text.contentassist.CompletionProposal; -import org.eclipse.jface.text.contentassist.ICompletionProposal; -import org.eclipse.jface.text.contentassist.IContentAssistProcessor; -import org.eclipse.jface.text.contentassist.IContextInformation; -import org.eclipse.jface.text.contentassist.IContextInformationValidator; - -public class PDAContentAssistProcessor implements IContentAssistProcessor { - - public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { - int index = offset - 1; - StringBuffer prefix = new StringBuffer(); - IDocument document = viewer.getDocument(); - while (index > 0) { - try { - char prev = document.getChar(index); - if (Character.isWhitespace(prev)) { - break; - } - prefix.insert(0, prev); - index--; - } catch (BadLocationException e) { - } - } - - List proposals = new ArrayList(); - String[] keywords = PDAScanner.fgKeywords; - if (prefix.length() > 0) { - String word = prefix.toString(); - for (int i = 0; i < keywords.length; i++) { - String keyword = keywords[i]; - if (keyword.startsWith(word) && word.length() < keyword.length()) { - proposals.add(new CompletionProposal(keyword + " ", index + 1, offset - (index + 1), keyword.length() + 1)); - } - } - } else { - // propose all keywords - for (int i = 0; i < keywords.length; i++) { - String keyword = keywords[i]; - proposals.add(new CompletionProposal(keyword + " ", offset, 0, keyword.length() + 1)); - } - } - if (!proposals.isEmpty()) { - return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]); - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int) - */ - public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() - */ - public char[] getCompletionProposalAutoActivationCharacters() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters() - */ - public char[] getContextInformationAutoActivationCharacters() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage() - */ - public String getErrorMessage() { - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator() - */ - public IContextInformationValidator getContextInformationValidator() { - return null; - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java deleted file mode 100644 index 01f71928e..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java +++ /dev/null @@ -1,42 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import org.eclipse.jface.text.DefaultInformationControl; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IInformationControl; -import org.eclipse.jface.text.IInformationControlCreator; -import org.eclipse.jface.text.contentassist.ContentAssistant; -import org.eclipse.swt.widgets.Shell; - -public class PDAContentAssistant extends ContentAssistant { - - public PDAContentAssistant() { - super(); - - PDAContentAssistProcessor processor= new PDAContentAssistProcessor(); - setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE); - - enableAutoActivation(false); - enableAutoInsert(false); - - setInformationControlCreator(getInformationControlCreator()); - } - - private IInformationControlCreator getInformationControlCreator() { - return new IInformationControlCreator() { - public IInformationControl createInformationControl(Shell parent) { - return new DefaultInformationControl(parent); - } - }; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java deleted file mode 100644 index 3617cb172..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java +++ /dev/null @@ -1,48 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import java.util.ResourceBundle; - -import org.eclipse.jface.action.IAction; -import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor; -import org.eclipse.ui.texteditor.ContentAssistAction; -import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; - -/** - * PDA editor - */ -public class PDAEditor extends AbstractDecoratedTextEditor { - - /** - * Creates a PDE editor - */ - public PDAEditor() { - super(); - setSourceViewerConfiguration(new PDASourceViewerConfiguration()); - setRulerContextMenuId("pda.editor.rulerMenu"); - setEditorContextMenuId("pda.editor.editorMenu"); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions() - */ - protected void createActions() { - super.createActions(); - ResourceBundle bundle = ResourceBundle.getBundle("org.eclipse.debug.examples.ui.pda.editor.PDAEditorMessages"); //$NON-NLS-1$ - IAction action = new ContentAssistAction(bundle, "ContentAssistProposal.", this); //$NON-NLS-1$ - action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - setAction("ContentAssistProposal", action); //$NON-NLS-1$ - } - - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditorMessages.properties b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditorMessages.properties deleted file mode 100644 index 3215e8892..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditorMessages.properties +++ /dev/null @@ -1,15 +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 -############################################################################### - -ContentAssistProposal.label=Content &Assist -ContentAssistProposal.tooltip=Content Assist -ContentAssistProposal.image= -ContentAssistProposal.description=Content Assist \ No newline at end of file diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.java deleted file mode 100644 index b62d0ba45..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import org.eclipse.debug.examples.ui.pda.DebugUIPlugin; -import org.eclipse.jface.text.TextAttribute; -import org.eclipse.jface.text.rules.BufferedRuleBasedScanner; -import org.eclipse.jface.text.rules.IRule; -import org.eclipse.jface.text.rules.IWordDetector; -import org.eclipse.jface.text.rules.Token; -import org.eclipse.jface.text.rules.WordRule; - - -/** - * PDA editor keyword scanner. - */ -public class PDAScanner extends BufferedRuleBasedScanner { - - /** - * PDA keywods - */ - public static final String[] fgKeywords = new String[] { - "add", "branch_not_zero", "call", "dec", "dup", - "halt", "output", "pop", "push", "return", "var" - }; - - /** - * Detects potential keywords - */ - class PDAWordDetector implements IWordDetector { - - /* (non-Javadoc) - * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char) - */ - public boolean isWordStart(char c) { - return Character.isLetter(c); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char) - */ - public boolean isWordPart(char c) { - return Character.isLetter(c) || c == '_'; - } - } - - /** - * Detects PDA branch labels - */ - class PDALabelDetector extends PDAWordDetector { - - /* (non-Javadoc) - * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char) - */ - public boolean isWordStart(char c) { - return c == ':'; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char) - */ - public boolean isWordPart(char c) { - return super.isWordPart(c) || Character.isDigit(c); - } - } - - /** - * Constructs a scanner that identifies PDA keywords. - */ - public PDAScanner() { - // keywords - Token token = new Token(new TextAttribute(DebugUIPlugin.getDefault().getColor(DebugUIPlugin.KEYWORD))); - WordRule keywords = new WordRule(new PDAWordDetector()); - for (int i = 0; i < fgKeywords.length; i++) { - String keyword = fgKeywords[i]; - keywords.addWord(keyword, token); - } - // labels - token = new Token(new TextAttribute(DebugUIPlugin.getDefault().getColor(DebugUIPlugin.LABEL))); - WordRule labels = new WordRule(new PDALabelDetector(), token); - setRules(new IRule[]{keywords, labels}); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java deleted file mode 100644 index 6c24c36a0..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java +++ /dev/null @@ -1,63 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.contentassist.IContentAssistant; -import org.eclipse.jface.text.presentation.IPresentationReconciler; -import org.eclipse.jface.text.presentation.PresentationReconciler; -import org.eclipse.jface.text.rules.DefaultDamagerRepairer; -import org.eclipse.jface.text.source.IAnnotationHover; -import org.eclipse.jface.text.source.ISourceViewer; -import org.eclipse.ui.editors.text.TextSourceViewerConfiguration; - -/** - * Source view configuration for the PDA editor - */ -public class PDASourceViewerConfiguration extends TextSourceViewerConfiguration { - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getTextHover(org.eclipse.jface.text.source.ISourceViewer, java.lang.String) - */ - public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) { - return new TextHover(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAnnotationHover(org.eclipse.jface.text.source.ISourceViewer) - */ - public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { - return new AnnotationHover(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer) - */ - public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) { - PresentationReconciler reconciler = new PresentationReconciler(); - reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer)); - DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new PDAScanner()); - reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE); - reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE); - return reconciler; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer) - */ - public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) { - return new PDAContentAssistant(); - } - - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PopFrameActionDelegate.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PopFrameActionDelegate.java deleted file mode 100644 index 43e35dc26..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PopFrameActionDelegate.java +++ /dev/null @@ -1,96 +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 - * Bjorn Freeman-Benson - initial API and implementation - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -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; - - -public class PopFrameActionDelegate implements IObjectActionDelegate, IActionDelegate2 { - - private PDAThread fThread = null; - - /* (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) { - //#ifdef ex5 -//# // TODO: Exercise 5 - pop the top frame - //#else - try { - fThread.popFrame(); - } catch (DebugException e) { - } - //#endif - } - - /* (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) { - IStructuredSelection ss = (IStructuredSelection) selection; - Object element = ss.getFirstElement(); - if (element instanceof PDAStackFrame) { - PDAStackFrame frame = (PDAStackFrame) element; - //#ifdef ex5 -//# // TODO: Exercise 5 - enable the action if the frame's thread supports it - //#else - fThread = (PDAThread) frame.getThread(); - try { - action.setEnabled(fThread.canPopFrame() && fThread.getTopStackFrame().equals(frame)); - } catch (DebugException e) { - } - return; - //#endif - } - - } - action.setEnabled(false); - } - - /* (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() { - fThread = 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.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java deleted file mode 100644 index 6b14e4c74..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java +++ /dev/null @@ -1,91 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IThread; -import org.eclipse.debug.core.model.IVariable; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITextHover; -import org.eclipse.jface.text.ITextViewer; - - -/** - * Produces debug hover for the PDA debugger. - */ -public class TextHover implements ITextHover { - - /* (non-Javadoc) - * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion) - */ - public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) { - String varName = null; - try { - varName = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength()); - } catch (BadLocationException e) { - return null; - } - if (varName.startsWith("$") && varName.length() > 1) { - varName = varName.substring(1); - } - - PDAStackFrame frame = null; - IAdaptable debugContext = DebugUITools.getDebugContext(); - if (debugContext instanceof PDAStackFrame) { - frame = (PDAStackFrame) debugContext; - } else if (debugContext instanceof PDAThread) { - PDAThread thread = (PDAThread) debugContext; - try { - frame = (PDAStackFrame) thread.getTopStackFrame(); - } catch (DebugException e) { - return null; - } - } else if (debugContext instanceof PDADebugTarget) { - PDADebugTarget target = (PDADebugTarget) debugContext; - try { - IThread[] threads = target.getThreads(); - if (threads.length > 0) { - frame = (PDAStackFrame) threads[0].getTopStackFrame(); - } - } catch (DebugException e) { - return null; - } - } - if (frame != null) { - try { - IVariable[] variables = frame.getVariables(); - for (int i = 0; i < variables.length; i++) { - IVariable variable = variables[i]; - if (variable.getName().equals(varName)) { - return varName + " = " + variable.getValue().getValueString(); - } - } - } catch (DebugException e) { - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int) - */ - public IRegion getHoverRegion(ITextViewer textViewer, int offset) { - return WordFinder.findWord(textViewer.getDocument(), offset); - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/WordFinder.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/WordFinder.java deleted file mode 100644 index e60d98203..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/WordFinder.java +++ /dev/null @@ -1,79 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.editor; - - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Region; - -/** - * Looks for an identifier in a source file - */ -public class WordFinder { - - /** - * Returns the region in the given document that contains an identifier, or - * null if none. - * - * @param document document to search - * @param offset offset at which to look for an identifier - * @return region containing an identifier, or null - */ - public static IRegion findWord(IDocument document, int offset) { - - int start= -1; - int end= -1; - - - try { - - int pos= offset; - char c; - - while (pos >= 0) { - c= document.getChar(pos); - if (!Character.isJavaIdentifierPart(c)) - break; - --pos; - } - - start= pos; - - pos= offset; - int length= document.getLength(); - - while (pos < length) { - c= document.getChar(pos); - if (!Character.isJavaIdentifierPart(c)) - break; - ++pos; - } - - end= pos; - - } catch (BadLocationException x) { - } - - if (start > -1 && end > -1) { - if (start == offset && end == offset) - return new Region(offset, 0); - else if (start == offset) - return new Region(start, end - start); - else - return new Region(start + 1, end - start - 1); - } - - return null; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java deleted file mode 100644 index 78fc73d48..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java +++ /dev/null @@ -1,77 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.launcher; - -import org.eclipse.core.resources.IFile; -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.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.ILaunchShortcut; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorPart; - - -/** - * Launches a PDA file - */ -public class PDALaunchShortcut implements ILaunchShortcut { - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String) - */ - public void launch(ISelection selection, String mode) { - // must be a structured selection with one file selected - IFile file = (IFile) ((IStructuredSelection)selection).getFirstElement(); - - // check for an existing launch config for the pda file - String path = file.getFullPath().toString(); - ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); - ILaunchConfigurationType type = launchManager.getLaunchConfigurationType(DebugCorePlugin.ID_PDA_LAUNCH_CONFIGURATION_TYPE); - try { - ILaunchConfiguration[] configurations = launchManager.getLaunchConfigurations(type); - for (int i = 0; i < configurations.length; i++) { - ILaunchConfiguration configuration = configurations[i]; - String attribute = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null); - if (path.equals(attribute)) { - DebugUITools.launch(configuration, mode); - return; - } - } - } catch (CoreException e) { - return; - } - - try { - // create a new configuration for the pda file - ILaunchConfigurationWorkingCopy workingCopy = type.newInstance(null, file.getName()); - workingCopy.setAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, path); - workingCopy.setMappedResources(new IResource[]{file}); - ILaunchConfiguration configuration = workingCopy.doSave(); - DebugUITools.launch(configuration, mode); - } catch (CoreException e1) { - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String) - */ - public void launch(IEditorPart editor, String mode) { - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java deleted file mode 100644 index 27b3a2fcc..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java +++ /dev/null @@ -1,196 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.launcher; - - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.ui.pda.DebugUIPlugin; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.jface.window.Window; -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.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.dialogs.ResourceListSelectionDialog; - - -/** - * Tab to specify the PDA program to run/debug. - */ -public class PDAMainTab extends AbstractLaunchConfigurationTab { - - private Text fProgramText; - private Button fProgramButton; - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - Font font = parent.getFont(); - - Composite comp = new Composite(parent, SWT.NONE); - setControl(comp); - GridLayout topLayout = new GridLayout(); - topLayout.verticalSpacing = 0; - topLayout.numColumns = 3; - comp.setLayout(topLayout); - comp.setFont(font); - - createVerticalSpacer(comp, 3); - - Label programLabel = new Label(comp, SWT.NONE); - programLabel.setText("&Program:"); - GridData gd = new GridData(GridData.BEGINNING); - programLabel.setLayoutData(gd); - programLabel.setFont(font); - - fProgramText = new Text(comp, SWT.SINGLE | SWT.BORDER); - gd = new GridData(GridData.FILL_HORIZONTAL); - fProgramText.setLayoutData(gd); - fProgramText.setFont(font); - fProgramText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - fProgramButton = createPushButton(comp, "&Browse...", null); //$NON-NLS-1$ - fProgramButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - browsePDAFiles(); - } - }); - } - - /** - * Open a resource chooser to select a PDA program - */ - protected void browsePDAFiles() { - ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE); - dialog.setTitle("PDA Program"); - dialog.setMessage("Select PDA Program"); - if (dialog.open() == Window.OK) { - Object[] files = dialog.getResult(); - IFile file = (IFile) files[0]; - fProgramText.setText(file.getFullPath().toString()); - } - - } - /* (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) { - //#ifdef ex1 -//# // TODO: Exercise 1 - retrieve the program path attribute from the launch configuration -//# String program = null; -//# if (program != null) { -//# fProgramText.setText(program); -//# } - //#else - try { - String program = null; - program = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null); - if (program != null) { - fProgramText.setText(program); - } - } catch (CoreException e) { - setErrorMessage(e.getMessage()); - } - //#endif - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - String program = fProgramText.getText().trim(); - if (program.length() == 0) { - program = null; - } - //#ifdef ex1 -//# // TODO: Exercise 1 - update the launch configuration with the path to -//# // currently specified program - //#else - configuration.setAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, program); - //#endif - - // perform resource mapping for contextual launch - IResource[] resources = null; - if (program!= null) { - IPath path = new Path(program); - IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(path); - if (res != null) { - resources = new IResource[]{res}; - } - } - configuration.setMappedResources(resources); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return "Main"; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration launchConfig) { - setErrorMessage(null); - setMessage(null); - String text = fProgramText.getText(); - //#ifdef ex1 -//# // TODO: Exercise 1 - validate the currently specified program exists and is not -//# // empty, providing the user with feedback. - //#else - if (text.length() > 0) { - IPath path = new Path(text); - if (ResourcesPlugin.getWorkspace().getRoot().findMember(path) == null) { - setErrorMessage("Specified program does not exist"); - return false; - } - } else { - setMessage("Specify a program"); - } - //#endif - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return DebugUIPlugin.getDefault().getImageRegistry().get(DebugUIPlugin.IMG_OBJ_PDA); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDATabGroup.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDATabGroup.java deleted file mode 100644 index 6f1753c45..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDATabGroup.java +++ /dev/null @@ -1,39 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.launcher; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; - -/** - * Tab group for a PDA application - */ -public class PDATabGroup extends AbstractLaunchConfigurationTabGroup { - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - //#ifdef ex1 -//# // TODO: Exercise 1 - add the PDA main tab, source lookup tab and common -//# // tab to the tab group - //#else - setTabs(new ILaunchConfigurationTab[] { - new PDAMainTab(), - new SourceLookupTab(), - new CommonTab() - }); - //#endif - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java deleted file mode 100644 index 7d5d3ba91..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java +++ /dev/null @@ -1,192 +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 - * Bjorn Freeman-Benson - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.presentation; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IBreakpoint; -import org.eclipse.debug.core.model.ILineBreakpoint; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.examples.core.pda.DebugCorePlugin; -import org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint; -import org.eclipse.debug.examples.core.pda.breakpoints.PDAWatchpoint; -import org.eclipse.debug.examples.core.pda.model.PDADebugTarget; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.debug.ui.IValueDetailListener; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.part.FileEditorInput; - - -/** - * Renders PDA debug elements - */ -public class PDAModelPresentation extends LabelProvider implements IDebugModelPresentation { - /* (non-Javadoc) - * @see org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(java.lang.String, java.lang.Object) - */ - public void setAttribute(String attribute, Object value) { - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) - */ - public String getText(Object element) { - if (element instanceof PDADebugTarget) { - return getTargetText((PDADebugTarget)element); - } else if (element instanceof PDAThread) { - return getThreadText((PDAThread)element); - } else if (element instanceof PDAStackFrame) { - return getStackFrameText((PDAStackFrame)element); - } else if (element instanceof PDAWatchpoint) { - return getWatchpointText((PDAWatchpoint)element); - } - return null; - } - - /** - * Returns a label for the given watchpoint. - * - * @param watchpoint - * @return a label for the given watchpoint - */ - private String getWatchpointText(PDAWatchpoint watchpoint) { - try { - String label = watchpoint.getVariableName() + " (" + watchpoint.getFunctionName() + ")"; - if (watchpoint.isAccess()) { - label += " [read]"; - } - if (watchpoint.isModification()) { - label += " [write]"; - } - return label; - } catch (CoreException e) { - return null; - } - } - /** - * Returns a label for the given debug target - * - * @param target debug target - * @return a label for the given debug target - */ - private String getTargetText(PDADebugTarget target) { - try { - String pgmPath = target.getLaunch().getLaunchConfiguration().getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null); - if (pgmPath != null) { - IPath path = new Path(pgmPath); - String label = ""; - if (target.isTerminated()) { - label = ""; - } - return label + "PDA [" + path.lastSegment() + "]"; - } - } catch (CoreException e) { - } - return "PDA"; - - } - - /** - * Returns a label for the given stack frame - * - * @param frame a stack frame - * @return a label for the given stack frame - */ - private String getStackFrameText(PDAStackFrame frame) { - try { - return frame.getName() + " (line: " + frame.getLineNumber() + ")"; - } catch (DebugException e) { - } - return null; - - } - - /** - * Returns a label for the given thread - * - * @param thread a thread - * @return a label for the given thread - */ - private String getThreadText(PDAThread thread) { - String label = thread.getName(); - if (thread.isStepping()) { - label += " (stepping)"; - } else if (thread.isSuspended()) { - IBreakpoint[] breakpoints = thread.getBreakpoints(); - if (breakpoints.length == 0) { - if (thread.getError() == null) { - label += " (suspended)"; - } else { - label += " (" + thread.getError() + ")"; - } - } else { - IBreakpoint breakpoint = breakpoints[0]; // there can only be one in PDA - if (breakpoint instanceof PDALineBreakpoint) { - PDALineBreakpoint pdaBreakpoint = (PDALineBreakpoint) breakpoint; - if (pdaBreakpoint instanceof PDAWatchpoint) { - try { - PDAWatchpoint watchpoint = (PDAWatchpoint)pdaBreakpoint; - label += " (watchpoint: " + watchpoint.getSuspendType() + " " + watchpoint.getVariableName() + ")"; - } catch (CoreException e) { - } - } else if (pdaBreakpoint.isRunToLineBreakpoint()) { - label += " (run to line)"; - } else { - label += " (suspended at line breakpoint)"; - } - } - } - } else if (thread.isTerminated()) { - label = " " + label; - } - return label; - } - - /* (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) { - String detail = ""; - try { - detail = value.getValueString(); - } catch (DebugException e) { - } - listener.detailComputed(value, detail); - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ISourcePresentation#getEditorInput(java.lang.Object) - */ - public IEditorInput getEditorInput(Object element) { - if (element instanceof IFile) { - return new FileEditorInput((IFile)element); - } - if (element instanceof ILineBreakpoint) { - return new FileEditorInput((IFile)((ILineBreakpoint)element).getMarker().getResource()); - } - return null; - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(org.eclipse.ui.IEditorInput, java.lang.Object) - */ - public String getEditorId(IEditorInput input, Object element) { - if (element instanceof IFile || element instanceof ILineBreakpoint) { - return "pda.editor"; - } - return null; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java deleted file mode 100644 index d9a279f4b..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java +++ /dev/null @@ -1,66 +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.examples.ui.pda.views; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.handlers.HandlerUtil; - -/** - * Base class for command handlers for data stack view. - */ -abstract public class AbstractDataStackViewHandler extends AbstractHandler { - - public Object execute(ExecutionEvent event) throws ExecutionException { - IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); - if (part instanceof DataStackView) { - DataStackView view = (DataStackView)part; - - ISelection selection = DebugUITools.getDebugContextForEventChecked(event); - if (selection instanceof IStructuredSelection) { - Object element = ((IStructuredSelection)selection).getFirstElement(); - - PDAThread thread = null; - if (element instanceof PDAThread) { - thread = (PDAThread)element; - } else if (element instanceof PDAStackFrame) { - thread = (PDAThread)((PDAStackFrame)element).getThread(); - } - - if (element != null) { - doExecute( - view, - thread, - HandlerUtil.getCurrentSelectionChecked(event)); - } - } - } else { - throw new ExecutionException("Handler must be with DataStackView only"); - } - return null; - } - - /** - * Performs the actual handler operation. - * - * @param view The view that the handler was invoked in. - * @param target The current active debug target. - * @param selection The current selection in view. - */ - abstract protected void doExecute(DataStackView view, PDAThread target, ISelection selection) throws ExecutionException; -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java deleted file mode 100644 index 10b5acd31..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java +++ /dev/null @@ -1,46 +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.examples.ui.pda.views; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.debug.examples.core.pda.model.PDADebugElement; -import org.eclipse.debug.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAThread; - -/** - * Property tester for use with standard expressions to determine whether - * the given debug target can perform a push operation. - */ -public class CanPushTester extends PropertyTester { - - private static final String CAN_PUSH_PROPERTY = "canPush"; - - public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { - if (CAN_PUSH_PROPERTY.equals(property)) { - if (receiver instanceof IAdaptable) { - PDADebugElement element = (PDADebugElement) - ((IAdaptable)receiver).getAdapter(PDADebugElement.class); - PDAThread thread = null; - if (element instanceof PDAThread) { - thread = (PDAThread)element; - } else if (element instanceof PDAStackFrame) { - thread = (PDAThread)((PDAStackFrame)element).getThread(); - } - - if (thread != null) { - return thread.canPushData(); - } - } - } - return false; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CheckboxView.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CheckboxView.java deleted file mode 100644 index 13c5cb885..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CheckboxView.java +++ /dev/null @@ -1,31 +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 maintenance and enhancements - *****************************************************************/ -package org.eclipse.debug.examples.ui.pda.views; - -import org.eclipse.debug.internal.ui.views.variables.VariablesView; -import org.eclipse.swt.SWT; - -public class CheckboxView extends VariablesView { - public static String ID = "CHECKBOX_VIEW_ID"; - - protected int getViewerStyle() { - return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.CHECK; - } - - protected String getHelpContextId() { - return ID; - } - - protected String getPresentationContextId() { - return ID; - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java deleted file mode 100644 index 5e040fdbe..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java +++ /dev/null @@ -1,177 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2005, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - * Bjorn Freeman-Benson - initial API and implementation - * Wind River - Pawel Piech - replaced actions with handlers (bug 229219) - * Pawel Piech (Wind River) - ported PDA Virtual Machine to Java (Bug 261400) -******************************************************************************/ -package org.eclipse.debug.examples.ui.pda.views; - -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.examples.core.pda.model.PDAStackFrame; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.debug.ui.AbstractDebugView; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.contexts.DebugContextEvent; -import org.eclipse.debug.ui.contexts.IDebugContextListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.progress.UIJob; - - -/** - * View of the PDA VM data stack - */ -public class DataStackView extends AbstractDebugView implements IDebugContextListener { - - private PDAThread fThread; - - class StackViewContentProvider implements ITreeContentProvider { - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object) - */ - public Object[] getChildren(Object parentElement) { - if (parentElement instanceof PDAThread) { - try { - return ((PDAThread)parentElement).getDataStack(); - } catch (DebugException e) { - } - } - return new Object[0]; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object) - */ - public Object getParent(Object element) { - if (element instanceof PDAThread) { - return null; - } else { - return fThread; - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object) - */ - public boolean hasChildren(Object element) { - return element instanceof PDAThread; - } - - /* (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() { - } - - /* (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.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite) - */ - protected Viewer createViewer(Composite parent) { - TreeViewer viewer = new TreeViewer(parent); - viewer.setLabelProvider(DebugUITools.newDebugModelPresentation()); - viewer.setContentProvider(new StackViewContentProvider()); - DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).addDebugContextListener(this); - getSite().setSelectionProvider(viewer); - return viewer; - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#createActions() - */ - protected void createActions() { - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId() - */ - protected String getHelpContextId() { - return null; - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager) - */ - protected void fillContextMenu(IMenuManager menu) { - menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager) - */ - protected void configureToolBar(IToolBarManager tbm) { - } - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPart#dispose() - */ - public void dispose() { - DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).removeDebugContextListener(this); - super.dispose(); - } - - public void debugContextChanged(final DebugContextEvent event) { - new UIJob(getSite().getShell().getDisplay(), "DataStackView update") { - { - setSystem(true); - } - - public IStatus runInUIThread(IProgressMonitor monitor) { - if (getViewer() != null) { // runs asynchronously, view may be disposed - update(event.getContext()); - } - return Status.OK_STATUS; - } - }.schedule(); - } - - /** - * Updates the view for the selected thread (if suspended) - */ - private void update(ISelection context) { - fThread = null; - - if (context instanceof IStructuredSelection) { - Object element = ((IStructuredSelection)context).getFirstElement(); - if (element instanceof PDAThread) { - fThread = (PDAThread)element; - } else if (element instanceof PDAStackFrame) { - fThread = (PDAThread)((PDAStackFrame)element).getThread(); - } - } - Object input = null; - if (fThread != null && fThread.isSuspended()) { - input = fThread; - } - getViewer().setInput(input); - getViewer().refresh(); - } -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java deleted file mode 100644 index 1c0c5bc72..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java +++ /dev/null @@ -1,60 +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.examples.ui.pda.views; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.core.model.IValue; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; - -/** - * Pops a selected value off the data stack. The selection does not have to be - * the top element on the stack. - */ -public class PopHandler extends AbstractDataStackViewHandler { - - protected void doExecute(DataStackView view, PDAThread thread, ISelection selection) throws ExecutionException { - TreeViewer viewer = (TreeViewer)view.getViewer(); - Object popee = selection instanceof IStructuredSelection - ? ((IStructuredSelection)selection).getFirstElement() : null; - if (popee != null) { - try { - IValue[] stack = thread.getDataStack(); - List restore = new ArrayList(); - for (int i = 0; i < stack.length; i++) { - Object value = stack[i]; - if (popee.equals(value)) { - // pop & stop - thread.popData(); - break; - } else { - // remember value to push back on - restore.add(thread.popData()); - } - } - while (!restore.isEmpty()) { - IValue value = (IValue) restore.remove(restore.size() - 1); - thread.pushData(value.getValueString()); - } - } catch (DebugException e) { - throw new ExecutionException("Failed to execute push command", e); - } - viewer.refresh(); - } - } - -} diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java deleted file mode 100644 index 58fbc7c0e..000000000 --- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java +++ /dev/null @@ -1,37 +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.examples.ui.pda.views; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.core.DebugException; -import org.eclipse.debug.examples.core.pda.model.PDAThread; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.window.Window; - -/** - * Pushes a value onto the data stack. - */ -public class PushHandler extends AbstractDataStackViewHandler { - - protected void doExecute(DataStackView view, PDAThread thread, ISelection selection) throws ExecutionException { - InputDialog dialog = new InputDialog(view.getSite().getShell(), "Specify Value", "Enter value to push", null, null); - if (dialog.open() == Window.OK) { - try { - thread.pushData(dialog.getValue()); - } catch (DebugException e) { - throw new ExecutionException("Failed to execute push command", e); - } - } - view.getViewer().refresh(); - } - -} diff --git a/org.eclipse.debug.tests/.classpath b/org.eclipse.debug.tests/.classpath deleted file mode 100644 index 2fbb7a23e..000000000 --- a/org.eclipse.debug.tests/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.debug.tests/.cvsignore b/org.eclipse.debug.tests/.cvsignore deleted file mode 100644 index c5e82d745..000000000 --- a/org.eclipse.debug.tests/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin \ No newline at end of file diff --git a/org.eclipse.debug.tests/.project b/org.eclipse.debug.tests/.project deleted file mode 100644 index a6fb25e05..000000000 --- a/org.eclipse.debug.tests/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.eclipse.debug.tests - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index f0000fbc4..000000000 --- a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,98 +0,0 @@ -#Thu Sep 24 11:03:22 CDT 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=disabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled -org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH -org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.debug.tests/META-INF/MANIFEST.MF b/org.eclipse.debug.tests/META-INF/MANIFEST.MF deleted file mode 100644 index f707a7142..000000000 --- a/org.eclipse.debug.tests/META-INF/MANIFEST.MF +++ /dev/null @@ -1,15 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.debug.tests;singleton:=true -Bundle-Version: 3.6.1.qualifier -Bundle-Activator: org.eclipse.debug.tests.TestsPlugin -Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", - org.eclipse.debug.ui;bundle-version="[3.6.0,4.0.0)", - org.junit;bundle-version="3.8.2", - org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)", - org.eclipse.test.performance;bundle-version="3.6.0" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.4 -Bundle-Vendor: %providerName diff --git a/org.eclipse.debug.tests/about.html b/org.eclipse.debug.tests/about.html deleted file mode 100644 index 81aacb112..000000000 --- a/org.eclipse.debug.tests/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

                              About This Content

                              - -

                              September 11, 2009

                              -

                              License

                              - -

                              The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

                              - -

                              If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

                              - - - \ No newline at end of file diff --git a/org.eclipse.debug.tests/build.properties b/org.eclipse.debug.tests/build.properties deleted file mode 100644 index 6b24bcb7e..000000000 --- a/org.eclipse.debug.tests/build.properties +++ /dev/null @@ -1,19 +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 -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - test.xml,\ - about.html,\ - plugin.properties,\ - plugin.xml,\ - test-import/ diff --git a/org.eclipse.debug.tests/plugin.properties b/org.eclipse.debug.tests/plugin.properties deleted file mode 100755 index 0f638c66d..000000000 --- a/org.eclipse.debug.tests/plugin.properties +++ /dev/null @@ -1,13 +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 implementation -############################################################################### - -pluginName=Debug Test Plugin -providerName=Eclipse.org diff --git a/org.eclipse.debug.tests/plugin.xml b/org.eclipse.debug.tests/plugin.xml deleted file mode 100644 index 75673ba84..000000000 --- a/org.eclipse.debug.tests/plugin.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AbstractLaunchTest.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AbstractLaunchTest.java deleted file mode 100644 index d3b649354..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AbstractLaunchTest.java +++ /dev/null @@ -1,77 +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.eclipe.debug.tests.launching; - -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.core.ILaunchManager; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager; - -import junit.framework.TestCase; - -/** - * Common function for launch related tests. - */ -public abstract class AbstractLaunchTest extends TestCase { - - /** - * Constructs a test with the given name. - * - * @param name - */ - public AbstractLaunchTest(String name) { - super(name); - } - - /** - * Returns the launch manager. - * - * @return launch manager - */ - protected ILaunchManager getLaunchManager() { - return DebugPlugin.getDefault().getLaunchManager(); - } - - /** - * Returns the singleton instance of the LaunchConfigurationManager - * - * @return the singleton instance of the LaunchConfigurationManager - */ - protected LaunchConfigurationManager getLaunchConfigurationManager() { - return DebugUIPlugin.getDefault().getLaunchConfigurationManager(); - } - - /** - * Returns a launch configuration with the given name, creating one if required. - * - * @param name configuration name - * @return launch configuration - * @throws CoreException - */ - protected ILaunchConfiguration getLaunchConfiguration(String name) throws CoreException { - ILaunchManager manager = getLaunchManager(); - ILaunchConfiguration[] configurations = manager.getLaunchConfigurations(); - for (int i = 0; i < configurations.length; i++) { - ILaunchConfiguration config = configurations[i]; - if (config.getName().equals(name)) { - return config; - } - } - ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(LaunchConfigurationTests.ID_TEST_LAUNCH_TYPE); - ILaunchConfigurationWorkingCopy wc = type.newInstance(null, name); - ILaunchConfiguration saved = wc.doSave(); - return saved; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AcceleratorSubstitutionTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AcceleratorSubstitutionTests.java deleted file mode 100644 index ddf76214e..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/AcceleratorSubstitutionTests.java +++ /dev/null @@ -1,59 +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.eclipe.debug.tests.launching; - -import junit.framework.TestCase; - -import org.eclipse.debug.internal.ui.DebugUIPlugin; - -/** - * Tests accelerator adjustments for DBCS languages. - * See bug 186921. - * - * @since 3.3 - */ -public class AcceleratorSubstitutionTests extends TestCase { - - /** - * Constructor - * @param name the name of the test - */ - public AcceleratorSubstitutionTests(String name) { - super(name); - } - - /** - * tests a string with "..." - */ - public void testWithEllipses() { - assertEquals("incorrect DBCS accelerator substitution", - "Open Run Dialog(&R)...", - DebugUIPlugin.adjustDBCSAccelerator("Open Run(&R) Dialog...")); - } - - /** - * tests a string without "..." - */ - public void testWithoutEllipses() { - assertEquals("incorrect DBCS accelerator substitution", - "Open Run Dialog(&R)", - DebugUIPlugin.adjustDBCSAccelerator("Open Run(&R) Dialog")); - } - - /** - * tests a string that should not change (no DBCS style accelerator). - */ - public void testWithoutDBCSAcclerator() { - assertEquals("incorrect DBCS accelerator substitution", - "Open &Run Dialog...", - DebugUIPlugin.adjustDBCSAccelerator("Open &Run Dialog...")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java deleted file mode 100644 index dfcab8ff6..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java +++ /dev/null @@ -1,205 +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 - *******************************************************************************/ -package org.eclipe.debug.tests.launching; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileInfo; -import org.eclipse.core.filesystem.IFileStore; -import org.eclipse.core.filesystem.provider.FileInfo; -import org.eclipse.core.filesystem.provider.FileStore; -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; - -/** - * Implementation of an in memory file store to test launch configurations on EFS - */ -public class DebugFileStore extends FileStore { - - /** - * Output steam for writing a file - */ - class DebugOutputStream extends ByteArrayOutputStream { - - /* (non-Javadoc) - * @see java.io.ByteArrayOutputStream#close() - */ - public void close() throws IOException { - super.close(); - DebugFileSystem.getDefault().setContents(toURI(), toByteArray()); - } - - } - - private URI uri; - - public DebugFileStore(URI id) { - uri = id; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#childNames(int, org.eclipse.core.runtime.IProgressMonitor) - */ - public String[] childNames(int options, IProgressMonitor monitor) throws CoreException { - URI[] uris = DebugFileSystem.getDefault().getFileURIs(); - List children = new ArrayList(); - IPath me = getPath(); - for (int i = 0; i < uris.length; i++) { - URI id = uris[i]; - Path path = new Path(id.getPath()); - if (path.segmentCount() > 0) { - if (path.removeLastSegments(1).equals(me)) { - children.add(path.lastSegment()); - } - } - } - return (String[]) children.toArray(new String[children.size()]); - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#fetchInfo(int, org.eclipse.core.runtime.IProgressMonitor) - */ - public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException { - byte[] contents = DebugFileSystem.getDefault().getContents(toURI()); - FileInfo info = new FileInfo(); - info.setName(getName()); - info.setAttribute(EFS.ATTRIBUTE_READ_ONLY, false); - if (contents == null) { - info.setExists(false); - info.setLength(0L); - } else { - info.setExists(true); - info.setLength(contents.length); - info.setDirectory(contents == DebugFileSystem.DIRECTORY_BYTES); - if (info.isDirectory()) { - info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true); - } - } - return info; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#getChild(java.lang.String) - */ - public IFileStore getChild(String name) { - try { - return new DebugFileStore(new URI(getFileSystem().getScheme(), getPath().append(name).toString(), null)); - } catch (URISyntaxException e) { - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#getName() - */ - public String getName() { - IPath path = getPath(); - if (path.segmentCount() > 0) { - return path.lastSegment(); - } - return ""; - } - - /** - * @return - */ - private IPath getPath() { - URI me = toURI(); - IPath path = new Path(me.getPath()); - return path; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#getParent() - */ - public IFileStore getParent() { - IPath path = getPath(); - if (path.segmentCount() > 0) { - try { - return new DebugFileStore(new URI(getFileSystem().getScheme(), path.removeLastSegments(1).toString(), null)); - } catch (URISyntaxException e) { - } - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor) - */ - public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException { - byte[] contents = DebugFileSystem.getDefault().getContents(toURI()); - if (contents != null) { - return new ByteArrayInputStream(contents); - } - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jdt.debug.tests", - "File does not exist: " + toURI())); - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#openOutputStream(int, org.eclipse.core.runtime.IProgressMonitor) - */ - public OutputStream openOutputStream(int options, IProgressMonitor monitor) throws CoreException { - return new DebugOutputStream(); - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#mkdir(int, org.eclipse.core.runtime.IProgressMonitor) - */ - public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException { - IFileInfo info = fetchInfo(); - if (info.exists()) { - if (!info.isDirectory()) { - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jdt.debug.tests", - "mkdir failed - file already exists with name: " + toURI())); - } - } else { - IFileStore parent = getParent(); - if (parent.fetchInfo().exists()) { - DebugFileSystem.getDefault().setContents(toURI(), DebugFileSystem.DIRECTORY_BYTES); - } else { - if ((options & EFS.SHALLOW) > 0) { - throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jdt.debug.tests", - "mkdir failed - parent does not exist: " + toURI())); - } else { - parent.mkdir(EFS.NONE, null); - } - } - } - return this; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#toURI() - */ - public URI toURI() { - return uri; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileStore#delete(int, org.eclipse.core.runtime.IProgressMonitor) - */ - public void delete(int options, IProgressMonitor monitor) throws CoreException { - DebugFileSystem.getDefault().delete(toURI()); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileSystem.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileSystem.java deleted file mode 100644 index d0a7183e4..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileSystem.java +++ /dev/null @@ -1,118 +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 - *******************************************************************************/ -package org.eclipe.debug.tests.launching; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.filesystem.IFileStore; -import org.eclipse.core.filesystem.provider.FileSystem; -import org.eclipse.core.runtime.Path; - -/** - * A simple in memory file system to test launch configurations in EFS - */ -public class DebugFileSystem extends FileSystem { - - /** - * represents a directory - */ - public static final byte[] DIRECTORY_BYTES = new byte[] {1, 2, 3, 4}; - - private static DebugFileSystem system; - - /** - * Keys URIs to file stores for existing files - */ - private Map files = new HashMap(); - - /** - * Constructs the singleton - */ - public DebugFileSystem() { - system = this; - // create root of the file system - try { - setContents(new URI("debug", Path.ROOT.toString(), null), DIRECTORY_BYTES); - } catch (URISyntaxException e) {} - } - - /** - * Returns the Debug files system. - * - * @return file system - */ - static DebugFileSystem getDefault() { - return system; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileSystem#getStore(java.net.URI) - */ - public IFileStore getStore(URI uri) { - return new DebugFileStore(uri); - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileSystem#canDelete() - */ - public boolean canDelete() { - return true; - } - - /* (non-Javadoc) - * @see org.eclipse.core.filesystem.provider.FileSystem#canWrite() - */ - public boolean canWrite() { - return true; - } - - /** - * Returns whether contents of the file or null if none. - * - * @param uri - * @return bytes or null - */ - public byte[] getContents(URI uri) { - return (byte[]) files.get(uri); - } - - /** - * Deletes the file. - * - * @param uri - */ - public void delete(URI uri) { - files.remove(uri); - } - - /** - * Sets the content of the given file. - * - * @param uri - * @param bytes - */ - public void setContents(URI uri, byte[] bytes) { - files.put(uri, bytes); - } - - /** - * Returns URIs of all existing files. - * - * @return - */ - public URI[] getFileURIs() { - return (URI[])files.keySet().toArray(new URI[files.size()]); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchConfigurationTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchConfigurationTests.java deleted file mode 100644 index 6219f340b..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchConfigurationTests.java +++ /dev/null @@ -1,1357 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipe.debug.tests.launching; - -import java.io.File; -import java.io.FileFilter; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.CodingErrorAction; -import java.nio.charset.IllegalCharsetNameException; -import java.nio.charset.UnsupportedCharsetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.filesystem.EFS; -import org.eclipse.core.filesystem.IFileSystem; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.Path; -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.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.internal.core.LaunchManager; -import org.eclipse.debug.tests.TestsPlugin; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; - -/** - * Tests for launch configurations - */ -public class LaunchConfigurationTests extends AbstractLaunchTest implements ILaunchConfigurationListener { - - /** - * Identifier of test launch configuration type extension - */ - public static final String ID_TEST_LAUNCH_TYPE = "org.eclipse.debug.tests.launch.type"; - - /** - * The from/to handles during rename operations - */ - protected ILaunchConfiguration fFrom; - protected ILaunchConfiguration fTo; - - protected Object fLock = new Object(); - protected ILaunchConfiguration fAdded; - protected ILaunchConfiguration fRemoved; - - class Listener implements ILaunchConfigurationListener { - - private List addedList = new ArrayList(); - private List removedList = new ArrayList(); - private List changedList = new ArrayList(); - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationAdded(ILaunchConfiguration configuration) { - addedList.add(configuration); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationChanged(ILaunchConfiguration configuration) { - changedList.add(configuration); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - removedList.add(configuration); - } - - public List getAdded() { - return addedList; - } - public List getChanged() { - return changedList; - } - public List getRemoved() { - return removedList; - } - - } - - /** - * Returns the given input stream's contents as a character array. - * If a length is specified (i.e. if length != -1), this represents the number of bytes in the stream. - * Note the specified stream is not closed in this method - * @param stream the stream to get convert to the char array - * @return the given input stream's contents as a character array. - * @throws IOException if a problem occurred reading the stream. - */ - public static char[] getInputStreamAsCharArray(InputStream stream) throws IOException { - Charset charset = null; - try { - charset = Charset.forName("UTF-8"); - } catch (IllegalCharsetNameException e) { - System.err.println("Illegal charset name : " + "UTF-8"); //$NON-NLS-1$ - return null; - } catch(UnsupportedCharsetException e) { - System.err.println("Unsupported charset : " + "UTF-8"); //$NON-NLS-1$ - return null; - } - CharsetDecoder charsetDecoder = charset.newDecoder(); - charsetDecoder.onMalformedInput(CodingErrorAction.REPLACE).onUnmappableCharacter(CodingErrorAction.REPLACE); - byte[] contents = getInputStreamAsByteArray(stream, -1); - ByteBuffer byteBuffer = ByteBuffer.allocate(contents.length); - byteBuffer.put(contents); - byteBuffer.flip(); - return charsetDecoder.decode(byteBuffer).array(); - } - - /** - * Returns the given input stream as a byte array - * @param stream the stream to get as a byte array - * @param length the length to read from the stream or -1 for unknown - * @return the given input stream as a byte array - * @throws IOException - */ - public static byte[] getInputStreamAsByteArray(InputStream stream, int length) throws IOException { - byte[] contents; - if (length == -1) { - contents = new byte[0]; - int contentsLength = 0; - int amountRead = -1; - do { - // read at least 8K - int amountRequested = Math.max(stream.available(), 8192); - // resize contents if needed - if (contentsLength + amountRequested > contents.length) { - System.arraycopy(contents, - 0, - contents = new byte[contentsLength + amountRequested], - 0, - contentsLength); - } - // read as many bytes as possible - amountRead = stream.read(contents, contentsLength, amountRequested); - if (amountRead > 0) { - // remember length of contents - contentsLength += amountRead; - } - } while (amountRead != -1); - // resize contents if necessary - if (contentsLength < contents.length) { - System.arraycopy(contents, 0, contents = new byte[contentsLength], 0, contentsLength); - } - } else { - contents = new byte[length]; - int len = 0; - int readSize = 0; - while ((readSize != -1) && (len != length)) { - // See PR 1FMS89U - // We record first the read size. In this case length is the actual - // read size. - len += readSize; - readSize = stream.read(contents, len, length - len); - } - } - return contents; - } - - /** - * Constructor - * @param name - */ - public LaunchConfigurationTests(String name) { - super(name); - } - - /** - * Returns a scratch project for launch configurations - * - * @return - */ - protected IProject getProject() throws CoreException { - return TestsPlugin.createProject("LaunchConfigurationTests"); - } - - /** - * Creates and returns a new launch config the given name, local - * or shared, with 4 attributes: - * - String1 = "String1" - * - Int1 = 1 - * - Boolean1 = true - * - Boolean2 = false - */ - protected ILaunchConfigurationWorkingCopy newConfiguration(IContainer container, String name) throws CoreException { - ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(ID_TEST_LAUNCH_TYPE); - assertTrue("Should support debug mode", type.supportsMode(ILaunchManager.DEBUG_MODE)); //$NON-NLS-1$ - assertTrue("Should support run mode", type.supportsMode(ILaunchManager.RUN_MODE)); //$NON-NLS-1$ - ILaunchConfigurationWorkingCopy wc = type.newInstance(container, name); - wc.setAttribute("String1", "String1"); //$NON-NLS-1$ //$NON-NLS-2$ - wc.setAttribute("Int1", 1); //$NON-NLS-1$ - wc.setAttribute("Boolean1", true); //$NON-NLS-1$ - wc.setAttribute("Boolean2", false); //$NON-NLS-1$ - assertTrue("Should need saving", wc.isDirty()); //$NON-NLS-1$ - return wc; - } - - /** - * Creates and returns a new launch configuration with the given name, local - * or shared, with no attributes - */ - protected ILaunchConfigurationWorkingCopy newEmptyConfiguration(IContainer container, String name) throws CoreException { - ILaunchConfigurationType type = getLaunchManager().getLaunchConfigurationType(ID_TEST_LAUNCH_TYPE); - ILaunchConfigurationWorkingCopy wc = type.newInstance(container, name); - assertEquals("Should have no attributes", 0, wc.getAttributes().size()); - return wc; - } - - /** - * Returns whether the given handle is contained in the specified - * array of handles. - */ - protected boolean existsIn(ILaunchConfiguration[] configs, ILaunchConfiguration config) { - for (int i = 0; i < configs.length; i++) { - if (configs[i].equals(config)) { - return true; - } - } - return false; - } - - /** - * Creates a local working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. - * - * @throws CoreException - */ - public void testCreateLocalConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config1"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertEquals("String1 should be String1", handle.getAttribute("String1", "Missing"), "String1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("Int1 should be 1", handle.getAttribute("Int1", 0), 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$//$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$//$NON-NLS-2$ - - // ensure new handle is the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Creates a local working copy configuration and tests its name. - * - * @throws CoreException - */ - public void testLocalName() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "localName"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertEquals("Wrong name", handle.getName(), "localName"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Creates a shared working copy configuration and tests is name. - */ - public void testSharedName() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "sharedName"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertEquals("Wrong name", handle.getName(), "sharedName"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Ensures that a launch configuration returns a complete attribute map - * @throws CoreException - */ - public void testGetAttributes() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config1"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - Map attributes = handle.getAttributes(); - // retrieve attributes - assertEquals("String1 should be String1", "String1", attributes.get("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - assertEquals("Int1 should be 1", new Integer(1), attributes.get("Int1")); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Boolean1 should be true", Boolean.valueOf(true), attributes.get("Boolean1")); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Boolean2 should be false", Boolean.valueOf(false), attributes.get("Boolean2")); //$NON-NLS-1$ //$NON-NLS-2$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Ensures that set attributes works - * @throws CoreException - */ - public void testSetAttributes() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config1"); //$NON-NLS-1$ - Map map = new HashMap(); - map.put("ATTR1", "ONE"); //$NON-NLS-1$ //$NON-NLS-2$ - map.put("ATTR2", "TWO"); //$NON-NLS-1$ //$NON-NLS-2$ - wc.setAttributes(map); - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - Map attributes = handle.getAttributes(); - assertEquals("should have two attributes", 2, attributes.size()); //$NON-NLS-1$ - // retrieve attributes - assertEquals("ATTR1 should be ONE", "ONE", attributes.get("ATTR1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - assertEquals("ATTR2 should be TWO", "TWO", attributes.get("ATTR2")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Ensures that set attributes to null works - * @throws CoreException - */ - public void testSetNullAttributes() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config1"); //$NON-NLS-1$ - wc.setAttributes(null); - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - Map attributes = handle.getAttributes(); - assertEquals("should have no attributes", 0, attributes.size()); //$NON-NLS-1$ - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Creates a local working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. - * Copy the configuration and ensure the original still exists. - * @throws CoreException - */ - public void testLocalCopy() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "configToCopy"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$ - - ILaunchConfigurationWorkingCopy softCopy = handle.copy("CopyOf" + handle.getName()); //$NON-NLS-1$ - assertNull("Original in copy should be null", softCopy.getOriginal()); //$NON-NLS-1$ - ILaunchConfiguration hardCopy = softCopy.doSave(); - - // retrieve attributes - assertTrue("String1 should be String1", hardCopy.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", hardCopy.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", hardCopy.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !hardCopy.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - assertTrue("Original should still exist", handle.exists()); //$NON-NLS-1$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - hardCopy.delete(); - assertTrue("Config should not exist after deletion", !hardCopy.exists()); //$NON-NLS-1$ - } - - /** - * Create a config and save it twice, ensuring it only - * ends up in the index once. - * @throws CoreException - */ - public void testDoubleSave() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "configDoubleSave"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$ - - String name = wc.getName(); - wc.rename("newName"); //$NON-NLS-1$ - wc.rename(name); - assertTrue("Should be dirty", wc.isDirty()); //$NON-NLS-1$ - wc.doSave(); - - ILaunchConfiguration[] newConfigs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Should be the same number of configs", newConfigs.length == configs.length); //$NON-NLS-1$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - - } - - /** - * Creates a local working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. Deletes - * the configuration and ensures it no longer exists. - * @throws CoreException - */ - public void testDeleteLocalConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config2delete"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - File file = wc.getLocation().toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // delete - handle.delete(); - assertTrue("Config should no longer exist", !handle.exists()); //$NON-NLS-1$ - - // ensure handle is not in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should not exist in project index", !existsIn(configs, handle)); //$NON-NLS-1$ - } - - /** - * Creates a local working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. Renames - * the configuration and ensures it's old config no longer exists, - * and that attributes are retrievable from the new (renamed) config. - * @throws CoreException - */ - public void testRenameLocalConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config2rename"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // rename - wc = handle.getWorkingCopy(); - wc.rename("config-2-rename"); //$NON-NLS-1$ - addConfigListener(); - ILaunchConfiguration newHandle = wc.doSave(); - removeConfigListener(); - assertTrue("Config should no longer exist", !handle.exists()); //$NON-NLS-1$ - assertEquals("From should be original", handle, fFrom); //$NON-NLS-1$ - assertEquals("To should be new handle", newHandle, fTo); //$NON-NLS-1$ - - // retrieve new attributes - assertTrue("String1 should be String1", newHandle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", newHandle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", newHandle.getAttribute("Boolean1", false)); //$NON-NLS-1$//$NON-NLS-2$ - assertTrue("Boolean2 should be false", !newHandle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Renamed configuration should exist in project index", existsIn(configs, newHandle)); //$NON-NLS-1$ - assertTrue("Original configuration should NOT exist in project index", !existsIn(configs, handle)); //$NON-NLS-1$ - - // cleanup - newHandle.delete(); - assertTrue("Config should not exist after deletion", !newHandle.exists()); //$NON-NLS-1$ - } - - /** - * Moves a local configuration to a shared location - * @throws CoreException - */ - public void testMoveLocalToSharedConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config2share"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // move - wc = handle.getWorkingCopy(); - wc.setContainer(getProject()); - addConfigListener(); - ILaunchConfiguration newHandle = wc.doSave(); - removeConfigListener(); - assertTrue("Config should no longer exist", !handle.exists()); //$NON-NLS-1$ - assertEquals("From should be original", handle, fFrom); //$NON-NLS-1$ - assertEquals("To should be new handle", newHandle, fTo); //$NON-NLS-1$ - - // retrieve new attributes - assertTrue("String1 should be String1", newHandle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", newHandle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", newHandle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !newHandle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Renamed configuration should exist in project index", existsIn(configs, newHandle)); //$NON-NLS-1$ - assertTrue("Original configuration should NOT exist in project index", !existsIn(configs, handle)); //$NON-NLS-1$ - - // cleanup - newHandle.delete(); - assertTrue("Config should not exist after deletion", !newHandle.exists()); //$NON-NLS-1$ - } - - /** - * Moves a local configuration to a shared location - * @throws CoreException - */ - public void testMoveSharedToLocalConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "config2local"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // move - wc = handle.getWorkingCopy(); - wc.setContainer(null); - addConfigListener(); - ILaunchConfiguration newHandle = wc.doSave(); - removeConfigListener(); - assertTrue("Config should no longer exist", !handle.exists()); //$NON-NLS-1$ - assertEquals("From should be original", handle, fFrom); //$NON-NLS-1$ - assertEquals("To should be new handle", newHandle, fTo); //$NON-NLS-1$ - - // retrieve new attributes - assertTrue("String1 should be String1", newHandle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", newHandle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", newHandle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !newHandle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Renamed configuration should exist in project index", existsIn(configs, newHandle)); //$NON-NLS-1$ - assertTrue("Original configuration should NOT exist in project index", !existsIn(configs, handle)); //$NON-NLS-1$ - - // cleanup - newHandle.delete(); - assertTrue("Config should not exist after deletion", !newHandle.exists()); //$NON-NLS-1$ - } - - /** - * Creates a shared working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. - * @throws CoreException - */ - public void testCreateSharedConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "config2"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Creates a shared working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. - * Copies the configuration and ensures the original still exists. - * @throws CoreException - */ - public void testSharedCopy() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "config2Copy"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$ - - // copy - ILaunchConfigurationWorkingCopy softCopy = handle.copy("CopyOf" + handle.getName()); //$NON-NLS-1$ - ILaunchConfiguration hardCopy = softCopy.doSave(); - - // retrieve attributes - assertTrue("String1 should be String1", hardCopy.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", hardCopy.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", hardCopy.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !hardCopy.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - assertTrue("Original should still exist", handle.exists()); //$NON-NLS-1$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - hardCopy.delete(); - assertTrue("Config should not exist after deletion", !hardCopy.exists()); //$NON-NLS-1$ - } - - - /** - * Creates a shared working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. Deletes - * the configuration and ensures it no longer exists. - * @throws CoreException - */ - public void testDeleteSharedConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "shared2delete"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // delete - handle.delete(); - assertTrue("Config should no longer exist", !handle.exists()); //$NON-NLS-1$ - - // ensure handle is not in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should not exist in project index", !existsIn(configs, handle)); //$NON-NLS-1$ - } - - /** - * Creates a shared working copy configuration, sets some attributes, - * and saves the working copy, and retrieves the attributes. Renames - * the configuration and ensures it's old config no longer exists, - * and that attributes are retrievable from the new (renamed) config. - * @throws CoreException - */ - public void testRenameSharedConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "shared2rename"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // rename - wc = handle.getWorkingCopy(); - wc.rename("shared-2-rename"); //$NON-NLS-1$ - addConfigListener(); - ILaunchConfiguration newHandle = wc.doSave(); - removeConfigListener(); - assertTrue("Config should no longer exist", !handle.exists()); //$NON-NLS-1$ - assertEquals("From should be original", handle, fFrom); //$NON-NLS-1$ - assertEquals("To should be new handle", newHandle, fTo); //$NON-NLS-1$ - - // retrieve new attributes - assertTrue("String1 should be String1", newHandle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", newHandle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", newHandle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !newHandle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is in the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Renamed configuration should exist in project index", existsIn(configs, newHandle)); //$NON-NLS-1$ - assertTrue("Original configuration should NOT exist in project index", !existsIn(configs, handle)); //$NON-NLS-1$ - - // cleanup - newHandle.delete(); - assertTrue("Config should not exist after deletion", !newHandle.exists()); //$NON-NLS-1$ - } - - /** - * Closes all editors in the active workbench page. - */ - protected void closeAllEditors() { - IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - activeWorkbenchWindow.getActivePage().closeAllEditors(false); - } - - /** - * Creates a few configs, closes the project and re-opens the - * project to ensure the config index is persisted properly - * @throws CoreException - */ - public void testPersistIndex() throws CoreException { - // close all editors before closing project: @see bug 204023 - closeAllEditors(); - - ILaunchConfigurationWorkingCopy wc1 = newConfiguration(null, "persist1local"); //$NON-NLS-1$ - ILaunchConfigurationWorkingCopy wc2 = newConfiguration(getProject(), "persist2shared"); //$NON-NLS-1$ - ILaunchConfiguration lc1 = wc1.doSave(); - ILaunchConfiguration lc2 = wc2.doSave(); - - IProject project = getProject(); - ILaunchConfiguration[] before = getLaunchManager().getLaunchConfigurations(); - assertTrue("config should be in index", existsIn(before, lc1)); //$NON-NLS-1$ - assertTrue("config should be in index", existsIn(before, lc2)); //$NON-NLS-1$ - - project.close(null); - ILaunchConfiguration[] during = getLaunchManager().getLaunchConfigurations(); - boolean local = true; - for (int i = 0; i < during.length; i++) { - // must be local, or not from the closed project - local = local && (during[i].isLocal() || !during[i].getFile().getProject().equals(project)); - } - project.open(null); - assertTrue("Should only be local configs when closed", local); //$NON-NLS-1$ - ILaunchConfiguration[] after = getLaunchManager().getLaunchConfigurations(); - assertTrue("Should be same number of configs after openning", after.length == before.length); //$NON-NLS-1$ - for (int i = 0; i < before.length; i++) { - assertTrue("Config should exist after openning", existsIn(after, before[i])); //$NON-NLS-1$ - } - - // cleanup - lc1.delete(); - assertTrue("Config should not exist after deletion", !lc1.exists()); //$NON-NLS-1$ - lc2.delete(); - assertTrue("Config should not exist after deletion", !lc2.exists()); //$NON-NLS-1$ - - - } - - - /** - * @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void launchConfigurationAdded(ILaunchConfiguration configuration) { - fFrom = getLaunchManager().getMovedFrom(configuration); - synchronized (fLock) { - fAdded = configuration; - fLock.notifyAll(); - } - } - - /** - * @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(ILaunchConfiguration configuration) { - fTo = getLaunchManager().getMovedTo(configuration); - synchronized (fLock) { - fRemoved = configuration; - fLock.notifyAll(); - } - } - - protected void addConfigListener() { - getLaunchManager().addLaunchConfigurationListener(this); - } - - protected void removeConfigListener() { - getLaunchManager().removeLaunchConfigurationListener(this); - } - - /** - * Ensures that a removal notification is sent for a shared config in a project - * that is deleted. - * - * @throws Exception - */ - public void testDeleteProjectWithSharedConfig() throws Exception { - IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("DeleteSharedConfig"); //$NON-NLS-1$ - try { - assertFalse("project should not exist yet", project.exists()); //$NON-NLS-1$ - project.create(null); - assertTrue("project should now exist", project.exists()); //$NON-NLS-1$ - project.open(null); - assertTrue("project should be open", project.isOpen()); //$NON-NLS-1$ - ILaunchConfigurationWorkingCopy wc = newConfiguration(project, "ToBeDeleted"); //$NON-NLS-1$ - - addConfigListener(); - ILaunchConfiguration configuration = wc.doSave(); - assertEquals(configuration, fAdded); - - synchronized (fLock) { - fRemoved = null; - project.delete(true, false, null); - if (fRemoved == null) { - fLock.wait(10000); - } - } - assertEquals(configuration, fRemoved); - } finally { - if (project.exists()) { - project.delete(true, false, null); - } - removeConfigListener(); - } - } - - /** - * Tests a nested working copy. - * - * @throws CoreException - */ - public void testNestedWorkingCopyLocalConfiguration() throws CoreException { - ILaunchConfigurationWorkingCopy wc = newConfiguration(null, "config123"); //$NON-NLS-1$ - IPath location = wc.getLocation(); - ILaunchConfiguration handle = wc.doSave(); - File file = location.toFile(); - assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertEquals("String1 should be String1", handle.getAttribute("String1", "Missing"), "String1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("Int1 should be 1", handle.getAttribute("Int1", 0), 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // ensure new handle is the index - ILaunchConfiguration[] configs = getLaunchManager().getLaunchConfigurations(); - assertTrue("Configuration should exist in project index", existsIn(configs, handle)); //$NON-NLS-1$ - - // get a working copy - wc = handle.getWorkingCopy(); - ILaunchConfigurationWorkingCopy nested = wc.getWorkingCopy(); - - // verify nested is same as original - assertEquals("String1 should be String1", nested.getAttribute("String1", "Missing"), "String1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("Int1 should be 1", nested.getAttribute("Int1", 0), 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", nested.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !nested.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // change an attribute in the nested working copy - nested.setAttribute("String1", "StringOne"); //$NON-NLS-1$ //$NON-NLS-2$ - assertEquals("Wrong attribute value", nested.getAttribute("String1", "Missing"), "StringOne"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("Wrong attribute value", wc.getAttribute("String1", "Missing"), "String1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("Wrong attribute value", handle.getAttribute("String1", "Missing"), "String1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // save back to parent - ILaunchConfigurationWorkingCopy parent = nested.getParent(); - assertEquals("Wrong parent", wc, parent); //$NON-NLS-1$ - assertNull("Should have no parent", wc.getParent()); //$NON-NLS-1$ - nested.doSave(); - assertEquals("Wrong attribute value", wc.getAttribute("String1", "Missing"), "StringOne"); //$NON-NLS-1$ //$NON-NLS-2$//$NON-NLS-3$ //$NON-NLS-4$ - assertEquals("Wrong attribute value", handle.getAttribute("String1", "Missing"), "String1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - - // check originals - assertEquals("Wrong original config" , handle, wc.getOriginal()); //$NON-NLS-1$ - assertEquals("Wrong original config" , handle, nested.getOriginal()); //$NON-NLS-1$ - - // cleanup - handle.delete(); - assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Creates a configuration in an EFS linked folder. Deletes configuration directly. - * - * @throws CoreException - * @throws URISyntaxException - */ - public void testCreateDeleteEFS() throws CoreException, URISyntaxException { - IFileSystem fileSystem = EFS.getFileSystem("debug"); - assertNotNull("Missing debug EFS", fileSystem); - - // create folder in EFS - IFolder folder = getProject().getFolder("efs"); - folder.createLink(new URI("debug", Path.ROOT.toString(), null), 0, null); - - // create configuration - ILaunchConfigurationWorkingCopy wc = newConfiguration(folder, "efsConfig"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // delete configuration - handle.delete(); - assertTrue("Configuration should not exist", !handle.exists()); //$NON-NLS-1$ - - // cleanup - folder.delete(IResource.NONE, null); - } - - /** - * Creates a configuration in an EFS linked folder. Deletes the folder to ensure the - * configuration is also deleted. - * - * @throws CoreException - * @throws URISyntaxException - */ - public void testCreateDeleteEFSLink() throws CoreException, URISyntaxException { - IFileSystem fileSystem = EFS.getFileSystem("debug"); - assertNotNull("Missing debug EFS", fileSystem); - - // create folder in EFS - IFolder folder = getProject().getFolder("efs2"); - folder.createLink(new URI("debug", Path.ROOT.toString(), null), 0, null); - - // create configuration - ILaunchConfigurationWorkingCopy wc = newConfiguration(folder, "efsConfig"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // cleanup - folder.delete(IResource.NONE, null); - assertTrue("Configuration should not exist", !handle.exists()); //$NON-NLS-1$ - } - - /** - * Test that renaming a project with a linked EFS folder containing a shared - * launch configuration is properly updated. - * - * @throws Exception - */ - public void testEFSProjectRename() throws Exception { - // create test project - IProject pro = ResourcesPlugin.getWorkspace().getRoot().getProject("RenameEFS"); - if (pro.exists()) { - pro.delete(true, true, null); - } - // create project - IProject project = TestsPlugin.createProject("RenameEFS"); - - IFileSystem fileSystem = EFS.getFileSystem("debug"); - assertNotNull("Missing debug EFS", fileSystem); - - // create folder in EFS - IFolder folder = project.getFolder("efs2"); - folder.createLink(new URI("debug", Path.ROOT.toString(), null), 0, null); - - // create configuration - ILaunchConfigurationWorkingCopy wc = newConfiguration(folder, "efsConfig"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // rename project - IProjectDescription description = project.getDescription(); - description.setName("SFEemaneR"); // reverse name - project.move(description, false, null); - - // original configuration should no longer exist - handle out of date - assertTrue("Configuration should not exist", !handle.exists()); //$NON-NLS-1$ - - // get the new handle - project = ResourcesPlugin.getWorkspace().getRoot().getProject("SFEemaneR"); - assertTrue("Project should exist", project.exists()); - IFile file = project.getFile(new Path("efs2/efsConfig.launch")); - assertTrue("launch config file should exist", file.exists()); - handle = getLaunchManager().getLaunchConfiguration(file); - assertTrue("launch config should exist", handle.exists()); - - // retrieve attributes - assertTrue("String1 should be String1", handle.getAttribute("String1", "Missing").equals("String1")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ - assertTrue("Int1 should be 1", handle.getAttribute("Int1", 0) == 1); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean1 should be true", handle.getAttribute("Boolean1", false)); //$NON-NLS-1$ //$NON-NLS-2$ - assertTrue("Boolean2 should be false", !handle.getAttribute("Boolean2", true)); //$NON-NLS-1$ //$NON-NLS-2$ - - // validate shared location - assertEquals("Shared location should be updated", file, handle.getFile()); - - // cleanup - project.delete(IResource.NONE, null); - assertTrue("Configuration should not exist", !handle.exists()); //$NON-NLS-1$ - - } - - /** - * Tests launch configuration import. - * - * @throws Exception - */ - public void testImport() throws Exception { - // create a shared configuration "Import4" in the workspace to be overwritten on import - ILaunchConfigurationWorkingCopy wc = newConfiguration(getProject(), "Import4"); //$NON-NLS-1$ - ILaunchConfiguration handle = wc.doSave(); - assertTrue("Configuration should exist", handle.exists()); //$NON-NLS-1$ - - File dir = TestsPlugin.getDefault().getFileInPlugin(new Path("test-import")); - assertTrue("Import directory does not exist", dir.exists()); - LaunchManager manager = (LaunchManager) getLaunchManager(); - - Listener listener = new Listener(); - try { - getLaunchManager().addLaunchConfigurationListener(listener); - // import - manager.importConfigurations(dir.listFiles( - new FileFilter() { - public boolean accept(File file) { - return file.isFile() && - file.getName().endsWith( - ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION); - } - }), - null); - - // should be one removed - List removed = listener.getRemoved(); - assertEquals("Should be one removed config", 1, removed.size()); - assertTrue("Import4 should be removed", removed.contains(handle)); - - // should be 5 added - List added = listener.getAdded(); - assertEquals("Should be 5 added configs", 5, added.size()); - Set names = new HashSet(); - Iterator iterator = added.iterator(); - while (iterator.hasNext()) { - ILaunchConfiguration lc = (ILaunchConfiguration) iterator.next(); - names.add(lc.getName()); - } - assertTrue("Missing Name", names.contains("Import1")); - assertTrue("Missing Name", names.contains("Import2")); - assertTrue("Missing Name", names.contains("Import3")); - assertTrue("Missing Name", names.contains("Import4")); - assertTrue("Missing Name", names.contains("Import5")); - - // should be one changed - List changed = listener.getChanged(); - assertEquals("Should be 1 changed config", 1, changed.size()); - assertEquals("Wrong changed config", "Import4", ((ILaunchConfiguration)changed.get(0)).getName()); - } finally { - manager.removeLaunchConfigurationListener(listener); - } - - } - - /** - * Tests the location of a local working copy. - * - * @throws CoreException - */ - public void testWorkingCopyGetLocation() throws CoreException { - ILaunchConfigurationWorkingCopy workingCopy = newConfiguration(null, "test-get-location"); - IPath location = workingCopy.getLocation(); - assertEquals("Wrong path for local working copy", LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.append("test-get-location.launch"), location); - } - - /** - * Tests that the framework adds time stamps to launch objects. - */ - public void testLaunchTimeStamp() throws CoreException { - ILaunchConfigurationWorkingCopy workingCopy = newConfiguration(null, "test-time-stamp"); - ILaunch launch = workingCopy.launch(ILaunchManager.DEBUG_MODE, null); - try { - String stamp = launch.getAttribute(DebugPlugin.ATTR_LAUNCH_TIMESTAMP); - assertNotNull("missing time stamp", stamp); - Long.parseLong(stamp); // should be a long - will throw NumberFormatException if not - } finally { - if (launch != null) { - getLaunchManager().removeLaunch(launch); - } - } - } - - /** - * Tests that attributes in a nested map are persisted in alphabetical order. - * - * @throws CoreException - */ - public void testMapAttributePersistence() throws CoreException, IOException { - ILaunchConfigurationWorkingCopy c1 = newEmptyConfiguration(getProject(), "testMapAttributes1"); - HashMap map = new HashMap(); - map.put("Z", "z-value"); - map.put("Y", "y-value"); - map.put("X", "x-value"); - map.put("W", "w-value"); - map.put("V", "v-value"); - map.put("U", "u-value"); - map.put("T", "t-value"); - map.put("S", "s-value"); - map.put("R", "r-value"); - map.put("Q", "q-value"); - map.put("P", "p-value"); - map.put("O", "o-value"); - map.put("N", "n-value"); - map.put("M", "m-value"); - map.put("L", "l-value"); - map.put("K", "k-value"); - map.put("J", "j-value"); - map.put("I", "i-value"); - map.put("H", "h-value"); - map.put("G", "g-value"); - map.put("F", "f-value"); - map.put("E", "e-value"); - map.put("D", "d-value"); - map.put("C", "c-value"); - map.put("B", "b-value"); - map.put("A", "a-value"); - c1.setAttribute("Map-Attribute", map); - c1.doSave(); - - ILaunchConfigurationWorkingCopy c2 = newEmptyConfiguration(getProject(), "testMapAttributes2"); - map = new HashMap(); - map.put("A", "a-value"); - map.put("Z", "z-value"); - map.put("B", "b-value"); - map.put("Y", "y-value"); - map.put("C", "c-value"); - map.put("X", "x-value"); - map.put("D", "d-value"); - map.put("W", "w-value"); - map.put("E", "e-value"); - map.put("V", "v-value"); - map.put("F", "f-value"); - map.put("U", "u-value"); - map.put("G", "g-value"); - map.put("T", "t-value"); - map.put("H", "h-value"); - map.put("S", "s-value"); - map.put("I", "i-value"); - map.put("R", "r-value"); - map.put("J", "j-value"); - map.put("Q", "q-value"); - map.put("K", "k-value"); - map.put("P", "p-value"); - map.put("L", "l-value"); - map.put("M", "m-value"); - map.put("O", "o-value"); - map.put("N", "n-value"); - c2.setAttribute("Map-Attribute", map); - c2.doSave(); - - // file contents should be the same - char[] chars1 = getInputStreamAsCharArray(c1.getFile().getContents()); - char[] chars2 = getInputStreamAsCharArray(c2.getFile().getContents()); - assertEquals("Should be the same characters", chars1.length, chars2.length); - for (int i = 0; i < chars2.length; i++) { - assertEquals("Should be the same character", chars1[i], chars2[i]); - } - - } - - /** - * Tests that attributes in a nested set are persisted in alphabetical order. - * - * @throws CoreException - */ - public void testSetAttributePersistence() throws CoreException, IOException { - ILaunchConfigurationWorkingCopy c1 = newEmptyConfiguration(getProject(), "testSetAttributes1"); - Set set = new HashSet(); - set.add("z-value"); - set.add("y-value"); - set.add("x-value"); - set.add("w-value"); - set.add("v-value"); - set.add("u-value"); - set.add("t-value"); - set.add("s-value"); - set.add("r-value"); - set.add("q-value"); - set.add("p-value"); - set.add("o-value"); - set.add("n-value"); - set.add("m-value"); - set.add("l-value"); - set.add("k-value"); - set.add("j-value"); - set.add("i-value"); - set.add("h-value"); - set.add("g-value"); - set.add("f-value"); - set.add("e-value"); - set.add("d-value"); - set.add("c-value"); - set.add("b-value"); - set.add("a-value"); - c1.setAttribute("Set-Attribute", set); - c1.doSave(); - - ILaunchConfigurationWorkingCopy c2 = newEmptyConfiguration(getProject(), "testSetAttributes2"); - set = new HashSet(); - set.add("a-value"); - set.add("z-value"); - set.add("b-value"); - set.add("y-value"); - set.add("c-value"); - set.add("x-value"); - set.add("d-value"); - set.add("w-value"); - set.add("e-value"); - set.add("v-value"); - set.add("f-value"); - set.add("u-value"); - set.add("g-value"); - set.add("t-value"); - set.add("h-value"); - set.add("s-value"); - set.add("i-value"); - set.add("r-value"); - set.add("j-value"); - set.add("q-value"); - set.add("k-value"); - set.add("p-value"); - set.add("l-value"); - set.add("m-value"); - set.add("o-value"); - set.add("n-value"); - c2.setAttribute("Set-Attribute", set); - c2.doSave(); - - // file contents should be the same - char[] chars1 = getInputStreamAsCharArray(c1.getFile().getContents()); - char[] chars2 = getInputStreamAsCharArray(c2.getFile().getContents()); - assertEquals("Should be the same characters", chars1.length, chars2.length); - for (int i = 0; i < chars2.length; i++) { - assertEquals("Should be the same character", chars1[i], chars2[i]); - } - - } - - /** - * Ensures that client does not attempt to nest configurations in a sub directory when - * using local metadata location. See bug 275741. - * - * @throws CoreException - */ - public void testIllegalFileSepCharName() { - try { - newConfiguration(null, new Path("some").append("nested").append("config").toOSString()); - } catch (CoreException e) { - // i.e. expected code path - return; - } - assertTrue("Should be an illegal argument - cannot nest local configurations", false); - } - - /** - * Ensures that client can nest configurations in a sub directory when - * using a workspace location. See bug 275741. For behavior compatibility - * a client should be able to use a slash in the configuration name. - * - * @throws CoreException - */ - public void testLegalFileSepCharName() { - try { - newConfiguration(getProject(), new Path("some").append("nested").append("config").toOSString()); - } catch (CoreException e) { - assertTrue("Should *not* be an illegal argument - can nest shared cofigurations", false); - } - } - - /** - * Test that an illegal name with '<' causes an exception - * - * @throws CoreException - */ - public void testIllegalCharName() { - try { - newConfiguration(getProject(), ""); - } catch (CoreException e) { - // expected code path - return; - } - assertTrue("Should be an illegal argument - illegal character used in name", false); - } -} - - diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchFavoriteTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchFavoriteTests.java deleted file mode 100644 index 1e5a7827e..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchFavoriteTests.java +++ /dev/null @@ -1,259 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipe.debug.tests.launching; - -import java.util.ArrayList; -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.internal.ui.launchConfigurations.LaunchHistory; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Test the launch history favorites get updated properly as configurations as - * modified. - * - * @since 3.6 - */ -public class LaunchFavoriteTests extends AbstractLaunchTest { - - /** - * Configuration to use for the test. One is created for each test during - * setup and deleted during tear down. - */ - private ILaunchConfiguration fConfig; - - /** - * Constructor - * @param name - */ - public LaunchFavoriteTests(String name) { - super(name); - } - - /** - * Returns the run launch history - * @return - */ - private LaunchHistory getRunLaunchHistory() { - return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_RUN_LAUNCH_GROUP); - } - - /** - * Returns the debug launch history - * @return - */ - private LaunchHistory getDebugLaunchHistory() { - return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#setUp() - */ - protected void setUp() throws Exception { - super.setUp(); - // clear the favorites - getRunLaunchHistory().setFavorites(new ILaunchConfiguration[0]); - getDebugLaunchHistory().setFavorites(new ILaunchConfiguration[0]); - fConfig = getLaunchConfiguration(getName()); - } - - /* (non-Javadoc) - * @see junit.framework.TestCase#tearDown() - */ - protected void tearDown() throws Exception { - super.tearDown(); - // delete the configuration used during this test - ILaunchConfiguration configuration = getLaunchConfiguration(); - if (configuration.exists()) { - configuration.delete(); - } - } - - /** - * Returns the new/initial launch configuration to use for this test. - * - * @return - */ - private ILaunchConfiguration getLaunchConfiguration() { - return fConfig; - } - - /** - * Makes the configuration a favorite in the specified group. - * - * @param config configuration to make a favorite - may be a working copy already - * @param groupId group to add it to - * @return working copy after making it a favorite - * - * @throws CoreException - */ - private ILaunchConfigurationWorkingCopy addFavorite(ILaunchConfiguration config, String groupId) throws CoreException { - ILaunchConfigurationWorkingCopy wc = getWorkingCopy(config); - List list = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null); - if (list == null) { - list = new ArrayList(); - } - list.add(groupId); - wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, list); - return wc; - } - - /** - * Removes the favorite group from the configuration's favorites attribute. Returns - * the resulting working copy. - * - * @param config configuration to remove favorite attribute from, may already be a working copy - * @param groupId group to remove - * @return working copy after removing favorite - * @throws CoreException - */ - private ILaunchConfigurationWorkingCopy removeFavorite(ILaunchConfiguration config, String groupId) throws CoreException { - ILaunchConfigurationWorkingCopy wc = getWorkingCopy(config); - List list = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null); - if (list != null) { - if (list.remove(groupId)) { - if (list.isEmpty()) { - list = null; - } - wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, list); - } - } - return wc; - } - - private ILaunchConfigurationWorkingCopy getWorkingCopy(ILaunchConfiguration config) throws CoreException { - ILaunchConfigurationWorkingCopy wc = null; - if (config.isWorkingCopy()) { - wc = (ILaunchConfigurationWorkingCopy) config; - } else { - wc = config.getWorkingCopy(); - } - return wc; - } - - /** - * Returns whether the launch history contains the given configuration as a favorite and is - * the expected size. - * - * @param history launch history - * @param configuration launch configuration - * @param size expected size of favorites or -1 if unknown - * @return whether the launch history contains the given configuration as a favorite and is - * the expected size - */ - private boolean containsFavorite(LaunchHistory history, ILaunchConfiguration configuration, int size) { - ILaunchConfiguration[] favorites = history.getFavorites(); - assertNotNull("No favorites", favorites); - if (size != -1) { - assertEquals("Favorites wrong size", size, favorites.length); - } - for (int i = 0; i < favorites.length; i++) { - if (configuration.equals(favorites[i])) { - return true; - } - } - return false; - } - - /** - * Tests that a configuration becoming a favorite appears in the favorites. - * - * @throws CoreException - */ - public void testBecomeFavorite() throws CoreException { - ILaunchConfigurationWorkingCopy wc = addFavorite(getLaunchConfiguration(), IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); - addFavorite(wc, IDebugUIConstants.ID_RUN_LAUNCH_GROUP); - ILaunchConfiguration saved = wc.doSave(); - assertTrue("Missing from debug favorites", containsFavorite(getDebugLaunchHistory(), saved, 1)); - assertTrue("Missing from run favorites", containsFavorite(getRunLaunchHistory(), saved, 1)); - } - - /** - * Tests that a when a favorite is no longer a favorite, it gets removed from the favorites. - * - * @throws CoreException - */ - public void testUnFavorite() throws CoreException { - testBecomeFavorite(); // create favorite in two histories - ILaunchConfigurationWorkingCopy wc = removeFavorite(getLaunchConfiguration(), IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); - removeFavorite(wc, IDebugUIConstants.ID_RUN_LAUNCH_GROUP); - ILaunchConfiguration saved = wc.doSave(); - assertFalse("Should not be a debug favorite", containsFavorite(getDebugLaunchHistory(), saved, 0)); - assertFalse("Should not be a run favorite", containsFavorite(getRunLaunchHistory(), saved, 0)); - } - - /** - * When a configuration is deleted, it should no longer be in the list. - * - * @throws CoreException - */ - public void testDeleteConfiguration() throws CoreException { - testBecomeFavorite(); // create a favorite in two histories - ILaunchConfiguration configuration = getLaunchConfiguration(); - configuration.delete(); - assertFalse("Should not be a debug favorite", containsFavorite(getDebugLaunchHistory(), configuration, 0)); - assertFalse("Should not be a run favorite", containsFavorite(getRunLaunchHistory(), configuration, 0)); - } - - /** - * When a favorite is renamed, it should still be in the list, with the new name. - * - * @throws CoreException - */ - public void testRenameFavorite() throws CoreException { - testBecomeFavorite(); - ILaunchConfiguration original = getLaunchConfiguration(); - ILaunchConfigurationWorkingCopy copy = original.getWorkingCopy(); - copy.rename("rename"+original.getName()); - ILaunchConfiguration saved = copy.doSave(); - assertTrue("Missing from debug favorites", containsFavorite(getDebugLaunchHistory(), saved, 1)); - assertTrue("Missing from run favorites", containsFavorite(getRunLaunchHistory(), saved, 1)); - saved.delete(); - } - - /** - * Renaming a configuration and making it a favorite at the same time - should appear in the list. - * - * @throws CoreException - */ - public void testRenameBecomeFavorite() throws CoreException { - ILaunchConfiguration original = getLaunchConfiguration(); - ILaunchConfigurationWorkingCopy copy = original.getWorkingCopy(); - copy.rename("rename"+original.getName()); - addFavorite(copy, IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); - addFavorite(copy, IDebugUIConstants.ID_RUN_LAUNCH_GROUP); - ILaunchConfiguration saved = copy.doSave(); - assertTrue("Missing from debug favorites", containsFavorite(getDebugLaunchHistory(), saved, 1)); - assertTrue("Missing from run favorites", containsFavorite(getRunLaunchHistory(), saved, 1)); - saved.delete(); - } - - /** - * Renaming a configuration and removing its favorite status should remove it from the list. - * - * @throws CoreException - */ - public void testRenameUnFavorite() throws CoreException { - testBecomeFavorite(); - ILaunchConfiguration original = getLaunchConfiguration(); - ILaunchConfigurationWorkingCopy copy = original.getWorkingCopy(); - copy.rename("rename"+original.getName()); - removeFavorite(copy, IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); - removeFavorite(copy, IDebugUIConstants.ID_RUN_LAUNCH_GROUP); - ILaunchConfiguration saved = copy.doSave(); - assertFalse("Should not be a debug favorite", containsFavorite(getDebugLaunchHistory(), saved, 0)); - assertFalse("Should not be a run favorite", containsFavorite(getRunLaunchHistory(), saved, 0)); - saved.delete(); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchHistoryTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchHistoryTests.java deleted file mode 100644 index d7b1ed70f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchHistoryTests.java +++ /dev/null @@ -1,197 +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.eclipe.debug.tests.launching; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory; -import org.eclipse.debug.ui.IDebugUIConstants; - -/** - * Test the utilization of launch histories: sizing, ordering, completeness and correctness - * - * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory - * @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationManager - * @see org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener - * @see org.eclipse.debug.ui.actions.AbstractLaunchHistoryAction - * - * @since 3.3 - */ -public class LaunchHistoryTests extends AbstractLaunchTest { - - /** - * Constructor - * @param name - */ - public LaunchHistoryTests(String name) { - super(name); - } - - /** - * Returns the run launch history - * @return - */ - private LaunchHistory getRunLaunchHistory() { - return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_RUN_LAUNCH_GROUP); - } - - /** - * Returns the maximum allowed size of the launch histories - * @return the maximum size of the launch histories - */ - private int getMaxHistorySize() { - return DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_HISTORY_SIZE); - } - - /** - * Sets the maximum size of the launch history to the specified value - * @param value the new maximum size for launch histories - */ - private void setMaxHistorySize(int value) { - DebugUIPlugin.getDefault().getPreferenceStore().setValue(IDebugUIConstants.PREF_MAX_HISTORY_SIZE, value); - } - - /** - * Returns the debug launch history - * @return - */ - private LaunchHistory getDebugLaunchHistory() { - return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP); - } - - /** - * This method tests that an item added to the history is added to the head of - * history. - */ - public void testHistoryAddition() throws CoreException { - LaunchHistory runhistory = getRunLaunchHistory(); - assertNotNull("The run launch history should not be null", runhistory); //$NON-NLS-1$ - ILaunchConfiguration config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - } - - /** - * As both the run and the debug launch histories will accept a java application - * launch config, both launch histories should contain the test launch configuration - * and it should be the recent launch for both of them - */ - public void testHistoriesInSync() throws CoreException { - LaunchHistory runhistory = getRunLaunchHistory(); - assertNotNull("The run launch history should not be null", runhistory); //$NON-NLS-1$ - LaunchHistory debughistory = getDebugLaunchHistory(); - assertNotNull("the debug launch history should not be null", debughistory); //$NON-NLS-1$ - ILaunchConfiguration config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("the run history should contain LaunchHistoryTest", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("the run recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - assertTrue("the debug history should contain LaunchHistoryTest", debughistory.contains(config)); //$NON-NLS-1$ - assertEquals("the debug recent launch should be LaunchHistoryTest", debughistory.getRecentLaunch(), config); //$NON-NLS-1$ - } - - /** - * If we launch config A, then config B, and then config A again, A should be the most recent launch - */ - public void testHistoryReodering() throws CoreException { - LaunchHistory runhistory = getRunLaunchHistory(); - assertNotNull("The run launch history should not be null", runhistory); //$NON-NLS-1$ - ILaunchConfiguration config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - config = getLaunchConfiguration("LaunchHistoryTest2"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest2 launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest2 config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest2", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - } - - /** - * If we rename a launch configuration it should not effect the launch history if the renamed configuration - * is present in the history. - */ - public void testRenameConfigHistoryUpdate() throws CoreException { - LaunchHistory runhistory = getRunLaunchHistory(); - assertNotNull("The run launch history should not be null", runhistory); //$NON-NLS-1$ - ILaunchConfiguration config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - ILaunchConfigurationWorkingCopy copy = config.getWorkingCopy(); - copy.rename("RenamedLaunchHistoryItem"); //$NON-NLS-1$ - config = copy.doSave(); - assertEquals("the renamed config should still be the first on in the history", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - - //rename the configuration back to what it was - copy = config.getWorkingCopy(); - copy.rename("LaunchHistoryTest"); //$NON-NLS-1$ - config = copy.doSave(); - } - - /** - * If we delete a launch configuration and the configuration is present in the launch history, it should be removed - * from the history and the history should be shifted up one place. - */ - public void testDeleteLaunchConfigurationHistoryUpdate() throws CoreException { - LaunchHistory runhistory = getRunLaunchHistory(); - assertNotNull("The run launch history should not be null", runhistory); //$NON-NLS-1$ - ILaunchConfiguration config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - config = getLaunchConfiguration("LaunchHistoryTest2"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest2 launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("The run history should contain the LaunchHistoryTest2 config", runhistory.contains(config)); //$NON-NLS-1$ - assertEquals("The most recent launch should be LaunchHistoryTest2", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - config.delete(); - config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertEquals("the run history should have LaunchHistoryTest as the recent launch after delete", runhistory.getRecentLaunch(), config); //$NON-NLS-1$ - } - - /** - * Tests that setting the size of the launch history appropriately changes what will be returned - * when the history is queried for it contents - */ - public void testLaunchHistorySize() throws CoreException { - LaunchHistory runhistory = getRunLaunchHistory(); - assertNotNull("The run launch history should not be null", runhistory); //$NON-NLS-1$ - int oldsize = getMaxHistorySize(); - setMaxHistorySize(2); - assertTrue("the maximum history size should be 2", getMaxHistorySize() == 2); //$NON-NLS-1$ - ILaunchConfiguration config = getLaunchConfiguration("LaunchHistoryTest"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - config = getLaunchConfiguration("LaunchHistoryTest2"); //$NON-NLS-1$ - assertNotNull("LaunchHistoryTest2 launch config should not be null", config); //$NON-NLS-1$ - config.launch(ILaunchManager.RUN_MODE, new NullProgressMonitor()); - assertTrue("there should only be two items in the history", runhistory.getHistory().length == getMaxHistorySize()); //$NON-NLS-1$ - assertTrue("the complete launch history should be greater than or equal to the history size", runhistory.getCompleteLaunchHistory().length >= runhistory.getHistory().length); //$NON-NLS-1$ - - //reset the history size - setMaxHistorySize(oldsize); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchManagerTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchManagerTests.java deleted file mode 100644 index 11dce573c..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchManagerTests.java +++ /dev/null @@ -1,203 +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.eclipe.debug.tests.launching; - -import org.eclipse.core.runtime.Platform; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.internal.core.LaunchManager; - -/** - * - * Variety of tests for the {@link org.eclipse.debug.internal.core.LaunchManager} - * - * @since 3.6 - */ -public class LaunchManagerTests extends AbstractLaunchTest { - - /** - * Constructor - * @param name - */ - public LaunchManagerTests(String name) { - super(name); - } - - /** - * Tests generating a valid launch configuration name - */ - public void testGenereateConfigName() { - String configname = "launch_configuration"; - String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname); - assertTrue("the name nust be '"+configname+"'", name.equals(configname)); - } - - /** - * Tests generating a launch configuration name with an unsupported char using - * the deprecated method - */ - public void testGenereateConfigNameBadChar() { - String configname = "config:name"; - String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname); - assertEquals("config name should be '"+configname+"'", configname, name); - } - - /** - * Tests that a valid name is accepted as is. - */ - public void testGenerateValidName() { - String configname = "thisisavalidname"; - String name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("Should be the same as the seed", configname, name); - } - - /** - * Tests generating a launch configuration name using a name that is an OS reserved - * name. Win 32 test only. - */ - public void testGenerateConfigNameReservedName() { - if(Platform.OS_WIN32.equals(Platform.getOS())) { - String configname = "aux"; - String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname); - assertEquals("config name should be '"+configname+"'", configname, name); - } - } - - /** - * Tests generating a configuration name that contains an invalid character - */ - public void testGenerateBadConfigName() { - String configname = "config:name"; - String name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("config name should be 'config_name'", "config_name", name); - } - - /** - * Tests generating a name that conflicts with an OS reserved name. This test is for windows only as there - * are no reserved names on other OS's. - */ - public void testGenerateConflictingName() { - if(Platform.OS_WIN32.equals(Platform.getOS())) { - String configname = "aux"; - String name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("config name should be 'launch_configuration'", "launch_configuration", name); - } - } - - /** - * Tests generating a configuration name that contains an invalid character and where there - * is another config with the replaced name already - */ - public void testGenerateBadCharConflict() throws Exception { - String configname = "config:name"; - String name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("config name should be 'config_name'", "config_name", name); - getLaunchConfiguration(name); - name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("config name should be 'config_name (1)'", "config_name (1)", name); - ILaunchConfiguration config = getLaunchConfiguration("config_name"); - config.delete(); - } - - /** - * Tests generating a name that conflicts with an OS reserved name and that - * there is a config with the replaced name already. This test is for windows only as there - * are no reserved names on other OS's. - */ - public void testGenerateBadNameConflict() throws Exception { - if(Platform.OS_WIN32.equals(Platform.getOS())) { - String configname = "com2"; - String name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("config name should be 'launch_configuration'", "launch_configuration", name); - getLaunchConfiguration(name); - name = getLaunchManager().generateLaunchConfigurationName(configname); - assertEquals("config name should be 'launch_configuration (1)'", "launch_configuration (1)", name); - ILaunchConfiguration config = getLaunchConfiguration("launch_configuration"); - config.delete(); - } - } - - /** - * Tests the {@link org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(String)} method for correctness - */ - public void testValidateConfigGoodName() { - String configname = "configname"; - try { - getLaunchManager().isValidLaunchConfigurationName(configname); - } - catch(IllegalArgumentException iae) { - fail("the config name should not have thrown an exception during validation"); - } - } - - /** - * Tests the {@link org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(String)} method for correctness - */ - public void testValidateConfigBadCharName() { - String configname = "config:name"; - try { - getLaunchManager().isValidLaunchConfigurationName(configname); - } - catch(IllegalArgumentException iae) { - return; - } - fail("the config name should have thrown an exception during validation"); - } - - /** - * Tests the {@link org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(String)} method for correctness - */ - public void testValidateConfigBadName() { - if(Platform.OS_WIN32.equals(Platform.getOS())) { - String configname = "com1"; - try { - getLaunchManager().isValidLaunchConfigurationName(configname); - } - catch(IllegalArgumentException iae) { - return; - } - fail("the config name should have thrown an exception during validation"); - } - } - - /** - * Tests that generating a configuration name when there exists a configuration with that name - * already properly updates a '(N)' counter at the end - */ - public void testGenerateNameExistingConfig() throws Exception { - String configname = "x.y.z.configname"; - getLaunchConfiguration(configname); - String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname); - assertEquals("the configuration name should have been "+configname+" (1)", configname+" (1)", name); - getLaunchConfiguration(name); - name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(name); - assertEquals("the configuration name should have been "+configname+" (2)", configname+" (2)", name); - ILaunchConfiguration config = getLaunchConfiguration(configname); - if(config != null) { - config.delete(); - } - config = getLaunchConfiguration(configname +" (1)"); - if(config != null) { - config.delete(); - } - } - - /** - * Tests that removing an accelerator properly removes it without affecting the base string (readable) value - */ - public void testRemoveAcc() { - String text = "&Remove"; - String label = LaunchManager.removeAccelerators(text); - assertEquals("the label should be 'Remove'", "Remove", label); - text = "Remo&ve"; - label = LaunchManager.removeAccelerators(text); - assertEquals("the label should be 'Remove'", "Remove", label); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/RefreshTabTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/RefreshTabTests.java deleted file mode 100644 index 900e4d066..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/RefreshTabTests.java +++ /dev/null @@ -1,204 +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.eclipe.debug.tests.launching; - -import java.io.ByteArrayInputStream; - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IFolder; -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.debug.core.RefreshUtil; -import org.eclipse.debug.internal.core.RefreshScopeComparator; -import org.eclipse.debug.tests.TestsPlugin; -import org.eclipse.debug.ui.RefreshTab; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchPartSite; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; - -/** - * Tests the refresh tab. - */ -public class RefreshTabTests extends AbstractLaunchTest { - - /** - * Constructor - * @param name - */ - public RefreshTabTests(String name) { - super(name); - } - - /** - * Sets the selected resource in the navigator view. - * - * @param resource resource to select - */ - protected void setSelection(IResource resource) { - IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); - assertNotNull("The active workbench page should not be null", page); - IViewPart part; - try { - part = page.showView("org.eclipse.ui.views.ResourceNavigator"); - IWorkbenchPartSite site = part.getSite(); - assertNotNull("The part site for org.eclipse.ui.views.ResourceNavigator should not be null ", site); - ISelectionProvider provider = site.getSelectionProvider(); - assertNotNull("the selection provider should not be null for org.eclipse.ui.views.ResourceNavigator", provider); - provider.setSelection(new StructuredSelection(resource)); - } catch (PartInitException e) { - assertNotNull("Failed to open navigator view", null); - } - } - - /** - * Tests a refresh scope of the selected resource - * @throws CoreException - */ - public void testSelectedResource() throws CoreException { - String scope = "${resource}"; - IResource resource = getProject().getFolder("src"); - setSelection(resource); - IResource[] result = RefreshTab.getRefreshResources(scope); - assertNotNull(result); - assertEquals(1, result.length); - assertEquals(resource, result[0]); - } - - /** - * Tests a refresh scope of the selected resource's container - * @throws CoreException - */ - public void testSelectionsFolder() throws CoreException { - String scope = "${container}"; - IResource resource = getProject().getFolder("src"); - setSelection(resource); - IResource[] result = RefreshTab.getRefreshResources(scope); - assertNotNull(result); - assertEquals(1, result.length); - assertEquals(resource.getParent(), result[0]); - } - - /** - * Tests a refresh scope of the selected resource's project - * @throws CoreException - */ - public void testSelectionsProject() throws CoreException { - String scope = "${project}"; - IResource resource = getProject().getFolder("src"); - setSelection(resource); - IResource[] result = RefreshTab.getRefreshResources(scope); - assertNotNull(result); - assertEquals(1, result.length); - assertEquals(resource.getProject(), result[0]); - } - - /** - * Tests a refresh scope of the selected resource's project - * @throws CoreException - */ - public void testWorkspaceScope() throws CoreException { - String scope = "${workspace}"; - IResource[] result = RefreshTab.getRefreshResources(scope); - assertNotNull(result); - assertEquals(1, result.length); - assertEquals(ResourcesPlugin.getWorkspace().getRoot(), result[0]); - } - - /** - * Tests a refresh scope for a specific resource (old format) - * @throws CoreException - */ - public void testSpecificResource() throws CoreException { - String scope = "${resource:/RefreshTabTests/some.file}"; - IResource resource = getProject().getFile("some.file"); - IResource[] result = RefreshTab.getRefreshResources(scope); - assertNotNull(result); - assertEquals(1, result.length); - assertEquals(resource, result[0]); - } - - /** - * Tests a refresh scope for a working set - * @throws CoreException - */ - public void testWorkingSet() throws CoreException { - String scope= "${working_set:\n\n\n}"; //$NON-NLS-1$ - IResource resource = getProject().getFile("some.file"); - IResource[] result = RefreshTab.getRefreshResources(scope); - assertNotNull(result); - assertEquals(1, result.length); - assertEquals(resource, result[0]); - } - - /** - * Returns a scratch project for launch configurations - * - * @return - */ - protected IProject getProject() throws CoreException { - IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); - IProject project= root.getProject("RefreshTabTests"); - if (!project.exists()) { - project = TestsPlugin.createProject("RefreshTabTests"); - IFolder folder = project.getFolder("src"); - folder.create(false, true, null); - IFile file = project.getFile("some.file"); - file.create(new ByteArrayInputStream("test file".getBytes()), false, null); - } - return project; - } - - /** - * Tests the launch configuration attribute comparator extension for comparing - * old/new attribute styles. - * - * @throws CoreException - */ - public void testRefreshScopeComparator() throws CoreException { - String oldStyle = "${working_set:\n\n\n}"; //$NON-NLS-1$ - String newStyle = "${working_set:\n\n\n}"; - assertEquals("Comparator should return 0", 0, new RefreshScopeComparator().compare(oldStyle, newStyle)); - } - - /** - * Tests persist restore of some resources. - * - * @throws CoreException - */ - public void testResourceMemento() throws CoreException { - IResource[] resources = new IResource[]{getProject(), getProject().getFile("not.exist"), getProject().getFile("some.file")}; - String memento = RefreshUtil.toMemento(resources); - IResource[] restore = RefreshUtil.toResources(memento); - assertEquals(resources.length, restore.length); - assertEquals(resources[0], restore[0]); - assertEquals(resources[1], restore[1]); - assertEquals(resources[2], restore[2]); - } - - /** - * Tests persist/restore of empty resource collection. - * - * @throws CoreException - */ - public void testEmptyResourceSet() throws CoreException { - String memento = RefreshUtil.toMemento(new IResource[]{}); - IResource[] resources = RefreshUtil.toResources(memento); - assertNotNull(resources); - assertEquals("Should be empty", 0, resources.length); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/TestLaunchDelegate.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/TestLaunchDelegate.java deleted file mode 100644 index 54994d369..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/TestLaunchDelegate.java +++ /dev/null @@ -1,31 +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.eclipe.debug.tests.launching; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.debug.core.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.model.LaunchConfigurationDelegate; - -/** - * An empty lauch delegate - */ -public class TestLaunchDelegate extends LaunchConfigurationDelegate { - - /* (non-Javadoc) - * @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate#launch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) - */ - public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { - // do nothing - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/DynamicRenderingBindings.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/DynamicRenderingBindings.java deleted file mode 100644 index 0bf6f5c5e..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/DynamicRenderingBindings.java +++ /dev/null @@ -1,69 +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.eclipe.debug.tests.view.memory; - -import org.eclipse.debug.core.model.IMemoryBlock; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.memory.AbstractMemoryRenderingBindingsProvider; -import org.eclipse.debug.ui.memory.IMemoryRenderingType; - -/** - * Contributed dynamic rendernig bindings. - * @since 3.1 - */ -public class DynamicRenderingBindings extends AbstractMemoryRenderingBindingsProvider { - - // - private static DynamicRenderingBindings fgSingleton = null; - - // id of rendering type bound by this provider - private String fId = "rendering_type_1"; - - /** - * Constructor - */ - public DynamicRenderingBindings() { - fgSingleton = this; - } - - /** - * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock) - */ - public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) { - return new IMemoryRenderingType[]{getPrimaryRenderingType(block)}; - } - - /** - * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock) - */ - public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) { - return new IMemoryRenderingType[]{getPrimaryRenderingType(block)}; - } - - /** - * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock) - */ - public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) { - return DebugUITools.getMemoryRenderingManager().getRenderingType(fId); - } - - /** - * Sets the current rendering bound to this provider, and notifies - * listeners of the change. - * - * @param id rendering id - */ - public static void setBinding(String id) { - fgSingleton.fId = id; - fgSingleton.fireBindingsChanged(); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlock.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlock.java deleted file mode 100644 index d9705418f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlock.java +++ /dev/null @@ -1,91 +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.eclipe.debug.tests.view.memory; - -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.IMemoryBlock; - -/** - * Dummy memory block implementation. - * - * @since 3.1 - */ -public class MemoryBlock implements IMemoryBlock { - - /** - * @see org.eclipse.debug.core.model.IMemoryBlock#getStartAddress() - */ - public long getStartAddress() { - return 0; - } - - /** - * @see org.eclipse.debug.core.model.IMemoryBlock#getLength() - */ - public long getLength() { - return 100; - } - - /** - * @see org.eclipse.debug.core.model.IMemoryBlock#getBytes() - */ - public byte[] getBytes() throws DebugException { - byte[] bytes = new byte[(int)getLength()]; - for (int i = 0; i < bytes.length; i++) { - bytes[i] = (byte)i; - } - return bytes; - } - - /** - * @see org.eclipse.debug.core.model.IMemoryBlock#supportsValueModification() - */ - public boolean supportsValueModification() { - return false; - } - - /** - * @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[]) - */ - public void setValue(long offset, byte[] bytes) throws DebugException { - - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier() - */ - public String getModelIdentifier() { - return "no.debugger"; - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget() - */ - public IDebugTarget getDebugTarget() { - return null; - } - - /** - * @see org.eclipse.debug.core.model.IDebugElement#getLaunch() - */ - public ILaunch getLaunch() { - return null; - } - - /** - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class adapter) { - return null; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockDynamic.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockDynamic.java deleted file mode 100644 index 53ffe59ca..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockDynamic.java +++ /dev/null @@ -1,21 +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.eclipe.debug.tests.view.memory; - - -/** - * Dummy memory block - * - * @since 3.1 - */ -public class MemoryBlockDynamic extends MemoryBlock { - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockOne.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockOne.java deleted file mode 100644 index 06a07fafa..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockOne.java +++ /dev/null @@ -1,21 +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.eclipe.debug.tests.view.memory; - - -/** - * Dummy memory block - * - * @since 3.1 - */ -public class MemoryBlockOne extends MemoryBlock { - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockThree.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockThree.java deleted file mode 100644 index 81ac323c1..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockThree.java +++ /dev/null @@ -1,21 +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.eclipe.debug.tests.view.memory; - - -/** - * Dummy memory block - * - * @since 3.1 - */ -public class MemoryBlockThree extends MemoryBlock { - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockTwo.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockTwo.java deleted file mode 100644 index 63c22c7d0..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlockTwo.java +++ /dev/null @@ -1,21 +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.eclipe.debug.tests.view.memory; - - -/** - * Dummy memory block - * - * @since 3.1 - */ -public class MemoryBlockTwo extends MemoryBlock { - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryRenderingTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryRenderingTests.java deleted file mode 100644 index 448c7ef68..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryRenderingTests.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.eclipe.debug.tests.view.memory; - -import junit.framework.TestCase; - -import org.eclipse.debug.core.model.IMemoryBlock; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener; -import org.eclipse.debug.ui.memory.IMemoryRenderingManager; -import org.eclipse.debug.ui.memory.IMemoryRenderingType; - -/** - * Tests memory rendering manager - */ -public class MemoryRenderingTests extends TestCase { - - public MemoryRenderingTests(String name) { - super(name); - } - - public void testRenderingTypes() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryRenderingType[] types = manager.getRenderingTypes(); - assertTrue("Wrong number of rendering types contributed", types.length > 6); - assertTrue("Missing type 1", indexOf(manager.getRenderingType("rendering_type_1"), types) >= 0); - assertTrue("Missing type 2", indexOf(manager.getRenderingType("rendering_type_2"), types) >= 0); - assertTrue("Missing type 3", indexOf(manager.getRenderingType("rendering_type_3"), types) >= 0); - assertTrue("Missing type", indexOf(manager.getRenderingType("org.eclipse.debug.ui.rendering.raw_memory"), types) >= 0); - assertTrue("Missing type", indexOf(manager.getRenderingType("org.eclipse.debug.ui.rendering.ascii"), types) >= 0); - assertTrue("Missing type", indexOf(manager.getRenderingType("org.eclipse.debug.ui.rendering.signedint"), types) >= 0); - assertTrue("Missing type", indexOf(manager.getRenderingType("org.eclipse.debug.ui.rendering.unsignedint"), types) >= 0); - } - - public void testRenderingTypeNames() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryRenderingType type = manager.getRenderingType("rendering_type_1"); - assertEquals("Wrong name", "Rendering One", type.getLabel()); - type = manager.getRenderingType("rendering_type_2"); - assertEquals("Wrong name", "Rendering Two", type.getLabel()); - } - - public void testSingleBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockOne(); - IMemoryRenderingType[] types = manager.getRenderingTypes(block); - assertEquals("Wrong number of bindings", 1, types.length); - assertEquals("Wrong binding", "rendering_type_1", types[0].getId()); - } - - public void testDoubleBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockTwo(); - IMemoryRenderingType[] types = manager.getRenderingTypes(block); - assertEquals("Wrong number of bindings", 2, types.length); - assertTrue("Missing binding", indexOf(manager.getRenderingType("rendering_type_1"), types) >= 0); - assertTrue("Missing binding", indexOf(manager.getRenderingType("rendering_type_2"), types) >= 0); - } - - public void testDefaultBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockOne(); - IMemoryRenderingType[] types = manager.getDefaultRenderingTypes(block); - assertEquals("Wrong number of bindings", 1, types.length); - assertEquals("Wrong binding", "rendering_type_1", types[0].getId()); - } - - public void testNoDefaultBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockTwo(); - IMemoryRenderingType[] types = manager.getDefaultRenderingTypes(block); - assertEquals("Wrong number of bindings", 0, types.length); - } - - public void testPrimaryBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockOne(); - IMemoryRenderingType type = manager.getPrimaryRenderingType(block); - assertEquals("Wrong binding", "rendering_type_1", type.getId()); - } - - public void testNoPrimaryBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockTwo(); - IMemoryRenderingType type = manager.getPrimaryRenderingType(block); - assertNull("Wrong binding", type); - } - - public void testDefaultWithoutPrimaryBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockThree(); - IMemoryRenderingType[] types = manager.getDefaultRenderingTypes(block); - assertEquals("Wrong number of bindings", 1, types.length); - assertEquals("Wrong binding", "rendering_type_3", types[0].getId()); - } - - public void testDynamicBinding() { - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - IMemoryBlock block = new MemoryBlockDynamic(); - IMemoryRenderingType[] types = manager.getRenderingTypes(block); - assertEquals("Wrong number of bindings", 1, types.length); - assertEquals("Wrong binding", "rendering_type_1", types[0].getId()); - types = manager.getDefaultRenderingTypes(block); - assertEquals("Wrong number of bindings", 1, types.length); - assertEquals("Wrong binding", "rendering_type_1", types[0].getId()); - IMemoryRenderingType type = manager.getPrimaryRenderingType(block); - assertEquals("Wrong bindings", manager.getRenderingType("rendering_type_1"), type); - } - - public void testBindingChangeNotification() { - final boolean[] changed = new boolean[1]; - IMemoryRenderingBindingsListener listener = new IMemoryRenderingBindingsListener() { - public void memoryRenderingBindingsChanged() { - changed[0] = true; - } - }; - IMemoryRenderingManager manager = DebugUITools.getMemoryRenderingManager(); - try { - manager.addListener(listener); - assertFalse("Renderings should not have changed yet", changed[0]); - DynamicRenderingBindings.setBinding("rendering_type_2"); - assertTrue("Renderings should have changed", changed[0]); - IMemoryBlock block = new MemoryBlockDynamic(); - IMemoryRenderingType[] types = manager.getRenderingTypes(block); - assertEquals("Wrong number of bindings", 1, types.length); - assertEquals("Wrong binding", "rendering_type_2", types[0].getId()); - } finally { - // restore original bindings - DynamicRenderingBindings.setBinding("rendering_type_1"); - manager.removeListener(listener); - } - } - - protected int indexOf(Object thing, Object[] list) { - for (int i = 0; i < list.length; i++) { - Object object2 = list[i]; - if (object2.equals(thing)) { - return i; - } - } - return -1; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/RenderingTypeDelegate.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/RenderingTypeDelegate.java deleted file mode 100644 index b4f9a70be..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/RenderingTypeDelegate.java +++ /dev/null @@ -1,30 +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.eclipe.debug.tests.view.memory; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.ui.memory.IMemoryRendering; -import org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate; - -/** - * Test memory rendering type delegate. - * - * @since 3.1 - */ -public class RenderingTypeDelegate implements IMemoryRenderingTypeDelegate { - - /** - * @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String) - */ - public IMemoryRendering createRendering(String id) throws CoreException { - return null; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java deleted file mode 100644 index c6bef8d6a..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java +++ /dev/null @@ -1,176 +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.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests which verify the check box support. This test is very similar to the - * content test except that the extending class should create a viewer with - * the SWT.CHECK style enabled.
                              - * Most of the check box verification is performed in the test model. - * - * @since 3.6 - */ -abstract public class CheckTests extends TestCase { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public CheckTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - abstract protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - protected void runTest() throws Throwable { - try { - super.runTest(); - } catch (Throwable t) { - throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); - } - } - - public void testSimpleSingleLevel() { - // Create the model with test data - TestModel model = TestModel.simpleSingleLevel(); - - // Make sure that all elements are expanded - fViewer.setAutoExpandLevel(-1); - - // Create the agent which forces the tree to populate - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - // Create the listener which determines when the view is finished updating. - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the viewer input (and trigger updates). - fViewer.setInput(model.getRootElement()); - - // Wait for the updates to complete. - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testSimpleMultiLevel() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleMultiLevel(); - fViewer.setAutoExpandLevel(-1); - - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - fViewer.setInput(model.getRootElement()); - - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - - // TODO: no idea how to trigger a toggle event on an item -// public void testCheckReceiver() { -// // Initial setup -// TestModel model = TestModel.simpleSingleLevel(); -// fViewer.setAutoExpandLevel(-1); -// //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); -// fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); -// fViewer.setInput(model.getRootElement()); -// -// // Wait for the updates to complete and validate. -// while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); -// model.validateData(fViewer, TreePath.EMPTY); -// -// InternalTreeModelViewer treeViewer = ((InternalTreeModelViewer)fViewer); -// TreePath elementPath = model.findElement("1"); -// TestElement element = model.getElement(elementPath); -// boolean initialCheckState = element.getChecked(); -// Event event = new Event(); -// event.item = treeViewer.findItem(elementPath); -// event.detail = SWT.CHECK; -// event.display = fDisplay; -// event.type = SWT.Selection; -// event.widget = treeViewer.getControl(); -// fDisplay.post(event); -// -// while (fDisplay.readAndDispatch ()); -// -// Assert.assertTrue(element.getChecked() != initialCheckState); -// } - - public void testUpdateCheck() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = model.getRootElement().getChildren()[0]; - - TreePath elementPath = new TreePath(new Object[] { element }); - ModelDelta delta = model.setElementChecked(elementPath, false, false); - - fListener.reset(elementPath, element, -1, true, false); - model.postDelta(delta); - while (!fListener.isFinished(TestModelUpdatesListener.LABEL_COMPLETE | TestModelUpdatesListener.MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java deleted file mode 100644 index 4095eeff2..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java +++ /dev/null @@ -1,188 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipse.debug.internal.ui.DebugUIPlugin; -import org.eclipse.debug.internal.ui.viewers.model.ChildrenUpdate; -import org.eclipse.debug.internal.ui.viewers.model.ILabelUpdateListener; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider; -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.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.ViewerFilter; -import org.eclipse.jface.viewers.ViewerLabel; -import org.eclipse.swt.widgets.Display; - -/** - * Tests coalescing of children update requests. - * - * @since 3.3 - */ -public class ChildrenUpdateTests extends TestCase { - - class BogusModelContentProvider extends TreeModelContentProvider { - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#getViewer() - */ - protected ITreeModelContentProviderTarget getViewer() { - return new ITreeModelContentProviderTarget(){ - - public void setSelection(ISelection selection) {} - public void removeSelectionChangedListener(ISelectionChangedListener listener) {} - public void addSelectionChangedListener(ISelectionChangedListener listener) {} - public void updateViewer(IModelDelta delta) {} - public void setSelection(ISelection selection, boolean reveal, boolean force) {} - public void clearSelectionQuiet() {} - public boolean trySelection(ISelection selection, boolean reveal, boolean force) { return true; } - public void setInput(Object object) {} - public void setAutoExpandLevel(int level) {} - public boolean saveElementState(TreePath path, ModelDelta delta, int flags) { return true; } - public void removeStateUpdateListener(IStateUpdateListener listener) {} - public void removeViewerUpdateListener(IViewerUpdateListener listener) {} - public void removeModelChangedListener(IModelChangedListener listener) {} - public void removeLabelUpdateListener(ILabelUpdateListener listener) {} - public void addViewerUpdateListener(IViewerUpdateListener listener) {} - public void addStateUpdateListener(IStateUpdateListener listener) {} - public void addModelChangedListener(IModelChangedListener listener) {} - public void addLabelUpdateListener(ILabelUpdateListener listener) {} - public void update(Object element) {} - public void setHasChildren(Object elementOrTreePath, boolean hasChildren) {} - public void setExpandedState(Object elementOrTreePath, boolean expanded) {} - public void setChildCount(Object elementOrTreePath, int count) {} - public void reveal(TreePath path, int index) {} - public void replace(Object parentOrTreePath, int index, Object element) {} - public void remove(Object parentOrTreePath, int index) {} - public void remove(Object elementOrTreePath) {} - public void refresh() {} - public void refresh(Object element) {} - - public ISelection getSelection() { - return null; - } - - public IPresentationContext getPresentationContext() { - return null; - } - - public Object getInput() { - return null; - } - - public ViewerLabel getElementLabel(TreePath path, String columnId) { - return null; - } - - public Display getDisplay() { - return DebugUIPlugin.getStandardDisplay(); - } - - public int getAutoExpandLevel() { - return 0; - } - - - public boolean overrideSelection(ISelection current, ISelection candidate) { - return false; - } - - public void insert(Object parentOrTreePath, Object element, int position) { - } - - public TreePath getTopElementPath() { - return null; - } - - public ViewerFilter[] getFilters() { - return null; - } - - public boolean getExpandedState(Object elementOrTreePath) { - return false; - } - - public Object getChildElement(TreePath path, int index) { - return null; - } - - public boolean getHasChildren(Object elementOrTreePath) { - return false; - } - - public int getChildCount(TreePath path) { - return 0; - } - - public int findElementIndex(TreePath parentPath, Object element) { - return 0; - } - - public void expandToLevel(Object elementOrTreePath, int level) { - } - - public void autoExpand(TreePath elementPath) { - } - - public boolean getElementChildrenRealized(TreePath parentPath) { - return false; - } - }; - } - } - - /** - * @param name - */ - public ChildrenUpdateTests(String name) { - super(name); - } - - protected TreeModelContentProvider getContentProvider() { - return new BogusModelContentProvider(); - } - - /** - * Tests coalescing of requests - */ - public void testCoalesce () { - Object element = new Object(); - TreeModelContentProvider cp = getContentProvider(); - ChildrenUpdate update1 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 1, null, null); - ChildrenUpdate update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 2, null, null); - assertTrue("Should coalesce", update1.coalesce(update2)); - assertEquals("Wrong offset", 1, update1.getOffset()); - assertEquals("Wrong length", 2, update1.getLength()); - - update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 3, null, null); - assertTrue("Should coalesce", update1.coalesce(update2)); - assertEquals("Wrong offset", 1, update1.getOffset()); - assertEquals("Wrong length", 3, update1.getLength()); - - update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 2, null, null); - assertTrue("Should coalesce", update1.coalesce(update2)); - assertEquals("Wrong offset", 1, update1.getOffset()); - assertEquals("Wrong length", 3, update1.getLength()); - - update2 = new ChildrenUpdate(cp, element, TreePath.EMPTY, element, 5, null, null); - assertFalse("Should not coalesce", update1.coalesce(update2)); - assertEquals("Wrong offset", 1, update1.getOffset()); - assertEquals("Wrong length", 3, update1.getLength()); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java deleted file mode 100644 index 1c1fcca1b..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java +++ /dev/null @@ -1,116 +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.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests that verify that the viewer property retrieves all the content - * from the model. - * - * @since 3.6 - */ -abstract public class ContentTests extends TestCase { - - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public ContentTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, true, true); - - fShell.open (); - } - - abstract protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - protected void runTest() throws Throwable { - try { - super.runTest(); - } catch (Throwable t) { - throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); - } - } - - public void testSimpleSingleLevel() { - // Create the model with test data - TestModel model = TestModel.simpleSingleLevel(); - - // Make sure that all elements are expanded - fViewer.setAutoExpandLevel(-1); - - // Create the agent which forces the tree to populate - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - // Create the listener which determines when the view is finished updating. - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, true); - - // Set the viewer input (and trigger updates). - fViewer.setInput(model.getRootElement()); - - // Wait for the updates to complete. - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testSimpleMultiLevel() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleMultiLevel(); - fViewer.setAutoExpandLevel(-1); - - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, true); - - fViewer.setInput(model.getRootElement()); - - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java deleted file mode 100644 index 9e9662f2b..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java +++ /dev/null @@ -1,634 +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.eclipe.debug.tests.viewer.model; - -import java.util.Arrays; -import java.util.List; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.ISelection; -import org.eclipse.jface.viewers.ITreeSelection; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests to verify that the viewer property retrieves and processes the - * model deltas generated by the test model. - */ -abstract public class DeltaTests extends TestCase implements ITestModelUpdatesListenerConstants { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public DeltaTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - abstract protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - protected void runTest() throws Throwable { - try { - super.runTest(); - } catch (Throwable t) { - throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); - } - } - - public void testUpdateLabel() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = model.getRootElement().getChildren()[0]; - TreePath elementPath = new TreePath(new Object[] { element }); - ModelDelta delta = model.appendElementLabel(elementPath, "-modified"); - - fListener.reset(elementPath, element, -1, true, false); - model.postDelta(delta); - while (!fListener.isFinished(LABEL_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testRefreshStruct() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = model.getRootElement().getChildren()[0]; - TreePath elementPath = new TreePath(new Object[] { element }); - TestElement[] newChildren = new TestElement[] { - new TestElement(model, "1.1 - new", new TestElement[0]), - new TestElement(model, "1.2 - new", new TestElement[0]), - new TestElement(model, "1.3 - new", new TestElement[0]), - }; - ModelDelta delta = model.setElementChildren(elementPath, newChildren); - - fListener.reset(elementPath, element, -1, true, false); - model.postDelta(delta); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testRefreshStruct2() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleMultiLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - String prefix = "new - "; - model.setElementChildren(TreePath.EMPTY, new TestElement[] { - new TestElement(model, prefix + "1", new TestElement[0]), - new TestElement(model, prefix + "2", true, false, new TestElement[] { - new TestElement(model, prefix + "2.1", true, true, new TestElement[0]), - new TestElement(model, prefix + "2.2", false, true, new TestElement[0]), - new TestElement(model, prefix + "2.3", true, false, new TestElement[0]), - }), - new TestElement(model, prefix + "3", new TestElement[] { - new TestElement(model, prefix + "3.1", new TestElement[] { - new TestElement(model, prefix + "3.1.1", new TestElement[0]), - new TestElement(model, prefix + "3.1.2", new TestElement[0]), - new TestElement(model, prefix + "3.1.3", new TestElement[0]), - }), - new TestElement(model, prefix + "3.2", new TestElement[] { - new TestElement(model, prefix + "3.2.1", new TestElement[0]), - new TestElement(model, prefix + "3.2.2", new TestElement[0]), - new TestElement(model, prefix + "3.2.3", new TestElement[0]), - }), - new TestElement(model, prefix + "3.3", new TestElement[] { - new TestElement(model, prefix + "3.3.1", new TestElement[0]), - new TestElement(model, prefix + "3.3.2", new TestElement[0]), - new TestElement(model, prefix + "3.3.3", new TestElement[0]), - }), - }) - }); - - TestElement element = model.getRootElement(); - fListener.reset(TreePath.EMPTY, element, -1, false, false); - - model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testInsert() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = new TestElement(model, "7", new TestElement[0]); - TreePath elementPath = new TreePath(new Object[] { element }); - ModelDelta delta = model.insertElementChild(TreePath.EMPTY, 6, element); - - // Insert causes the update of element's data, label and children. - // TODO: update of element's data after insert seems redundant - // but it's probably not a big inefficiency - fListener.reset(); - fListener.addChildreUpdate(TreePath.EMPTY, 6); - fListener.addHasChildrenUpdate(elementPath); - fListener.addLabelUpdate(elementPath); - // TODO: redundant label updates on insert! - fListener.setFailOnRedundantUpdates(false); - model.postDelta(delta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - /** - * This test checks that insert and select delta flags are processed in correct order: - * insert then select. - */ - public void testInsertAndSelect() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - - while (!fListener.isFinished()) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep(); - - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - // Insert two new elements at once - TestElement element0 = new TestElement(model, "00", new TestElement[] {}); - TestElement element1 = new TestElement(model, "01", new TestElement[] {}); - TreePath elementPath0 = new TreePath(new Object[] { element0 }); - TreePath elementPath1 = new TreePath(new Object[] { element1 }); - ModelDelta rootDelta = model.insertElementChild(TreePath.EMPTY, 0, element0); - rootDelta = model.insertElementChild(rootDelta, TreePath.EMPTY, 1, element1); - - // Set the select flag on the first added node. - ModelDelta delta0 = rootDelta.getChildDelta(element0); - delta0.setFlags(delta0.getFlags() | IModelDelta.SELECT); - - fListener.reset(); - fListener.addHasChildrenUpdate(elementPath0); - fListener.addHasChildrenUpdate(elementPath1); - fListener.addLabelUpdate(elementPath0); - fListener.addLabelUpdate(elementPath1); - - // TODO: list full set of expected updates. - fListener.setFailOnRedundantUpdates(false); - - model.postDelta(rootDelta); - while (!fListener.isFinished()) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - - /** - * This test checks that insert and remove deltas are processed in correct order: - * remove deltas are processed first then insert deltas. - */ - public void testInsertAndRemove() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - fViewer.setInput(model.getRootElement()); - - while (!fListener.isFinished()) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep(); - - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - // Remove one element then insert a new one - IModelDelta removeDelta = model.removeElementChild(TreePath.EMPTY, 3).getChildDeltas()[0]; - - // Insert new elements at once - TestElement element = new TestElement(model, "00", new TestElement[] {}); - TreePath elementPath = new TreePath(new Object[] { element }); - IModelDelta insertDelta = model.insertElementChild(TreePath.EMPTY, 1, element).getChildDeltas()[0]; - - // Create a combined delta where the insert child delta is first and the remove child delta is second. - ModelDelta combinedDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE, 0, model.getRootElement().getChildren().length); - combinedDelta.addNode(insertDelta.getElement(), insertDelta.getIndex(), insertDelta.getFlags(), insertDelta.getChildCount()); - combinedDelta.addNode(removeDelta.getElement(), removeDelta.getIndex(), removeDelta.getFlags(), removeDelta.getChildCount()); - - // Set the select flag on the first added node. - fListener.reset(); - fListener.addHasChildrenUpdate(elementPath); - fListener.addLabelUpdate(elementPath); - - // TODO: list full set of expected updates. - fListener.setFailOnRedundantUpdates(false); - - model.postDelta(combinedDelta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - - - public void testAddElement() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = new TestElement(model, "7", new TestElement[0]); - TreePath elementPath = new TreePath(new Object[] { element }); - ModelDelta delta = model.addElementChild(TreePath.EMPTY, 6, element); - - // Add causes the update of parent child count and element's children. - fListener.reset(elementPath, element, -1, true, false); - fListener.addChildreUpdate(TreePath.EMPTY, 6); - // TODO: redundant updates on add! - fListener.setFailOnRedundantUpdates(false); - model.postDelta(delta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - - public void testRemove() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - ModelDelta delta = model.removeElementChild(TreePath.EMPTY, 5); - - // Remove delta should generate no new updates, but we still need to wait for the event to - // be processed. - fListener.reset(); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testExpandAndSelect() { - TestModel model = TestModel.simpleMultiLevel(); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Create the delta - fListener.reset(); - // TODO Investigate: there seem to be unnecessary updates being issued - // by the viewer. These include the updates that are commented out: - // For now disable checking for extra updates. - fListener.setFailOnRedundantUpdates(false); - TestElement element = model.getRootElement(); - TreePath path_root = TreePath.EMPTY; - ModelDelta delta= new ModelDelta(model.getRootElement(), -1, IModelDelta.EXPAND, element.getChildren().length); - ModelDelta deltaRoot = delta; - element = element.getChildren()[2]; - TreePath path_root_3 = path_root.createChildPath(element); - delta = delta.addNode(element, 2, IModelDelta.EXPAND, element.fChildren.length); - fListener.addChildreUpdate(path_root_3, 0); - TreePath path_root_3_1 = path_root_3.createChildPath(element.getChildren()[0]); - fListener.addHasChildrenUpdate(path_root_3_1); - fListener.addLabelUpdate(path_root_3_1); - TreePath path_root_3_3 = path_root_3.createChildPath(element.getChildren()[2]); - fListener.addHasChildrenUpdate(path_root_3_3); - fListener.addLabelUpdate(path_root_3_3); - //TODO unnecessary update: fListener.addChildreUpdate(path1, 1); - fListener.addChildreUpdate(path_root_3, 2); - element = element.getChildren()[1]; - TreePath path_root_3_2 = path_root_3.createChildPath(element); - delta = delta.addNode(element, 1, IModelDelta.EXPAND, element.fChildren.length); - fListener.addLabelUpdate(path_root_3_2); - TreePath path_root_3_2_1 = path_root_3_2.createChildPath(element.getChildren()[0]); - fListener.addHasChildrenUpdate(path_root_3_2_1); - fListener.addLabelUpdate(path_root_3_2_1); - TreePath path_root_3_2_3 = path_root_3_2.createChildPath(element.getChildren()[2]); - fListener.addHasChildrenUpdate(path_root_3_2_3); - fListener.addLabelUpdate(path_root_3_2_3); - // TODO unnecessary update: fListener.addChildreCountUpdate(path2); - fListener.addChildreUpdate(path_root_3_2, 0); - // TODO unnecessary update: fListener.addChildreUpdate(path2, 1); - fListener.addChildreUpdate(path_root_3_2, 2); - element = element.getChildren()[1]; - TreePath path_root_3_2_2 = path_root_3_2.createChildPath(element); - delta = delta.addNode(element, 1, IModelDelta.SELECT, element.fChildren.length); - fListener.addLabelUpdate(path_root_3_2_2); - fListener.addHasChildrenUpdate(path_root_3_2_2); - - // Validate the expansion state BEFORE posting the delta. - - ITreeModelContentProviderTarget contentProviderViewer = (ITreeModelContentProviderTarget)fViewer; - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3)); - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3_2)); - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2)); - - model.postDelta(deltaRoot); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Validate the expansion state AFTER posting the delta. - Assert.assertTrue(contentProviderViewer.getExpandedState(path_root_3)); - Assert.assertTrue(contentProviderViewer.getExpandedState(path_root_3_2)); - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2)); - - // Verify selection - ISelection selection = fViewer.getSelection(); - if (selection instanceof ITreeSelection) { - List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() ); - Assert.assertTrue(selectionPathsList.contains(path_root_3_2_2)); - } else { - Assert.fail("Not a tree selection"); - } - } - - /** - * This test verifies that expand and select updates are being ignored. - */ - public void testExpandAndSelect_simple() { - TestModel model = TestModel.simpleMultiLevel(); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Create the delta - fListener.reset(); - // TODO Investigate: there seem to be unnecessary updates being issued - // by the viewer. These include the updates that are commented out: - // For now disable checking for extra updates. - fListener.setFailOnRedundantUpdates(false); - TestElement element = model.getRootElement(); - TreePath path_root = TreePath.EMPTY; - ModelDelta delta= new ModelDelta(model.getRootElement(), -1, IModelDelta.EXPAND, element.getChildren().length); - ModelDelta deltaRoot = delta; - element = element.getChildren()[2]; - TreePath path_root_3 = path_root.createChildPath(element); - delta.addNode(element, 2, IModelDelta.SELECT | IModelDelta.EXPAND, element.fChildren.length); - - // Validate the expansion state BEFORE posting the delta. - - ITreeModelContentProviderTarget contentProviderViewer = (ITreeModelContentProviderTarget)fViewer; - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3)); - - model.postDelta(deltaRoot); - while (true) { - if (fListener.isFinished(MODEL_CHANGED_COMPLETE)) { - if (fListener.isFinished(CONTENT_UPDATES_COMPLETE | LABEL_UPDATES_COMPLETE) ) { - break; - } - } - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - model.validateData(fViewer, TreePath.EMPTY, true); - - // Validate the expansion state AFTER posting the delta. - Assert.assertTrue(contentProviderViewer.getExpandedState(path_root_3)); - - // Verify selection - ISelection selection = fViewer.getSelection(); - if (selection instanceof ITreeSelection) { - List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() ); - Assert.assertTrue(selectionPathsList.contains(path_root_3)); - } else { - Assert.fail("Not a tree selection"); - } - } - - public void testCompositeModelRefreshStruct() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.compositeMultiLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - // TODO: redundant updates on install deltas - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Update the model - TreePath m4_2_1Path = model.findElement("m4.2.1"); - TestElement m4_2_1 = model.getElement(m4_2_1Path); - TestModel m4 = m4_2_1.getModel(); - TestElement[] newChildren = new TestElement[] { - new TestElement(m4, "4.2.1.new-1", new TestElement[0]), - new TestElement(m4, "4.2.1.new-2", new TestElement[0]), - new TestElement(m4, "4.2.1.new-3", new TestElement[0]), - }; - - ModelDelta delta = m4.setElementChildren(m4_2_1Path, newChildren); - - fListener.reset(m4_2_1Path, m4_2_1, -1, true, false); - model.postDelta(delta); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testCompositeModelAddElement() { - TestModel model = TestModel.compositeMultiLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - // TODO: redundant updates on install deltas - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - TreePath m3_1Path = model.findElement("m3.1"); - TestElement m3_1 = model.getElement(m3_1Path); - TestModel m3 = m3_1.getModel(); - TestElement m3_1_new = new TestElement(m3, "m3.1-new", new TestElement[0]); - TreePath m3_1_newPath = m3_1Path.createChildPath(m3_1_new); - ModelDelta delta = m3.addElementChild(m3_1Path, 0, m3_1_new); - - fListener.reset(m3_1_newPath, m3_1_new, -1, true, false); - fListener.addChildreUpdate(m3_1Path, 0); - fListener.setFailOnRedundantUpdates(false); - - m3.postDelta(delta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - model.validateData(fViewer, TreePath.EMPTY); - } - - public void testBug292322() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Update the model: remove one child of an un-expanded element, then - // make sure that the number of children is correct. - TreePath parentPath = model.findElement("2"); - TestElement parentElement = model.getElement(parentPath); - ModelDelta delta = model.removeElementChild(parentPath, 0); - - // Update the viewer - fListener.reset(parentPath, parentElement, 0, false, false); - //fListener.addChildreCountUpdate(parentPath); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CONTENT_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate the viewer data. - model.validateData(fViewer, TreePath.EMPTY, true); - - // Update the model: remove the remaining children and make sure that - // the element children are updated to false. - model.removeElementChild(parentPath, 0); - - // Update the viewer - fListener.reset(parentPath, parentElement, 0, false, false); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CONTENT_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate the viewer data. - model.validateData(fViewer, TreePath.EMPTY, true); - - // Update the model: remove the remaining children and make sure that - // the element children are updated to false. - model.removeElementChild(parentPath, 0); - - // Update the viewer - fListener.reset(parentPath, parentElement, 0, false, false); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CONTENT_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate the viewer data. - model.validateData(fViewer, TreePath.EMPTY, true); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTransformTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTransformTests.java deleted file mode 100644 index 67b65d111..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTransformTests.java +++ /dev/null @@ -1,136 +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.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipse.debug.internal.ui.viewers.model.FilterTransform; -import org.eclipse.jface.viewers.TreePath; - -/** - * Tests the virtual viewer's filter transform - * @since 3.3 - */ -public class FilterTransformTests extends TestCase { - - public Object root; - public Object element0; - public Object element1; - public Object element2; - public Object element3; - public Object element4; - public Object element5; - public Object element6; - public Object element7; - - public FilterTransform transform; - - /** - * @param name - */ - public FilterTransformTests(String name) { - super(name); - } - - /** - * Builds a filter transform. Model has 8 elements, - * and elements 0, 2, 3, 6, 7 are filtered. Elements - * 1, 4, 5 are visible. - */ - protected void setUp() throws Exception { - super.setUp(); - transform = new FilterTransform(); - root = new Object(); - element0 = new Object(); - element1 = new Object(); - element2 = new Object(); - element3 = new Object(); - element4 = new Object(); - element5 = new Object(); - element6 = new Object(); - element7 = new Object(); - assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 0, element0)); - assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 2, element2)); - assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 3, element3)); - assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 6, element6)); - assertTrue(transform.addFilteredIndex(TreePath.EMPTY, 7, element7)); - } - - protected boolean equals(int[] a, int[] b) { - if (a.length == b.length) { - for (int i = 0; i < b.length; i++) { - if (a[i] != b[i]) { - return false; - } - } - return true; - } - return false; - } - - public void testRemoveMiddleElementFromFilters() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 3)); - transform.removeElementFromFilters(TreePath.EMPTY, element3); - assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 3)); - assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[]{0, 2, 5, 6})); - } - - public void testRemoveFirstElementFromFilters() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 0)); - transform.removeElementFromFilters(TreePath.EMPTY, element0); - assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 0)); - assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[]{1, 2, 5, 6})); - } - - public void testRemoveLastFromFilters() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 7)); - transform.removeElementFromFilters(TreePath.EMPTY, element7); - assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 7)); - assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[]{0, 2, 3, 6})); - } - - public void testClearMiddleElementFromFilters() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 3)); - transform.clear(TreePath.EMPTY, 3); - assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 3)); - assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[]{0, 2, 6, 7})); - } - - public void testClearFirstElementFromFilters() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 0)); - transform.clear(TreePath.EMPTY, 0); - assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 0)); - assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[]{2, 3, 6, 7})); - } - - public void testClearLastFromFilters() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 7)); - transform.clear(TreePath.EMPTY, 7); - assertFalse("Element should be unfiltered", transform.isFiltered(TreePath.EMPTY, 7)); - assertTrue("Wrong filter state", equals(transform.getFilteredChildren(TreePath.EMPTY), new int[]{0, 2, 3, 6})); - } - - public void testViewToModelCount() { - assertEquals("Wrong model count", 8, transform.viewToModelCount(TreePath.EMPTY, 3)); - } - - public void testViewToModelIndex() { - assertEquals("Wrong model index", 1, transform.viewToModelIndex(TreePath.EMPTY, 0)); - assertEquals("Wrong model index", 4, transform.viewToModelIndex(TreePath.EMPTY, 1)); - assertEquals("Wrong model index", 5, transform.viewToModelIndex(TreePath.EMPTY, 2)); - } - - public void testAddAlreadyFiltered() { - assertTrue("Element should be filtered", transform.isFiltered(TreePath.EMPTY, 0)); - boolean added = transform.addFilteredIndex(TreePath.EMPTY, 0, element0); - assertFalse("Filter should not be added - should already have been there", added); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java deleted file mode 100644 index 73b4cb027..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ITestModelUpdatesListenerConstants.java +++ /dev/null @@ -1,50 +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.eclipe.debug.tests.viewer.model; - -/** - * Convenience interface with constants used by the test model update listener. - * - * @since 3.6 - */ -public interface ITestModelUpdatesListenerConstants { - - public static final int LABEL_UPDATES_COMPLETE = 0X00000001; - public static final int CONTENT_UPDATES_COMPLETE = 0X00000002; - public static final int CONTENT_UPDATES_STARTED = 0X00020000; - public static final int LABEL_UPDATES = 0X00000004; - public static final int LABEL_UPDATES_STARTED = 0X00040000; - public static final int HAS_CHILDREN_UPDATES = 0X00000008; - public static final int HAS_CHILDREN_UPDATES_STARTED = 0X00080000; - public static final int CHILD_COUNT_UPDATES = 0X00000010; - public static final int CHILD_COUNT_UPDATES_STARTED = 0X00100000; - public static final int CHILDREN_UPDATES = 0X00000020; - public static final int CHILDREN_UPDATES_STARTED = 0X00200000; - public static final int MODEL_CHANGED_COMPLETE = 0X00000040; - public static final int MODEL_PROXIES_INSTALLED = 0X00000080; - public static final int STATE_SAVE_COMPLETE = 0X00000100; - public static final int STATE_SAVE_STARTED = 0X01000000; - public static final int STATE_RESTORE_COMPLETE = 0X00000200; - public static final int STATE_RESTORE_STARTED = 0X02000000; - public static final int STATE_UPDATES = 0X00000400; - public static final int STATE_UPDATES_STARTED = 0X04000000; - - public static final int VIEWER_UPDATES_RUNNING = 0X00001000; - public static final int LABEL_UPDATES_RUNNING = 0X00002000; - - public static final int VIEWER_UPDATES_STARTED = HAS_CHILDREN_UPDATES_STARTED | CHILD_COUNT_UPDATES_STARTED | CHILDREN_UPDATES_STARTED; - - public static final int LABEL_COMPLETE = LABEL_UPDATES_COMPLETE | LABEL_UPDATES | LABEL_UPDATES_RUNNING; - public static final int CONTENT_COMPLETE = - CONTENT_UPDATES_COMPLETE | HAS_CHILDREN_UPDATES | CHILD_COUNT_UPDATES | CHILDREN_UPDATES | VIEWER_UPDATES_RUNNING; - - public static final int ALL_UPDATES_COMPLETE = LABEL_COMPLETE | CONTENT_COMPLETE | MODEL_PROXIES_INSTALLED | LABEL_UPDATES_RUNNING | VIEWER_UPDATES_RUNNING; -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerCheckTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerCheckTests.java deleted file mode 100644 index 7cb15a0ee..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerCheckTests.java +++ /dev/null @@ -1,32 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerCheckTests extends CheckTests { - - public JFaceViewerCheckTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL | SWT.CHECK, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerContentTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerContentTests.java deleted file mode 100644 index 10213a3a3..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerContentTests.java +++ /dev/null @@ -1,32 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerContentTests extends ContentTests { - - public JFaceViewerContentTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerDeltaTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerDeltaTests.java deleted file mode 100644 index ed613bd6f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerDeltaTests.java +++ /dev/null @@ -1,38 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerDeltaTests extends DeltaTests { - - public JFaceViewerDeltaTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); - } - - /** - * TODO: remove this method when bug 292322 gets fixed in TreeViewer - */ - public void testBug292322() { - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPerformanceTests.java deleted file mode 100644 index 865db9508..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPerformanceTests.java +++ /dev/null @@ -1,36 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerPerformanceTests extends PerformanceTests { - - public JFaceViewerPerformanceTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); - } - - protected int getTestModelDepth() { - return 5; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPopupTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPopupTests.java deleted file mode 100644 index f3dcce096..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPopupTests.java +++ /dev/null @@ -1,32 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerPopupTests extends PopupTests { - - public JFaceViewerPopupTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell, int style) { - return new TreeModelViewer(fShell, SWT.VIRTUAL | style, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerSelectionTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerSelectionTests.java deleted file mode 100644 index 6cde1fbfc..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerSelectionTests.java +++ /dev/null @@ -1,32 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerSelectionTests extends SelectionTests { - - public JFaceViewerSelectionTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerStateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerStateTests.java deleted file mode 100644 index 2e4f23979..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerStateTests.java +++ /dev/null @@ -1,32 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerStateTests extends StateTests { - - public JFaceViewerStateTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL | SWT.MULTI, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerUpdateTests.java deleted file mode 100644 index 983b8d77f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerUpdateTests.java +++ /dev/null @@ -1,32 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class JFaceViewerUpdateTests extends UpdateTests { - - public JFaceViewerUpdateTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java deleted file mode 100644 index b8d47d390..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java +++ /dev/null @@ -1,178 +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.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.TreePath; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.test.performance.Performance; -import org.eclipse.test.performance.PerformanceMeter; -import org.eclipse.ui.PlatformUI; - -/** - * Tests to measure the performance of the viewer updates. - */ -abstract public class PerformanceTests extends TestCase implements ITestModelUpdatesListenerConstants { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public PerformanceTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - abstract protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - protected void runTest() throws Throwable { - try { - super.runTest(); - } catch (Throwable t) { - throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); - } - } - - /** - * Depth (size) of the test model to be used in the tests. This number allows - * the jface based tests to use a small enough model to fit on the screen, and - * for the virtual viewer to exercise the content provider to a greater extent. - */ - abstract protected int getTestModelDepth(); - - public void testRefreshStruct() { - TestModel model = new TestModel(); - model.setRoot( new TestElement(model, "root", new TestElement[0] ) ); - model.setElementChildren(TreePath.EMPTY, makeModelElements(model, getTestModelDepth(), "model")); - - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - Performance perf = Performance.getDefault(); - PerformanceMeter meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this)); - try { - for (int i = 0; i < 100; i++) { - // Update the model - model.setAllAppendix(" - pass " + i); - //model.setElementChildren(TreePath.EMPTY, makeModelElements(model, getTestModelDepth(), "pass " + i)); - - TestElement element = model.getRootElement(); - fListener.reset(TreePath.EMPTY, element, -1, false, false); - - meter.start(); - model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - meter.stop(); - System.gc(); - } - - meter.commit(); - perf.assertPerformance(meter); - } finally { - meter.dispose(); - } - } - - public void testRefreshStructReplaceElements() { - TestModel model = new TestModel(); - model.setRoot( new TestElement(model, "root", new TestElement[0] ) ); - model.setElementChildren(TreePath.EMPTY, makeModelElements(model, getTestModelDepth(), "model")); - - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - Performance perf = Performance.getDefault(); - PerformanceMeter meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(this)); - try { - for (int i = 0; i < 2000; i++) { - // Update the model - model.setElementChildren(TreePath.EMPTY, makeModelElements(model, getTestModelDepth(), "pass " + i)); - - TestElement element = model.getRootElement(); - fListener.reset(TreePath.EMPTY, element, -1, false, false); - - meter.start(); - model.postDelta(new ModelDelta(element, IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - meter.stop(); - System.gc(); - } - - meter.commit(); - perf.assertPerformance(meter); - } finally { - meter.dispose(); - } - } - - private TestElement[] makeModelElements(TestModel model, int depth, String prefix) { - TestElement[] elements = new TestElement[depth]; - for (int i = 0; i < depth; i++) { - String name = prefix + "." + i; - elements[i] = new TestElement(model, name, makeModelElements(model, i, name)); - } - return elements; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java deleted file mode 100644 index 38848d05a..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java +++ /dev/null @@ -1,245 +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.eclipe.debug.tests.viewer.model; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.ISelection; -import org.eclipse.jface.viewers.ITreeSelection; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests to verify that the viewer property updates when created - * with the SWT.POPUP style. - * - * @since 3.6 - */ -abstract public class PopupTests extends TestCase implements ITestModelUpdatesListenerConstants { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public PopupTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell, SWT.POP_UP); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - protected ITreeModelContentProviderTarget getCTargetViewer() { - return (ITreeModelContentProviderTarget)fViewer; - } - - - abstract protected ITreeModelViewer createViewer(Display display, Shell shell, int style); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - /** - * This test verifies that content updates are still being performed. - */ - public void testRefreshStruct() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = model.getRootElement().getChildren()[0]; - TreePath elementPath = new TreePath(new Object[] { element }); - TestElement[] newChildren = new TestElement[] { - new TestElement(model, "1.1 - new", new TestElement[0]), - new TestElement(model, "1.2 - new", new TestElement[0]), - new TestElement(model, "1.3 - new", new TestElement[0]), - }; - ModelDelta delta = model.setElementChildren(elementPath, newChildren); - - fListener.reset(elementPath, element, -1, true, false); - model.postDelta(delta); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - /** - * This test verifies that expand and select updates are being ignored. - */ - public void testExpandAndSelect() { - TestModel model = TestModel.simpleMultiLevel(); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Create the delta - fListener.reset(); - // TODO Investigate: there seem to be unnecessary updates being issued - // by the viewer. These include the updates that are commented out: - // For now disable checking for extra updates. - fListener.setFailOnRedundantUpdates(false); - TestElement element = model.getRootElement(); - TreePath path_root = TreePath.EMPTY; - ModelDelta delta= new ModelDelta(model.getRootElement(), -1, IModelDelta.EXPAND, element.getChildren().length); - ModelDelta deltaRoot = delta; - element = element.getChildren()[2]; - TreePath path_root_3 = path_root.createChildPath(element); - delta.addNode(element, 2, IModelDelta.SELECT | IModelDelta.EXPAND, element.fChildren.length); - - // Validate the expansion state BEFORE posting the delta. - - ITreeModelContentProviderTarget contentProviderViewer = (ITreeModelContentProviderTarget)fViewer; - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3)); - - model.postDelta(deltaRoot); - while (true) { - if (fListener.isFinished(MODEL_CHANGED_COMPLETE)) { - if (fListener.isFinished(CONTENT_UPDATES_STARTED)) { - if (fListener.isFinished(CONTENT_UPDATES_COMPLETE)) { - break; - } - } else { - break; - } - } - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - model.validateData(fViewer, TreePath.EMPTY, true); - - // Validate the expansion state AFTER posting the delta. - Assert.assertFalse(contentProviderViewer.getExpandedState(path_root_3)); - - // Verify selection - ISelection selection = fViewer.getSelection(); - if (selection instanceof ITreeSelection) { - List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() ); - Assert.assertFalse(selectionPathsList.contains(path_root_3)); - } else { - Assert.fail("Not a tree selection"); - } - } - - - - public void testPreserveExpandedOnSubTreeContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - - // Expand all - fViewer.setAutoExpandLevel(-1); - - // Create the listener, - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Turn off auto-expansion - fViewer.setAutoExpandLevel(0); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("3.3.1")); - fViewer.setSelection(originalSelection); - - // Update the model - model.addElementChild(model.findElement("3"), 0, new TestElement(model, "3.0 - new", new TestElement[0])); - - // Create the delta for element "3" with content update. - TreePath elementPath = model.findElement("3"); - ModelDelta rootDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - ModelDelta elementDelta = model.getElementDelta(rootDelta, elementPath, true); - elementDelta.setFlags(IModelDelta.CONTENT); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - fListener.addUpdates(getCTargetViewer(), elementPath, model.getElement(elementPath), -1, ALL_UPDATES_COMPLETE); - - // Post the sub-tree update - model.postDelta(rootDelta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - // On windows, getExpandedState() may return true for an element with no children: - // Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.0 - new")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.2")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.3")) == true); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - private boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) { - Set sel1Set = new HashSet(); - sel1Set.addAll( Arrays.asList(sel1.getPaths()) ); - - Set sel2Set = new HashSet(); - sel2Set.addAll( Arrays.asList(sel2.getPaths()) ); - - return sel1Set.equals(sel2Set); - } - - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java deleted file mode 100644 index 7e4d2d280..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PresentationContextTests.java +++ /dev/null @@ -1,54 +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 - * IBM - moved to debug platform tests from JDT - *******************************************************************************/ -package org.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.ui.IPersistableElement; -import org.eclipse.ui.XMLMemento; - -/** - * Test the serialization of presentation context properties. - * - * @since 3.4 - */ -public class PresentationContextTests extends TestCase { - - public PresentationContextTests(String name) { - super(name); - } - - /** - * Tests saving and restoring presentation context properties. - */ - public void testSaveRestore () { - PresentationContext context = new PresentationContext("test"); - context.setProperty("string", "string"); - context.setProperty("integer", new Integer(1)); - context.setProperty("boolean", new Boolean(true)); - context.setProperty("persistable", ResourcesPlugin.getWorkspace().getRoot().getAdapter(IPersistableElement.class)); - - final XMLMemento memento = XMLMemento.createWriteRoot("TEST"); - context.saveProperites(memento); - - context = new PresentationContext("test"); - context.initProperties(memento); - assertEquals("Wrong value restored", "string", context.getProperty("string")); - assertEquals("Wrong value restored", new Integer(1), context.getProperty("integer")); - assertEquals("Wrong value restored", new Boolean(true), context.getProperty("boolean")); - assertEquals("Wrong value restored", ResourcesPlugin.getWorkspace().getRoot(), context.getProperty("persistable")); - context.dispose(); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java deleted file mode 100644 index 230c09c6f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java +++ /dev/null @@ -1,274 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 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.eclipe.debug.tests.viewer.model; - -import java.util.ArrayList; -import java.util.List; - -import junit.framework.TestCase; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.ModelDelta; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests to verify that the viewer properly handles selection changes. - */ -abstract public class SelectionTests extends TestCase implements ITestModelUpdatesListenerConstants { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public SelectionTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - abstract protected ITreeModelViewer createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - private static class SelectionListener implements ISelectionChangedListener { - private List fEvents = new ArrayList(1); - - public void selectionChanged(SelectionChangedEvent event) { - fEvents.add(event); - } - } - - private TestModel makeMultiLevelModel() { - TestModel model = TestModel.simpleMultiLevel(); - fViewer.setAutoExpandLevel(-1); - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - return model; - } - - /** - * In this test: - * - set selection to an element deep in the model - * - verify that selection chagned listener is called - * - verify that the selection is in the viewer is correct - */ - public void testSimpleSetSelection() { - // Create the model and populate the view. - TestModel model = makeMultiLevelModel(); - - // Create a selection object to the deepest part of the tree. - SelectionListener listener = new SelectionListener(); - fViewer.addSelectionChangedListener(listener); - - // Set the selection and verify that the listener is called. - TreeSelection selection = new TreeSelection(model.findElement("3.3.3")); - fViewer.setSelection(selection, true, false); - assertTrue(listener.fEvents.size() == 1); - - // Check that the new selection is what was requested. - ISelection viewerSelection = fViewer.getSelection(); - assertEquals(selection, viewerSelection); - } - - /** - * In this test verify that selection policy can prevent selection - * from being set and verify that a FORCE flag can override the selection - * policy. - */ - public void testSelectionPolicy() { - // Create the model and populate the view. - final TestModel model = makeMultiLevelModel(); - - // Set the selection and verify it. - TreeSelection selection_3_3_3 = new TreeSelection(model.findElement("3.3.3")); - fViewer.setSelection(selection_3_3_3, true, false); - assertEquals(selection_3_3_3, fViewer.getSelection()); - - model.setSelectionPolicy(new IModelSelectionPolicy() { - - public ISelection replaceInvalidSelection(ISelection invalidSelection, ISelection newSelection) { - return null; - } - - public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context) { - return false; - } - - public boolean isSticky(ISelection selection, IPresentationContext context) { - return true; - } - - public boolean contains(ISelection selection, IPresentationContext context) { - return true; - } - }); - - // Attempt to change selection and verify that old selection is still valid. - TreeSelection selection_3_3_1 = new TreeSelection(model.findElement("3.3.1")); - fViewer.setSelection(selection_3_3_1, true, false); - assertEquals(selection_3_3_3, fViewer.getSelection()); - - // Now attempt to *force* selection and verify that new selection was set. - fViewer.setSelection(selection_3_3_1, true, true); - assertEquals(selection_3_3_1, fViewer.getSelection()); - - // Create the an update delta to attempt to change selection back to - // 3.3.3 and verify that selection did not get overriden. - TreePath path_3_3_3 = model.findElement("3.3.3"); - ModelDelta baseDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - ModelDelta delta_3_3_3 = model.getElementDelta(baseDelta, path_3_3_3, false); - delta_3_3_3.setFlags(IModelDelta.SELECT); - fViewer.updateViewer(baseDelta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - assertEquals(selection_3_3_1, fViewer.getSelection()); - - // Add the *force* flag to the selection delta and update viewer again. - // Verify that selection did change. - delta_3_3_3.setFlags(IModelDelta.SELECT | IModelDelta.FORCE); - fViewer.updateViewer(baseDelta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - assertEquals(selection_3_3_3, fViewer.getSelection()); - } - - - /** - * In this test: - * - set a seleciton to an element - * - then remove that element - * - update the view with remove delta - * -> The selection should be re-set to empty. - */ - public void testSelectRemove() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - // Create the model and populate the view. - TestModel model = makeMultiLevelModel(); - - // Create a selection object to the deepest part of the tree. - TreePath elementPath = model.findElement("3.3.3"); - TreeSelection selection = new TreeSelection(elementPath); - - // Set the selection. - fViewer.setSelection(selection, true, false); - - // Remove the element - TreePath removePath = model.findElement("3"); - TreePath parentPath = removePath.getParentPath(); - int removeIndex = model.getElement(parentPath).indexOf( model.getElement(removePath) ); - ModelDelta delta = model.removeElementChild(removePath.getParentPath(), removeIndex); - - // Configure a selection listener - SelectionListener listener = new SelectionListener(); - fViewer.addSelectionChangedListener(listener); - - // Reset the listener and update the viewer. With a remove - // delta only wait for the delta to be processed. - fListener.reset(); - model.postDelta(delta); - while (!fListener.isFinished(TestModelUpdatesListener.MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Check to make sure the selection was made - //assertTrue(listener.fEvents.size() == 1); - - // Check that the new selection is empty - ISelection viewerSelection = fViewer.getSelection(); - assertTrue(viewerSelection.isEmpty()); - } - - - /** - * In this test: - * - set a selection to an element - * - then remove that element - * - then refresh the view. - * -> The selection should be re-set to empty. - */ - public void testSelectRemoveRefreshStruct() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - // Create the model and populate the view. - TestModel model = makeMultiLevelModel(); - - // Create a selection object to the deepest part of the tree. - TreePath elementPath = model.findElement("3.3.3"); - TreeSelection selection = new TreeSelection(elementPath); - - // Set the selection. - fViewer.setSelection(selection, true, false); - - // Remove the element - TreePath removePath = model.findElement("3"); - TreePath parentPath = removePath.getParentPath(); - int removeIndex = model.getElement(parentPath).indexOf( model.getElement(removePath) ); - model.removeElementChild(removePath.getParentPath(), removeIndex); - - // Configure a selection listener - SelectionListener listener = new SelectionListener(); - fViewer.addSelectionChangedListener(listener); - - // Reset the listener to ignore redundant updates. When elements are removed - // the viewer may still request updates for those elements. - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Refresh the viewer - model.postDelta( new ModelDelta(model.getRootElement(), IModelDelta.CONTENT) ); - while (!fListener.isFinished(TestModelUpdatesListener.ALL_UPDATES_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Check to make sure the selection was made - // Commented out until JFace bug 219887 is fixed. - //assertTrue(listener.fEvents.size() == 1); - - // Check that the new selection is empty - ISelection viewerSelection = fViewer.getSelection(); - assertTrue(viewerSelection.isEmpty()); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java deleted file mode 100644 index f1c79cb2f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java +++ /dev/null @@ -1,923 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 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.eclipe.debug.tests.viewer.model; - -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.ITreeSelection; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.TreeSelection; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests to verify that the viewer can save and restore correctly the expansion - * state of elements. - * - * @since 3.6 - */ -abstract public class StateTests extends TestCase implements ITestModelUpdatesListenerConstants { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public StateTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - abstract protected ITreeModelViewer createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - protected void runTest() throws Throwable { - try { - super.runTest(); - } catch (Throwable t) { - throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); - } - } - - protected ITreeModelContentProviderTarget getCTargetViewer() { - return (ITreeModelContentProviderTarget)fViewer; - } - - public void testUpdateViewer() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleMultiLevel(); - - // Create the listener - fListener.reset(); - fListener.addChildreUpdate(TreePath.EMPTY, 0); - fListener.addChildreUpdate(TreePath.EMPTY, 1); - fListener.addChildreUpdate(TreePath.EMPTY, 2); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Create the update delta - TestElement element = model.getRootElement(); - TreePath path0 = TreePath.EMPTY; - ModelDelta delta = new ModelDelta(model.getRootElement(), -1, IModelDelta.EXPAND, element.getChildren().length); - ModelDelta updateDelta = delta; - element = element.getChildren()[2]; - TreePath path1 = path0.createChildPath(element); - delta = delta.addNode(element, 2, IModelDelta.EXPAND, element.fChildren.length); - element = element.getChildren()[1]; - TreePath path2 = path1.createChildPath(element); - delta = delta.addNode(element, 1, IModelDelta.EXPAND, element.fChildren.length); - element = element.getChildren()[1]; - TreePath path3 = path2.createChildPath(element); - delta = delta.addNode(element, 1, IModelDelta.SELECT); - - fListener.reset(false, false); - - fListener.addChildreUpdate(path0, 2); - fListener.addHasChildrenUpdate(path1); - fListener.addChildreCountUpdate(path1); - fListener.addLabelUpdate(path1); - fListener.addChildreUpdate(path1, 1); - fListener.addHasChildrenUpdate(path2); - fListener.addChildreCountUpdate(path2); - fListener.addLabelUpdate(path2); - fListener.addHasChildrenUpdate(path2); - fListener.addChildreCountUpdate(path2); - fListener.addChildreUpdate(path2, 1); - fListener.addHasChildrenUpdate(path3); - fListener.addLabelUpdate(path3); - - fViewer.updateViewer(updateDelta); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE | LABEL_UPDATES)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Extract the new state from viewer - ModelDelta savedDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - fViewer.saveElementState(path0, savedDelta, IModelDelta.EXPAND | IModelDelta.SELECT); - - if (!deltaMatches(updateDelta, savedDelta) ) { - Assert.fail("Expected:\n" + updateDelta.toString() + "\nGot:\n" + savedDelta); - } - } - - boolean deltaMatches(ModelDelta requested, ModelDelta received) { - if ( requested.getElement().equals(received.getElement()) && - requested.getFlags() == received.getFlags() && - ( requested.getChildCount() == -1 || requested.getChildCount() == received.getChildCount() )&& - ( requested.getIndex() == -1 || requested.getIndex() == received.getIndex()) && - ((requested.getReplacementElement() != null && requested.getReplacementElement().equals(received.getReplacementElement())) || - (requested.getReplacementElement() == null && received.getReplacementElement() == null)) && - requested.getChildDeltas().length == received.getChildDeltas().length) - { - for (int i = 0; i < requested.getChildDeltas().length; i++) { - ModelDelta requestedChildDelta = (ModelDelta)requested.getChildDeltas()[i]; - ModelDelta receivedChildDelta = received.getChildDelta(requestedChildDelta.getElement()); - if ( receivedChildDelta == null || !deltaMatches(requestedChildDelta, receivedChildDelta) ) { - return false; - } - } - return true; - } - return false; - } - - /** - * Creates a model in the pattern of: - * - * root - * 1 - * 1.1 - * 1.1.1 - * 2 - * 2.1 - * 2.1.1 - * 3 - * 3.1 - * 3.1.1 - * ... - */ - private TestModel alternatingSubsreesModel(int size) { - TestModel model = new TestModel(); - - TestElement[] elements = new TestElement[size]; - for (int i = 0; i < size; i++) { - String text = Integer.toString(i + 1); - elements[i] = - new TestElement(model, text, new TestElement[] { - new TestElement(model, text + ".1", new TestElement[] { - new TestElement(model, text + ".1.1", new TestElement[0]) - }) - }); - } - model.setRoot(new TestElement(model, "root", elements)); - - return model; - } - - private boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) { - Set sel1Set = new HashSet(); - sel1Set.addAll( Arrays.asList(sel1.getPaths()) ); - - Set sel2Set = new HashSet(); - sel2Set.addAll( Arrays.asList(sel2.getPaths()) ); - - return sel1Set.equals(sel2Set); - } - - private void expandAlternateElements(TestModel model, boolean waitForAllUpdates) { - fListener.reset(); - fListener.setFailOnRedundantUpdates(false); - - TestElement rootElement = model.getRootElement(); - TestElement[] children = rootElement.getChildren(); - ModelDelta rootDelta = new ModelDelta(rootElement, IModelDelta.NO_CHANGE); - ModelDelta expandDelta = model.getBaseDelta(rootDelta); - for (int i = 0; i < children.length; i++) { - // Expand only odd children - if (i % 2 == 1) { - continue; - } - - // Expand the element and the first child of each sub-element - TestElement element = children[i]; - ModelDelta delta = expandDelta; - int index = i; - while (element.getChildren().length != 0) { - TreePath elementPath = model.findElement(element.getLabel()); - fListener.addUpdates( - elementPath, element, 1, - CHILD_COUNT_UPDATES | (waitForAllUpdates ? CHILDREN_UPDATES : 0) ); - delta = delta.addNode(element, index, IModelDelta.EXPAND, element.getChildren().length); - element = element.getChildren()[0]; - index = 0; - } - } - model.postDelta(rootDelta); - - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - public void testPreserveExpandedOnRemove() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(6); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - expandAlternateElements(model, true); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("5.1")); - fViewer.setSelection(originalSelection); - - // Update the model - ModelDelta delta = model.removeElementChild(TreePath.EMPTY, 0); - - // Remove delta should not generate any new updates - fListener.reset(); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - public void testPreserveExpandedOnInsert() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(6); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - expandAlternateElements(model, true); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("5.1")); - fViewer.setSelection(originalSelection); - - // Update the model - ModelDelta delta = model.insertElementChild(TreePath.EMPTY, 0, new TestElement(model, "0 - new", new TestElement[0])); - - // Insert delta should generate updates only for the new element - TreePath path = model.findElement("0 - new"); - // Note: redundant label updates on insert. - fListener.reset(path, (TestElement)path.getLastSegment(), 0, false, false); - fListener.addChildreUpdate(TreePath.EMPTY, 0); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | ALL_UPDATES_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("1.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - public void testPreserveExpandedOnMultLevelContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(6); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - expandAlternateElements(model, true); - - // Set a selection in view - // Set a selection in view - TreeSelection originalSelection = new TreeSelection( - new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findElement("6") }); - fViewer.setSelection(originalSelection); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Update the model - model.removeElementChild(TreePath.EMPTY, 0); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - fListener.addUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE); - - // Create the delta which has nodes with CONTENT flag set at multiple levels. - ModelDelta rootDelta = new ModelDelta(model.getRootElement(), IModelDelta.CONTENT); - ModelDelta elementDelta = model.getElementDelta(rootDelta, model.findElement("3.1.1"), true); - elementDelta.setFlags(IModelDelta.CONTENT); - - // Post the multi-content update delta - model.postDelta(rootDelta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - - public void testPreserveExpandedOnSubTreeContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - - // Expand all - fViewer.setAutoExpandLevel(-1); - - // Create the listener, - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Turn off auto-expansion - fViewer.setAutoExpandLevel(0); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("3.3.1")); - fViewer.setSelection(originalSelection); - - // Update the model - model.addElementChild(model.findElement("3"), 0, new TestElement(model, "3.0 - new", new TestElement[0])); - - // Create the delta for element "3" with content update. - TreePath elementPath = model.findElement("3"); - ModelDelta rootDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - ModelDelta elementDelta = model.getElementDelta(rootDelta, elementPath, true); - elementDelta.setFlags(IModelDelta.CONTENT); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - fListener.addUpdates(getCTargetViewer(), elementPath, model.getElement(elementPath), -1, ALL_UPDATES_COMPLETE); - - // Post the sub-tree update - model.postDelta(rootDelta); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - // On windows, getExpandedState() may return true for an element with no children: - // Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.0 - new")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.2")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.3")) == true); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - public void _X_testPreserveExpandedOnContentStress() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(6); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - expandAlternateElements(model, true); - - // Set a selection in view -// TreeSelection originalSelection = new TreeSelection( -// new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findElement("6") }); - TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); - fViewer.setSelection(originalSelection); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Run this test ten times as we've seen intermittent failures related - // to timing in it. - for (int i = 0; i < 10; i++) { - // Update the model - model.removeElementChild(TreePath.EMPTY, 0); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - fListener.addUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE); - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Update the model again - model.addElementChild(TreePath.EMPTY, 0, new TestElement(model, "1", new TestElement[0])); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - fListener.addUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE); - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - model.validateData(fViewer, TreePath.EMPTY, true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - } - - public void _X_testPreserveLargeModelOnContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(100); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); -// model.validateData(fViewer, TreePath.EMPTY, true); - - expandAlternateElements(model, false); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); - fViewer.setSelection(originalSelection); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Update the model - model.removeElementChild(TreePath.EMPTY, 0); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Update the model again - model.addElementChild(TreePath.EMPTY, 0, new TestElement(model, "1", new TestElement[0])); - - // Note: Re-expanding nodes causes redundant updates. - fListener.reset(false, false); - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - /** - * This test verifies that if the model selects a new element - * following a content refresh, the state restore logic will - * not override the selection requested by the model. - */ - public void testPreserveSelectionDeltaAfterContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - - // Expand all - fViewer.setAutoExpandLevel(-1); - - // Create the listener. - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Set a selection in view - fViewer.setSelection(new TreeSelection(model.findElement("3.1.1"))); - - // Reset the listener (ignore redundant updates) - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Refresh content. - // Note: Wait only for the processing of the delta, not for all updates - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Update the viewer with new selection delta to something new in the view - ModelDelta selectDelta = model.makeElementDelta(model.findElement("2.1"), IModelDelta.SELECT); - - // Wait for the second model delta to process - fListener.resetModelChanged(); - model.postDelta(selectDelta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Wait for all the updates to complete (note: we're not resetting the listener. - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Check to make sure that the state restore didn't change the selection. - Assert.assertEquals(new TreeSelection(model.findElement("2.1")), fViewer.getSelection()); - } - - public void testPreserveCollapseDeltaAfterContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - - // Expand all - fViewer.setAutoExpandLevel(-1); - - // Create the listener. - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Turn off auto-expand - fViewer.setAutoExpandLevel(0); - - // Reset the listener (ignore redundant updates) - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Refresh content. - // Note: Wait only for the processing of the delta, not for all updates - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Update the viewer to collapse an element - ModelDelta collapseDelta = model.makeElementDelta(model.findElement("3.1"), IModelDelta.COLLAPSE); - - // Remove updates for the collapsed element from listener, because they - // will never happen if the element remains collapsed. - fListener.resetModelChanged(); - fListener.removeLabelUpdate(model.findElement("3.1.1")); - fListener.removeLabelUpdate(model.findElement("3.1.2")); - fListener.removeLabelUpdate(model.findElement("3.1.3")); - fListener.removeHasChildrenUpdate(model.findElement("3.1.1")); - fListener.removeHasChildrenUpdate(model.findElement("3.1.2")); - fListener.removeHasChildrenUpdate(model.findElement("3.1.3")); - fListener.removeChildreCountUpdate(model.findElement("3.1")); - fListener.removeChildrenUpdate(model.findElement("3.1"), 0); - fListener.removeChildrenUpdate(model.findElement("3.1"), 1); - fListener.removeChildrenUpdate(model.findElement("3.1"), 2); - - // Wait for the second model delta to process - model.postDelta(collapseDelta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Wait for all the updates to complete (note: we're not resetting the listener. - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Check to make sure that the state restore didn't change the selection. - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == false); - } - - public void testPreserveExpandDeltaAfterContent() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - - // Note: Do not auto-expand! - - // Create the listener. - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Reset the listener (ignore redundant updates) - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false); - - // Refresh content. - // Note: Wait only for the processing of the delta, not for all updates - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Update the viewer to expand an element - ModelDelta expandDelta = model.makeElementDelta(model.findElement("3.1"), IModelDelta.EXPAND); - - // Wait for the second model delta to process - fListener.resetModelChanged(); - model.postDelta(expandDelta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Wait for all the updates to complete (note: we're not resetting the listener. - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Check to make sure that the state restore didn't change the selection. - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - } - - - public void testSaveAndRestore1() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(6); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY, true); - - // Expand some, but not all elements - expandAlternateElements(model, true); - - // Set a selection in view - fViewer.setSelection(new TreeSelection(new TreePath[] { model.findElement("5.1"), model.findElement("5.1.1"), model.findElement("6.1.1") } )); - - // Extract the original state from viewer - ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - fViewer.saveElementState(TreePath.EMPTY, originalState, IModelDelta.EXPAND | IModelDelta.SELECT); - - // Set the viewer input to null. This will trigger the view to save the viewer state. - fListener.reset(true, false); - fListener.addStateUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement()); - fViewer.setInput(null); - while (!fListener.isFinished(STATE_SAVE_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Set the viewer input back to the model. When view updates are complete - // the viewer - // Note: disable redundant updates because the reveal delta triggers one. - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false); - // TODO: add state updates somehow? - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Extract the restored state from viewer - ModelDelta restoredState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - fViewer.saveElementState(TreePath.EMPTY, restoredState, IModelDelta.EXPAND | IModelDelta.SELECT); - - if (!deltaMatches(originalState, restoredState)) { - Assert.fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState); - } - } - - public void testSaveAndRestore2() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = TestModel.simpleMultiLevel(); - - // expand all elements - fViewer.setAutoExpandLevel(-1); - - // Create the listener, only check the first level - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Set a selection in view - fViewer.setSelection(new TreeSelection(new TreePath[] { model.findElement("3.2"), model.findElement("3.2.1"), model.findElement("2") } )); - fViewer.setSelection(new TreeSelection(model.findElement("3.2.3"))); - - // Turn off the auto-expand now since we want to text the auto-expand logic - fViewer.setAutoExpandLevel(-1); - - // Extract the original state from viewer - ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - fViewer.saveElementState(TreePath.EMPTY, originalState, IModelDelta.EXPAND | IModelDelta.SELECT); - - // Set the viewer input to null. This will trigger the view to save the viewer state. - fListener.reset(true, false); - fListener.addStateUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement()); - - fViewer.setInput(null); - while (!fListener.isFinished(STATE_SAVE_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Set the viewer input back to the model. When view updates are complete - // the viewer - // Note: disable redundant updates because the reveal delta triggers one. - fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false); - // TODO: add state updates somehow? - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Extract the restored state from viewer - ModelDelta restoredState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE); - fViewer.saveElementState(TreePath.EMPTY, restoredState, IModelDelta.EXPAND | IModelDelta.SELECT); - - if (!deltaMatches(originalState, restoredState)) { - Assert.fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState); - } - } - - - public void testSaveAndRestoreLarge() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(100); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - expandAlternateElements(model, false); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); - fViewer.setSelection(originalSelection); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Set the viewer input to null. This will trigger the view to save the viewer state. - fListener.reset(); - fListener.addStateUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement()); - - fViewer.setInput(null); - while (!fListener.isFinished(STATE_SAVE_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Set the viewer input back to the model. When view updates are complete - // the viewer - // Note: disable redundant updates because the reveal delta triggers one. - fListener.reset(); - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data (only select visible elements). - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("1.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } - - /** - * This test saves state of a large tree. Then the tree is modified - * to contain much fewer elements. The restore logic should discard the - * rest of the saved state delta once all the elements are visible. - */ - public void testSaveAndRestorePartialStateLarge() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - TestModel model = alternatingSubsreesModel(100); - - // NOTE: WE ARE NOT EXPANDING ANY CHILDREN - - // Create the listener, only check the first level - fListener.reset(); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - expandAlternateElements(model, false); - - // Set a selection in view - TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); - fViewer.setSelection(originalSelection); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - - // Set the viewer input to null. This will trigger the view to save the viewer state. - fListener.reset(); - fListener.addStateUpdates(getCTargetViewer(), TreePath.EMPTY, model.getRootElement()); - - fViewer.setInput(null); - while (!fListener.isFinished(STATE_SAVE_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - - TestElement[] elements = model.getRootElement().getChildren(); - TestElement[] newElements = new TestElement[10]; - System.arraycopy(elements, 0, newElements, 0, newElements.length); - model.setElementChildren(TreePath.EMPTY, newElements); - - // Set the viewer input back to the model. When view updates are complete - // the viewer - // Note: disable redundant updates because the reveal delta triggers one. - fListener.reset(); - fViewer.setInput(model.getRootElement()); - - // MONITOR FOR THE STATE RESTORE TO COMPLETE - while (!fListener.isFinished(CONTENT_UPDATES_COMPLETE| STATE_RESTORE_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Validate data - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("1.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("2")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("3.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("4")) == false); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("5.1")) == true); - Assert.assertTrue(getCTargetViewer().getExpandedState(model.findElement("6")) == false); - Assert.assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) ); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModel.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModel.java deleted file mode 100644 index 8a6aad223..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModel.java +++ /dev/null @@ -1,672 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 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.eclipe.debug.tests.viewer.model; - -import java.util.Arrays; - -import junit.framework.Assert; - -import org.eclipse.core.runtime.PlatformObject; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelCheckProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate; -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.IElementCompareRequest; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider; -import org.eclipse.debug.internal.ui.viewers.model.provisional.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.ILabelUpdate; -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.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.ModelDelta; -import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.jface.viewers.Viewer; - -/** - * Test model for the use in unit tests. This test model contains a set of - * elements in a tree structure. It contains utility methods for modifying the - * model and for verifying that the viewer content matches the model. - * - * @since 3.6 - */ -public class TestModel implements IElementContentProvider, IElementLabelProvider, IModelProxyFactory2 , IElementMementoProvider, IModelSelectionPolicyFactory { - - public static class TestElement extends PlatformObject { - private final TestModel fModel; - private final String fID; - TestElement[] fChildren; - String fLabelAppendix = ""; - boolean fExpanded; - boolean fChecked; - boolean fGrayed; - - public TestElement(TestModel model, String text, TestElement[] children) { - this (model, text, false, false, children); - } - - public TestElement(TestModel model, String text, boolean checked, boolean grayed, TestElement[] children) { - fModel = model; - fID = text; - fChildren = children; - fChecked = checked; - fGrayed = grayed; - } - - public TestModel getModel() { - return fModel; - } - - public Object getAdapter(Class adapter) { - if (adapter.isInstance(fModel)) { - return fModel; - } - return null; - } - - public String getID() { - return fID; - } - - public void setLabelAppendix(String appendix) { - fLabelAppendix = appendix; - } - - public String getLabel() { - return fID + fLabelAppendix; - } - - public TestElement[] getChildren() { - return fChildren; - } - - public boolean isExpanded() { - return fExpanded; - } - - public boolean getGrayed() { - return fGrayed; - } - - public boolean getChecked() { - return fChecked; - } - - public void setChecked(boolean checked, boolean grayed) { - fChecked = checked; - fGrayed = grayed; - } - - public boolean equals(Object obj) { - return obj instanceof TestElement && fID.equals(((TestElement)obj).fID); - } - - public int hashCode() { - return fID.hashCode(); - } - - public String toString() { - return getLabel(); - } - - public int indexOf(TestElement child) { - return Arrays.asList(fChildren).indexOf(child); - } - } - - private class ModelProxy extends AbstractModelProxy { - public void installed(Viewer viewer) { - super.installed(viewer); - ModelDelta rootDelta = TestModel.this.getBaseDelta(new ModelDelta(fInput, IModelDelta.NO_CHANGE)); - installSubModelProxies(fRootPath, rootDelta); - fireModelChanged(rootDelta); - } - - private void installSubModelProxies(TreePath path, ModelDelta delta) { - TestElement element = getElement(path); - if (element.fModel != TestModel.this) { - // Found an element from a different model. Install its proxy and return. - delta.setFlags(delta.getFlags() | IModelDelta.INSTALL); - } else { - TestElement[] children = element.getChildren(); - - for (int i = 0; i < children.length; i++) { - installSubModelProxies(path.createChildPath(children[i]), delta.addNode(children[i], IModelDelta.NO_CHANGE)); - } - } - } - } - - private TestElement fRoot; - private Object fInput = null; - private TreePath fRootPath = TreePath.EMPTY; - private ModelProxy fModelProxy; - private IModelSelectionPolicy fModelSelectionPolicy; - - - /** - * Constructor private. Use static factory methods instead. - */ - public TestModel() {} - - public TestElement getRootElement() { - return fRoot; - } - - public void setSelectionPolicy(IModelSelectionPolicy modelSelectionPolicy) { - fModelSelectionPolicy = modelSelectionPolicy; - } - - public IModelSelectionPolicy createModelSelectionPolicyAdapter(Object element, IPresentationContext context) { - return fModelSelectionPolicy; - } - - public ModelDelta getBaseDelta(ModelDelta rootDelta) { - ModelDelta delta = rootDelta; - for (int i = 0; i < fRootPath.getSegmentCount(); i++) { - ModelDelta subDelta = delta.getChildDelta(fRootPath.getSegment(i)); - if (subDelta == null) { - subDelta = delta.addNode(fRootPath.getSegment(i), IModelDelta.NO_CHANGE); - } - delta = subDelta; - } - delta.setChildCount(getRootElement().getChildren().length); - return delta; - } - - public int getModelDepth() { - return getDepth(getRootElement(), 0); - } - - private int getDepth(TestElement element, int atDepth) { - TestElement[] children = element.getChildren(); - if (children.length == 0) { - return atDepth; - } - int depth = atDepth + 1; - for (int i = 0; i < children.length; i++) { - depth = Math.max(depth, getDepth(children[i], atDepth + 1)); - } - - return depth; - } - - public void update(IHasChildrenUpdate[] updates) { - for (int i = 0; i < updates.length; i++) { - TestElement element = (TestElement)updates[i].getElement(); - updates[i].setHasChilren(element.getChildren().length > 0); - updates[i].done(); - } - } - - public void update(IChildrenCountUpdate[] updates) { - for (int i = 0; i < updates.length; i++) { - TestElement element = (TestElement)updates[i].getElement(); - updates[i].setChildCount(element.getChildren().length); - updates[i].done(); - } - } - - public void update(IChildrenUpdate[] updates) { - for (int i = 0; i < updates.length; i++) { - TestElement element = (TestElement)updates[i].getElement(); - int endOffset = updates[i].getOffset() + updates[i].getLength(); - for (int j = updates[i].getOffset(); j < endOffset; j++) { - if (j < element.getChildren().length) { - updates[i].setChild(element.getChildren()[j], j); - } - } - updates[i].done(); - } - } - - public void update(ILabelUpdate[] updates) { - for (int i = 0; i < updates.length; i++) { - TestElement element = (TestElement)updates[i].getElement(); - updates[i].setLabel(element.getLabel(), 0); - if (updates[i] instanceof ICheckUpdate && - Boolean.TRUE.equals(updates[i].getPresentationContext().getProperty(ICheckUpdate.PROP_CHECK))) - { - ((ICheckUpdate)updates[i]).setChecked(element.getChecked(), element.getGrayed()); - } - updates[i].done(); - } - } - - public final static String ELEMENT_MEMENTO_ID = "id"; - - public void compareElements(IElementCompareRequest[] updates) { - for (int i = 0; i < updates.length; i++) { - String elementID = ((TestElement)updates[i].getElement()).getID(); - String mementoID = updates[i].getMemento().getString(ELEMENT_MEMENTO_ID); - updates[i].setEqual( elementID.equals(mementoID) ); - updates[i].done(); - } - - } - - public void encodeElements(IElementMementoRequest[] updates) { - for (int i = 0; i < updates.length; i++) { - String elementID = ((TestElement)updates[i].getElement()).getID(); - updates[i].getMemento().putString(ELEMENT_MEMENTO_ID, elementID); - updates[i].done(); - } - } - - - public void elementChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) { - TestElement element = getElement(path); - Assert.assertFalse(element.getGrayed()); - element.setChecked(checked, false); - } - - public IModelProxy createTreeModelProxy(Object input, TreePath path, IPresentationContext context) { - fModelProxy = new ModelProxy(); - fInput = input; - fRootPath = path; - return fModelProxy; - } - - public IModelProxy getModelProxy() { - return fModelProxy; - } - - public TestElement getElement(TreePath path) { - if (path.getSegmentCount() == 0) { - return getRootElement(); - } else { - return (TestElement)path.getLastSegment(); - } - } - - public void setAllExpanded() { - doSetExpanded(fRoot); - } - - private void doSetExpanded(TestElement element) { - element.fExpanded = true; - for (int i = 0; i < element.fChildren.length; i++) { - doSetExpanded(element.fChildren[i]); - } - } - - public void setAllAppendix(String appendix) { - doSetAllAppendix(fRoot, appendix); - } - - private void doSetAllAppendix(TestElement element, String appendix) { - element.setLabelAppendix(appendix); - for (int i = 0; i < element.fChildren.length; i++) { - doSetAllAppendix(element.fChildren[i], appendix); - } - } - - public void validateData(ITreeModelViewer viewer, TreePath path) { - validateData(viewer, path, false); - } - - public void validateData(ITreeModelViewer _viewer, TreePath path, boolean expandedElementsOnly) { - ITreeModelContentProviderTarget viewer = (ITreeModelContentProviderTarget)_viewer; - TestElement element = getElement(path); - if ( Boolean.TRUE.equals(_viewer.getPresentationContext().getProperty(ICheckUpdate.PROP_CHECK)) ) { - ITreeModelCheckProviderTarget checkTarget = (ITreeModelCheckProviderTarget)_viewer; - Assert.assertEquals(element.getChecked(), checkTarget.getElementChecked(path)); - Assert.assertEquals(element.getGrayed(), checkTarget.getElementGrayed(path)); - } - - if (!expandedElementsOnly || path.getSegmentCount() == 0 || viewer.getExpandedState(path) ) { - TestElement[] children = element.getChildren(); - Assert.assertEquals(children.length, viewer.getChildCount(path)); - - for (int i = 0; i < children.length; i++) { - Assert.assertEquals(children[i], viewer.getChildElement(path, i)); - validateData(viewer, path.createChildPath(children[i]), expandedElementsOnly); - } - } else if (!viewer.getExpandedState(path)) { - // If element not expanded, verify the plus sign. - Assert.assertEquals(viewer.getHasChildren(path), element.getChildren().length > 0); - } - } - - public void setRoot(TestElement root) { - fRoot = root; - } - - public void postDelta(IModelDelta delta) { - fModelProxy.fireModelChanged(delta); - } - - /** Create or retrieve delta for given path - * @param combine if then new deltas for the given path are created. If false existing ones are reused. - */ - public ModelDelta getElementDelta(ModelDelta baseDelta, TreePath path, boolean combine) { - TestElement element = getRootElement(); - ModelDelta delta = baseDelta; - - for (int i = 0; i < path.getSegmentCount(); i++) { - TestElement[] children = element.getChildren(); - delta.setChildCount(children.length); - Object segment = path.getSegment(i); - int j; - for (j = 0; j < children.length; j++) { - if (segment.equals(children[j])) { - element = children[j]; - ModelDelta nextDelta = null; - if (combine) { - nextDelta = delta.getChildDelta(element); - } - if (nextDelta == null) { - nextDelta = delta.addNode(element, j, IModelDelta.NO_CHANGE, element.getChildren().length); - } - delta = nextDelta; - break; - } - } - if (j == children.length) { - throw new IllegalArgumentException("Invalid path"); - } - } - return delta; - - } - - private TreePath getRelativePath(TreePath path) { - Object[] segments = new Object[path.getSegmentCount() - fRootPath.getSegmentCount()]; - for (int i = fRootPath.getSegmentCount(), _i = 0; i < path.getSegmentCount(); i++, _i++) { - segments[_i] = path.getSegment(i); - } - return new TreePath(segments); - } - - public ModelDelta appendElementLabel(TreePath path, String labelAppendix) { - Assert.assertTrue(path.startsWith(fRootPath, null)); - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - TreePath relativePath = getRelativePath(path); - TestElement element = getElement(relativePath); - ModelDelta delta = getElementDelta(baseDelta, relativePath, false); - element.setLabelAppendix(labelAppendix); - delta.setFlags(delta.getFlags() | IModelDelta.STATE); - - return rootDelta; - } - - public ModelDelta setElementChecked(TreePath path, boolean checked, boolean grayed) { - Assert.assertTrue(path.startsWith(fRootPath, null)); - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - TreePath relativePath = getRelativePath(path); - TestElement element = getElement(relativePath); - ModelDelta delta = getElementDelta(baseDelta, relativePath, false); - element.setChecked(checked, grayed); - delta.setFlags(delta.getFlags() | IModelDelta.STATE); - - return rootDelta; - } - - public ModelDelta setElementChildren(TreePath path, TestElement[] children) { - Assert.assertTrue(path.startsWith(fRootPath, null)); - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - TreePath relativePath = getRelativePath(path); - - // Find the parent element and generate the delta node for it. - TestElement element = getElement(relativePath); - ModelDelta delta = getElementDelta(baseDelta, relativePath, false); - - // Set the new children array - element.fChildren = children; - - // Add the delta flag and update the child count in the parent delta. - delta.setFlags(delta.getFlags() | IModelDelta.CONTENT); - delta.setChildCount(children.length); - - return rootDelta; - } - - public ModelDelta replaceElementChild(TreePath parentPath, int index, TestElement child) { - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - TreePath relativePath = getRelativePath(parentPath); - - TestElement element = getElement(relativePath); - ModelDelta delta= getElementDelta(baseDelta, relativePath, false); - TestElement oldChild = element.fChildren[index]; - element.fChildren[index] = child; - delta.addNode(oldChild, child, IModelDelta.REPLACED); - // TODO: set replacement index!?! - - return rootDelta; - } - - public ModelDelta addElementChild(TreePath parentPath, int index, TestElement newChild) { - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - TreePath relativePath = getRelativePath(parentPath); - - // Find the parent element and generate the delta node for it. - TestElement element = getElement(relativePath); - ModelDelta delta= getElementDelta(baseDelta, relativePath, false); - - // Add the new element - element.fChildren = doInsertElementInArray(element.fChildren, index, newChild); - - // Add the delta flag and update the child count in the parent delta. - delta.setChildCount(element.getChildren().length); - delta.addNode(newChild, index, IModelDelta.ADDED); - - return rootDelta; - } - - public ModelDelta insertElementChild(TreePath parentPath, int index, TestElement newChild) { - return insertElementChild(null, parentPath, index, newChild); - } - - public ModelDelta insertElementChild(ModelDelta rootDelta, TreePath parentPath, int index, TestElement newChild) { - if (rootDelta == null) { - rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - } - ModelDelta baseDelta = getBaseDelta(rootDelta); - TreePath relativePath = getRelativePath(parentPath); - - // Find the parent element and generate the delta node for it. - TestElement element = getElement(relativePath); - ModelDelta delta= getElementDelta(baseDelta, relativePath, false); - - // Add the new element - element.fChildren = doInsertElementInArray(element.fChildren, index, newChild); - - // Add the delta flag and update the child count in the parent delta. - delta.setChildCount(element.getChildren().length); - delta.addNode(newChild, index, IModelDelta.INSERTED); - - return rootDelta; - } - - private TestElement[] doInsertElementInArray(TestElement[] children, int index, TestElement newChild) { - // Create the new children array add the element to it and set it to - // the parent. - TestElement[] newChildren = new TestElement[children.length + 1]; - System.arraycopy(children, 0, newChildren, 0, index); - newChildren[index] = newChild; - System.arraycopy(children, index, newChildren, index + 1, children.length - index); - return newChildren; - } - - public ModelDelta removeElementChild(TreePath parentPath, int index) { - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - - // Find the parent element and generate the delta node for it. - TestElement element = getElement(parentPath); - ModelDelta delta= getElementDelta(baseDelta, parentPath, false); - - // Create a new child array with the element removed - TestElement[] children = element.getChildren(); - TestElement childToRemove = children[index]; - TestElement[] newChildren = new TestElement[children.length - 1]; - System.arraycopy(children, 0, newChildren, 0, index); - System.arraycopy(children, index + 1, newChildren, index, children.length - index - 1); - element.fChildren = newChildren; - - // Add the delta flag and update the child count in the parent delta. - delta.setChildCount(element.getChildren().length); - delta.addNode(childToRemove, index, IModelDelta.REMOVED); - - return rootDelta; - } - - public ModelDelta makeElementDelta(TreePath path, int flags) { - ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE); - ModelDelta baseDelta = getBaseDelta(rootDelta); - - // Find the element and generate the delta node for it. - ModelDelta delta= getElementDelta(baseDelta, path, false); - - delta.setFlags(flags); - return rootDelta; - } - - public TreePath findElement(String label) { - return findElement(TreePath.EMPTY, label); - } - - public TreePath findElement(TreePath startPath, String label) { - TestElement element = getElement(startPath); - for (int i = 0; i < element.getChildren().length; i++) { - TestElement child = element.getChildren()[i]; - TreePath path = startPath.createChildPath(child); - if ( label.equals(child.getLabel()) ) { - return path; - } else { - TreePath subPath = findElement(path, label); - if (subPath != null) { - return subPath; - } - } - } - return null; - } - - public String toString() { - return getElementString(fRoot, ""); - } - - public String getElementString(TestElement element, String indent) { - StringBuffer builder = new StringBuffer(); - builder.append(indent); - builder.append(element.toString()); - builder.append('\n'); - TestElement[] children = element.getChildren(); - for (int i = 0; i < children.length; i++) { - builder.append(getElementString(children[i], indent + " ")); - } - return builder.toString(); - } - - public static TestModel simpleSingleLevel() { - TestModel model = new TestModel(); - model.setRoot( new TestElement(model, "root", new TestElement[] { - new TestElement(model, "1", true, true, new TestElement[0]), - new TestElement(model, "2", true, false, new TestElement[0]), - new TestElement(model, "3", false, true, new TestElement[0]), - new TestElement(model, "4", false, false, new TestElement[0]), - new TestElement(model, "5", new TestElement[0]), - new TestElement(model, "6", new TestElement[0]) - }) ); - return model; - } - - public static TestModel simpleMultiLevel() { - TestModel model = new TestModel(); - model.setRoot( new TestElement(model, "root", new TestElement[] { - new TestElement(model, "1", new TestElement[0]), - new TestElement(model, "2", true, false, new TestElement[] { - new TestElement(model, "2.1", true, true, new TestElement[0]), - new TestElement(model, "2.2", false, true, new TestElement[0]), - new TestElement(model, "2.3", true, false, new TestElement[0]), - }), - new TestElement(model, "3", new TestElement[] { - new TestElement(model, "3.1", new TestElement[] { - new TestElement(model, "3.1.1", new TestElement[0]), - new TestElement(model, "3.1.2", new TestElement[0]), - new TestElement(model, "3.1.3", new TestElement[0]), - }), - new TestElement(model, "3.2", new TestElement[] { - new TestElement(model, "3.2.1", new TestElement[0]), - new TestElement(model, "3.2.2", new TestElement[0]), - new TestElement(model, "3.2.3", new TestElement[0]), - }), - new TestElement(model, "3.3", new TestElement[] { - new TestElement(model, "3.3.1", new TestElement[0]), - new TestElement(model, "3.3.2", new TestElement[0]), - new TestElement(model, "3.3.3", new TestElement[0]), - }), - }) - }) ); - return model; - } - - public static TestModel compositeMultiLevel() { - TestModel m2 = new TestModel(); - m2.setRoot( new TestElement(m2, "m2.root", new TestElement[] { - new TestElement(m2, "m2.1", new TestElement[0]), - new TestElement(m2, "m2.2", true, false, new TestElement[] { - new TestElement(m2, "m2.2.1", true, true, new TestElement[0]), - new TestElement(m2, "m2.2.2", false, true, new TestElement[0]), - new TestElement(m2, "m2.2.3", true, false, new TestElement[0]), - }), - }) ); - - TestModel m3 = new TestModel(); - m3.setRoot( new TestElement(m3, "m3.root", new TestElement[] { - new TestElement(m3, "m3.1", new TestElement[0]), - new TestElement(m3, "m3.2", true, false, new TestElement[] { - new TestElement(m3, "m3.2.1", true, true, new TestElement[0]), - new TestElement(m3, "m3.2.2", false, true, new TestElement[0]), - new TestElement(m3, "m3.2.3", true, false, new TestElement[0]), - }), - }) ); - - TestModel m4 = new TestModel(); - m4.setRoot( new TestElement(m4, "m4.root", new TestElement[] { - new TestElement(m4, "m4.1", new TestElement[0]), - new TestElement(m4, "m4.2", true, false, new TestElement[] { - new TestElement(m4, "m4.2.1", true, true, new TestElement[0]), - new TestElement(m4, "m4.2.2", false, true, new TestElement[0]), - new TestElement(m4, "m4.2.3", true, false, new TestElement[0]), - }), - }) ); - - TestModel m1 = new TestModel(); - m1.setRoot( new TestElement(m1, "m1.root", new TestElement[] { - new TestElement(m1, "m1.1", new TestElement[0]), - new TestElement(m1, "m1.2", true, false, new TestElement[] { - m2.fRoot, - m3.fRoot, - m4.fRoot, - }), - }) ); - - - return m1; - } - - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModelUpdatesListener.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModelUpdatesListener.java deleted file mode 100644 index 468e7d1c3..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModelUpdatesListener.java +++ /dev/null @@ -1,641 +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.eclipe.debug.tests.viewer.model; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; - -import junit.framework.Assert; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.debug.internal.ui.viewers.model.ILabelUpdateListener; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.IHasChildrenUpdate; -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.IStateUpdateListener; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener; -import org.eclipse.jface.viewers.TreePath; - -public class TestModelUpdatesListener - implements IViewerUpdateListener, ILabelUpdateListener, IModelChangedListener, ITestModelUpdatesListenerConstants, - IStateUpdateListener -{ - private final ITreeModelViewer fViewer; - - private boolean fFailOnRedundantUpdates; - private Set fRedundantUpdates = new HashSet(); - - private boolean fFailOnMultipleModelUpdateSequences; - private boolean fMultipleModelUpdateSequencesObserved; - private boolean fFailOnMultipleLabelUpdateSequences; - private boolean fMultipleLabelUpdateSequencesObserved; - - private Set fHasChildrenUpdatesScheduled = new HashSet(); - private Set fHasChildrenUpdatesRunning = new HashSet(); - private Set fHasChildrenUpdatesCompleted = new HashSet(); - private Map fChildrenUpdatesScheduled = new HashMap(); - private Set fChildrenUpdatesRunning = new HashSet(); - private Set fChildrenUpdatesCompleted = new HashSet(); - private Set fChildCountUpdatesScheduled = new HashSet(); - private Set fChildCountUpdatesRunning = new HashSet(); - private Set fChildCountUpdatesCompleted = new HashSet(); - private Set fLabelUpdates = new HashSet(); - private Set fLabelUpdatesRunning = new HashSet(); - private Set fLabelUpdatesCompleted = new HashSet(); - private Set fProxyModels = new HashSet(); - private Set fStateUpdates = new HashSet(); - private boolean fViewerUpdatesStarted; - private boolean fViewerUpdatesComplete; - private boolean fLabelUpdatesStarted; - private boolean fLabelUpdatesComplete; - private boolean fModelChangedComplete; - private boolean fStateSaveStarted; - private boolean fStateSaveComplete; - private boolean fStateRestoreStarted; - private boolean fStateRestoreComplete; - private int fViewerUpdatesCounter; - private int fLabelUpdatesCounter; - private int fTimeoutInterval = 60000; - private long fTimeoutTime; - - - public TestModelUpdatesListener(ITreeModelViewer viewer, boolean failOnRedundantUpdates, boolean failOnMultipleModelUpdateSequences) { - this(viewer); - setFailOnRedundantUpdates(failOnRedundantUpdates); - setFailOnMultipleModelUpdateSequences(failOnMultipleModelUpdateSequences); - } - - public TestModelUpdatesListener(ITreeModelViewer viewer) { - fViewer = viewer; - fViewer.addLabelUpdateListener(this); - fViewer.addModelChangedListener(this); - fViewer.addStateUpdateListener(this); - fViewer.addViewerUpdateListener(this); - } - - public void dispose() { - fViewer.removeLabelUpdateListener(this); - fViewer.removeModelChangedListener(this); - fViewer.removeStateUpdateListener(this); - fViewer.removeViewerUpdateListener(this); - } - - - public void setFailOnRedundantUpdates(boolean failOnRedundantUpdates) { - fFailOnRedundantUpdates = failOnRedundantUpdates; - } - - public void setFailOnMultipleModelUpdateSequences(boolean failOnMultipleLabelUpdateSequences) { - fFailOnMultipleModelUpdateSequences = failOnMultipleLabelUpdateSequences; - } - - public void setFailOnMultipleLabelUpdateSequences(boolean failOnMultipleLabelUpdateSequences) { - fFailOnMultipleLabelUpdateSequences = failOnMultipleLabelUpdateSequences; - } - - /** - * Sets the the maximum amount of time (in milliseconds) that the update listener - * is going to wait. If set to -1, the listener will wait indefinitely. - */ - public void setTimeoutInterval(int milis) { - fTimeoutInterval = milis; - } - - public void reset(TreePath path, TestElement element, int levels, boolean failOnRedundantUpdates, boolean failOnMultipleUpdateSequences) { - reset(); - addUpdates(path, element, levels); - addProxies(element); - setFailOnRedundantUpdates(failOnRedundantUpdates); - setFailOnMultipleModelUpdateSequences(failOnMultipleUpdateSequences); - setFailOnMultipleLabelUpdateSequences(false); - } - - public void reset(boolean failOnRedundantUpdates, boolean failOnMultipleUpdateSequences) { - reset(); - setFailOnRedundantUpdates(failOnRedundantUpdates); - setFailOnMultipleModelUpdateSequences(failOnMultipleUpdateSequences); - setFailOnMultipleLabelUpdateSequences(false); - } - - public void reset() { - fRedundantUpdates.clear(); - fMultipleLabelUpdateSequencesObserved = false; - fMultipleModelUpdateSequencesObserved = false; - fHasChildrenUpdatesScheduled.clear(); - fHasChildrenUpdatesRunning.clear(); - fHasChildrenUpdatesCompleted.clear(); - fChildrenUpdatesScheduled.clear(); - fChildrenUpdatesRunning.clear(); - fChildrenUpdatesCompleted.clear(); - fChildCountUpdatesScheduled.clear(); - fChildCountUpdatesRunning.clear(); - fChildCountUpdatesCompleted.clear(); - fLabelUpdates.clear(); - fLabelUpdatesRunning.clear(); - fLabelUpdatesCompleted.clear(); - fProxyModels.clear(); - fViewerUpdatesStarted = false; - fViewerUpdatesComplete = false; - fLabelUpdatesStarted = false; - fLabelUpdatesComplete = false; - fStateSaveStarted = false; - fStateSaveComplete = false; - fStateRestoreStarted = false; - fStateRestoreComplete = false; - fTimeoutTime = System.currentTimeMillis() + fTimeoutInterval; - resetModelChanged(); - } - - public void resetModelChanged() { - fModelChangedComplete = false; - } - - public void addHasChildrenUpdate(TreePath path) { - fHasChildrenUpdatesScheduled.add(path); - } - - public void removeHasChildrenUpdate(TreePath path) { - fHasChildrenUpdatesScheduled.remove(path); - } - - public void addChildreCountUpdate(TreePath path) { - fChildCountUpdatesScheduled.add(path); - } - - public void removeChildreCountUpdate(TreePath path) { - fChildCountUpdatesScheduled.remove(path); - } - - public void addChildreUpdate(TreePath path, int index) { - Set childrenIndexes = (Set)fChildrenUpdatesScheduled.get(path); - if (childrenIndexes == null) { - childrenIndexes = new TreeSet(); - fChildrenUpdatesScheduled.put(path, childrenIndexes); - } - childrenIndexes.add(new Integer(index)); - } - - public void removeChildrenUpdate(TreePath path, int index) { - Set childrenIndexes = (Set)fChildrenUpdatesScheduled.get(path); - if (childrenIndexes != null) { - childrenIndexes.remove(new Integer(index)); - if (childrenIndexes.isEmpty()) { - fChildrenUpdatesScheduled.remove(path); - } - } - } - - public void addLabelUpdate(TreePath path) { - fLabelUpdates.add(path); - } - - public void removeLabelUpdate(TreePath path) { - fLabelUpdates.remove(path); - } - - public void addUpdates(TreePath path, TestElement element, int levels) { - addUpdates(path, element, levels, ALL_UPDATES_COMPLETE); - } - - public void addStateUpdates(ITreeModelContentProviderTarget viewer, TreePath path, TestElement element) { - addUpdates(viewer, path, element, -1, STATE_UPDATES); - } - - public void addUpdates(TreePath path, TestElement element, int levels, int flags) { - addUpdates(null, path, element, levels, flags); - } - - public void addUpdates(ITreeModelContentProviderTarget viewer, TreePath path, TestElement element, int levels, int flags) { - if (!path.equals(TreePath.EMPTY)) { - if ((flags & LABEL_UPDATES) != 0) { - fLabelUpdates.add(path); - } - if ((flags & HAS_CHILDREN_UPDATES) != 0) { - fHasChildrenUpdatesScheduled.add(path); - } - } - - if (levels-- != 0) { - TestElement[] children = element.getChildren(); - if (children.length > 0 && (viewer == null || path.getSegmentCount() == 0 || viewer.getExpandedState(path))) { - if ((flags & CHILD_COUNT_UPDATES) != 0) { - fChildCountUpdatesScheduled.add(path); - } - if ((flags & CHILDREN_UPDATES) != 0) { - Set childrenIndexes = new HashSet(); - for (int i = 0; i < children.length; i++) { - childrenIndexes.add(new Integer(i)); - } - fChildrenUpdatesScheduled.put(path, childrenIndexes); - } - - if ((flags & STATE_UPDATES) != 0 && viewer != null) { - fStateUpdates.add(path); - } - - for (int i = 0; i < children.length; i++) { - addUpdates(viewer, path.createChildPath(children[i]), children[i], levels, flags); - } - } - - } - } - - private void addProxies(TestElement element) { - TestModel model = element.getModel(); - if (model.getModelProxy() == null) { - fProxyModels.add(element.getModel()); - } - TestElement[] children = element.getChildren(); - for (int i = 0; i < children.length; i++) { - addProxies(children[i]); - } - } - - public boolean isFinished() { - return isFinished(ALL_UPDATES_COMPLETE); - } - - public boolean isTimedOut() { - return fTimeoutInterval > 0 && fTimeoutTime < System.currentTimeMillis(); - } - - public boolean isFinished(int flags) { - if (isTimedOut()) { - throw new RuntimeException("Timed Out: " + toString(flags)); - } - - if (fFailOnRedundantUpdates && !fRedundantUpdates.isEmpty()) { - Assert.fail("Redundant Updates: " + fRedundantUpdates.toString()); - } - if (fFailOnMultipleLabelUpdateSequences && !fMultipleLabelUpdateSequencesObserved) { - Assert.fail("Multiple label update sequences detected"); - } - if (fFailOnMultipleModelUpdateSequences && fMultipleModelUpdateSequencesObserved) { - Assert.fail("Multiple viewer update sequences detected"); - } - - if ( (flags & LABEL_UPDATES_COMPLETE) != 0) { - if (!fLabelUpdatesComplete) return false; - } - if ( (flags & LABEL_UPDATES_STARTED) != 0) { - if (!fLabelUpdatesStarted) return false; - } - if ( (flags & LABEL_UPDATES) != 0) { - if (!fLabelUpdates.isEmpty()) return false; - } - if ( (flags & CONTENT_UPDATES_STARTED) != 0) { - if (!fViewerUpdatesStarted) return false; - } - if ( (flags & CONTENT_UPDATES_COMPLETE) != 0) { - if (!fViewerUpdatesComplete) return false; - } - if ( (flags & HAS_CHILDREN_UPDATES_STARTED) != 0) { - if (fHasChildrenUpdatesRunning.isEmpty() && fHasChildrenUpdatesCompleted.isEmpty()) return false; - } - if ( (flags & HAS_CHILDREN_UPDATES) != 0) { - if (!fHasChildrenUpdatesScheduled.isEmpty()) return false; - } - if ( (flags & CHILD_COUNT_UPDATES_STARTED) != 0) { - if (fChildCountUpdatesRunning.isEmpty() && fChildCountUpdatesCompleted.isEmpty()) return false; - } - if ( (flags & CHILD_COUNT_UPDATES) != 0) { - if (!fChildCountUpdatesScheduled.isEmpty()) return false; - } - if ( (flags & CHILDREN_UPDATES_STARTED) != 0) { - if (fChildrenUpdatesRunning.isEmpty() && fChildrenUpdatesCompleted.isEmpty()) return false; - } - if ( (flags & CHILDREN_UPDATES) != 0) { - if (!fChildrenUpdatesScheduled.isEmpty()) return false; - } - if ( (flags & MODEL_CHANGED_COMPLETE) != 0) { - if (!fModelChangedComplete) return false; - } - if ( (flags & STATE_SAVE_COMPLETE) != 0) { - if (!fStateSaveComplete) return false; - } - if ( (flags & STATE_SAVE_STARTED) != 0) { - if (!fStateSaveStarted) return false; - } - if ( (flags & STATE_RESTORE_COMPLETE) != 0) { - if (!fStateRestoreComplete) return false; - } - if ( (flags & STATE_RESTORE_STARTED) != 0) { - if (!fStateRestoreStarted) return false; - } - if ( (flags & MODEL_PROXIES_INSTALLED) != 0) { - if (fProxyModels.size() != 0) return false; - } - if ( (flags & VIEWER_UPDATES_RUNNING) != 0) { - if (fViewerUpdatesCounter != 0) { - return false; - } - } - if ( (flags & LABEL_UPDATES_RUNNING) != 0) { - if (fLabelUpdatesCounter != 0) { - return false; - } - } - - - return true; - } - - public void updateStarted(IViewerUpdate update) { - synchronized (this) { - fViewerUpdatesCounter++; - if (update instanceof IHasChildrenUpdate) { - fHasChildrenUpdatesRunning.add(update); - } if (update instanceof IChildrenCountUpdate) { - fChildCountUpdatesRunning.add(update); - } else if (update instanceof IChildrenUpdate) { - fChildCountUpdatesRunning.add(update); - } - } - } - - public void updateComplete(IViewerUpdate update) { - synchronized (this) { - fViewerUpdatesCounter--; - } - - if (!update.isCanceled()) { - if (update instanceof IHasChildrenUpdate) { - fHasChildrenUpdatesRunning.remove(update); - fHasChildrenUpdatesCompleted.add(update); - if (!fHasChildrenUpdatesScheduled.remove(update.getElementPath()) && fFailOnRedundantUpdates) { - fRedundantUpdates.add(update); - } - } if (update instanceof IChildrenCountUpdate) { - fChildCountUpdatesRunning.remove(update); - fChildCountUpdatesCompleted.add(update); - if (!fChildCountUpdatesScheduled.remove(update.getElementPath()) && fFailOnRedundantUpdates) { - fRedundantUpdates.add(update); - } - } else if (update instanceof IChildrenUpdate) { - fChildrenUpdatesRunning.remove(update); - fChildrenUpdatesCompleted.add(update); - - int start = ((IChildrenUpdate)update).getOffset(); - int end = start + ((IChildrenUpdate)update).getLength(); - - Set childrenIndexes = (Set)fChildrenUpdatesScheduled.get(update.getElementPath()); - if (childrenIndexes != null) { - for (int i = start; i < end; i++) { - childrenIndexes.remove(new Integer(i)); - } - if (childrenIndexes.isEmpty()) { - fChildrenUpdatesScheduled.remove(update.getElementPath()); - } - } else if (fFailOnRedundantUpdates) { - fRedundantUpdates.add(update); - } - } - } - } - - public void viewerUpdatesBegin() { - if (fFailOnMultipleModelUpdateSequences && fViewerUpdatesComplete) { - fMultipleModelUpdateSequencesObserved = true; - } - fViewerUpdatesStarted = true; - } - - public void viewerUpdatesComplete() { - fViewerUpdatesComplete = true; - } - - public void labelUpdateComplete(ILabelUpdate update) { - synchronized (this) { - fLabelUpdatesRunning.remove(update); - fLabelUpdatesCompleted.add(update); - fLabelUpdatesCounter--; - } - if (!fLabelUpdates.remove(update.getElementPath()) && fFailOnRedundantUpdates) { - Assert.fail("Redundant update: " + update); - } - } - - public void labelUpdateStarted(ILabelUpdate update) { - synchronized (this) { - fLabelUpdatesRunning.add(update); - fLabelUpdatesCounter++; - } - } - - public void labelUpdatesBegin() { - if (fFailOnMultipleLabelUpdateSequences && fLabelUpdatesComplete) { - fMultipleLabelUpdateSequencesObserved = true; - } - fLabelUpdatesStarted = true; - } - - public void labelUpdatesComplete() { - fLabelUpdatesComplete = true; - } - - public void modelChanged(IModelDelta delta, IModelProxy proxy) { - fModelChangedComplete = true; - - for (Iterator itr = fProxyModels.iterator(); itr.hasNext();) { - TestModel model = (TestModel)itr.next(); - if (model.getModelProxy() == proxy) { - itr.remove(); - break; - } - } - } - - public void stateRestoreUpdatesBegin(Object input) { - fStateRestoreStarted = true; - } - - public void stateRestoreUpdatesComplete(Object input) { - fStateRestoreComplete = true; - } - - public void stateSaveUpdatesBegin(Object input) { - fStateSaveStarted = true; - } - - public void stateSaveUpdatesComplete(Object input) { - fStateSaveComplete = true; - } - - public void stateUpdateComplete(Object input, IViewerUpdate update) { - } - - public void stateUpdateStarted(Object input, IViewerUpdate update) { - } - - private String toString(int flags) { - StringBuffer buf = new StringBuffer("Viewer Update Listener"); - - if (fFailOnRedundantUpdates) { - buf.append("\n\t"); - buf.append("fRedundantUpdates = " + fRedundantUpdates); - } - if (fFailOnMultipleLabelUpdateSequences) { - buf.append("\n\t"); - buf.append("fMultipleLabelUpdateSequencesObserved = " + fMultipleLabelUpdateSequencesObserved); - } - if (fFailOnMultipleModelUpdateSequences) { - buf.append("\n\t"); - buf.append("fMultipleModelUpdateSequencesObserved = " + fMultipleModelUpdateSequencesObserved); - } - if ( (flags & LABEL_UPDATES_COMPLETE) != 0) { - buf.append("\n\t"); - buf.append("fLabelUpdatesComplete = " + fLabelUpdatesComplete); - } - if ( (flags & LABEL_UPDATES_RUNNING) != 0) { - buf.append("\n\t"); - buf.append("fLabelUpdatesRunning = " + fLabelUpdatesCounter); - } - if ( (flags & LABEL_UPDATES_STARTED) != 0) { - buf.append("\n\t"); - buf.append("fLabelUpdatesRunning = "); - buf.append( fLabelUpdatesRunning ); - buf.append("\n\t"); - buf.append("fLabelUpdatesCompleted = "); - buf.append( fLabelUpdatesCompleted ); - } - if ( (flags & LABEL_UPDATES) != 0) { - buf.append("\n\t"); - buf.append("fLabelUpdates = "); - buf.append( toString(fLabelUpdates) ); - } - if ( (flags & CONTENT_UPDATES_COMPLETE) != 0) { - buf.append("\n\t"); - buf.append("fViewerUpdatesComplete = " + fViewerUpdatesComplete); - } - if ( (flags & VIEWER_UPDATES_RUNNING) != 0) { - buf.append("\n\t"); - buf.append("fViewerUpdatesRunning = " + fViewerUpdatesCounter); - } - if ( (flags & HAS_CHILDREN_UPDATES_STARTED) != 0) { - buf.append("\n\t"); - buf.append("fHasChildrenUpdatesRunning = "); - buf.append( fHasChildrenUpdatesRunning ); - buf.append("\n\t"); - buf.append("fHasChildrenUpdatesCompleted = "); - buf.append( fHasChildrenUpdatesCompleted ); - } - if ( (flags & HAS_CHILDREN_UPDATES) != 0) { - buf.append("\n\t"); - buf.append("fHasChildrenUpdates = "); - buf.append( toString(fHasChildrenUpdatesScheduled) ); - } - if ( (flags & CHILD_COUNT_UPDATES_STARTED) != 0) { - buf.append("\n\t"); - buf.append("fChildCountUpdatesRunning = "); - buf.append( fChildCountUpdatesRunning ); - buf.append("\n\t"); - buf.append("fChildCountUpdatesCompleted = "); - buf.append( fChildCountUpdatesCompleted ); - } - if ( (flags & CHILD_COUNT_UPDATES) != 0) { - buf.append("\n\t"); - buf.append("fChildCountUpdates = "); - buf.append( toString(fChildCountUpdatesScheduled) ); - } - if ( (flags & CHILDREN_UPDATES_STARTED) != 0) { - buf.append("\n\t"); - buf.append("fChildrenUpdatesRunning = "); - buf.append( fChildrenUpdatesRunning ); - buf.append("\n\t"); - buf.append("fChildrenUpdatesCompleted = "); - buf.append( fChildrenUpdatesCompleted ); - } - if ( (flags & CHILDREN_UPDATES) != 0) { - buf.append("\n\t"); - buf.append("fChildrenUpdates = "); - buf.append( toString(fChildrenUpdatesScheduled) ); - } - if ( (flags & MODEL_CHANGED_COMPLETE) != 0) { - buf.append("\n\t"); - buf.append("fModelChangedComplete = " + fModelChangedComplete); - } - if ( (flags & STATE_SAVE_COMPLETE) != 0) { - buf.append("\n\t"); - buf.append("fStateSaveComplete = " + fStateSaveComplete); - } - if ( (flags & STATE_RESTORE_COMPLETE) != 0) { - buf.append("\n\t"); - buf.append("fStateRestoreComplete = " + fStateRestoreComplete); - } - if ( (flags & MODEL_PROXIES_INSTALLED) != 0) { - buf.append("\n\t"); - buf.append("fProxyModels = " + fProxyModels); - } - if (fTimeoutInterval > 0) { - buf.append("\n\t"); - buf.append("fTimeoutInterval = " + fTimeoutInterval); - } - return buf.toString(); - } - - private String toString(Set set) { - if (set.isEmpty()) { - return "(EMPTY)"; - } - StringBuffer buf = new StringBuffer(); - for (Iterator itr = set.iterator(); itr.hasNext(); ) { - buf.append("\n\t\t"); - buf.append(toString((TreePath)itr.next())); - } - return buf.toString(); - } - - private String toString(Map map) { - if (map.isEmpty()) { - return "(EMPTY)"; - } - StringBuffer buf = new StringBuffer(); - for (Iterator itr = map.keySet().iterator(); itr.hasNext(); ) { - buf.append("\n\t\t"); - TreePath path = (TreePath)itr.next(); - buf.append(toString(path)); - Set updates = (Set)map.get(path); - buf.append(" = "); - buf.append(updates.toString()); - } - return buf.toString(); - } - - private String toString(TreePath path) { - if (path.getSegmentCount() == 0) { - return "/"; - } - StringBuffer buf = new StringBuffer(); - for (int i = 0; i < path.getSegmentCount(); i++) { - buf.append("/"); - buf.append(path.getSegment(i)); - } - return buf.toString(); - } - - public String toString() { - return toString(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE | STATE_RESTORE_COMPLETE | VIEWER_UPDATES_STARTED | LABEL_UPDATES_STARTED); - } -} - - diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java deleted file mode 100644 index 2600fbebb..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java +++ /dev/null @@ -1,94 +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.eclipe.debug.tests.viewer.model; - -import java.util.LinkedList; - -import org.eclipse.core.runtime.Assert; -import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate; -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.jface.viewers.ILazyTreePathContentProvider; -import org.eclipse.jface.viewers.TreePath; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.swt.widgets.TreeItem; -import org.eclipse.swt.widgets.Widget; - -/** - * - */ -public class TreeModelViewerAutopopulateAgent implements IViewerUpdateListener { - - private TreeModelViewer fViewer; - - - public TreeModelViewerAutopopulateAgent(TreeModelViewer viewer) { - fViewer = viewer; - fViewer.addViewerUpdateListener(this); - } - - public void updateComplete(IViewerUpdate update) { - if (update instanceof IChildrenCountUpdate) { - TreePath path = update.getElementPath(); - ILazyTreePathContentProvider contentProvider = (ILazyTreePathContentProvider) fViewer.getContentProvider(); - - Widget[] items = fViewer.testFindItems(update.getElement()); - for (int i = 0; i < items.length; i++) { - if ( path.equals(getTreePath(items[i])) ) { - int itemCount = getItemChildCount(items[i]); - for (int j = 0; j < itemCount; j++) { - contentProvider.updateElement(path, j); - } - } - } - } - } - - public void updateStarted(IViewerUpdate update) { - // TODO Auto-generated method stub - - } - - public void viewerUpdatesBegin() { - // TODO Auto-generated method stub - - } - - public void viewerUpdatesComplete() { - // TODO Auto-generated method stub - - } - - private TreePath getTreePath(Widget w) { - if (w instanceof TreeItem) { - TreeItem item = (TreeItem)w; - LinkedList segments = new LinkedList(); - while (item != null) { - Object segment = item.getData(); - Assert.isNotNull(segment); - segments.addFirst(segment); - item = item.getParentItem(); - } - return new TreePath(segments.toArray()); - } - return TreePath.EMPTY; - } - - private int getItemChildCount(Widget w) { - if (w instanceof Tree) { - return ((Tree)w).getItemCount(); - } else if (w instanceof TreeItem) { - return ((TreeItem)w).getItemCount(); - } - return 0; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java deleted file mode 100644 index 2380ce8f9..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java +++ /dev/null @@ -1,329 +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.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipe.debug.tests.viewer.model.TestModel.TestElement; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -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.TreePath; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests to verify that the viewer property updates following changes in the - * model, following simple content update deltas from the model. - * - * @since 3.6 - */ -abstract public class UpdateTests extends TestCase implements ITestModelUpdatesListenerConstants { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public UpdateTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - abstract protected ITreeModelViewer createViewer(Display display, Shell shell); - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - protected void runTest() throws Throwable { - try { - super.runTest(); - } catch (Throwable t) { - throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); - } - } - - /** - * This test: - * - creates a simple model - * - replaces the list of elements with a shorter list of elements - * - refreshes the viewer - */ - public void testRemoveElements() { - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement root = model.getRootElement(); - TreePath rootPath = new TreePath(new Object[] {}); - TestElement[] newElements = new TestElement[] { - new TestElement(model, "1", new TestElement[0]), - new TestElement(model, "2", new TestElement[0]), - new TestElement(model, "3", new TestElement[0]), - }; - model.setElementChildren(rootPath, newElements); - - // Reset the listener to NOT fail on redundant updates. - // When elements are remvoed from the model and the model is - // refreshed the viewer will issue an IChildrenUpdate for the - // missing elements as an optimization. - fListener.reset(rootPath, root, -1, false, false); - - model.postDelta(new ModelDelta(root, IModelDelta.CONTENT)); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - /** - * This test: - * - creates a simple model - * - sets a list of children to one of the elements - * - refreshes the viewer - */ - public void testAddNewChildren() { - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - TestElement element = model.getRootElement().getChildren()[0]; - TreePath elementPath = new TreePath(new Object[] { element }); - TestElement[] newChildren = new TestElement[] { - new TestElement(model, "1.1", new TestElement[0]), - new TestElement(model, "1.2", new TestElement[0]), - new TestElement(model, "1.3", new TestElement[0]), - }; - model.setElementChildren(elementPath, newChildren); - - // Reset the viewer to ignore redundant updates. The '1' element - // will be updated for "hasChildren" before it is expanded, which is - // expected. - TreePath rootPath = TreePath.EMPTY; - TestElement rootElement = model.getRootElement(); - fListener.reset(rootPath, rootElement, -1, false, false); - - // Refresh the viewer - model.postDelta(new ModelDelta(rootElement, IModelDelta.CONTENT)); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } - - - private void removeElement(TestModel model, int index, boolean validate) { - ModelDelta delta = model.removeElementChild(TreePath.EMPTY, index); - - // Remove delta should generate no new updates, but we still need to wait for the event to - // be processed. - fListener.reset(); - model.postDelta(delta); - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - if (validate) { - model.validateData(fViewer, TreePath.EMPTY); - } - } - - private void addElement(TestModel model, String label, int position, boolean validate) { - ModelDelta delta = model.addElementChild(TreePath.EMPTY, position, new TestElement(model, label, new TestElement[0])); - - // Remove delta should generate no new updates, but we still need to wait for the event to - // be processed. - fListener.reset(); - model.postDelta(delta); - - if (validate) { - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CONTENT_UPDATES_COMPLETE | LABEL_UPDATES_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } else { - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - } - - private void insertElement(TestModel model, String label, int position, boolean validate) { - ModelDelta delta = model.insertElementChild(TreePath.EMPTY, position, new TestElement(model, label, new TestElement[0])); - - // Remove delta should generate no new updates, but we still need to wait for the event to - // be processed. - fListener.reset(); - model.postDelta(delta); - - if (validate) { - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CONTENT_UPDATES_COMPLETE | LABEL_UPDATES_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - } else { - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - } - - public void testRepeatedAddRemoveElement() { - //TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer); - - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Update the model - removeElement(model, 2, true); - addElement(model, "3-new", 3, true); - removeElement(model, 4, true); - addElement(model, "5-new", 5, true); - removeElement(model, 1, true); - addElement(model, "1-new", 1, true); - removeElement(model, 3, true); - addElement(model, "4-new", 4, true); - } - - - /** - * This test case attempts to create a race condition between processing - * of the content updates and processing of add/remove model deltas. - *
                              - * See bug 304066 - */ - public void _X_testContentPlusAddRemoveUpdateRaceConditionsElement() { - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - // Create a listener to listen only to a children count update for the root. - TestModelUpdatesListener childrenCountUpdateListener = new TestModelUpdatesListener(fViewer, false, false); - - for (int i = 0; i < 10; i++) { - String pass = "pass #" + i; - - // Request a content update for view - childrenCountUpdateListener.reset(); - childrenCountUpdateListener.addChildreCountUpdate(TreePath.EMPTY); - model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT)); - // Wait until the delta is processed - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - removeElement(model, 5, false); - removeElement(model, 4, false); - removeElement(model, 3, false); - removeElement(model, 2, false); - removeElement(model, 1, false); - removeElement(model, 0, false); - - // Wait until the children count update is completed using the count from - // before elements were removed. - while (!childrenCountUpdateListener.isFinished(CHILD_COUNT_UPDATES)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - insertElement(model, "1 - " + pass, 0, false); - insertElement(model, "2 - " + pass, 1, false); - insertElement(model, "3 - " + pass, 2, false); - insertElement(model, "4 - " + pass, 3, false); - insertElement(model, "5 - " + pass, 4, false); - insertElement(model, "6 - " + pass, 5, false); - - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) - if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - } - - childrenCountUpdateListener.dispose(); - } - - - /** - * This test forces the viewer to reschedule pending content updates - * due to a remove event from the model. - * @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#rescheduleUpdates - */ - public void testRescheduleUpdates() { - TestModel model = TestModel.simpleSingleLevel(); - fViewer.setAutoExpandLevel(-1); - - // Create the listener - fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false); - - // Set the input into the view and update the view. - fViewer.setInput(model.getRootElement()); - while (!fListener.isFinished()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - model.validateData(fViewer, TreePath.EMPTY); - - for (int i = 0; i < 5; i++) { - // Refresh the viewer so that updates are generated. - TestElement rootElement = model.getRootElement(); - fListener.reset(); - fListener.addUpdates(TreePath.EMPTY, model.getRootElement(), 1, CHILD_COUNT_UPDATES); - model.postDelta(new ModelDelta(rootElement, IModelDelta.CONTENT)); - - // Wait for the delta to be processed. - while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES)) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - - // Update the model - removeElement(model, 0, true); - addElement(model, "1", 0, true); - } - } - - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerContentTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerContentTests.java deleted file mode 100644 index 8cacbe173..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerContentTests.java +++ /dev/null @@ -1,31 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerContentTests extends ContentTests { - - public VirtualViewerContentTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerDeltaTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerDeltaTests.java deleted file mode 100644 index f3101784f..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerDeltaTests.java +++ /dev/null @@ -1,31 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerDeltaTests extends DeltaTests { - - public VirtualViewerDeltaTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java deleted file mode 100644 index 7ff53f54c..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java +++ /dev/null @@ -1,76 +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.eclipe.debug.tests.viewer.model; - -import junit.framework.TestCase; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -/** - * Tests which verify the operation of the virtual viewer in the lazy mode. - * Note: the virtual viewer doesn't support lazy mode yet, so this class - * is really just a big place holder. - * - * @since 3.6 - */ -public class VirtualViewerLazyModeTests extends TestCase { - Display fDisplay; - Shell fShell; - ITreeModelViewer fViewer; - TestModelUpdatesListener fListener; - - public VirtualViewerLazyModeTests(String name) { - super(name); - } - - /** - * @throws java.lang.Exception - */ - protected void setUp() throws Exception { - fDisplay = PlatformUI.getWorkbench().getDisplay(); - fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/); - fShell.setMaximized(true); - fShell.setLayout(new FillLayout()); - - fViewer = createViewer(fDisplay, fShell); - - fListener = new TestModelUpdatesListener(fViewer, false, false); - - fShell.open (); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(display, SWT.VIRTUAL, new PresentationContext("TestViewer")); - } - - /** - * @throws java.lang.Exception - */ - protected void tearDown() throws Exception { - fListener.dispose(); - fViewer.getPresentationContext().dispose(); - - // Close the shell and exit. - fShell.close(); - while (!fShell.isDisposed()) if (!fDisplay.readAndDispatch ()) fDisplay.sleep (); - } - - public void test() { - // TODO - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPerformanceTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPerformanceTests.java deleted file mode 100644 index 2c4e6cd6b..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPerformanceTests.java +++ /dev/null @@ -1,35 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerPerformanceTests extends PerformanceTests { - - public VirtualViewerPerformanceTests(String name) { - super(name); - } - - protected ITreeModelContentProviderTarget createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); - } - - protected int getTestModelDepth() { - return 7; - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPopupTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPopupTests.java deleted file mode 100644 index 71484d116..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPopupTests.java +++ /dev/null @@ -1,33 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerPopupTests extends PopupTests { - - public VirtualViewerPopupTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell, int style) { - return new VirtualTreeModelViewer(fDisplay, style, new PresentationContext("TestViewer")); - } - - -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerSelectionTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerSelectionTests.java deleted file mode 100644 index e716acf03..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerSelectionTests.java +++ /dev/null @@ -1,31 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerSelectionTests extends SelectionTests { - - public VirtualViewerSelectionTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerStateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerStateTests.java deleted file mode 100644 index 5a4e4d671..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerStateTests.java +++ /dev/null @@ -1,31 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerStateTests extends StateTests { - - public VirtualViewerStateTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerUpdateTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerUpdateTests.java deleted file mode 100644 index 507be5192..000000000 --- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerUpdateTests.java +++ /dev/null @@ -1,31 +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.eclipe.debug.tests.viewer.model; - -import org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer; -import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationContext; -import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; - -/** - * @since 3.6 - */ -public class VirtualViewerUpdateTests extends UpdateTests { - - public VirtualViewerUpdateTests(String name) { - super(name); - } - - protected ITreeModelViewer createViewer(Display display, Shell shell) { - return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java deleted file mode 100644 index 4d9b0b45b..000000000 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/AutomatedSuite.java +++ /dev/null @@ -1,95 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.debug.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipe.debug.tests.launching.AcceleratorSubstitutionTests; -import org.eclipe.debug.tests.launching.LaunchConfigurationTests; -import org.eclipe.debug.tests.launching.LaunchFavoriteTests; -import org.eclipe.debug.tests.launching.LaunchHistoryTests; -import org.eclipe.debug.tests.launching.LaunchManagerTests; -import org.eclipe.debug.tests.launching.RefreshTabTests; -import org.eclipe.debug.tests.view.memory.MemoryRenderingTests; -import org.eclipe.debug.tests.viewer.model.ChildrenUpdateTests; -import org.eclipe.debug.tests.viewer.model.FilterTransformTests; -import org.eclipe.debug.tests.viewer.model.JFaceViewerCheckTests; -import org.eclipe.debug.tests.viewer.model.JFaceViewerContentTests; -import org.eclipe.debug.tests.viewer.model.JFaceViewerDeltaTests; -import org.eclipe.debug.tests.viewer.model.JFaceViewerSelectionTests; -import org.eclipe.debug.tests.viewer.model.JFaceViewerStateTests; -import org.eclipe.debug.tests.viewer.model.JFaceViewerUpdateTests; -import org.eclipe.debug.tests.viewer.model.PresentationContextTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerContentTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerDeltaTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerLazyModeTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerSelectionTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerStateTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerUpdateTests; -import org.eclipse.debug.tests.statushandlers.StatusHandlerTests; - -/** - * Tests for integration and nightly builds. - * - * @since 3.6 - */ -public class AutomatedSuite extends TestSuite { - - /** - * Returns the suite. This is required to use the JUnit Launcher. - * - * @return the test suite - */ - public static Test suite() { - return new AutomatedSuite(); - } - - /** - * Constructs the automated test suite. Adds all tests. - */ - public AutomatedSuite() { - // JFace viewer tests - addTest(new TestSuite(JFaceViewerCheckTests.class)); - addTest(new TestSuite(JFaceViewerContentTests.class)); - addTest(new TestSuite(JFaceViewerDeltaTests.class)); - addTest(new TestSuite(JFaceViewerSelectionTests.class)); - addTest(new TestSuite(JFaceViewerStateTests.class)); - addTest(new TestSuite(JFaceViewerUpdateTests.class)); - - // Virtual viewer tests - addTest(new TestSuite(VirtualViewerDeltaTests.class)); - addTest(new TestSuite(VirtualViewerContentTests.class)); - addTest(new TestSuite(VirtualViewerLazyModeTests.class)); - addTest(new TestSuite(VirtualViewerSelectionTests.class)); - addTest(new TestSuite(VirtualViewerStateTests.class)); - addTest(new TestSuite(VirtualViewerUpdateTests.class)); - - // Viewer neutral tests - addTest(new TestSuite(FilterTransformTests.class)); - addTest(new TestSuite(ChildrenUpdateTests.class)); - addTest(new TestSuite(PresentationContextTests.class)); - - // Memory view - addTest(new TestSuite(MemoryRenderingTests.class)); - - // Launch framework - addTest(new TestSuite(LaunchConfigurationTests.class)); - addTest(new TestSuite(AcceleratorSubstitutionTests.class)); - addTest(new TestSuite(LaunchHistoryTests.class)); - addTest(new TestSuite(LaunchFavoriteTests.class)); - addTest(new TestSuite(LaunchManagerTests.class)); - addTest(new TestSuite(RefreshTabTests.class)); - - // Status handlers - addTest(new TestSuite(StatusHandlerTests.class)); - } -} diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java deleted file mode 100644 index 98fcfaca9..000000000 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/PerformanceSuite.java +++ /dev/null @@ -1,46 +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.tests; - -import junit.framework.Test; -import junit.framework.TestSuite; - -import org.eclipe.debug.tests.viewer.model.JFaceViewerPerformanceTests; -import org.eclipe.debug.tests.viewer.model.VirtualViewerPerformanceTests; - -/** - * Tests for release builds. - * - * @since 3.6 - */ -public class PerformanceSuite extends TestSuite { - - /** - * Returns the suite. This is required to use the JUnit Launcher. - * - * @return the test suite - */ - public static Test suite() { - return new PerformanceSuite(); - } - - /** - * Constructs the automated test suite. Adds all tests. - */ - public PerformanceSuite() { - // JFace viewer tests - addTest(new TestSuite(JFaceViewerPerformanceTests.class)); - - // Virtual viewer tests - addTest(new TestSuite(VirtualViewerPerformanceTests.class)); - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java deleted file mode 100644 index 6652d3339..000000000 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java +++ /dev/null @@ -1,113 +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 - * IBM - ongoing enhancements - *******************************************************************************/ -package org.eclipse.debug.tests; - -import java.io.File; -import java.io.IOException; -import java.net.URL; - -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.FileLocator; -import org.eclipse.core.runtime.IPath; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - * - * @since 3.6 - */ -public class TestsPlugin extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "org.eclipse.debug.tests"; //$NON-NLS-1$ - - // The shared instance - private static TestsPlugin plugin; - - /** - * The constructor - */ - public TestsPlugin() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static TestsPlugin getDefault() { - return plugin; - } - - /** - * Returns the file corresponding to the specified path from within this bundle - * @param path - * @return the file corresponding to the specified path from within this bundle, or - * null if not found - */ - public File getFileInPlugin(IPath path) { - try { - Bundle bundle = getDefault().getBundle(); - URL installURL= new URL(bundle.getEntry("/"), path.toString()); - URL localURL= FileLocator.toFileURL(installURL);//Platform.asLocalURL(installURL); - return new File(localURL.getFile()); - } catch (IOException e) { - return null; - } - } - - /** - * Creates a new project with the specified name - * @param projectName - * @return a new project with the specified name - * @throws CoreException - */ - public static IProject createProject(String projectName) throws CoreException { - IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); - IProject project= root.getProject(projectName); - if (!project.exists()) { - project.create(null); - } else { - project.refreshLocal(IResource.DEPTH_INFINITE, null); - } - - if (!project.isOpen()) { - project.open(null); - } - return project; - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java deleted file mode 100644 index 6315b43f1..000000000 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java +++ /dev/null @@ -1,29 +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.tests.statushandlers; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.debug.core.IStatusHandler; - -/** - * Test status handler - */ -public class StatusHandler 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 { - return null; - } - -} diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java deleted file mode 100644 index bb002ca6e..000000000 --- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandlerTests.java +++ /dev/null @@ -1,56 +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.tests.statushandlers; - -import junit.framework.TestCase; - -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.preferences.InstanceScope; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.IStatusHandler; -import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; -import org.eclipse.debug.internal.core.Preferences; -import org.eclipse.debug.tests.TestsPlugin; - -/** - * Tests status handlers - */ -public class StatusHandlerTests extends TestCase { - - /** - * Status for which a handler is registered. - */ - public static final IStatus STATUS = new Status(IStatus.ERROR, TestsPlugin.PLUGIN_ID, 333,"", null); - - /** - * Tests that a status handler extension exists - */ - public void testStatusHandlerExtension() { - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(STATUS); - assertNotNull("missing status handler extension", handler); - assertTrue("Unexpected handler", handler instanceof StatusHandler); - } - - /** - * Tests that status handlers are not returned when preference is disabled - */ - public void testDisableStatusHandlers() { - try { - Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, false, new InstanceScope()); - IStatusHandler handler = DebugPlugin.getDefault().getStatusHandler(STATUS); - assertNull("status handler extension should be disabled", handler); - } finally { - Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_ENABLE_STATUS_HANDLERS, true, new InstanceScope()); - } - } - -} diff --git a/org.eclipse.debug.tests/test-import/Import1.launch b/org.eclipse.debug.tests/test-import/Import1.launch deleted file mode 100644 index cb886fecf..000000000 --- a/org.eclipse.debug.tests/test-import/Import1.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.tests/test-import/Import2.launch b/org.eclipse.debug.tests/test-import/Import2.launch deleted file mode 100644 index 23065ebe7..000000000 --- a/org.eclipse.debug.tests/test-import/Import2.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.tests/test-import/Import3.launch b/org.eclipse.debug.tests/test-import/Import3.launch deleted file mode 100644 index db7943d57..000000000 --- a/org.eclipse.debug.tests/test-import/Import3.launch +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.tests/test-import/Import4.launch b/org.eclipse.debug.tests/test-import/Import4.launch deleted file mode 100644 index 687854047..000000000 --- a/org.eclipse.debug.tests/test-import/Import4.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.tests/test-import/Import5.launch b/org.eclipse.debug.tests/test-import/Import5.launch deleted file mode 100644 index 61e32f5b0..000000000 --- a/org.eclipse.debug.tests/test-import/Import5.launch +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/org.eclipse.debug.tests/test.xml b/org.eclipse.debug.tests/test.xml deleted file mode 100644 index a52699707..000000000 --- a/org.eclipse.debug.tests/test.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.ui.console/.classpath b/org.eclipse.ui.console/.classpath deleted file mode 100644 index ce7393340..000000000 --- a/org.eclipse.ui.console/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.eclipse.ui.console/.cvsignore b/org.eclipse.ui.console/.cvsignore deleted file mode 100644 index ba077a403..000000000 --- a/org.eclipse.ui.console/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -bin diff --git a/org.eclipse.ui.console/.project b/org.eclipse.ui.console/.project deleted file mode 100644 index b48657dd4..000000000 --- a/org.eclipse.ui.console/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.ui.console - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index aa7d7641b..000000000 --- a/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,99 +0,0 @@ -#Thu Feb 26 08:17:36 CST 2009 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=disabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=ignore -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=error -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.compiler.taskCaseSensitive=enabled -org.eclipse.jdt.core.compiler.taskPriorities=NORMAL,HIGH,NORMAL,HIGH,HIGH -org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX,EXPERIMENTAL,CONTEXTLAUNCHING -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.ui.console/.settings/org.eclipse.pde.prefs b/org.eclipse.ui.console/.settings/org.eclipse.pde.prefs deleted file mode 100644 index cc551467a..000000000 --- a/org.eclipse.ui.console/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,29 +0,0 @@ -#Mon Dec 14 12:09:13 CST 2009 -compilers.f.unresolved-features=1 -compilers.f.unresolved-plugins=1 -compilers.incompatible-environment=1 -compilers.p.build=1 -compilers.p.build.missing.output=1 -compilers.p.deprecated=1 -compilers.p.discouraged-class=1 -compilers.p.illegal-att-value=0 -compilers.p.internal=1 -compilers.p.missing-packages=0 -compilers.p.missing-version-export-package=2 -compilers.p.missing-version-import-package=2 -compilers.p.missing-version-require-bundle=2 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=1 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=1 -compilers.p.unknown-element=0 -compilers.p.unknown-identifier=1 -compilers.p.unknown-resource=1 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.p.unused-element-or-attribute=1 -compilers.s.create-docs=false -compilers.s.doc-folder=doc -compilers.s.open-tags=1 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.ui.console/META-INF/MANIFEST.MF b/org.eclipse.ui.console/META-INF/MANIFEST.MF deleted file mode 100644 index 55ce4373d..000000000 --- a/org.eclipse.ui.console/META-INF/MANIFEST.MF +++ /dev/null @@ -1,20 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %pluginName -Bundle-SymbolicName: org.eclipse.ui.console; singleton:=true -Bundle-Version: 3.5.0.qualifier -Bundle-Activator: org.eclipse.ui.console.ConsolePlugin -Bundle-Vendor: %providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.ui.console, - org.eclipse.ui.console.actions, - org.eclipse.ui.internal.console;x-internal:=true -Require-Bundle: org.eclipse.ui;bundle-version="[3.5.0,4.0.0)", - org.eclipse.jface.text;bundle-version="[3.5.0,4.0.0)", - org.eclipse.ui.workbench.texteditor;bundle-version="[3.5.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)", - org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)", - org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)" -Bundle-ActivationPolicy: lazy -Import-Package: com.ibm.icu.text -Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/org.eclipse.ui.console/about.html b/org.eclipse.ui.console/about.html deleted file mode 100644 index 460233046..000000000 --- a/org.eclipse.ui.console/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

                              About This Content

                              - -

                              June 2, 2006

                              -

                              License

                              - -

                              The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

                              - -

                              If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

                              - - - \ No newline at end of file diff --git a/org.eclipse.ui.console/build.properties b/org.eclipse.ui.console/build.properties deleted file mode 100644 index cad430c4c..000000000 --- a/org.eclipse.ui.console/build.properties +++ /dev/null @@ -1,21 +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 -############################################################################### -bin.includes = icons/,\ - plugin.xml,\ - plugin.properties,\ - .,\ - about.html,\ - META-INF/ - -source.. src/ -src.includes = about.html,\ - schema/ -output.. = bin/ diff --git a/org.eclipse.ui.console/icons/full/clcl16/clear_co.gif b/org.eclipse.ui.console/icons/full/clcl16/clear_co.gif deleted file mode 100644 index af30a42f8..000000000 Binary files a/org.eclipse.ui.console/icons/full/clcl16/clear_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/clcl16/lock_co.gif b/org.eclipse.ui.console/icons/full/clcl16/lock_co.gif deleted file mode 100644 index 68fd6cf39..000000000 Binary files a/org.eclipse.ui.console/icons/full/clcl16/lock_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/clcl16/pin.gif b/org.eclipse.ui.console/icons/full/clcl16/pin.gif deleted file mode 100644 index ec50b70fa..000000000 Binary files a/org.eclipse.ui.console/icons/full/clcl16/pin.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/cview16/console_view.gif b/org.eclipse.ui.console/icons/full/cview16/console_view.gif deleted file mode 100644 index a598f6082..000000000 Binary files a/org.eclipse.ui.console/icons/full/cview16/console_view.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif b/org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif deleted file mode 100644 index 6775edfab..000000000 Binary files a/org.eclipse.ui.console/icons/full/dlcl16/clear_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/dlcl16/lock_co.gif b/org.eclipse.ui.console/icons/full/dlcl16/lock_co.gif deleted file mode 100644 index b77647893..000000000 Binary files a/org.eclipse.ui.console/icons/full/dlcl16/lock_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/dlcl16/pin.gif b/org.eclipse.ui.console/icons/full/dlcl16/pin.gif deleted file mode 100644 index 61615d57d..000000000 Binary files a/org.eclipse.ui.console/icons/full/dlcl16/pin.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/dlcl16/rem_co.gif b/org.eclipse.ui.console/icons/full/dlcl16/rem_co.gif deleted file mode 100644 index 559e46298..000000000 Binary files a/org.eclipse.ui.console/icons/full/dlcl16/rem_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/elcl16/clear_co.gif b/org.eclipse.ui.console/icons/full/elcl16/clear_co.gif deleted file mode 100644 index af30a42f8..000000000 Binary files a/org.eclipse.ui.console/icons/full/elcl16/clear_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/elcl16/lock_co.gif b/org.eclipse.ui.console/icons/full/elcl16/lock_co.gif deleted file mode 100644 index 68fd6cf39..000000000 Binary files a/org.eclipse.ui.console/icons/full/elcl16/lock_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/elcl16/new_con.gif b/org.eclipse.ui.console/icons/full/elcl16/new_con.gif deleted file mode 100644 index 7aea894d0..000000000 Binary files a/org.eclipse.ui.console/icons/full/elcl16/new_con.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/elcl16/pin.gif b/org.eclipse.ui.console/icons/full/elcl16/pin.gif deleted file mode 100644 index ec50b70fa..000000000 Binary files a/org.eclipse.ui.console/icons/full/elcl16/pin.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/elcl16/rem_co.gif b/org.eclipse.ui.console/icons/full/elcl16/rem_co.gif deleted file mode 100644 index 2cd9c5444..000000000 Binary files a/org.eclipse.ui.console/icons/full/elcl16/rem_co.gif and /dev/null differ diff --git a/org.eclipse.ui.console/icons/full/eview16/console_view.gif b/org.eclipse.ui.console/icons/full/eview16/console_view.gif deleted file mode 100644 index a598f6082..000000000 Binary files a/org.eclipse.ui.console/icons/full/eview16/console_view.gif and /dev/null differ diff --git a/org.eclipse.ui.console/plugin.properties b/org.eclipse.ui.console/plugin.properties deleted file mode 100644 index 6f6a488e5..000000000 --- a/org.eclipse.ui.console/plugin.properties +++ /dev/null @@ -1,24 +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 -############################################################################### - -pluginName=Console -providerName=Eclipse.org -ConsoleView.name=Console - -ConsolePatternMatchListenerName= Console Pattern Match Listeners -ConsolePageParticipantName= Console Page Participants - -ConsoleFactoryName= Console Factories - -consoleViewConsoleFactory.name=New Console View - -context.consoleview.name=In Console View -context.consoleview.description=In Console View \ No newline at end of file diff --git a/org.eclipse.ui.console/plugin.xml b/org.eclipse.ui.console/plugin.xml deleted file mode 100644 index 6fd8a3858..000000000 --- a/org.eclipse.ui.console/plugin.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.ui.console/schema/consoleFactories.exsd b/org.eclipse.ui.console/schema/consoleFactories.exsd deleted file mode 100644 index 210882f4a..000000000 --- a/org.eclipse.ui.console/schema/consoleFactories.exsd +++ /dev/null @@ -1,136 +0,0 @@ - - - - - - - - - A console factory creates or activates a console, and appears as an action in the console view. - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - action label to appear in menu - - - - - - - - - - optional plug-in relative path to an icon to appear with the action - - - - - - - - - - class implementing <code>org.eclipse.ui.console.IConsoleFactory</code> that will be called when the associated action is invoked - - - - - - - - - - - - - - - 3.1 - - - - - - - - - The following is an example of a console factory extension point: -<pre> -<extension point="org.eclipse.ui.console.consoleFactories"> - <consoleFactory - label="Command Console" - class="com.example.CommandConsoleFactory" - icon="icons/cmd_console.gif"> - </consoleFactory> -</extension> -</pre> -This extension will cause an entry to appear in the console view's <b>Open Console</b> drop-down menu labelled <b>Command Console</b> with the specified icon. When the action is invoked by a user, the method <b>openConsole()</b> on the class <b>com.example.CommandConsoleFactory</b> will be called. The factory can the decide to create a new console or activate an existing console. - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.ui.console.IConsoleFactory</b>. - - - - - - - - - The console plug-in provides a console factory to open a new console view. - - - - - - - - - Copyright (c) 2004, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.ui.console/schema/consolePageParticipants.exsd b/org.eclipse.ui.console/schema/consolePageParticipants.exsd deleted file mode 100644 index 06b40c117..000000000 --- a/org.eclipse.ui.console/schema/consolePageParticipants.exsd +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - This extension point provides a mechanism for contributing a console page participant. A console page participant is notified of page lifecycle events such as creation, activation, deactivation and disposal. A page participant can also provide adapters for a page. - - - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - specifies a unique identifier for this Console Page Participant - - - - - - - specifies a fully qualified name of a Java class that implements <code>IConsolePageParticipant</code> - - - - - - - - - - - - - - - 3.1 - - - - - - - - - The following is an example of a console page participant extension point: -<pre> - <extension - point="org.eclipse.ui.console.consolePageParticipants"> - <consolePageParticipant - class="com.example.ExamplePageParticipant" - id="com.example.ExamplePageParticipant"> - <enablement> - <instanceof value="com.example.ExampleConsole"/> - </enablement> - </consolePageParticipant> - </extension> -</pre> -In the above example, the contributed console page participant will be used for all consoles of type "com.example.ExampleConsole." - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.ui.console.IConsolePageParticipant</b>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd b/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd deleted file mode 100644 index 29c0ee6bb..000000000 --- a/org.eclipse.ui.console/schema/consolePatternMatchListeners.exsd +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - Provides regular expression matching for text consoles. Pattern match listeners can be contributed to specific consoles by using an enablement expression. Listeners are notified as matches are found. - - - - - - - - - - - - - - a fully qualified identifier of the target extension point - - - - - - - an optional identifier of the extension instance - - - - - - - an optional name of the extension instance - - - - - - - - - - - - - - - specifies a unique identifier for this console pattern match listener - - - - - - - specifies a fully qualified name of a Java class that implements <code>IPatternMatchListenerDelegate</code> - - - - - - - - - - specifies the regular expression to be matched. Since 3.2, this attribute supports string variable substitution. - - - - - - - specifies flags to be used when matching the pattern. Acceptable flags are defined in <code>java.util.regex.Pattern</code> and should be specified as Strings (eg "Pattern.MULTILINE" or "MULTILINE") - - - - - - - a simple regular expression used to identify a line that may contain this pattern match listener's complete regular expression <code>regex</code>. When a line is found containing this expression, a search is performed from the beginning of the line for this pattern matcher's complete <code>regex</code>. Use of this attribute is optional but can greatly improve performance as lines not containing this expression are disqualified from the search. Since 3.2, this attribute supports string variable substitution. - - - - - - - - - - - - 3.1 - - - - - - - - - The following is an example of a console pattern match listener extension point: -<pre> - <extension - point="org.eclipse.ui.console.consolePatternMatchListeners"> - <consolePatternMatchListener - class="com.example.ExampleConsolePatternMatcher" - id="com.example.ExampleConsolePatternMatcher" - regex=".*foo.*"> - <enablement> - <test property="org.eclipse.ui.console.consoleTypeTest" value="exampleConsole"/> - </enablement> - </consolePatternMatchListener> - </extension> -</pre> -In the above example, the contributed console pattern matcher will be used for consoles with a type of "exampleConsole." - - - - - - - - - Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <b>org.eclipse.ui.console.IPatternMatchListenerDelegate</b>. - - - - - - - - - The console plug-in provides a console type property tester for enablement expressions that tests the value of <code>IConsole.getType()</code>. The property tester's identifier is <code>org.eclipse.ui.console.consoleTypeTest</code>. - - - - - - - - - Copyright (c) 2000, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - diff --git a/org.eclipse.ui.console/scripts/exportplugin.xml b/org.eclipse.ui.console/scripts/exportplugin.xml deleted file mode 100644 index af246f1b1..000000000 --- a/org.eclipse.ui.console/scripts/exportplugin.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java deleted file mode 100644 index 99fb78418..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java +++ /dev/null @@ -1,335 +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.ui.console; - -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.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.IBasicPropertyConstants; -import org.eclipse.ui.internal.console.ConsoleMessages; - -/** - * Common function for consoles. - *

                              - * Clients implementing consoles should subclass this class. - *

                              - * @since 3.0 - */ -public abstract class AbstractConsole implements IConsole { - - // property listeners - private ListenerList fListeners; - - /** - * Console name - */ - private String fName = null; - - /** - * Console image descriptor - */ - private ImageDescriptor fImageDescriptor = null; - - /** - * Console type identifier - */ - private String fType = null; - - /** - * Used to notify this console of lifecycle methods init() - * and dispose(). - */ - class Lifecycle implements IConsoleListener { - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[]) - */ - public void consolesAdded(IConsole[] consoles) { - for (int i = 0; i < consoles.length; i++) { - IConsole console = consoles[i]; - if (console == AbstractConsole.this) { - initialize(); - } - } - - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[]) - */ - public void consolesRemoved(IConsole[] consoles) { - for (int i = 0; i < consoles.length; i++) { - IConsole console = consoles[i]; - if (console == AbstractConsole.this) { - ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this); - destroy(); - } - } - } - } - - /** - * Notifies listeners of property changes, handling any exceptions - */ - class PropertyNotifier implements ISafeRunnable { - - private IPropertyChangeListener fListener; - private PropertyChangeEvent fEvent; - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.AbstractConsole_0, exception); - ConsolePlugin.log(status); - } - - /** - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - fListener.propertyChange(fEvent); - } - - /** - * Notifies listeners of the property change - * - * @param event the event that describes the property that has changed - */ - public void notify(PropertyChangeEvent event) { - if (fListeners == null) { - return; - } - fEvent = event; - Object[] copiedListeners= fListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IPropertyChangeListener)copiedListeners[i]; - SafeRunner.run(this); - } - fListener = null; - } - } - - /** - * Constructs a new console with the given name and image. - * - * @param name console name, cannot be null - * @param imageDescriptor image descriptor, or null if none - * @param autoLifecycle whether this console's lifecycle methods should be called - * automatically when it is added (initialize()) and removed - * (destroy()) from the console manager. When false, - * clients are responsible for calling the lifecycle methods. - * @since 3.1 - */ - public AbstractConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle) { - this(name, null, imageDescriptor, autoLifecycle); - } - - /** - * Constructs a new console with the given name, type, image and lifecycle. - * - * @param name console name, cannot be null - * @param type console type identifier or null - * @param imageDescriptor image descriptor, or null if none - * @param autoLifecycle whether this console's lifecycle methods should be called - * automatically when it is added (initialize()) and removed - * (destroy()) from the console manager. When false, - * clients are responsible for calling the lifecycle methods. - * @since 3.1 - */ - public AbstractConsole(String name, String type, ImageDescriptor imageDescriptor, boolean autoLifecycle) { - setName(name); - setType(type); - setImageDescriptor(imageDescriptor); - if (autoLifecycle) { - ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new Lifecycle()); - } - } - - /** - * Constructs a new console with the given name and image. The console's lifecycle - * methods init() and dispose() will be called when the - * console is added and removed from the console manager. - * - * @param name console name, cannot be null - * @param imageDescriptor image descriptor, or null if none - */ - public AbstractConsole(String name, ImageDescriptor imageDescriptor) { - this(name, imageDescriptor, true); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#getName() - */ - public String getName() { - return fName; - } - - /** - * Sets the name of this console to the specified value and notifies - * property listeners of the change. - * - * @param name the new name - */ - protected void setName(String name) { - if (!name.equals(fName)) { - String old = fName; - fName = name; - firePropertyChange(this, IBasicPropertyConstants.P_TEXT, old, name); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#getImageDescriptor() - */ - public ImageDescriptor getImageDescriptor() { - return fImageDescriptor; - } - - /** - * Sets the image descriptor for this console to the specified value and notifies - * property listeners of the change. - * - * @param imageDescriptor the new image descriptor - */ - protected void setImageDescriptor(ImageDescriptor imageDescriptor) { - ImageDescriptor old = fImageDescriptor; - fImageDescriptor =imageDescriptor; - firePropertyChange(this, IBasicPropertyConstants.P_IMAGE, old, imageDescriptor); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) - */ - public void addPropertyChangeListener(IPropertyChangeListener listener) { - if (fListeners == null) { - fListeners = new ListenerList(); - } - fListeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener) - */ - public void removePropertyChangeListener(IPropertyChangeListener listener) { - if (fListeners != null) { - fListeners.remove(listener); - } - } - - /** - * Notify all listeners that the given property has changed. - * - * @param source the object on which a property has changed - * @param property identifier of the property that has changed - * @param oldValue the old value of the property, or null - * @param newValue the new value of the property, or null - */ - public void firePropertyChange(Object source, String property, Object oldValue, Object newValue) { - if (fListeners == null) { - return; - } - PropertyNotifier notifier = new PropertyNotifier(); - notifier.notify(new PropertyChangeEvent(source, property, oldValue, newValue)); - } - - /** - * Initializes this console. This method should only be called by clients managing a - * console's lifecycle, otherwise this method will be called automatically when this console - * is added to the console manager. The method is called once to initialize this console, - * marking the beginning of its lifecycle. - * - * @since 3.1 - */ - public final void initialize() { - init(); - } - - /** - * Called when this console is added to the console manager. Default - * implementation does nothing. Subclasses may override. - *

                              - * Since 3.1, this method is only called automatically if this console was - * created with an automatic lifecycle. - *

                              - */ - protected void init() { - } - - /** - * Disposes this console. This method should only be called by clients managing a - * console's lifecycle, otherwise this method will be called automatically when this - * console is removed from the console manager. The method is called once to dispose - * this console, after which this console will no longer be used. - * - * @since 3.1 - */ - public final void destroy() { - dispose(); - } - - /** - * Called when this console is removed from the console manager. Default - * implementation does nothing. Subclasses may override. - *

                              - * Since 3.1, this methods is only called automatically if this console was - * created with an automatic lifecycle. - *

                              - */ - protected void dispose() { - } - - /** - * Shows this console in all console views. This console will be become visible - * if another console is currently pinned. - * - * @since 3.1 - */ - public void activate() { - ConsolePlugin.getDefault().getConsoleManager().showConsoleView(this); - } - - /** - * Sets this console's type identifier. - * - * @param typeIdentifier the type identifier for this console - * @since 3.1 - */ - protected void setType(String typeIdentifier) { - fType = typeIdentifier; - } - - /** - * @see org.eclipse.ui.console.IConsole#getType() - * @since 3.1 - */ - public String getType() { - return fType; - } - - /** - * Returns the help context identifier for this console, or null - * if none. When a non-null value is returned the associated help - * will be installed for this console. - * - * @return help context id or null - * @since 3.2 - */ - public String getHelpContextId() { - return null; - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java deleted file mode 100644 index df35a076f..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java +++ /dev/null @@ -1,182 +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.ui.console; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.internal.console.ConsoleManager; -import org.eclipse.ui.internal.console.ConsolePluginImages; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The console plug-in class. - * - * @since 3.0 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - */ - -public class ConsolePlugin extends AbstractUIPlugin { - - /** - * Singleton console manager - */ - private IConsoleManager fConsoleManager = null; - - /** - * The singleton console plug-in instance - */ - private static ConsolePlugin fgPlugin= null; - - /** - * Unique identifier constant (value "org.eclipse.ui.console") - * for the UI Console plug-in. - */ - private static final String PI_UI_CONSOLE = "org.eclipse.ui.console"; //$NON-NLS-1$ - - /** - * Returns the singleton instance of the console plug-in. - */ - public static ConsolePlugin getDefault() { - return fgPlugin; - } - - public ConsolePlugin() { - super(); - fgPlugin = this; - } - - /** - * Convenience method which returns the unique identifier of this plug-in. - */ - public static String getUniqueIdentifier() { - return PI_UI_CONSOLE; - } - - /** - * 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) { - if (t instanceof CoreException) { - log(((CoreException)t).getStatus()); - } else { - log(newErrorStatus("Error logged from Console plug-in: ", t)); //$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 null if none - * @return a new error status - */ - public static IStatus newErrorStatus(String message, Throwable exception) { - return new Status(IStatus.ERROR, getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, message, exception); - } - - /** - * Returns the console manager. The manager will be created lazily on - * the first access. - * - * @return IConsoleManager - */ - public IConsoleManager getConsoleManager() { - if (fConsoleManager == null) { - fConsoleManager = new ConsoleManager(); - } - return fConsoleManager; - } - - /** - * Returns the workbench display. - */ - public static Display getStandardDisplay() { - return PlatformUI.getWorkbench().getDisplay(); - } - - /** - * 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(), IConsoleConstants.INTERNAL_ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$ - log(status); - } - ErrorDialog.openError(shell, title, message, status); - } - - /** - * Returns the Image identified by the given key, - * or null if it does not exist. - * - * @return the Image identified by the given key, - * or null if it does not exist - * @since 3.1 - */ - public static Image getImage(String key) { - return ConsolePluginImages.getImage(key); - } - - /** - * Returns the ImageDescriptor identified by the given key, - * or null if it does not exist. - * - * @return the ImageDescriptor identified by the given key, - * or null if it does not exist - * @since 3.1 - */ - public static ImageDescriptor getImageDescriptor(String key) { - return ConsolePluginImages.getImageDescriptor(key); - } - - /* (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - if (fConsoleManager != null) { - IConsole[] consoles = fConsoleManager.getConsoles(); - if (consoles != null) { - fConsoleManager.removeConsoles(consoles); - } - } - super.stop(context); - } - - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java deleted file mode 100644 index 7b935820d..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsole.java +++ /dev/null @@ -1,97 +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.ui.console; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.ui.part.IPageBookViewPage; - -/** - * A console. A console is commonly used to display messages such as the output - * streams of a system process. A console can be displayed in one or more console - * views. - *

                              - * The console implementations provided by this plug-in are textual - * (TextConsole, MessageConsole and IOConsole). - * However a client can provide alternate presentations since a console implementation - * is responsible for providing is page for the page book views in which consoles are - * displayed. - *

                              - *

                              - * Subclass AbstractConsole when implementing this interface. - *

                              - * @since 3.0 - */ -public interface IConsole { - - /** - * Returns the name of this console. - * - * @return the name of this console - */ - public String getName(); - - /** - * Returns an image descriptor for this console, or null - * if none. - * - * @return an image descriptor for this console, or null - * if none - */ - public ImageDescriptor getImageDescriptor(); - - /** - * Creates and returns a new page for this console. The page is displayed - * for this console in the console given view. - * - * @param view the view in which the page is to be created - * @return a page book view page representation of this console - */ - public IPageBookViewPage createPage(IConsoleView view); - - /** - * Adds a listener for changes to properties of this console. - * Has no effect if an identical listener is already registered. - *

                              - * The changes supported by the console view are as follows: - *

                                - *
                              • IBasicPropertyConstants.P_TEXT - indicates the name - * of a console has changed
                              • - *
                              • IBasicPropertyConstants.P_IMAGE - indicates the image - * of a console has changed
                              • - *
                              - *

                              - *

                              - * Consoles may define additional properties as required. - *

                              - * - * @param listener a property change listener - */ - public void addPropertyChangeListener(IPropertyChangeListener listener); - - /** - * Removes the given property listener from this console page. - * Has no effect if an identical listener is not already registered. - * - * @param listener a property listener - */ - public void removePropertyChangeListener(IPropertyChangeListener listener); - - /** - * Returns a unique identifier for this console's type, or null - * if unspecified. - * - * @return a unique identifier for this console's type, or null - * @since 3.1 - */ - public String getType(); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java deleted file mode 100644 index 06d04d14b..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java +++ /dev/null @@ -1,156 +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.ui.console; - -/** - * Constants relating to the console plug-in. - * - * @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 IConsoleConstants { - - /** - * Console plug-in identifier (value "org.eclipse.ui.console"). - */ - public static final String PLUGIN_ID = ConsolePlugin.getUniqueIdentifier(); - - /** - * Console view identifier (value "org.eclipse.ui.console.ConsoleView"). - */ - public static final String ID_CONSOLE_VIEW= "org.eclipse.ui.console.ConsoleView"; //$NON-NLS-1$ - - /** - * Type identifier for MessageConsole - * @since 3.1 - */ - public static final String MESSAGE_CONSOLE_TYPE = "org.eclipse.ui.MessageConsole"; //$NON-NLS-1$ - - /** - * The name of the font to use for the Console (value "org.eclipse.ui.console.ConsoleFont"). - * - * @deprecated When a console is created, its font is set to the default text font as specified - * by JFaceResources.TEXT_FONT. Clients must provide their own infrastructure to - * manage console specific fonts. - */ - public static final String CONSOLE_FONT= "org.eclipse.ui.console.ConsoleFont"; //$NON-NLS-1$ - - /** - * Menu group identifier for the console view context menu and toolbar, for actions pertaining to - * launching (value "launchGroup"). - */ - public static final String LAUNCH_GROUP = "launchGroup"; //$NON-NLS-1$ - - /** - * Menu group identifier for the console view context menu and toolbar, for actions pertaining to - * console output. (value"outputGroup"). - */ - public static final String OUTPUT_GROUP = "outputGroup"; //$NON-NLS-1$ - - /** - * Console view image identifier. - */ - public static final String IMG_VIEW_CONSOLE= "IMG_VIEW_CONSOLE"; //$NON-NLS-1$ - - /** - * Clear action image identifier. - */ - public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$ - - /** - * Status code indicating an unexpected internal error. - */ - public static final int INTERNAL_ERROR = 120; - - /** - * Console pattern match listeners extension point identifier - * (value "consolePatternMatchListeners"). - * - * @since 3.1 - */ - public static final String EXTENSION_POINT_CONSOLE_PATTERN_MATCH_LISTENERS = "consolePatternMatchListeners"; //$NON-NLS-1$ - - /** - * Console page participants extension point identifier - * (value "consolePageParticipants"). - * - * @since 3.1 - */ - public static final String EXTENSION_POINT_CONSOLE_PAGE_PARTICIPANTS = "consolePageParticipants"; //$NON-NLS-1$ - - /** - * Console factories extension point identifier - * (value "consoleFactories"). - * - * @since 3.1 - */ - public static final String EXTENSION_POINT_CONSOLE_FACTORIES = "consoleFactories"; //$NON-NLS-1$ - - /** - * Property constant indicating a console's font has changed. - * - * @since 3.1 - */ - public static final String P_FONT = ConsolePlugin.getUniqueIdentifier() + ".P_FONT"; //$NON-NLS-1$ - - /** - * Property constant indicating that a font style has changed - * - * @since 3.1 - */ - public static final String P_FONT_STYLE = ConsolePlugin.getUniqueIdentifier() + ".P_FONT_STYLE"; //$NON-NLS-1$ - - /** - * Property constant indicating the color of a stream has changed. - * - * @since 3.1 - */ - public static final String P_STREAM_COLOR = ConsolePlugin.getUniqueIdentifier() + ".P_STREAM_COLOR"; //$NON-NLS-1$ - - /** - * Property constant indicating tab size has changed - * - * @since 3.1 - */ - public static final String P_TAB_SIZE = ConsolePlugin.getUniqueIdentifier() + ".P_TAB_SIZE"; //$NON-NLS-1$ - - /** - * Property constant indicating the width of a fixed width console has changed. - * - * @since 3.1 - */ - public static final String P_CONSOLE_WIDTH = ConsolePlugin.getUniqueIdentifier() + ".P_CONSOLE_WIDTH"; //$NON-NLS-1$ - - /** - * Property constant indicating that all streams connected to this console have been closed - * and that all queued output has been processed. - * - * @since 3.1 - */ - public static final String P_CONSOLE_OUTPUT_COMPLETE = ConsolePlugin.getUniqueIdentifier() + ".P_CONSOLE_STREAMS_CLOSED"; //$NON-NLS-1$ - - /** - * Property constant indicating the background color of a console has changed. - * - * @since 3.3 - */ - public static final String P_BACKGROUND_COLOR = ConsolePlugin.getUniqueIdentifier() + ".P_BACKGROUND_COLOR"; //$NON-NLS-1$ - - /** - * The default tab size for text consoles. - * - * @since 3.1 - */ - public static final int DEFAULT_TAB_SIZE = 8; - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleDocumentPartitioner.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleDocumentPartitioner.java deleted file mode 100644 index 0da81fe60..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleDocumentPartitioner.java +++ /dev/null @@ -1,51 +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.ui.console; - -import org.eclipse.jface.text.IDocumentPartitioner; -import org.eclipse.swt.custom.StyleRange; - -/** - * A document partitioner for a text console. - *

                              - * In addition to regular partitioner duties, a console document partitioner - * dictates which regions in its document are read-only and provides style ranges. - *

                              - *

                              - * Clients may implement this interface. - *

                              - * @see org.eclipse.ui.console.TextConsole - * @since 3.1 - */ -public interface IConsoleDocumentPartitioner extends IDocumentPartitioner { - - /** - * Returns whether this partitioner's document is read-only at the specified - * offset. The user is not allowed to type in read-only locations. - * - * @param offset document offset - * @return whether this partitioner's document is read-only at the specified - * offset - */ - public boolean isReadOnly(int offset); - - /** - * Returns style ranges for the specified region of this partitioner's document - * to use when rendering, or null if none. - * - * @param offset beginning offset for which style ranges are requested - * @param length the length of text for which style ranges are requested - * @return style ranges for the specified region of this partitioner's document - * to use when rendering, or null if none - */ - public StyleRange[] getStyleRanges(int offset, int length); -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleFactory.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleFactory.java deleted file mode 100644 index 4e27fede6..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleFactory.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2005 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.console; - -/** - * A console factory extension is responsible for opening a console in the console view. - * Extensions appear on a menu in the console view, and their openConsole - * method is called when the action is invoked. Implementations may choose to open a new - * console or activate an existing console. The extension point used to contribute a - * console factory is org.eclipse.ui.console.consoleFactories. - *

                              - * Following is an example console factory extension. - *

                              - * <extension point="org.eclipse.ui.console.consoleFactories">
                              - *   <consoleFactory
                              - *      label="Command Console"
                              - *      icon="icons\cmd_console.gif"
                              - *      class="com.example.CommandConsoleFactory">
                              - *   </consoleFactory>
                              - * </extension>
                              - * 
                              - * An action appears in the console view's 'Open Console' drop-down menu with the - * corresponding label and optional icon. When the action - * is invoked, the specified class is instantiated and called to - * open a console, via the method openConsole(). - *

                              - *

                              - * Clients providing console factory extensions are intended to implement - * this interface. - *

                              - * @since 3.1 - */ -public interface IConsoleFactory { - /** - * Opens a console in the console view. Implementations may create a new - * console or activate an existing console. - */ - public void openConsole(); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java deleted file mode 100644 index 41aedb236..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleListener.java +++ /dev/null @@ -1,39 +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.ui.console; - -/** - * A console listener is notified when consoles are added or removed from - * the console manager. - *

                              - * Clients may implement this interface. - *

                              - * @since 3.0 - */ -public interface IConsoleListener { - - /** - * Notification the given consoles have been added to the console - * manager. - * - * @param consoles added consoles - */ - public void consolesAdded(IConsole[] consoles); - - /** - * Notification the given consoles have been removed from the - * console manager. - * - * @param consoles removed consoles - */ - public void consolesRemoved(IConsole[] consoles); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java deleted file mode 100644 index 14ac3b8ec..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleManager.java +++ /dev/null @@ -1,107 +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.ui.console; - -/** - * The console manager manages registered consoles. - * @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 IConsoleManager { - - /** - * Registers the given listener for console notifications. Has - * no effect if an identical listener is already registered. - * - * @param listener listener to register - */ - public void addConsoleListener(IConsoleListener listener); - - /** - * Unregisters the given listener for console notifications. Has - * no effect if an identical listener is not already registered. - * - * @param listener listener to unregister - */ - public void removeConsoleListener(IConsoleListener listener); - - /** - * Adds the given consoles to the console manager. Has no effect for - * equivalent consoles already registered. The consoles will be added - * to any existing console views. - * - * @param consoles consoles to add - */ - public void addConsoles(IConsole[] consoles); - - /** - * Removes the given consoles from the console manager. If the consoles are - * being displayed in any console views, the associated pages will be removed - * and disposed. - * - * @param consoles consoles to remove - */ - public void removeConsoles(IConsole[] consoles); - - /** - * Returns a collection of consoles registered with the console manager. - * - * @return a collection of consoles registered with the console manager - */ - public IConsole[] getConsoles(); - - /** - * Opens the console view and displays given the console. - * If the view is already open, it is brought to the front unless - * the view is pinned on a console other than the given console. - * Has no effect if the given console is not currently registered. - * - * @param console console to display - */ - public void showConsoleView(IConsole console); - - /** - * Warns that the content of the given console has changed in - * all console views. Has no effect if the given console is not - * currently registered. - * - * @param console the console that has changed - */ - public void warnOfContentChange(IConsole console); - - /** - * Creates and returns a collection of new pattern match listeners enabled for - * the given console. The pattern match listeners are new instances, intended - * to be used in a new console. No methods on the participants have been - * called. Clients are responsible for connecting to and disconnecting from - * the pattern match listeners. - *

                              - * Console pattern match listeners are contributed via the - * org.eclipse.ui.console.consolePatternMatchListeners extension point. - *

                              - * - * @param console the console for which pattern match listeners are requested - * @return a collection of new pattern match listeners - * @see IPatternMatchListener - * @since 3.1 - */ - public IPatternMatchListener[] createPatternMatchListeners(IConsole console); - - /** - * Requests a redraw of any visible console page containing the specified console. - * - * @param console the console to be refreshed - * @since 3.1 - */ - public void refresh(IConsole console); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsolePageParticipant.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsolePageParticipant.java deleted file mode 100644 index a2e751438..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsolePageParticipant.java +++ /dev/null @@ -1,71 +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.ui.console; - -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.ui.part.IPageBookViewPage; - -/** - * A console page participant is notified of page lifecycle events such as - * creation, activation, deactivation and disposal. A page participant can - * also provide adapters for a page. Participants are contributed via the - * org.eclispe.ui.console.consolePageParticipants extension point. - *

                              - * Participant behavior is implementation dependent. For example, a page participant - * could add actions to a console's toolbar by accessing a its page's action bars. - *

                              - *

                              - * Following is an example extension definition. - *

                              - * <extension point="org.eclipse.ui.console.consolePageParticipants">
                              - *   <consolePageParticipant
                              - *      id="com.example.ExamplePageParticipant"
                              - *      class="com.example.ExamplePageParticipant">
                              - *   </consolePageParticipant>
                              - * </extension>
                              - * 
                              - *

                              - * The example page participant is contributed to all console pages. An optional - * enablement attribute may be specified to control which consoles - * a page participant is applicable to. - *

                              - * Clients contributing console page participant extensions are intended to - * implement this interface. - *

                              - * @since 3.1 - */ -public interface IConsolePageParticipant extends IAdaptable { - /** - * Called during page initialization. Marks the start of this - * page participant's lifecycle. - * - * @param page the page corresponding to the given console - * @param console the console for which a page has been created - */ - public void init(IPageBookViewPage page, IConsole console); - - /** - * Disposes this page participant. Marks the end of this - * page participant's lifecycle. - */ - public void dispose(); - - /** - * Notification this participant's page has been activated. - */ - public void activated(); - - /** - * Notification this participant's page has been deactivated. - */ - public void deactivated(); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java deleted file mode 100644 index e1bc354d6..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.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 - *******************************************************************************/ -package org.eclipse.ui.console; - -import org.eclipse.ui.IViewPart; - -/** - * A view that displays consoles registered with the console manager. - * @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 IConsoleView extends IViewPart { - - /** - * Displays the page for the given console in this console view. - * Has no effect if this console view has a pinned console. - * - * @param console console to display, cannot be null - */ - public void display(IConsole console); - - /** - * Pins this console view. No other console page will be displayed until - * this console view is un-pinned. - * - * @param pin true to pin the current console to the - * top of the stack, false otherwise - * @since 3.1 - */ - public void setPinned(boolean pin); - - /** - * Displays and pins the given console in this console view. No - * other console can be displayed until this console view is - * un-pinned. Specifying null un-pins this console - * - * @param console console to pin, or null to un-pin - * @deprecated rather than pinning a specific console, a console view is - * pinned - use setPinned(boolean) - */ - public void pin(IConsole console); - - /** - * Returns whether this console view is currently pinned to a - * specific console. - * - * @return whether this console view is currently pinned to a - * specific console - */ - public boolean isPinned(); - - /** - * Returns the console currently being displayed, or null - * if none - * - * @return the console currently being displayed, or null - * if none - */ - public IConsole getConsole(); - - /** - * Warns that the content of the given console has changed. - * - * @param console the console that has changed - */ - public void warnOfContentChange(IConsole console); - - /** - * Sets the scroll lock state of the currently active console. - * - * @param scrollLock true to turn scroll lock on, otherwise false - * @since 3.1 - */ - public void setScrollLock(boolean scrollLock); - - /** - * Returns the scroll lock state of the currently active console. - * - * @return true if scroll lock is on, false otherwise - * @since 3.1 - */ - public boolean getScrollLock(); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink.java deleted file mode 100644 index 38aa4994c..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink.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.ui.console; - -/** - * A hyperlink in a console. Link behavior is implementation dependent. - *

                              - * Clients may implement this interface. - *

                              - * @since 3.1 - */ -public interface IHyperlink { - - /** - * Notification that the mouse has entered this link's region. - */ - public void linkEntered(); - - /** - * Notification that the mouse has exited this link's region - */ - public void linkExited(); - - /** - * Notification that this link has been activated. Performs - * context specific linking. - */ - public void linkActivated(); -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink2.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink2.java deleted file mode 100644 index 3895f1583..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IHyperlink2.java +++ /dev/null @@ -1,33 +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.ui.console; - -import org.eclipse.swt.widgets.Event; - -/** - * Optional extension to {@link IHyperlink}. - *

                              - * Clients implementing {@link IHyperlink} may also implement this interface. - * When implemented, the method linkActivated(Event) is called instead of - * linkActivated(). - *

                              - * @since 3.2 - */ -public interface IHyperlink2 extends IHyperlink { - - /** - * Notification that this link has been activated. Performs - * context specific linking. - * - * @param event the SWT event which triggered this hyperlink - */ - public void linkActivated(Event event); -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java deleted file mode 100644 index 883332866..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java +++ /dev/null @@ -1,293 +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 - * Remy Chi Jian Suen - Bug 214424 IOConsole(String, String, ImageDescriptor, String, boolean) constructor is missing api javadoc - *******************************************************************************/ - -package org.eclipse.ui.console; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.WorkbenchEncoding; -import org.eclipse.ui.internal.console.IOConsolePage; -import org.eclipse.ui.internal.console.IOConsolePartitioner; -import org.eclipse.ui.part.IPageBookViewPage; - -/** - * A console that displays text from I/O streams. An I/O console can have multiple - * output streams connected to it and provides one input stream connected to the - * keyboard. - *

                              - * Clients may instantiate and subclass this class. - *

                              - * @since 3.1 - */ -public class IOConsole extends TextConsole { - /** - * The document partitioner - */ - private IOConsolePartitioner partitioner; - - /** - * The stream from which user input may be read - */ - private IOConsoleInputStream inputStream; - - /** - * A collection of open streams connected to this console. - */ - private List openStreams; - - /** - * The encoding used to for displaying console output. - */ - private String fEncoding = WorkbenchEncoding.getWorkbenchDefaultEncoding(); - - - /** - * Constructs a console with the given name, type, image, and lifecycle, with the - * workbench's default encoding. - * - * @param name name to display for this console - * @param consoleType console type identifier or null - * @param imageDescriptor image to display for this console or null - * @param autoLifecycle whether lifecycle methods should be called automatically - * when this console is added/removed from the console manager - */ - public IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor, boolean autoLifecycle) { - this(name, consoleType, imageDescriptor, null, autoLifecycle); - } - - /** - * Constructs a console with the given name, type, image, encoding and lifecycle. - * - * @param name name to display for this console - * @param consoleType console type identifier or null - * @param imageDescriptor image to display for this console or null - * @param encoding the encoding that should be used to render the text, or null - * if the system default encoding should be used - * @param autoLifecycle whether lifecycle methods should be called automatically - * when this console is added/removed from the console manager - */ - public IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor, String encoding, boolean autoLifecycle) { - super(name, consoleType, imageDescriptor, autoLifecycle); - if (encoding != null) { - fEncoding = encoding; - } - openStreams = new ArrayList(); - inputStream = new IOConsoleInputStream(this); - synchronized (openStreams) { - openStreams.add(inputStream); - } - - partitioner = new IOConsolePartitioner(inputStream, this); - partitioner.connect(getDocument()); - } - - /** - * Constructs a console with the given name, type, and image with the workbench's - * default encoding. Lifecycle methods will be called when this console is - * added/removed from the console manager. - * - * @param name name to display for this console - * @param consoleType console type identifier or null - * @param imageDescriptor image to display for this console or null - */ - public IOConsole(String name, String consoleType, ImageDescriptor imageDescriptor) { - this(name, consoleType, imageDescriptor, true); - } - - /** - * Constructs a console with the given name and image. Lifecycle methods - * will be called when this console is added/removed from the console manager. - * This console will have an unspecified (null) type. - * - * @param name name to display for this console - * @param imageDescriptor image to display for this console or null - */ - public IOConsole(String name, ImageDescriptor imageDescriptor) { - this(name, null, imageDescriptor); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView) - */ - public IPageBookViewPage createPage(IConsoleView view) { - return new IOConsolePage(this, view); - } - - /** - * Creates and returns a new output stream which may be used to write to this console. - * A console may be connected to more than one output stream at once. Clients are - * responsible for closing any output streams created on this console. - *

                              - * Clients should avoid writing large amounts of output to this stream in the UI - * thread. The console needs to process the output in the UI thread and if the client - * hogs the UI thread writing output to the console, the console will not be able - * to process the output. - *

                              - * @return a new output stream connected to this console - */ - public IOConsoleOutputStream newOutputStream() { - IOConsoleOutputStream outputStream = new IOConsoleOutputStream(this); - outputStream.setEncoding(fEncoding); - synchronized(openStreams) { - openStreams.add(outputStream); - } - return outputStream; - } - - /** - * Returns the input stream connected to the keyboard. - * - * @return the input stream connected to the keyboard. - */ - public IOConsoleInputStream getInputStream() { - return inputStream; - } - - /** - * Returns this console's document partitioner. - * - * @return this console's document partitioner - */ - protected IConsoleDocumentPartitioner getPartitioner() { - return partitioner; - } - - /** - * Returns the maximum number of characters that the console will display at - * once. This is analogous to the size of the text buffer this console - * maintains. - * - * @return the maximum number of characters that the console will display - */ - public int getHighWaterMark() { - return partitioner.getHighWaterMark(); - } - - /** - * Returns the number of characters that will remain in this console - * when its high water mark is exceeded. - * - * @return the number of characters that will remain in this console - * when its high water mark is exceeded - */ - public int getLowWaterMark() { - return partitioner.getLowWaterMark(); - } - - /** - * Sets the text buffer size for this console. The high water mark indicates - * the maximum number of characters stored in the buffer. The low water mark - * indicates the number of characters remaining in the buffer when the high - * water mark is exceeded. - * - * @param low the number of characters remaining in the buffer when the high - * water mark is exceeded (if -1 the console does not limit output) - * @param high the maximum number of characters this console will cache in - * its text buffer (if -1 the console does not limit output) - * @exception IllegalArgumentException if low >= high & low != -1 - */ - public void setWaterMarks(int low, int high) { - if (low >= 0) { - if (low >= high) { - throw new IllegalArgumentException("High water mark must be greater than low water mark"); //$NON-NLS-1$ - } - } - partitioner.setWaterMarks(low, high); - } - - /** - * Check if all streams connected to this console are closed. If so, - * notify the partitioner that this console is finished. - */ - private void checkFinished() { - if (openStreams.isEmpty()) { - partitioner.streamsClosed(); - } - } - - /** - * Notification that an output stream connected to this console has been closed. - * - * @param stream stream that closed - */ - void streamClosed(IOConsoleOutputStream stream) { - synchronized (openStreams) { - openStreams.remove(stream); - checkFinished(); - } - } - - /** - * Notification that the input stream connected to this console has been closed. - * - * @param stream stream that closed - */ - void streamClosed(IOConsoleInputStream stream) { - synchronized (openStreams) { - openStreams.remove(stream); - checkFinished(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.TextConsole#clearConsole() - */ - public void clearConsole() { - if (partitioner != null) { - partitioner.clearBuffer(); - } - } - - /** - * Disposes this console. - */ - protected void dispose() { - super.dispose(); - partitioner.disconnect(); - //make a copy of the open streams and close them all - //a copy is needed as close the streams results in a callback that - //removes the streams from the openStreams collection (bug 152794) - Object[] allStreams= openStreams.toArray(); - for (int i = 0; i < allStreams.length; i++) { - Object stream = allStreams[i]; - if (stream instanceof IOConsoleInputStream) { - IOConsoleInputStream is = (IOConsoleInputStream) stream; - try { - is.close(); - } catch (IOException e) { - } - } else if (stream instanceof IOConsoleOutputStream) { - IOConsoleOutputStream os = (IOConsoleOutputStream) stream; - try { - os.close(); - } catch (IOException e) { - } - } - } - inputStream = null; - } - - /** - * Returns the encoding for this console, or null to indicate - * default encoding. - * - * @return the encoding set for this console, or null to indicate - * default encoding - * @since 3.3 - */ - public String getEncoding() { - return fEncoding; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java deleted file mode 100644 index f6933856b..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java +++ /dev/null @@ -1,285 +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.ui.console; - -import java.io.IOException; -import java.io.InputStream; -import java.io.UnsupportedEncodingException; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Color; - -/** - * InputStream used to read input from an {@link IOConsole}. - * This stream will buffer input that it receives until it has been read. - * An input stream is available from its {@link IOConsole}. - * @since 3.1 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - * - */ -public class IOConsoleInputStream extends InputStream { - /** - * Buffer to hold data from console until it is read. - */ - private byte[] input = new byte[100]; - - /** - * Location in the buffer that the next byte of data from the - * console should be stored. - */ - private int inPointer = 0; - - /** - * Location in the buffer that the next byte of data read from - * this stream should come from. - */ - private int outPointer = 0; - - /** - * The number of bytes of real data currently in the buffer. - */ - private int size = 0; - - /** - * Flag to indicate that EOF has been sent already. - */ - private boolean eofSent = false; - - /** - * Flag to indicate that the stream has been closed. - */ - private boolean closed = false; - - /** - * The console that this stream is connected to. - */ - private IOConsole console; - - /** - * The color used to display input in the console. - */ - private Color color; - - /** - * The font style used to decorate input in the console. - */ - private int fontStyle = SWT.NORMAL; - - - /** - * Constructs a new input stream on the given console. - * - * @param console I/O console - */ - IOConsoleInputStream(IOConsole console) { - this.console = console; - } - - /* - * (non-Javadoc) - * @see java.io.InputStream#read(byte[], int, int) - */ - public synchronized int read(byte[] b, int off, int len) throws IOException { - waitForData(); - if (available() == -1) { - return -1; - } - - int toCopy = Math.min(len, size); - if(input.length-outPointer > toCopy) { - System.arraycopy(input, outPointer, b, off, toCopy); - outPointer += toCopy; - size -= toCopy; - } else { - int bytesToEnd = input.length-outPointer; - System.arraycopy(input, outPointer, b, off, bytesToEnd); - System.arraycopy(input, 0, b, off+bytesToEnd, toCopy-bytesToEnd); - outPointer = toCopy-bytesToEnd; - size -=toCopy; - } - return toCopy; - } - - /* - * (non-Javadoc) - * @see java.io.InputStream#read(byte[]) - */ - public int read(byte[] b) throws IOException { - return read(b, 0, b.length); - } - - /* - * (non-Javadoc) - * @see java.io.InputStream#read() - */ - public synchronized int read() throws IOException { - waitForData(); - if (available() == -1) { - return -1; - } - - byte b = input[outPointer]; - outPointer++; - if (outPointer == input.length) { - outPointer = 0; - } - size -= 1; - return b; - } - - /** - * Blocks until data is available to be read. - * Ensure that the monitor for this object is obtained before - * calling this method. - */ - private void waitForData() { - while (size == 0 && !closed) { - try { - wait(); - } catch (InterruptedException e) { - } - } - } - - /** - * Appends text to this input stream's buffer. - * - * @param text the text to append to the buffer. - */ - public synchronized void appendData(String text) { - String encoding = console.getEncoding(); - byte[] newData; - if (encoding!=null) - try { - newData = text.getBytes(encoding); - } catch (UnsupportedEncodingException e) { - newData = text.getBytes(); - } - else - newData = text.getBytes(); - - while(input.length-size < newData.length) { - growArray(); - } - - if (size == 0) { //inPointer == outPointer - System.arraycopy(newData, 0, input, 0, newData.length); - inPointer = newData.length; - size = newData.length; - outPointer = 0; - } else if (inPointer < outPointer || input.length - inPointer > newData.length) { - System.arraycopy(newData, 0, input, inPointer, newData.length); - inPointer += newData.length; - size += newData.length; - } else { - System.arraycopy(newData, 0, input, inPointer, input.length-inPointer); - System.arraycopy(newData, input.length-inPointer, input, 0, newData.length-(input.length-inPointer)); - inPointer = newData.length-(input.length-inPointer); - size += newData.length; - } - - if (inPointer == input.length) { - inPointer = 0; - } - notifyAll(); - } - - /** - * Enlarges the buffer. - */ - private void growArray() { - byte[] newInput = new byte[input.length+1024]; - if (outPointer < inPointer) { - System.arraycopy(input, outPointer, newInput, 0, size); - } else { - System.arraycopy(input, outPointer, newInput, 0, input.length-outPointer); - System.arraycopy(input, 0, newInput, input.length-outPointer, inPointer); - } - outPointer = 0; - inPointer = size; - input = newInput; - newInput = null; - } - - /** - * Returns this stream's font style. - * - * @return the font style used to decorate input in the associated console - */ - public int getFontStyle() { - return fontStyle; - } - - /** - * Sets this stream's font style. - * - * @param newFontStyle the font style to be used to decorate input in the associated console - */ - public void setFontStyle(int newFontStyle) { - if (newFontStyle != fontStyle) { - int old = fontStyle; - fontStyle = newFontStyle; - console.firePropertyChange(this, IConsoleConstants.P_FONT_STYLE, new Integer(old), new Integer(fontStyle)); - } - } - - /** - * Sets the color to used to decorate input in the associated console. - * - * @param newColor the color to used to decorate input in the associated console. - */ - public void setColor(Color newColor) { - Color old = color; - if (old == null || !old.equals(newColor)) { - color = newColor; - console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor); - } - } - - /** - * Returns the color used to decorate input in the associated console - * - * @return the color used to decorate input in the associated console - */ - public Color getColor() { - return color; - } - - /* (non-Javadoc) - * @see java.io.InputStream#available() - */ - public int available() throws IOException { - if (closed && eofSent) { - throw new IOException("Input Stream Closed"); //$NON-NLS-1$ - } else if (size == 0) { - if (!eofSent) { - eofSent = true; - return -1; - } - throw new IOException("Input Stream Closed"); //$NON-NLS-1$ - } - - return size; - } - - /* (non-Javadoc) - * @see java.io.InputStream#close() - */ - public synchronized void close() throws IOException { - if(closed) { - throw new IOException("Input Stream Closed"); //$NON-NLS-1$ - } - closed = true; - notifyAll(); - console.streamClosed(this); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java deleted file mode 100644 index c035e1a6f..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java +++ /dev/null @@ -1,269 +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.ui.console; - -import java.io.IOException; -import java.io.OutputStream; - -import org.eclipse.swt.graphics.Color; -import org.eclipse.ui.WorkbenchEncoding; -import org.eclipse.ui.internal.console.IOConsolePartitioner; - -/** - * OutputStream used to write to an IOConsole. - *

                              - * Clients are not intended to instantiate this class directly, instead - * use IOConsole.newOutputStream(). - *

                              - *

                              - * Clients should avoid writing large amounts of output to this stream in the UI - * thread. The console needs to process the output in the UI thread and if the client - * hogs the UI thread writing output to the console, the console will not be able - * to process the output. - *

                              - * @since 3.1 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - */ -public class IOConsoleOutputStream extends OutputStream { - /** - * Flag indicating whether this stream has been closed. - */ - private boolean closed = false; - - /** - * The console's document partitioner. - */ - private IOConsolePartitioner partitioner; - - /** - * The console this stream is attached to. - */ - private IOConsole console; - - /** - * Flag indicating that the console should be activated when data - * is written to this stream. - */ - private boolean activateOnWrite = false; - - /** - * The color used to decorate data written to this stream. - */ - private Color color; - - /** - * The font style used to decorate data written to this stream. - */ - private int fontStyle; - - private String fEncoding; - private String fDefaultEncoding = WorkbenchEncoding.getWorkbenchDefaultEncoding(); - - private boolean fNeedsEncoding = false; - - private boolean prependCR; - - /** - * Constructs a new output stream on the given console. - * - * @param console I/O console - */ - IOConsoleOutputStream(IOConsole console) { - this.console = console; - this.partitioner = (IOConsolePartitioner) console.getPartitioner(); - } - - /** - * Returns the font style used to decorate data written to this stream. - * - * @return the font style used to decorate data written to this stream - */ - public int getFontStyle() { - return fontStyle; - } - - /** - * Sets the font style to be used to decorate data written to this stream. - * - * @param newFontStyle the font style to be used to decorate data written to this stream - */ - public void setFontStyle(int newFontStyle) { - if (newFontStyle != fontStyle) { - int old = fontStyle; - fontStyle = newFontStyle; - console.firePropertyChange(this, IConsoleConstants.P_FONT_STYLE, new Integer(old), new Integer(fontStyle)); - } - } - - /** - * Returns whether the console this stream is writing to will be activated when this stream - * is written to. - * - * @return whether the console this stream is writing to will be activated when this stream - * is written to. - */ - public boolean isActivateOnWrite() { - return activateOnWrite; - } - - /** - * Sets whether to activate the console this stream is writing to when this stream - * is written to. - * - * @param activateOnWrite whether the console this stream is writing to will be activated when this stream - * is written to. - */ - public void setActivateOnWrite(boolean activateOnWrite) { - this.activateOnWrite = activateOnWrite; - } - - /** - * Sets the color of this stream. Use null to indicate - * the default color. - * - * @param newColor color of this stream, or null - */ - public void setColor(Color newColor) { - Color old = color; - if (old == null || !old.equals(newColor)) { - color = newColor; - console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor); - } - } - - /** - * Returns the color of this stream, or null - * if default. - * - * @return the color of this stream, or null - */ - public Color getColor() { - return color; - } - - /** - * Returns true if the stream has been closed - * @return true is the stream has been closed, false otherwise. - */ - public synchronized boolean isClosed() { - return closed; - } - - /* - * (non-Javadoc) - * @see java.io.OutputStream#close() - */ - public synchronized void close() throws IOException { - if(closed) { - throw new IOException("Output Stream is closed"); //$NON-NLS-1$ - } - if (prependCR) { // force writing of last /r - prependCR = false; - notifyParitioner("\r"); //$NON-NLS-1$ - } - console.streamClosed(this); - closed = true; - partitioner = null; - } - - /* - * (non-Javadoc) - * @see java.io.OutputStream#flush() - */ - public void flush() throws IOException { - if(closed) { - throw new IOException("Output Stream is closed"); //$NON-NLS-1$ - } - } - - /* - * (non-Javadoc) - * @see java.io.OutputStream#write(byte[], int, int) - */ - public void write(byte[] b, int off, int len) throws IOException { - if (fNeedsEncoding) { - encodedWrite(new String(b, off, len, fEncoding)); - } else { - encodedWrite(new String(b, off, len)); - } - } - /* - * (non-Javadoc) - * @see java.io.OutputStream#write(byte[]) - */ - public void write(byte[] b) throws IOException { - write(b, 0, b.length); - } - /* - * (non-Javadoc) - * @see java.io.OutputStream#write(int) - */ - public void write(int b) throws IOException { - write(new byte[] {(byte)b}, 0, 1); - } - - /** - * Writes a string to the attached console. - * - * @param str the string to write to the attached console. - * @throws IOException if the stream is closed. - */ - public synchronized void write(String str) throws IOException { - if (fNeedsEncoding) { - byte[] defaultBytes = str.getBytes(); - str = new String(defaultBytes, fEncoding); - } - encodedWrite(str); - } - - private void encodedWrite(String encodedString) throws IOException { - if(closed) { - throw new IOException("Output Stream is closed"); //$NON-NLS-1$ - } - if (prependCR){ - encodedString="\r"+encodedString; //$NON-NLS-1$ - prependCR=false; - } - if (encodedString.endsWith("\r")) { //$NON-NLS-1$ - prependCR = true; - encodedString = new String(encodedString.substring(0, encodedString.length()-1)); - } - notifyParitioner(encodedString); - } - - private void notifyParitioner(String encodedString) throws IOException { - try { - partitioner.streamAppended(this, encodedString); - - if (activateOnWrite) { - console.activate(); - } else { - ConsolePlugin.getDefault().getConsoleManager().warnOfContentChange(console); - } - } catch (IOException e) { - if (!closed) { - close(); - } - throw e; - } - } - - /** - * Sets the character encoding used to interpret characters written to this steam. - * - * @param encoding encoding identifier - */ - public void setEncoding(String encoding) { - fEncoding = encoding; - fNeedsEncoding = (fEncoding!=null) && (!fEncoding.equals(fDefaultEncoding)); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListener.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListener.java deleted file mode 100644 index d3042ead2..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListener.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.ui.console; - -/** - * A pattern match listener is registered with a TextConsole, - * and is notified when its pattern has been matched to contents in - * that console. A pattern match listener can be registered with a console - * programmatically or via the consolePatternMatchListeners extension - * point. - *

                              - * Following is an example console pattern match listener extension definition. - * - * <extension point="org.eclipse.ui.console.consolePatternMatchListeners"> - * <consolePatternMatchListener - * id="com.example.ConsolePatternMatcher" - * regex=".*foo.*" - * class="com.example.ConsolePatternMatcher"> - * </consolePatternMatchListener> - * </extension> - * - * Attributes are specified as follows: - *

                                - *
                              • id - a unique identifier for the pattern match listener
                              • - *
                              • regex - regular expression to match
                              • - *
                              • class - fully qualified name of the Java class implementing - * org.eclipse.ui.console.IPatternMatchListenerDelegate
                              • - *
                              - *

                              - *

                              - * Optionally a qualifier attribute may be specified to improve performance - * of regular expression matching. A qualifier specifies a simple regular expression used to - * qualify lines for the search. Lines that do not contain the qualifier are not considered. - *

                              - *

                              - * Optionally an enablement expression may be provided to specify - * which console(s) a pattern matcher should be contributed to. - *

                              - *

                              - * Clients may implement this interface directly if registering a pattern match listener with - * a text console programmatically. Clients contributing a pattern match listener via an - * extension implement IPatternMatchListenerDelegate instead. - *

                              - * @see org.eclipse.ui.console.TextConsole - * @since 3.1 - */ -public interface IPatternMatchListener extends IPatternMatchListenerDelegate { - /** - * Returns the pattern to be used for matching. The pattern is - * a string representing a regular expression. - * - * @return the regular expression to be used for matching - */ - public String getPattern(); - - /** - * Returns the flags to use when compiling this pattern match listener's - * regular expression, as defined by by Pattern.compile(String regex, int flags) - * - * @return the flags to use when compiling this pattern match listener's - * regular expression - * @see java.util.regex.Pattern#compile(java.lang.String, int) - */ - public int getCompilerFlags(); - - /** - * Returns a simple regular expression used to identify lines that may - * match this pattern matcher's complete pattern, or null. - * Use of this attribute can improve performance by disqualifying lines - * from the search. When a line is found containing a match for this expression, - * the line is searched from the beginning for this pattern matcher's - * complete pattern. Lines not containing this pattern are discarded. - * - * @return a simple regular expression used to identify lines that may - * match this pattern matcher's complete pattern, or null - */ - public String getLineQualifier(); - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListenerDelegate.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListenerDelegate.java deleted file mode 100644 index a3e60dd87..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IPatternMatchListenerDelegate.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.ui.console; - -/** - * A pattern match listener delegate is notified of regular expression matches - * in a text console. A delegate is contributed via the - * consolePatternMatcherListeners extension point. - *

                              - * Clients contributing a console pattern match listener extension are intended - * to implement this interface. - *

                              - * @see org.eclipse.ui.console.IPatternMatchListener - * @see org.eclipse.ui.console.TextConsole - * @since 3.1 - */ -public interface IPatternMatchListenerDelegate { - /** - * Notification that pattern matching will begin in the specified console. - * A pattern matcher is connected to only one console at a time. - * - * @param console the console in which pattern matching will be performed - */ - public void connect(TextConsole console); - - /** - * Notification that pattern matching has been completed in the console - * this delegate was last connected to. - */ - public void disconnect(); - - /** - * Notification that a match has been found. - * - * @param event event describing where the match was found - */ - public void matchFound(PatternMatchEvent event); -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java deleted file mode 100644 index b9f3071bf..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.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 - *******************************************************************************/ -package org.eclipse.ui.console; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.internal.console.IOConsolePage; -import org.eclipse.ui.part.IPageBookViewPage; - -/** - * A console that displays messages. A message console may have one or - * more streams connected to it (MessageConsoleStream). - * Text written to streams is buffered and processed in a Job by the - * console's document partitioner. - *

                              - * Clients may instantiate this class. - *

                              - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class MessageConsole extends IOConsole { - - /** - * Property constant indicating the font of this console has changed. - * - * @deprecated use {@link IConsoleConstants#P_FONT} - */ - public static final String P_FONT = IConsoleConstants.P_FONT; - - /** - * Property constant indicating the color of a stream has changed. - * - * @deprecated use {@link IConsoleConstants#P_STREAM_COLOR} - */ - public static final String P_STREAM_COLOR = IConsoleConstants.P_STREAM_COLOR; - - /** - * Property constant indicating tab size has changed - * - * @deprecated use {@link IConsoleConstants#P_TAB_SIZE} - */ - public static final String P_TAB_SIZE = IConsoleConstants.P_TAB_SIZE; - - /** - * The default tab size - * - * @deprecated use {@link IConsoleConstants#DEFAULT_TAB_SIZE} - */ - public static final int DEFAULT_TAB_SIZE = IConsoleConstants.DEFAULT_TAB_SIZE; - - /** - * Constructs a message console with the given name and image. - * - * @param name console name - * @param imageDescriptor console image descriptor or null - */ - public MessageConsole(String name, ImageDescriptor imageDescriptor) { - this(name, imageDescriptor, true); - } - - /** - * Constructs a message console. - * - * @param name console name - * @param imageDescriptor console image descriptor or null - * @param autoLifecycle whether lifecycle methods should be called automatically - * when added and removed from the console manager - * @since 3.1 - */ - public MessageConsole(String name, ImageDescriptor imageDescriptor, boolean autoLifecycle) { - this(name, IConsoleConstants.MESSAGE_CONSOLE_TYPE, imageDescriptor, autoLifecycle); - } - - /** - * Constructs a message console with the given name, type, image, and lifecycle. - * - * @param name console name - * @param consoleType console type identifier or null - * @param imageDescriptor console image descriptor or null - * @param autoLifecycle whether lifecycle methods should be called automatically - * when added and removed from the console manager - * - * @since 3.4 - */ - public MessageConsole(String name, String consoleType, ImageDescriptor imageDescriptor, boolean autoLifecycle) { - this(name, consoleType, imageDescriptor, null, autoLifecycle); - } - - /** - * Constructs a message console with the given name, type, image, encoding, and lifecycle specification. - * - * @param name the name to display for this console - * @param consoleType console type identifier or null - * @param imageDescriptor console image descriptor or null - * @param encoding the encoding that should be used to render the text, or null - * if the system default encoding should be used - * @param autoLifecycle whether lifecycle methods should be called automatically - * when added and removed from the console manager - * @since 3.5 - */ - public MessageConsole(String name, String consoleType, ImageDescriptor imageDescriptor, String encoding, boolean autoLifecycle) { - super(name, consoleType, imageDescriptor, encoding, autoLifecycle); - } - - /** - * Returns a new message stream connected to this console. - *

                              - * Clients should avoid writing large amounts of output to this stream in the UI - * thread. The console needs to process the output in the UI thread and if the client - * hogs the UI thread writing output to the console, the console will not be able - * to process the output. - *

                              - * @return a new message stream connected to this console - */ - public MessageConsoleStream newMessageStream() { - return new MessageConsoleStream(this); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView) - */ - public IPageBookViewPage createPage(IConsoleView view) { - IOConsolePage page = (IOConsolePage) super.createPage(view); - page.setReadOnly(); - return page; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IOConsole#getInputStream() - */ - public IOConsoleInputStream getInputStream() { - throw new UnsupportedOperationException("Message Console does not support user input"); //$NON-NLS-1$ - } - - - /** - * Appends the given message to this console, from the specified stream. - * - * @param text message - * @param stream stream the message belongs to - * @deprecated since 3.1, this method should no longer be called, and has no effect. - * Writing to a message console stream updates the document - */ - protected void appendToDocument(String text, MessageConsoleStream stream) { - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java deleted file mode 100644 index 274e8a8f2..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsoleStream.java +++ /dev/null @@ -1,92 +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.ui.console; - -import java.io.IOException; - -/** - * Used to write messages to a message console. A message console may have more - * than one stream connected to it. Each stream may be displayed in a different - * color. - *

                              - * Instances are created via a {@link org.eclipse.ui.console.MessageConsole}. - *

                              - *

                              - * Clients should avoid writing large amounts of output to this stream in the UI - * thread. The console needs to process the output in the UI thread and if the client - * hogs the UI thread writing output to the console, the console will not be able - * to process the output. - *

                              - *

                              - * Since 3.1, this class extends {@link org.eclipse.ui.console.IOConsoleOutputStream}. - *

                              - * @since 3.0 - * @noinstantiate This class is not intended to be instantiated by clients. - * @noextend This class is not intended to be subclassed by clients. - */ -public class MessageConsoleStream extends IOConsoleOutputStream { - - private MessageConsole fMessageConsole; - - /** - * Constructs a new stream connected to the given console. - * - * @param console the console to write messages to - */ - public MessageConsoleStream(MessageConsole console) { - super(console); - fMessageConsole = console; - } - - /** - * Appends the specified message to this stream. - * - * @param message message to append - */ - public void print(String message) { - try { - write(message); - } catch (IOException e) { - ConsolePlugin.log(e); - } - } - - - /** - * Appends a line separator string to this stream. - */ - public void println() { - try { - write("\n"); //$NON-NLS-1$ - } catch (IOException e) { - ConsolePlugin.log(e); - } - } - - /** - * Appends the specified message to this stream, followed by a line - * separator string. - * - * @param message message to print - */ - public void println(String message) { - print(message + "\n"); //$NON-NLS-1$ - } - - /** - * Returns the console this stream is connected to. - * - * @return the console this stream is connected to - */ - public MessageConsole getConsole() { - return fMessageConsole; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/PatternMatchEvent.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/PatternMatchEvent.java deleted file mode 100644 index c4c00ff6f..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/PatternMatchEvent.java +++ /dev/null @@ -1,73 +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.ui.console; - -import java.util.EventObject; - -/** - * An event describing a pattern match in a text console. The source of the event - * is a TextConsole. - *

                              - * Clients may instantiate this class. - *

                              - * @see org.eclipse.ui.console.IPatternMatchListener - * @see org.eclipse.ui.console.TextConsole - * @since 3.1 - * @noextend This class is not intended to be subclassed by clients. - */ -public class PatternMatchEvent extends EventObject { - /* - * required by EventObject for ObjectSerialization. - */ - private static final long serialVersionUID = 876890383326854537L; - - /** - * The offset of the match within the console's document. - */ - private int offset; - - /** - * The length of the matched string - */ - private int length; - - /** - * Constructs a new pattern match event. - * - * @param console the console in which the match was found - * @param matchOffset the offset at which the match was found - * @param matchLength the length of the text that matched - */ - public PatternMatchEvent(TextConsole console, int matchOffset, int matchLength) { - super(console); - offset = matchOffset; - length = matchLength; - } - - /** - * Returns the length of the matched string. - * - * @return the length of the matched string - */ - public int getLength() { - return length; - } - - /** - * Returns the offset of the match within the document. - * - * @return the offset of the match within the document - */ - public int getOffset() { - return offset; - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java deleted file mode 100644 index 81561f9ff..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java +++ /dev/null @@ -1,554 +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.ui.console; - -import java.util.HashMap; - -import org.eclipse.core.runtime.jobs.ISchedulingRule; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.BadPositionCategoryException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.Region; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Font; -import org.eclipse.ui.internal.console.ConsoleDocument; -import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition; -import org.eclipse.ui.internal.console.ConsolePatternMatcher; -import org.eclipse.ui.part.IPageBookViewPage; - -/** - * An abstract text console that supports regular expression matching and - * hyperlinks. - *

                              - * Pattern match listeners can be registered with a console programmatically - * or via the org.eclipse.ui.console.consolePatternMatchListeners - * extension point. - *

                              - *

                              - * Clients may subclass this class. Subclasses must provide a document partitioner. - *

                              - * @since 3.1 - */ -public abstract class TextConsole extends AbstractConsole { - - /** - * The current width of the console. Used for fixed width consoles. - * A value of <=0 means does not have a fixed width. - */ - private int fConsoleWidth; - /** - * The current tab width - */ - private int fTabWidth; - /** - * The font used by this console - */ - private Font fFont; - - /** - * The background color used by this console or null if default - */ - private Color fBackground; - - /** - * The Console's regular expression pattern matcher - */ - private ConsolePatternMatcher fPatternMatcher; - - /** - * The Console's document - */ - private ConsoleDocument fDocument; - - /** - * indication that the console's partitioner is not expecting more input - */ - private boolean fPartitionerFinished = false; - - /** - * Indication that the console's pattern matcher has finished. - * (all matches have been found and all listeners notified) - */ - private boolean fMatcherFinished = false; - - /** - * indication that the console output complete property has been fired - */ - private boolean fCompleteFired = false; - - - /** - * Map of client defined attributes - */ - private HashMap fAttributes = new HashMap(); - - private IConsoleManager fConsoleManager = ConsolePlugin.getDefault().getConsoleManager(); - - - /* (non-Javadoc) - * @see org.eclipse.ui.console.AbstractConsole#dispose() - */ - protected void dispose() { - super.dispose(); - fFont = null; - synchronized(fAttributes) { - fAttributes.clear(); - } - } - /** - * Constructs a console with the given name, image descriptor, and lifecycle - * - * @param name name to display for this console - * @param consoleType console type identifier or null - * @param imageDescriptor image to display for this console or null - * @param autoLifecycle whether lifecycle methods should be called automatically - * when this console is added/removed from the console manager - */ - public TextConsole(String name, String consoleType, ImageDescriptor imageDescriptor, boolean autoLifecycle) { - super(name, consoleType, imageDescriptor, autoLifecycle); - fDocument = new ConsoleDocument(); - fDocument.addPositionCategory(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - fPatternMatcher = new ConsolePatternMatcher(this); - fDocument.addDocumentListener(fPatternMatcher); - fTabWidth = IConsoleConstants.DEFAULT_TAB_SIZE; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView) - */ - public IPageBookViewPage createPage(IConsoleView view) { - return new TextConsolePage(this, view); - } - - /** - * Returns this console's document. - *

                              - * Note that a console may or may not support direct manipulation of its document. - * For example, an I/O console document and its partitions are produced from the - * streams connected to it, and clients are not intended to modify the document's - * contents. - *

                              - * - * @return this console's document - */ - public IDocument getDocument() { - return fDocument; - } - - /** - * Returns the current width of this console. A value of zero of less - * indicates this console has no fixed width. - * - * @return the current width of this console - */ - public int getConsoleWidth() { - return fConsoleWidth; - } - - /** - * Sets the width of this console in characters. Any value greater than zero - * will cause this console to have a fixed width. - * - * @param width the width to make this console. Values of 0 or less imply - * the console does not have any fixed width. - */ - public void setConsoleWidth(int width) { - if (fConsoleWidth != width) { - int old = fConsoleWidth; - fConsoleWidth = width; - - firePropertyChange(this, IConsoleConstants.P_CONSOLE_WIDTH, new Integer(old), new Integer(fConsoleWidth)); - } - } - - /** - * Sets the tab width used in this console. - * - * @param newTabWidth the tab width - */ - public void setTabWidth(final int newTabWidth) { - if (fTabWidth != newTabWidth) { - final int oldTabWidth = fTabWidth; - fTabWidth = newTabWidth; - ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { - public void run() { - firePropertyChange(TextConsole.this, IConsoleConstants.P_TAB_SIZE, new Integer(oldTabWidth), new Integer(fTabWidth)); - } - }); - } - } - - /** - * Returns the tab width used in this console. - * - * @return tab width used in this console - */ - public int getTabWidth() { - return fTabWidth; - } - - /** - * Returns the font used by this console. Must be called in the UI thread. - * - * @return font used by this console - */ - public Font getFont() { - if (fFont == null) { - fFont = getDefaultFont(); - } - return fFont; - } - - /** - * Returns the default text font. - * - * @return the default text font - */ - private Font getDefaultFont() { - return JFaceResources.getFont(JFaceResources.TEXT_FONT); - } - - /** - * Sets the font used by this console. Specify null to use - * the default text font. - * - * @param newFont font, or null to indicate the default font - */ - public void setFont(Font newFont) { - // ensure font is initialized - getFont(); - // translate null to default font - if (newFont == null) { - newFont = getDefaultFont(); - } - // fire property change if required - if (!fFont.equals(newFont)) { - Font old = fFont; - fFont = newFont; - firePropertyChange(this, IConsoleConstants.P_FONT, old, fFont); - } - } - - /** - * Sets the background color used by this console. Specify null to use - * the default background color. - * - * @param background background color or null for default - * @since 3.3 - * @deprecated use setBackground(Color) instead - */ - public void setBackgrond(Color background) { - setBackground(background); - } - - /** - * Sets the background color used by this console. Specify null to use - * the default background color. - * - * @param background background color or null for default - * @since 3.3 - */ - public void setBackground(Color background) { - if (fBackground == null) { - if (background == null) { - return; - } - } else if (fBackground.equals(background)){ - return; - } - Color old = fBackground; - fBackground = background; - firePropertyChange(this, IConsoleConstants.P_BACKGROUND_COLOR, old, fBackground); - } - - /** - * Returns the background color to use for this console or null for the - * default background color. - * - * @return background color or null for default - * @since 3.3 - */ - public Color getBackground() { - return fBackground; - } - - /** - * Clears the console. - *

                              - * Since a console may or may not support direct manipulation - * of its document's contents, this method should be called to clear a text console's - * document. The default implementation sets this console's document content - * to the empty string directly. Subclasses should override as required. - *

                              - */ - public void clearConsole() { - IDocument document = getDocument(); - if (document != null) { - document.set(""); //$NON-NLS-1$ - } - } - - /** - * Returns the console's document partitioner. - * @return The console's document partitioner - */ - protected abstract IConsoleDocumentPartitioner getPartitioner(); - - /** - * Returns all hyperlinks in this console. - * - * @return all hyperlinks in this console - */ - public IHyperlink[] getHyperlinks() { - try { - Position[] positions = getDocument().getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - IHyperlink[] hyperlinks = new IHyperlink[positions.length]; - for (int i = 0; i < positions.length; i++) { - ConsoleHyperlinkPosition position = (ConsoleHyperlinkPosition) positions[i]; - hyperlinks[i] = position.getHyperLink(); - } - return hyperlinks; - } catch (BadPositionCategoryException e) { - return new IHyperlink[0]; - } - } - - /** - * Returns the hyperlink at the given offset of null if none. - * - * @param offset offset for which a hyperlink is requested - * @return the hyperlink at the given offset of null if none - */ - public IHyperlink getHyperlink(int offset) { - try { - IDocument document = getDocument(); - if (document != null) { - Position[] positions = document.getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - Position position = findPosition(offset, positions); - if (position instanceof ConsoleHyperlinkPosition) { - return ((ConsoleHyperlinkPosition) position).getHyperLink(); - } - } - } catch (BadPositionCategoryException e) { - } - return null; - } - - /** - * Binary search for the position at a given offset. - * - * @param offset the offset whose position should be found - * @return the position containing the offset, or null - */ - private Position findPosition(int offset, Position[] positions) { - - if (positions.length == 0) - return null; - - int left= 0; - int right= positions.length -1; - int mid= 0; - Position position= null; - - while (left < right) { - - mid= (left + right) / 2; - - position= positions[mid]; - if (offset < position.getOffset()) { - if (left == mid) - right= left; - else - right= mid -1; - } else if (offset > (position.getOffset() + position.getLength() - 1)) { - if (right == mid) - left= right; - else - left= mid +1; - } else { - left= right= mid; - } - } - - position= positions[left]; - if (offset >= position.getOffset() && (offset < (position.getOffset() + position.getLength()))) { - return position; - } - return null; - } - - /** - * Adds the given pattern match listener to this console. The listener will - * be connected and receive match notifications. Has no effect if an identical - * listener has already been added. - * - * @param listener the listener to add - */ - public void addPatternMatchListener(IPatternMatchListener listener) { - fPatternMatcher.addPatternMatchListener(listener); - } - - /** - * Removes the given pattern match listener from this console. The listener will be - * disconnected and will no longer receive match notifications. Has no effect - * if the listener was not previously added. - * - * @param listener the pattern match listener to remove - */ - public void removePatternMatchListener(IPatternMatchListener listener) { - fPatternMatcher.removePatternMatchListener(listener); - } - - - /** - * Job scheduling rule that prevent the job from running if the console's PatternMatcher - * is active. - */ - private class MatcherSchedulingRule implements ISchedulingRule { - public boolean contains(ISchedulingRule rule) { - return rule == this; - } - - public boolean isConflicting(ISchedulingRule rule) { - if (contains(rule)) { - return true; - } - if (rule != this && rule instanceof MatcherSchedulingRule) { - return (((MatcherSchedulingRule)rule).getConsole() == TextConsole.this); - } - return false; - } - - public TextConsole getConsole() { - return TextConsole.this; - } - } - - /** - * Returns a scheduling rule which can be used to prevent jobs from running - * while this console's pattern matcher is active. - *

                              - * Although this scheduling rule prevents jobs from running at the same time as - * pattern matching jobs for this console, it does not enforce any ordering of jobs. - * Since 3.2, pattern matching jobs belong to the job family identified by the console - * object that matching is occurring on. To ensure a job runs after all scheduled pattern - * matching is complete, clients must join on this console's job family. - *

                              - * @return a scheduling rule which can be used to prevent jobs from running - * while this console's pattern matcher is active - */ - public ISchedulingRule getSchedulingRule() { - return new MatcherSchedulingRule(); - } - - /** - * This console's partitioner should call this method when it is not expecting any new data - * to be appended to the document. - */ - public void partitionerFinished() { - fPatternMatcher.forceFinalMatching(); - fPartitionerFinished = true; - checkFinished(); - } - - /** - * Called by this console's pattern matcher when matching is complete. - *

                              - * Clients should not call this method. - *

                              - */ - public void matcherFinished() { - fMatcherFinished = true; - fDocument.removeDocumentListener(fPatternMatcher); - checkFinished(); - } - - /** - * Fires the console output complete property change event. - */ - private synchronized void checkFinished() { - if (!fCompleteFired && fPartitionerFinished && fMatcherFinished ) { - fCompleteFired = true; - firePropertyChange(this, IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE, null, null); - } - } - - /** - * Adds a hyperlink to this console. - * - * @param hyperlink the hyperlink to add - * @param offset the offset in the console document at which the hyperlink should be added - * @param length the length of the text which should be hyperlinked - * @throws BadLocationException if the specified location is not valid. - */ - public void addHyperlink(IHyperlink hyperlink, int offset, int length) throws BadLocationException { - IDocument document = getDocument(); - ConsoleHyperlinkPosition hyperlinkPosition = new ConsoleHyperlinkPosition(hyperlink, offset, length); - try { - document.addPosition(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY, hyperlinkPosition); - fConsoleManager.refresh(this); - } catch (BadPositionCategoryException e) { - ConsolePlugin.log(e); - } - } - - /** - * Returns the region associated with the given hyperlink. - * - * @param link hyperlink - * @return the region associated with the hyperlink or null if the hyperlink is not found. - */ - public IRegion getRegion(IHyperlink link) { - try { - IDocument doc = getDocument(); - if (doc != null) { - Position[] positions = doc.getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - for (int i = 0; i < positions.length; i++) { - ConsoleHyperlinkPosition position = (ConsoleHyperlinkPosition)positions[i]; - if (position.getHyperLink().equals(link)) { - return new Region(position.getOffset(), position.getLength()); - } - } - } - } catch (BadPositionCategoryException e) { - } - return null; - } - - /** - * Returns the attribute associated with the specified key. - * - * @param key attribute key - * @return the attribute associated with the specified key - */ - public Object getAttribute(String key) { - synchronized (fAttributes) { - return fAttributes.get(key); - } - } - - /** - * Sets an attribute value. Intended for client data. - * - * @param key attribute key - * @param value attribute value - */ - public void setAttribute(String key, Object value) { - synchronized(fAttributes) { - fAttributes.put(key, value); - } - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java deleted file mode 100644 index ae76fec0a..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java +++ /dev/null @@ -1,413 +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 - * Livar Cunha (livarcocc@gmail.com) - Bug 236049 - *******************************************************************************/ - -package org.eclipse.ui.console; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.ResourceBundle; - -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Widget; - -import org.eclipse.core.runtime.IAdaptable; - -import org.eclipse.jface.action.IAction; -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.resource.JFaceResources; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.SelectionChangedEvent; - -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IFindReplaceTarget; -import org.eclipse.jface.text.ITextListener; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.TextEvent; - -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.ISharedImages; -import org.eclipse.ui.IWorkbenchActionConstants; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.console.actions.ClearOutputAction; -import org.eclipse.ui.console.actions.TextViewerAction; -import org.eclipse.ui.internal.console.ConsoleMessages; -import org.eclipse.ui.internal.console.ConsoleResourceBundleMessages; -import org.eclipse.ui.internal.console.FollowHyperlinkAction; -import org.eclipse.ui.internal.console.IConsoleHelpContextIds; -import org.eclipse.ui.part.IPageBookViewPage; -import org.eclipse.ui.part.IPageSite; - -import org.eclipse.ui.texteditor.FindReplaceAction; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * A page for a text console. - *

                              - * Clients may contribute actions to the context menu of a text console page - * using the org.eclipse.ui.popupMenus extension point. The context - * menu identifier for a text console page is the associated console's type - * suffixed with .#ContextMenu. When a console does not specify - * a type, the context menu id is #ContextMenu. - *

                              - *

                              - * Clients may subclass this class. - *

                              - * @since 3.1 - */ -public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListener, IAdaptable { - private IPageSite fSite; - private TextConsole fConsole; - private IConsoleView fConsoleView; - private TextConsoleViewer fViewer; - private MenuManager fMenuManager; - protected Map fGlobalActions = new HashMap(); - protected ArrayList fSelectionActions = new ArrayList(); - protected ClearOutputAction fClearOutputAction; - - // text selection listener, used to update selection dependent actions on selection changes - private ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - updateSelectionDependentActions(); - } - }; - - // updates the find replace action and the clear action if the document length is > 0 - private ITextListener textListener = new ITextListener() { - public void textChanged(TextEvent event) { - IUpdate findReplace = (IUpdate)fGlobalActions.get(ActionFactory.FIND.getId()); - if (findReplace != null) { - findReplace.update(); - } - - if (fClearOutputAction != null) { - IDocument doc = fViewer.getDocument(); - if(doc != null) { - fClearOutputAction.setEnabled(doc.getLength() > 0); - } - } - } - }; - - /** - * Constructs a text console page for the given console in the given view. - * - * @param console text console - * @param view console view the page is contained in - */ - public TextConsolePage(TextConsole console, IConsoleView view) { - fConsole = console; - fConsoleView = view; - } - - /** - * Returns a viewer used to display the contents of this page's console. - * - * @param parent container for the viewer - * @return a viewer used to display the contents of this page's console - */ - protected TextConsoleViewer createViewer(Composite parent) { - return new TextConsoleViewer(parent, fConsole); - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.part.IPageBookViewPage#getSite() - */ - public IPageSite getSite() { - return fSite; - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.part.IPageBookViewPage#init(org.eclipse.ui.part.IPageSite) - */ - public void init(IPageSite pageSite) throws PartInitException { - fSite = pageSite; - } - - /** - * Updates selection dependent actions. - */ - protected void updateSelectionDependentActions() { - Iterator iterator= fSelectionActions.iterator(); - while (iterator.hasNext()) { - updateAction((String)iterator.next()); - } - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - fViewer = createViewer(parent); - fViewer.setConsoleWidth(fConsole.getConsoleWidth()); - fViewer.setTabWidth(fConsole.getTabWidth()); - fConsole.addPropertyChangeListener(this); - JFaceResources.getFontRegistry().addListener(this); - - String id = "#ContextMenu"; //$NON-NLS-1$ - if (getConsole().getType() != null) { - id = getConsole().getType() + "." + id; //$NON-NLS-1$ - } - fMenuManager= new MenuManager("#ContextMenu", id); //$NON-NLS-1$ - fMenuManager.setRemoveAllWhenShown(true); - fMenuManager.addMenuListener(new IMenuListener() { - public void menuAboutToShow(IMenuManager m) { - contextMenuAboutToShow(m); - } - }); - Menu menu = fMenuManager.createContextMenu(getControl()); - getControl().setMenu(menu); - - createActions(); - configureToolBar(getSite().getActionBars().getToolBarManager()); - - getSite().registerContextMenu(id, fMenuManager, fViewer); - getSite().setSelectionProvider(fViewer); - - fViewer.getSelectionProvider().addSelectionChangedListener(selectionChangedListener); - fViewer.addTextListener(textListener); - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.part.IPage#dispose() - */ - public void dispose() { - fConsole.removePropertyChangeListener(this); - JFaceResources.getFontRegistry().removeListener(this); - - if (fMenuManager != null) { - fMenuManager.dispose(); - } - fClearOutputAction = null; - fSelectionActions.clear(); - fGlobalActions.clear(); - - fViewer.getSelectionProvider().removeSelectionChangedListener(selectionChangedListener); - fViewer.removeTextListener(textListener); - fViewer = null; - } - - - /* - * (non-Javadoc) - * @see org.eclipse.ui.part.IPage#getControl() - */ - public Control getControl() { - return fViewer != null ? fViewer.getControl() : null; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.IPage#setActionBars(org.eclipse.ui.IActionBars) - */ - public void setActionBars(IActionBars actionBars) { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.IPage#setFocus() - */ - public void setFocus() { - if (fViewer != null) { - fViewer.getTextWidget().setFocus(); - } - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent event) { - if (fViewer != null) { - Object source = event.getSource(); - String property = event.getProperty(); - - if (source.equals(fConsole) && IConsoleConstants.P_FONT.equals(property)) { - fViewer.setFont(fConsole.getFont()); - } else if (IConsoleConstants.P_FONT_STYLE.equals(property)) { - fViewer.getTextWidget().redraw(); - } else if (property.equals(IConsoleConstants.P_STREAM_COLOR)) { - fViewer.getTextWidget().redraw(); - } else if (source.equals(fConsole) && property.equals(IConsoleConstants.P_TAB_SIZE)) { - Integer tabSize = (Integer)event.getNewValue(); - fViewer.setTabWidth(tabSize.intValue()); - } else if (source.equals(fConsole) && property.equals(IConsoleConstants.P_CONSOLE_WIDTH)) { - fViewer.setConsoleWidth(fConsole.getConsoleWidth()); - } else if (IConsoleConstants.P_BACKGROUND_COLOR.equals(property)) { - fViewer.getTextWidget().setBackground(fConsole.getBackground()); - } - } - } - - /** - * Creates actions. - */ - protected void createActions() { - IActionBars actionBars= getSite().getActionBars(); - TextViewerAction action= new TextViewerAction(fViewer, ITextOperationTarget.SELECT_ALL); - action.configureAction(ConsoleMessages.TextConsolePage_SelectAllText, ConsoleMessages.TextConsolePage_SelectAllDescrip, ConsoleMessages.TextConsolePage_SelectAllDescrip); - action.setActionDefinitionId(ActionFactory.SELECT_ALL.getCommandId()); - PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IConsoleHelpContextIds.CONSOLE_SELECT_ALL_ACTION); - setGlobalAction(actionBars, ActionFactory.SELECT_ALL.getId(), action); - - action= new TextViewerAction(fViewer, ITextOperationTarget.CUT); - action.configureAction(ConsoleMessages.TextConsolePage_CutText, ConsoleMessages.TextConsolePage_CutDescrip, ConsoleMessages.TextConsolePage_CutDescrip); - action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_CUT)); - action.setActionDefinitionId(ActionFactory.CUT.getCommandId()); - PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IConsoleHelpContextIds.CONSOLE_CUT_ACTION); - setGlobalAction(actionBars, ActionFactory.CUT.getId(), action); - - action= new TextViewerAction(fViewer, ITextOperationTarget.COPY); - action.configureAction(ConsoleMessages.TextConsolePage_CopyText, ConsoleMessages.TextConsolePage_CopyDescrip, ConsoleMessages.TextConsolePage_CopyDescrip); - action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_COPY)); - action.setActionDefinitionId(ActionFactory.COPY.getCommandId()); - PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IConsoleHelpContextIds.CONSOLE_COPY_ACTION); - setGlobalAction(actionBars, ActionFactory.COPY.getId(), action); - - action= new TextViewerAction(fViewer, ITextOperationTarget.PASTE); - action.configureAction(ConsoleMessages.TextConsolePage_PasteText, ConsoleMessages.TextConsolePage_PasteDescrip, ConsoleMessages.TextConsolePage_PasteDescrip); - action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_PASTE)); - action.setActionDefinitionId(ActionFactory.PASTE.getCommandId()); - PlatformUI.getWorkbench().getHelpSystem().setHelp(action, IConsoleHelpContextIds.CONSOLE_PASTE_ACTION); - setGlobalAction(actionBars, ActionFactory.PASTE.getId(), action); - - fClearOutputAction = new ClearOutputAction(fConsole); - - ResourceBundle bundle = ConsoleResourceBundleMessages.getBundle(); - FindReplaceAction fraction = new FindReplaceAction(bundle, "find_replace_action_", fConsoleView); //$NON-NLS-1$ - PlatformUI.getWorkbench().getHelpSystem().setHelp(fraction, IConsoleHelpContextIds.CONSOLE_FIND_REPLACE_ACTION); - setGlobalAction(actionBars, ActionFactory.FIND.getId(), fraction); - - fSelectionActions.add(ActionFactory.CUT.getId()); - fSelectionActions.add(ActionFactory.COPY.getId()); - fSelectionActions.add(ActionFactory.PASTE.getId()); - fSelectionActions.add(ActionFactory.FIND.getId()); - - actionBars.updateActionBars(); - } - - /** - * Configures an action for key bindings. - * - * @param actionBars action bars for this page - * @param actionID action definition id - * @param action associated action - */ - protected void setGlobalAction(IActionBars actionBars, String actionID, IAction action) { - fGlobalActions.put(actionID, action); - actionBars.setGlobalActionHandler(actionID, action); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) - */ - public Object getAdapter(Class required) { - if (IFindReplaceTarget.class.equals(required)) { - return fViewer.getFindReplaceTarget(); - } - if (Widget.class.equals(required)) { - return fViewer.getTextWidget(); - } - return null; - } - - /** - * Returns the view this page is contained in. - * - * @return the view this page is contained in - */ - protected IConsoleView getConsoleView() { - return fConsoleView; - } - - /** - * Returns the console this page is displaying. - * - * @return the console this page is displaying - */ - protected IConsole getConsole() { - return fConsole; - } - - /** - * Updates the global action with the given id - * - * @param actionId action definition id - */ - protected void updateAction(String actionId) { - IAction action= (IAction)fGlobalActions.get(actionId); - if (action instanceof IUpdate) { - ((IUpdate) action).update(); - } - } - - - /** - * Fill the context menu - * - * @param menuManager menu - */ - protected void contextMenuAboutToShow(IMenuManager menuManager) { - IDocument doc= fViewer.getDocument(); - if (doc == null) { - return; - } - - menuManager.add((IAction)fGlobalActions.get(ActionFactory.CUT.getId())); - menuManager.add((IAction)fGlobalActions.get(ActionFactory.COPY.getId())); - menuManager.add((IAction)fGlobalActions.get(ActionFactory.PASTE.getId())); - menuManager.add((IAction)fGlobalActions.get(ActionFactory.SELECT_ALL.getId())); - - menuManager.add(new Separator("FIND")); //$NON-NLS-1$ - menuManager.add((IAction)fGlobalActions.get(ActionFactory.FIND.getId())); - menuManager.add(new FollowHyperlinkAction(fViewer)); - menuManager.add(fClearOutputAction); - - menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS)); - } - - protected void configureToolBar(IToolBarManager mgr) { - mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, fClearOutputAction); - } - - - /** - * Returns the viewer contained in this page. - * - * @return the viewer contained in this page - */ - public TextConsoleViewer getViewer() { - return fViewer; - } - - /** - * Sets the viewer contained in this page. - * - * @param viewer text viewer - */ - public void setViewer(TextConsoleViewer viewer) { - this.fViewer = viewer; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java deleted file mode 100644 index 50c1a8e2d..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java +++ /dev/null @@ -1,699 +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.ui.console; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.jface.preference.JFacePreferences; -import org.eclipse.jface.resource.ColorRegistry; -import org.eclipse.jface.resource.JFaceColors; -import org.eclipse.jface.resource.JFaceResources; -import org.eclipse.jface.text.BadPositionCategoryException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentAdapter; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.jface.text.IPositionUpdater; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Position; -import org.eclipse.jface.text.source.SourceViewer; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.LineBackgroundEvent; -import org.eclipse.swt.custom.LineBackgroundListener; -import org.eclipse.swt.custom.LineStyleEvent; -import org.eclipse.swt.custom.LineStyleListener; -import org.eclipse.swt.custom.StyleRange; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.MouseListener; -import org.eclipse.swt.events.MouseMoveListener; -import org.eclipse.swt.events.MouseTrackListener; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Cursor; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Point; -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.ui.internal.console.ConsoleDocumentAdapter; -import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition; -import org.eclipse.ui.progress.WorkbenchJob; - -/** - * Default viewer used to display a TextConsole. - *

                              - * Clients may subclass this class. - *

                              - * - * @since 3.1 - */ -public class TextConsoleViewer extends SourceViewer implements LineStyleListener, LineBackgroundListener, MouseTrackListener, MouseMoveListener, MouseListener { - /** - * Adapts document to the text widget. - */ - private ConsoleDocumentAdapter documentAdapter; - - private IHyperlink hyperlink; - - private Cursor handCursor; - - private Cursor textCursor; - - private int consoleWidth = -1; - - private TextConsole console; - - private IPropertyChangeListener propertyChangeListener; - - private IDocumentListener documentListener = new IDocumentListener() { - public void documentAboutToBeChanged(DocumentEvent event) { - } - - public void documentChanged(DocumentEvent event) { - updateLinks(event.fOffset); - } - }; - // event listener used to send event to hyperlink for IHyperlink2 - private Listener mouseUpListener = new Listener() { - public void handleEvent(Event event) { - if (hyperlink != null) { - String selection = getTextWidget().getSelectionText(); - if (selection.length() <= 0) { - if (event.button == 1) { - if (hyperlink instanceof IHyperlink2) { - ((IHyperlink2) hyperlink).linkActivated(event); - } else { - hyperlink.linkActivated(); - } - } - } - } - } - }; - - WorkbenchJob revealJob = new WorkbenchJob("Reveal End of Document") {//$NON-NLS-1$ - public IStatus runInUIThread(IProgressMonitor monitor) { - StyledText textWidget = getTextWidget(); - if (textWidget != null && !textWidget.isDisposed()) { - int lineCount = textWidget.getLineCount(); - textWidget.setTopIndex(lineCount - 1); - } - return Status.OK_STATUS; - } - }; - - private IPositionUpdater positionUpdater = new IPositionUpdater() { - public void update(DocumentEvent event) { - try { - IDocument document = getDocument(); - if (document != null) { - Position[] positions = document.getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - for (int i = 0; i < positions.length; i++) { - Position position = positions[i]; - if (position.offset == event.fOffset && position.length<=event.fLength) { - position.delete(); - } - if (position.isDeleted) { - document.removePosition(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY, position); - } - } - } - } catch (BadPositionCategoryException e) { - } - } - }; - - /** - * Constructs a new viewer in the given parent for the specified console. - * - * @param parent - * containing widget - * @param console - * text console - */ - public TextConsoleViewer(Composite parent, TextConsole console) { - super(parent, null, SWT.V_SCROLL | SWT.H_SCROLL); - this.console = console; - - IDocument document = console.getDocument(); - setDocument(document); - - StyledText styledText = getTextWidget(); - styledText.setDoubleClickEnabled(true); - styledText.addLineStyleListener(this); - styledText.addLineBackgroundListener(this); - styledText.setEditable(true); - setFont(console.getFont()); - styledText.addMouseTrackListener(this); - styledText.addListener(SWT.MouseUp, mouseUpListener); - - ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); - propertyChangeListener = new HyperlinkColorChangeListener(); - colorRegistry.addListener(propertyChangeListener); - - revealJob.setSystem(true); - document.addDocumentListener(documentListener); - document.addPositionUpdater(positionUpdater); - } - - /** - * Sets the tab width used by this viewer. - * - * @param tabWidth - * the tab width used by this viewer - */ - public void setTabWidth(int tabWidth) { - StyledText styledText = getTextWidget(); - int oldWidth = styledText.getTabs(); - if (tabWidth != oldWidth) { - styledText.setTabs(tabWidth); - } - } - - /** - * Sets the font used by this viewer. - * - * @param font - * the font used by this viewer - */ - public void setFont(Font font) { - StyledText styledText = getTextWidget(); - Font oldFont = styledText.getFont(); - if (oldFont == font) { - return; - } - if (font == null || !(font.equals(oldFont))) { - styledText.setFont(font); - } - } - - /** - * Positions the cursor at the end of the document. - */ - protected void revealEndOfDocument() { - revealJob.schedule(50); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.custom.LineStyleListener#lineGetStyle(org.eclipse.swt.custom.LineStyleEvent) - */ - public void lineGetStyle(LineStyleEvent event) { - IDocument document = getDocument(); - if (document != null && document.getLength() > 0) { - ArrayList ranges = new ArrayList(); - int offset = event.lineOffset; - int length = event.lineText.length(); - - StyleRange[] partitionerStyles = ((IConsoleDocumentPartitioner) document.getDocumentPartitioner()).getStyleRanges(event.lineOffset, event.lineText.length()); - if (partitionerStyles != null) { - for (int i = 0; i < partitionerStyles.length; i++) { - ranges.add(partitionerStyles[i]); - } - } else { - ranges.add(new StyleRange(offset, length, null, null)); - } - - try { - Position[] positions = getDocument().getPositions(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - Position[] overlap = findPosition(offset, length, positions); - Color color = JFaceColors.getHyperlinkText(Display.getCurrent()); - if (overlap != null) { - for (int i = 0; i < overlap.length; i++) { - Position position = overlap[i]; - StyleRange linkRange = new StyleRange(position.offset, position.length, color, null); - linkRange.underline = true; - override(ranges, linkRange); - } - } - } catch (BadPositionCategoryException e) { - } - - if (ranges.size() > 0) { - event.styles = (StyleRange[]) ranges.toArray(new StyleRange[ranges.size()]); - } - } - } - - private void override(List ranges, StyleRange newRange) { - if (ranges.isEmpty()) { - ranges.add(newRange); - return; - } - - int start = newRange.start; - int end = start + newRange.length; - for (int i = 0; i < ranges.size(); i++) { - StyleRange existingRange = (StyleRange) ranges.get(i); - int rEnd = existingRange.start + existingRange.length; - if (end <= existingRange.start || start >= rEnd) { - continue; - } - - if (start < existingRange.start && end > existingRange.start) { - start = existingRange.start; - } - - if (start >= existingRange.start && end <= rEnd) { - existingRange.length = start - existingRange.start; - ranges.add(++i, newRange); - if (end != rEnd) { - ranges.add(++i, new StyleRange(end, rEnd - end - 1, existingRange.foreground, existingRange.background)); - } - return; - } else if (start >= existingRange.start && start < rEnd) { - existingRange.length = start - existingRange.start; - ranges.add(++i, newRange); - } else if (end >= rEnd) { - ranges.remove(i); - } else { - ranges.add(++i, new StyleRange(end + 1, rEnd - end + 1, existingRange.foreground, existingRange.background)); - } - } - } - - /** - * Binary search for the positions overlapping the given range - * - * @param offset - * the offset of the range - * @param length - * the length of the range - * @param positions - * the positions to search - * @return the positions overlapping the given range, or null - */ - private Position[] findPosition(int offset, int length, Position[] positions) { - - if (positions.length == 0) - return null; - - int rangeEnd = offset + length; - int left = 0; - int right = positions.length - 1; - int mid = 0; - Position position = null; - - while (left < right) { - - mid = (left + right) / 2; - - position = positions[mid]; - if (rangeEnd < position.getOffset()) { - if (left == mid) - right = left; - else - right = mid - 1; - } else if (offset > (position.getOffset() + position.getLength() - 1)) { - if (right == mid) - left = right; - else - left = mid + 1; - } else { - left = right = mid; - } - } - - List list = new ArrayList(); - int index = left - 1; - if (index >= 0) { - position = positions[index]; - while (index >= 0 && (position.getOffset() + position.getLength()) > offset) { - index--; - if (index > 0) { - position = positions[index]; - } - } - } - index++; - position = positions[index]; - while (index < positions.length && (position.getOffset() < rangeEnd)) { - list.add(position); - index++; - if (index < positions.length) { - position = positions[index]; - } - } - - if (list.isEmpty()) { - return null; - } - return (Position[]) list.toArray(new Position[list.size()]); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.custom.LineBackgroundListener#lineGetBackground(org.eclipse.swt.custom.LineBackgroundEvent) - */ - public void lineGetBackground(LineBackgroundEvent event) { - event.lineBackground = null; - } - - /** - * Returns the hand cursor. - * - * @return the hand cursor - */ - protected Cursor getHandCursor() { - if (handCursor == null) { - handCursor = new Cursor(ConsolePlugin.getStandardDisplay(), SWT.CURSOR_HAND); - } - return handCursor; - } - - /** - * Returns the text cursor. - * - * @return the text cursor - */ - protected Cursor getTextCursor() { - if (textCursor == null) { - textCursor = new Cursor(ConsolePlugin.getStandardDisplay(), SWT.CURSOR_IBEAM); - } - return textCursor; - } - - /** - * Notification a hyperlink has been entered. - * - * @param link - * the link that was entered - */ - protected void linkEntered(IHyperlink link) { - Control control = getTextWidget(); - if (hyperlink != null) { - linkExited(hyperlink); - } - hyperlink = link; - hyperlink.linkEntered(); - control.setCursor(getHandCursor()); - control.redraw(); - control.addMouseListener(this); - } - - /** - * Notification a link was exited. - * - * @param link - * the link that was exited - */ - protected void linkExited(IHyperlink link) { - link.linkExited(); - hyperlink = null; - Control control = getTextWidget(); - control.setCursor(getTextCursor()); - control.redraw(); - control.removeMouseListener(this); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter(org.eclipse.swt.events.MouseEvent) - */ - public void mouseEnter(MouseEvent e) { - getTextWidget().addMouseMoveListener(this); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseTrackListener#mouseExit(org.eclipse.swt.events.MouseEvent) - */ - public void mouseExit(MouseEvent e) { - getTextWidget().removeMouseMoveListener(this); - if (hyperlink != null) { - linkExited(hyperlink); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseTrackListener#mouseHover(org.eclipse.swt.events.MouseEvent) - */ - public void mouseHover(MouseEvent e) { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent) - */ - public void mouseMove(MouseEvent e) { - int offset = -1; - try { - Point p = new Point(e.x, e.y); - offset = getTextWidget().getOffsetAtLocation(p); - } catch (IllegalArgumentException ex) { - // out of the document range - } - updateLinks(offset); - } - - /** - * The cursor has just be moved to the given offset, the mouse has hovered - * over the given offset. Update link rendering. - * - * @param offset - */ - protected void updateLinks(int offset) { - if (offset >= 0) { - IHyperlink link = getHyperlink(offset); - if (link != null) { - if (link.equals(hyperlink)) { - return; - } - linkEntered(link); - return; - } - } - if (hyperlink != null) { - linkExited(hyperlink); - } - } - - /** - * Returns the currently active hyperlink or null if none. - * - * @return the currently active hyperlink or null if none - */ - public IHyperlink getHyperlink() { - return hyperlink; - } - - /** - * Returns the hyperlink at the specified offset, or null if - * none. - * - * @param offset - * offset at which a hyperlink has been requested - * @return hyperlink at the specified offset, or null if none - */ - public IHyperlink getHyperlink(int offset) { - if (offset >= 0 && console != null) { - return console.getHyperlink(offset); - } - return null; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent) - */ - public void mouseDoubleClick(MouseEvent e) { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent) - */ - public void mouseDown(MouseEvent e) { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent) - */ - public void mouseUp(MouseEvent e) { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.TextViewer#createDocumentAdapter() - */ - protected IDocumentAdapter createDocumentAdapter() { - if (documentAdapter == null) { - documentAdapter = new ConsoleDocumentAdapter(consoleWidth = -1); - } - return documentAdapter; - } - - /** - * Sets the console to have a fixed character width. Use -1 to indicate that - * a fixed width should not be used. - * - * @param width - * fixed character width of the console, or -1 - */ - public void setConsoleWidth(int width) { - if (consoleWidth != width) { - consoleWidth = width; - ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { - public void run() { - if (documentAdapter != null) { - documentAdapter.setWidth(consoleWidth); - } - } - }); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.TextViewer#handleDispose() - */ - protected void handleDispose() { - IDocument document = getDocument(); - if (document != null) { - document.removeDocumentListener(documentListener); - document.removePositionUpdater(positionUpdater); - } - - StyledText styledText = getTextWidget(); - styledText.removeLineStyleListener(this); - styledText.removeLineBackgroundListener(this); - styledText.removeMouseTrackListener(this); - - if(handCursor != null) { - handCursor.dispose(); - } - handCursor = null; - if(textCursor != null) { - textCursor.dispose(); - } - textCursor = null; - hyperlink = null; - console = null; - - ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); - colorRegistry.removeListener(propertyChangeListener); - - super.handleDispose(); - } - - class HyperlinkColorChangeListener implements IPropertyChangeListener { - public void propertyChange(PropertyChangeEvent event) { - if (event.getProperty().equals(JFacePreferences.ACTIVE_HYPERLINK_COLOR) || event.getProperty().equals(JFacePreferences.HYPERLINK_COLOR)) { - getTextWidget().redraw(); - } - } - - } - - /* - * work around to memory leak in TextViewer$WidgetCommand - */ - protected void updateTextListeners(WidgetCommand cmd) { - super.updateTextListeners(cmd); - cmd.preservedText = null; - cmd.event = null; - cmd.text = null; - } - - protected void internalRevealRange(int start, int end) { - StyledText textWidget = getTextWidget(); - int startLine = documentAdapter.getLineAtOffset(start); - int endLine = documentAdapter.getLineAtOffset(end); - - int top = textWidget.getTopIndex(); - if (top > -1) { - // scroll vertically - int lines = getVisibleLinesInViewport(); - int bottom = top + lines; - - // two lines at the top and the bottom should always be left - // if window is smaller than 5 lines, always center position is - // chosen - int bufferZone = 2; - if (startLine >= top + bufferZone && startLine <= bottom - bufferZone && endLine >= top + bufferZone && endLine <= bottom - bufferZone) { - - // do not scroll at all as it is already visible - } else { - int delta = Math.max(0, lines - (endLine - startLine)); - textWidget.setTopIndex(startLine - delta / 3); - updateViewportListeners(INTERNAL); - } - - // scroll horizontally - if (endLine < startLine) { - endLine += startLine; - startLine = endLine - startLine; - endLine -= startLine; - } - - int startPixel = -1; - int endPixel = -1; - - if (endLine > startLine) { - // reveal the beginning of the range in the start line - IRegion extent = getExtent(start, start); - startPixel = extent.getOffset() + textWidget.getHorizontalPixel(); - endPixel = startPixel; - } else { - IRegion extent = getExtent(start, end); - startPixel = extent.getOffset() + textWidget.getHorizontalPixel(); - endPixel = startPixel + extent.getLength(); - } - - int visibleStart = textWidget.getHorizontalPixel(); - int visibleEnd = visibleStart + textWidget.getClientArea().width; - - // scroll only if not yet visible - if (startPixel < visibleStart || visibleEnd < endPixel) { - // set buffer zone to 10 pixels - bufferZone = 10; - int newOffset = visibleStart; - int visibleWidth = visibleEnd - visibleStart; - int selectionPixelWidth = endPixel - startPixel; - - if (startPixel < visibleStart) - newOffset = startPixel; - else if (selectionPixelWidth + bufferZone < visibleWidth) - newOffset = endPixel + bufferZone - visibleWidth; - else - newOffset = startPixel; - - float index = ((float) newOffset) / ((float) getAverageCharWidth()); - - textWidget.setHorizontalIndex(Math.round(index)); - } - - } - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java deleted file mode 100644 index a1de229b5..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java +++ /dev/null @@ -1,95 +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.ui.console.actions; - - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.swt.custom.BusyIndicator; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.TextConsole; -import org.eclipse.ui.internal.console.ConsoleMessages; -import org.eclipse.ui.internal.console.ConsolePluginImages; -import org.eclipse.ui.internal.console.IConsoleHelpContextIds; -import org.eclipse.ui.internal.console.IInternalConsoleConstants; - -/** - * Clears the output in a text console. - *

                              - * Clients may instantiate this class. - *

                              - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class ClearOutputAction extends Action { - - private ITextViewer fViewer; - private TextConsole fIOConsole; - - /** - * Constructs a clear output action. - * - * @since 3.1 - */ - private ClearOutputAction() { - super(ConsoleMessages.ClearOutputAction_title); - setToolTipText(ConsoleMessages.ClearOutputAction_toolTipText); - setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IConsoleConstants.IMG_LCL_CLEAR)); - setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_CLEAR)); - setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLEAR)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CLEAR_CONSOLE_ACTION); - } - - /** - * Constructs a clear output action for an I/O console. Clearing an I/O console - * is performed via API on the IOConsole, rather than clearing - * its document directly. - * - * @param ioConsole I/O console the action is associated with - * @since 3.1 - */ - public ClearOutputAction(TextConsole ioConsole) { - this(); - fIOConsole = ioConsole; - } - - /** - * Constructs an action to clear the document associated with a text viewer. - * - * @param viewer viewer whose document this action is associated with - */ - public ClearOutputAction(ITextViewer viewer) { - this(); - fViewer = viewer; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - BusyIndicator.showWhile(ConsolePlugin.getStandardDisplay(), new Runnable() { - public void run() { - if (fIOConsole == null) { - IDocument document = fViewer.getDocument(); - if (document != null) { - document.set(""); //$NON-NLS-1$ - } - fViewer.setSelectedRange(0, 0); - } else { - fIOConsole.clearConsole(); - } - } - }); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/CloseConsoleAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/CloseConsoleAction.java deleted file mode 100644 index 8691ac226..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/CloseConsoleAction.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.ui.console.actions; - -import org.eclipse.jface.action.Action; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.internal.console.ConsoleMessages; -import org.eclipse.ui.internal.console.ConsolePluginImages; -import org.eclipse.ui.internal.console.IInternalConsoleConstants; - -/** - * Removes a console from the console manager. - *

                              - * Clients may instantiate this class. - *

                              - * @since 3.1 - * @noextend This class is not intended to be subclassed by clients. - */ -public class CloseConsoleAction extends Action { - - private IConsole fConsole; - - public CloseConsoleAction(IConsole console) { - super(ConsoleMessages.CloseConsoleAction_0, ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLOSE)); - setToolTipText(ConsoleMessages.CloseConsoleAction_1); - fConsole = console; - } - - public void run() { - ConsolePlugin.getDefault().getConsoleManager().removeConsoles(new IConsole[]{fConsole}); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java deleted file mode 100644 index b3809ea13..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java +++ /dev/null @@ -1,84 +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.ui.console.actions; - - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.text.ITextOperationTarget; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Common function for actions that operate on a text viewer. - *

                              - * Clients may subclass this class. - *

                              - * @since 3.0 - */ -public class TextViewerAction extends Action implements IUpdate { - - private int fOperationCode= -1; - private ITextOperationTarget fOperationTarget; - - /** - * Constructs a new action in the given text viewer with - * the specified operation code. - * - * @param viewer - * @param operationCode - */ - public TextViewerAction(ITextViewer viewer, int operationCode) { - fOperationCode= operationCode; - fOperationTarget= viewer.getTextOperationTarget(); - update(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - * - * Updates the enabled state of the action. - * Fires a property change if the enabled state changes. - * - * @see org.eclipse.jface.action.Action#firePropertyChange(String, Object, Object) - */ - public void update() { - - boolean wasEnabled= isEnabled(); - boolean isEnabled= (fOperationTarget != null && fOperationTarget.canDoOperation(fOperationCode)); - setEnabled(isEnabled); - - if (wasEnabled != isEnabled) { - firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - if (fOperationCode != -1 && fOperationTarget != null) { - fOperationTarget.doOperation(fOperationCode); - } - } - - /** - * Configures this action with a label, tool tip, and description. - * - * @param text action label - * @param toolTipText action tool tip - * @param description action description - */ - public void configureAction(String text, String toolTipText, String description) { - setText(text); - setToolTipText(toolTipText); - setDescription(description); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java deleted file mode 100644 index b029804f5..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java +++ /dev/null @@ -1,121 +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.ui.console.actions; - - -import com.ibm.icu.text.MessageFormat; - -import org.eclipse.jface.dialogs.IInputValidator; -import org.eclipse.jface.dialogs.InputDialog; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.ITextViewer; -import org.eclipse.jface.window.Window; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.internal.console.ConsoleMessages; - -/** - * Action to position a text viewer to a specific line. - *

                              - * Clients may instantiate this class. - *

                              - * @since 3.0 - * @noextend This class is not intended to be subclassed by clients. - */ -public class TextViewerGotoLineAction extends TextViewerAction { - - /** - * Validates whether the text found in the input field of the - * dialog forms a valid line number, i.e. one to which can be - * jumped. - */ - class NumberValidator implements IInputValidator { - - public String isValid(String input) { - try { - int i= Integer.parseInt(input); - if (i <= 0 || fLastLine < i) - return ConsoleMessages.TextViewerGotoLineAction_Line_number_out_of_range_1; - - } catch (NumberFormatException x) { - return ConsoleMessages.TextViewerGotoLineAction_Not_a_number_2; - } - - return null; - } - } - - protected int fLastLine; - protected ITextViewer fTextViewer; - - /** - * Constructs a goto line action for the viewer using the provided resource bundle - */ - public TextViewerGotoLineAction(ITextViewer viewer) { - super(viewer, -1); - fTextViewer= viewer; - setText(ConsoleMessages.TextViewerGotoLineAction_Go_to__Line____Ctrl_L_4); - setToolTipText(ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1); - setDescription(ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1); - } - - /** - * @see TextViewerAction#update() - */ - public void update() { - } - - /** - * Jumps to the line. - */ - protected void gotoLine(int line) { - - IDocument document= fTextViewer.getDocument(); - try { - int start= document.getLineOffset(line); - int length= document.getLineLength(line); - fTextViewer.getTextWidget().setSelection(start, start + length); - fTextViewer.revealRange(start, length); - } catch (BadLocationException x) { - ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - try { - Point selection= fTextViewer.getTextWidget().getSelection(); - IDocument document= fTextViewer.getDocument(); - fLastLine= document.getLineOfOffset(document.getLength()) + 1; - int startLine= selection == null ? 1 : fTextViewer.getTextWidget().getLineAtOffset(selection.x) + 1; - String title= ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1; - String message= MessageFormat.format(ConsoleMessages.TextViewerGotoLineAction_Enter_line_number__8, new Object[] {new Integer(fLastLine)}); - String value= Integer.toString(startLine); - Shell activeShell= fTextViewer.getTextWidget().getShell(); - InputDialog d= new InputDialog(activeShell, title, message, value, new NumberValidator()); - if (d.open() == Window.OK) { - try { - int line= Integer.parseInt(d.getValue()); - gotoLine(line - 1); - } catch (NumberFormatException x) { - ConsolePlugin.errorDialog(activeShell, ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // - } - } - } catch (BadLocationException x) { - ConsolePlugin.errorDialog(fTextViewer.getTextWidget().getShell(), ConsoleMessages.TextViewerGotoLineAction_Go_To_Line_1, ConsoleMessages.TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2, x); // - return; - } - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html b/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html deleted file mode 100644 index cfb538c69..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/actions/package.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - -Console Actions - - - - -

                              Application programming interfaces for Eclipse console specific - actions.

                              - -

                              Package Specification

                              - -

                              This package provides a set of actions related to the Eclipse console.

                              -

                              Clients are allowed to instantiate classes from this package. The classes are - not intended to be subclassed.

                              - - diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/package.html b/org.eclipse.ui.console/src/org/eclipse/ui/console/package.html deleted file mode 100644 index f6debb148..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/console/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - -Eclipse Console - - - - -

                              Application programming interfaces for interaction -with the Eclipse console.

                              - -

                              Package Specification

                              - -

                              The Eclipse platform UI console plug-in provides a set of classes and interfaces to -facilitate the creation and display of consoles in the ConsoleView. This package -contains a generic abstract console (AbstractConsole) that provides some basic -functionality as well as two complete implementations of consoles that may be subclassed. -

                              The class TextConsole supports regular expression matching and hyperlinks. - Clients must provide their own document partitioner. -

                              -

                              IOConsole extends TextConsole and provides support for creating consoles based upon -input and output streams via the use of IOConsoleOutputStream and -IOConsoleInputStream. IOConsole is not an abstract class, it may be used as is or -subclassed. -

                              -

                              A console manager (IConsoleManager) manages all active consoles, and - provides notification of consoles which are added and removed. Consoles are - displayed in a page book view. Each console implementation is reponsible for - creating its page (IPageBookView), which provides freedom of presentation - to the console implementation. A single console may be displayed simultaneously - in multiple console views, in different workbench windows. -

                              - - diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.java deleted file mode 100644 index ddf2491c6..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.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.ui.internal.console; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.BadPositionCategoryException; -import org.eclipse.jface.text.Document; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.Position; - -/** - * A console document. Requires synchronization for multi-threaded access. - */ -public class ConsoleDocument extends Document { - - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#get(int, int) - */ - public synchronized String get(int pos, int length) throws BadLocationException { - return super.get(pos, length); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLength() - */ - public synchronized int getLength() { - return super.getLength(); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLineDelimiter(int) - */ - public synchronized String getLineDelimiter(int line) throws BadLocationException { - return super.getLineDelimiter(line); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLineInformation(int) - */ - public synchronized IRegion getLineInformation(int line) throws BadLocationException { - return super.getLineInformation(line); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int) - */ - public synchronized IRegion getLineInformationOfOffset(int offset) throws BadLocationException { - return super.getLineInformationOfOffset(offset); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLineLength(int) - */ - public synchronized int getLineLength(int line) throws BadLocationException { - return super.getLineLength(line); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLineOffset(int) - */ - public synchronized int getLineOffset(int line) throws BadLocationException { - return super.getLineOffset(line); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getLineOfOffset(int) - */ - public int getLineOfOffset(int pos) throws BadLocationException { - return super.getLineOfOffset(pos); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getNumberOfLines() - */ - public synchronized int getNumberOfLines() { - return super.getNumberOfLines(); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String) - */ - public synchronized void replace(int pos, int length, String text) throws BadLocationException { - super.replace(pos, length, text); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#set(java.lang.String) - */ - public synchronized void set(String text) { - super.set(text); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.AbstractDocument#completeInitialization() - */ - protected void completeInitialization() { - super.completeInitialization(); - addPositionUpdater(new HyperlinkUpdater()); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#addPosition(java.lang.String, org.eclipse.jface.text.Position) - */ - public synchronized void addPosition(String category, Position position) throws BadLocationException, BadPositionCategoryException { - super.addPosition(category, position); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#removePosition(java.lang.String, org.eclipse.jface.text.Position) - */ - public synchronized void removePosition(String category, Position position) throws BadPositionCategoryException { - super.removePosition(category, position); - } - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocument#getPositions(java.lang.String) - */ - public synchronized Position[] getPositions(String category) throws BadPositionCategoryException { - return super.getPositions(category); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java deleted file mode 100644 index 2b00475d4..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java +++ /dev/null @@ -1,394 +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.ui.internal.console; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.eclipse.swt.custom.TextChangeListener; -import org.eclipse.swt.custom.TextChangedEvent; -import org.eclipse.swt.custom.TextChangingEvent; - -import org.eclipse.core.runtime.Assert; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentAdapter; -import org.eclipse.jface.text.IDocumentListener; - -/** - * Adapts a Console's document to the viewer StyledText widget. Allows proper line - * wrapping of fixed width consoles without having to add line delimiters to the StyledText. - * - * By using this adapter, the offset of any character is the same in both the widget and the - * document. - * - * @since 3.1 - */ -public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListener { - - private int consoleWidth = -1; - private List textChangeListeners; - private IDocument document; - - int[] offsets = new int[5000]; - int[] lengths = new int[5000]; - private int regionCount = 1; - private Pattern pattern = Pattern.compile("$", Pattern.MULTILINE); //$NON-NLS-1$ - - - public ConsoleDocumentAdapter(int width) { - textChangeListeners = new ArrayList(); - consoleWidth = width; - } - - /* - * repairs lines list from the beginning of the line containing the offset of any - * DocumentEvent, to the end of the Document. - */ - private void repairLines(int eventOffset) { - if (document == null) { - return; - } - try { - int docLine = document.getLineOfOffset(eventOffset); - int docLineOffset = document.getLineOffset(docLine); - int widgetLine = getLineAtOffset(docLineOffset); - - for (int i=regionCount-1; i>=widgetLine; i--) { - regionCount--; - } - - int numLinesInDoc = document.getNumberOfLines(); - - int nextOffset = document.getLineOffset(docLine); - for (int i = docLine; i 0) { - int trimmedLength = length; - String lineDelimiter = document.getLineDelimiter(i); - int lineDelimiterLength = 0; - if (lineDelimiter != null) { - lineDelimiterLength = lineDelimiter.length(); - trimmedLength -= lineDelimiterLength; - } - - if (consoleWidth > 0 && consoleWidth < trimmedLength) { - addRegion(offset, consoleWidth); - offset += consoleWidth; - length -= consoleWidth; - } else { - addRegion(offset, length); - offset += length; - length -= length; - } - } - } - } - } catch (BadLocationException e) { - } - - if (regionCount == 0) { - addRegion(0, document.getLength()); - } - } - - private void addRegion(int offset, int length) { - if (regionCount == 0) { - offsets[0] = offset; - lengths[0] = length; - } else { - if (regionCount == offsets.length) { - growRegionArray(regionCount * 2); - } - offsets[regionCount] = offset; - lengths[regionCount] = length; - } - regionCount++; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentAdapter#setDocument(org.eclipse.jface.text.IDocument) - */ - public void setDocument(IDocument doc) { - if (document != null) { - document.removeDocumentListener(this); - } - - document = doc; - - if (document != null) { - document.addDocumentListener(this); - repairLines(0); - } - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#addTextChangeListener(org.eclipse.swt.custom.TextChangeListener) - */ - public synchronized void addTextChangeListener(TextChangeListener listener) { - Assert.isNotNull(listener); - if (!textChangeListeners.contains(listener)) { - textChangeListeners.add(listener); - } - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#removeTextChangeListener(org.eclipse.swt.custom.TextChangeListener) - */ - public synchronized void removeTextChangeListener(TextChangeListener listener) { - if(textChangeListeners != null) { - Assert.isNotNull(listener); - textChangeListeners.remove(listener); - } - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getCharCount() - */ - public int getCharCount() { - return document.getLength(); - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getLine(int) - */ - public String getLine(int lineIndex) { - try { - StringBuffer line = new StringBuffer(document.get(offsets[lineIndex], lengths[lineIndex])); - int index = line.length() - 1; - while(index > -1 && (line.charAt(index)=='\n' || line.charAt(index)=='\r')) { - index--; - } - return new String(line.substring(0, index+1)); - } catch (BadLocationException e) { - } - return ""; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getLineAtOffset(int) - */ - public int getLineAtOffset(int offset) { - if (offset == 0 || regionCount <= 1) { - return 0; - } - - if (offset == document.getLength()) { - return regionCount-1; - } - - int left= 0; - int right= regionCount-1; - int midIndex = 0; - - while (left <= right) { - if(left == right) { - return right; - } - midIndex = (left + right) / 2; - - if (offset < offsets[midIndex]) { - right = midIndex; - } else if (offset >= offsets[midIndex] + lengths[midIndex]) { - left = midIndex + 1; - } else { - return midIndex; - } - } - - return midIndex; - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getLineCount() - */ - public int getLineCount() { - return regionCount; - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getLineDelimiter() - */ - public String getLineDelimiter() { - return System.getProperty("line.separator"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getOffsetAtLine(int) - */ - public int getOffsetAtLine(int lineIndex) { - return offsets[lineIndex]; - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#getTextRange(int, int) - */ - public String getTextRange(int start, int length) { - try { - return document.get(start, length); - } catch (BadLocationException e) { - } - return null; - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#replaceTextRange(int, int, java.lang.String) - */ - public void replaceTextRange(int start, int replaceLength, String text) { - try { - document.replace(start, replaceLength, text); - } catch (BadLocationException e) { - } - } - - /* (non-Javadoc) - * @see org.eclipse.swt.custom.StyledTextContent#setText(java.lang.String) - */ - public synchronized void setText(String text) { - TextChangedEvent changeEvent = new TextChangedEvent(this); - for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { - TextChangeListener element = (TextChangeListener) iter.next(); - element.textSet(changeEvent); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) - */ - public synchronized void documentAboutToBeChanged(DocumentEvent event) { - if (document == null) { - return; - } - - TextChangingEvent changeEvent = new TextChangingEvent(this); - changeEvent.start = event.fOffset; - changeEvent.newText = (event.fText == null ? "" : event.fText); //$NON-NLS-1$ - changeEvent.replaceCharCount = event.fLength; - changeEvent.newCharCount = (event.fText == null ? 0 : event.fText.length()); - - int first = getLineAtOffset(event.fOffset); - int lOffset = Math.max(event.fOffset + event.fLength - 1, 0); - int last = getLineAtOffset(lOffset); - changeEvent.replaceLineCount = Math.max(last - first, 0); - - int newLineCount = countNewLines(event.fText); - changeEvent.newLineCount = newLineCount >= 0 ? newLineCount : 0; - - if (changeEvent.newLineCount > offsets.length-regionCount) { - growRegionArray(changeEvent.newLineCount); - } - - for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { - TextChangeListener element = (TextChangeListener) iter.next(); - element.textChanging(changeEvent); - } - } - - private void growRegionArray(int minSize) { - int size = Math.max(offsets.length*2, minSize*2); - int[] newOffsets = new int[size]; - System.arraycopy(offsets, 0, newOffsets, 0, regionCount); - offsets = newOffsets; - int[] newLengths = new int[size]; - System.arraycopy(lengths, 0, newLengths, 0, regionCount); - lengths = newLengths; - } - - private int countNewLines(String string) { - int count = 0; - - if (string.length() == 0) return 0; - - // work around to - // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4994840 - // see bug 84641 - int offset = string.length() - 1; - while (offset > -1 && string.charAt(offset) == '\r') { - offset--; - count++; - } - // if offset == -1, the line was all '\r' and there is no string to search for matches (bug 207743) - if (offset > -1) { - if (offset < (string.length() - 1)) { - string = string.substring(0, offset); - } - - int lastIndex = 0; - int index = 0; - - Matcher matcher = pattern.matcher(string); - - while (matcher.find()) { - index = matcher.start(); - - if (index == 0) - count++; - else if (index!=string.length()) - count++; - - if (consoleWidth > 0) { - int lineLen = index - lastIndex + 1; - if (index == 0) lineLen += lengths[regionCount-1]; - count += lineLen/consoleWidth; - } - - lastIndex = index; - } - } - return count; - } - - - /* (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent) - */ - public synchronized void documentChanged(DocumentEvent event) { - if (document == null) { - return; - } - - repairLines(event.fOffset); - - TextChangedEvent changeEvent = new TextChangedEvent(this); - - for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { - TextChangeListener element = (TextChangeListener) iter.next(); - element.textChanged(changeEvent); - } - } - - /** - * sets consoleWidth, repairs line information, then fires event to the viewer text widget. - * @param width The console's width - */ - public void setWidth(int width) { - if (width != consoleWidth) { - consoleWidth = width; - repairLines(0); - TextChangedEvent changeEvent = new TextChangedEvent(this); - for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) { - TextChangeListener element = (TextChangeListener) iter.next(); - element.textSet(changeEvent); - } - } - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java deleted file mode 100644 index ab3b388ee..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java +++ /dev/null @@ -1,169 +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.ui.internal.console; - - -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IMenuCreator; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.IConsoleListener; -import org.eclipse.ui.console.IConsoleView; -import org.eclipse.ui.progress.UIJob; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Drop down action in the console to select the console to display. - */ -class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleListener, IUpdate { - - private IConsoleView fView; - private Menu fMenu; - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() { - IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles(); - setEnabled(consoles.length > 1); - } - - public ConsoleDropDownAction(IConsoleView view) { - fView= view; - setText(ConsoleMessages.ConsoleDropDownAction_0); - setToolTipText(ConsoleMessages.ConsoleDropDownAction_1); - setImageDescriptor(ConsolePluginImages.getImageDescriptor(IConsoleConstants.IMG_VIEW_CONSOLE)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_DISPLAY_CONSOLE_ACTION); - setMenuCreator(this); - ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(this); - update(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IMenuCreator#dispose() - */ - public void dispose() { - if (fMenu != null) { - fMenu.dispose(); - } - - fView= null; - ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this); - } - - /* (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.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control) - */ - public Menu getMenu(Control parent) { - if (fMenu != null) { - fMenu.dispose(); - } - - fMenu= new Menu(parent); - IConsole[] consoles= ConsolePlugin.getDefault().getConsoleManager().getConsoles(); - IConsole current = fView.getConsole(); - for (int i = 0; i < consoles.length; i++) { - IConsole console = consoles[i]; - Action action = new ShowConsoleAction(fView, console); - action.setChecked(console.equals(current)); - addActionToMenu(fMenu, action, i + 1); - } - return fMenu; - } - - private void addActionToMenu(Menu parent, Action action, int accelerator) { - if (accelerator < 10) { - StringBuffer label= new StringBuffer(); - //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(parent, -1); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - ConsoleView consoleView = (ConsoleView) fView; - boolean pinned = consoleView.isPinned(); - if (pinned) { - consoleView.setPinned(false); - } - List stack = consoleView.getConsoleStack(); - if (stack.size() > 1) { - IConsole console = (IConsole) stack.get(1); - fView.display(console); - } - if (pinned) { - consoleView.setPinned(true); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[]) - */ - public void consolesAdded(IConsole[] consoles) { - UIJob job = new UIJob("") { //$NON-NLS-1$ - public IStatus runInUIThread(IProgressMonitor monitor) { - update(); - return Status.OK_STATUS; - } - }; - job.setSystem(true); - job.setPriority(Job.INTERACTIVE); - job.schedule(); - } - - /* (non-Javadoc) - * - * Dispose the menu when a launch is removed, such that the actions in this - * menu do not hang on to associated resources. - * - * @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[]) - */ - public void consolesRemoved(IConsole[] consoles) { - UIJob job = new UIJob("") { //$NON-NLS-1$ - public IStatus runInUIThread(IProgressMonitor monitor) { - if (fMenu != null) { - fMenu.dispose(); - } - update(); - return Status.OK_STATUS; - } - }; - job.setSystem(true); - job.setPriority(Job.INTERACTIVE); - job.schedule(); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleFactoryExtension.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleFactoryExtension.java deleted file mode 100644 index 377d3d56d..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleFactoryExtension.java +++ /dev/null @@ -1,121 +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.ui.internal.console; - -import java.net.URL; - -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.runtime.CoreException; -import org.eclipse.core.runtime.FileLocator; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.Path; -import org.eclipse.core.runtime.Platform; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.ui.IPluginContribution; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleFactory; -import org.osgi.framework.Bundle; - -/** - * @since 3.1 - */ -public class ConsoleFactoryExtension implements IPluginContribution { - - private IConfigurationElement fConfig; - private Expression fEnablementExpression; - private String fLabel; - private ImageDescriptor fImageDescriptor; - private IConsoleFactory fFactory; - - ConsoleFactoryExtension(IConfigurationElement config) { - fConfig = config; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPluginContribution#getLocalId() - */ - public String getLocalId() { - return fConfig.getAttribute("id"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPluginContribution#getPluginId() - */ - public String getPluginId() { - return fConfig.getContributor().getName(); - } - - public boolean isEnabled() { - try { - Expression enablementExpression = getEnablementExpression(); - if (enablementExpression == null) { - return true; - } - EvaluationContext context = new EvaluationContext(null, this); - EvaluationResult evaluationResult = enablementExpression.evaluate(context); - return evaluationResult != EvaluationResult.FALSE; - } catch (CoreException e) { - ConsolePlugin.log(e); - return false; - } - } - - public Expression getEnablementExpression() throws CoreException { - if (fEnablementExpression == null) { - IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); - IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; - - if (enablement != null) { - fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); - } - } - return fEnablementExpression; - } - - public String getLabel() { - if (fLabel == null) { - fLabel = fConfig.getAttribute("label"); //$NON-NLS-1$ - } - return fLabel; - } - - /** - * @return - */ - public ImageDescriptor getImageDescriptor() { - if (fImageDescriptor == null) { - String path = fConfig.getAttribute("icon"); //$NON-NLS-1$ - if (path != null) { - Bundle bundle = Platform.getBundle(getPluginId()); - URL url = FileLocator.find(bundle, new Path(path), null); - if (url != null) { - fImageDescriptor = ImageDescriptor.createFromURL(url); - } - } - } - return fImageDescriptor; - } - - /** - * @return - * @throws CoreException - */ - public IConsoleFactory createFactory() throws CoreException { - if (fFactory == null) { - fFactory = (IConsoleFactory) fConfig.createExecutableExtension("class"); //$NON-NLS-1$ - } - return fFactory; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleHyperlinkPosition.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleHyperlinkPosition.java deleted file mode 100644 index b98df7300..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleHyperlinkPosition.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.ui.internal.console; - -import org.eclipse.jface.text.Position; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IHyperlink; - -/** - * Describes the postition of a hyperlink within the Console's document. - * - * @since 3.1 - */ -public class ConsoleHyperlinkPosition extends Position { - - public static final String HYPER_LINK_CATEGORY = ConsolePlugin.getUniqueIdentifier() + ".CONSOLE_HYPERLINK_POSITION"; //$NON-NLS-1$ - - private IHyperlink fLink = null; - - public ConsoleHyperlinkPosition(IHyperlink link, int offset, int length) { - super(offset, length); - fLink = link; - } - - public IHyperlink getHyperLink() { - return fLink; - } - - /** - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object arg) { - return arg instanceof ConsoleHyperlinkPosition && super.equals(arg) && getHyperLink().equals(((ConsoleHyperlinkPosition)arg).getHyperLink()); - } - - /** - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return super.hashCode() + getHyperLink().hashCode(); - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java deleted file mode 100644 index aea898a2f..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java +++ /dev/null @@ -1,471 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.internal.console; - -import java.util.ArrayList; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.regex.PatternSyntaxException; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtensionPoint; -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.swt.widgets.Control; -import org.eclipse.ui.IViewPart; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.IConsoleListener; -import org.eclipse.ui.console.IConsoleManager; -import org.eclipse.ui.console.IConsolePageParticipant; -import org.eclipse.ui.console.IConsoleView; -import org.eclipse.ui.console.IPatternMatchListener; -import org.eclipse.ui.console.TextConsole; -import org.eclipse.ui.progress.UIJob; -import org.eclipse.ui.progress.WorkbenchJob; - -/** - * The singleton console manager. - * - * @since 3.0 - */ -public class ConsoleManager implements IConsoleManager { - - /** - * Console listeners - */ - private ListenerList fListeners = null; - - /** - * List of registered consoles - */ - private List fConsoles = new ArrayList(10); - - - // change notification constants - private final static int ADDED = 1; - private final static int REMOVED = 2; - - private List fPatternMatchListeners; - - private List fPageParticipants; - - private List fConsoleFactoryExtensions; - - private List fConsoleViews = new ArrayList(); - - private boolean fWarnQueued = false; - - private RepaintJob fRepaintJob = new RepaintJob(); - - private class RepaintJob extends WorkbenchJob { - private Set list = new HashSet(); - - public RepaintJob() { - super("schedule redraw() of viewers"); //$NON-NLS-1$ - setSystem(true); - } - - void addConsole(IConsole console) { - synchronized (list) { - list.add(console); - } - } - - public IStatus runInUIThread(IProgressMonitor monitor) { - synchronized (list) { - if (list.isEmpty()) { - return Status.OK_STATUS; - } - - IWorkbenchWindow[] workbenchWindows = PlatformUI.getWorkbench().getWorkbenchWindows(); - for (int i = 0; i < workbenchWindows.length; i++) { - IWorkbenchWindow window = workbenchWindows[i]; - if (window != null) { - IWorkbenchPage page = window.getActivePage(); - if (page != null) { - IViewPart part = page.findView(IConsoleConstants.ID_CONSOLE_VIEW); - if (part != null && part instanceof IConsoleView) { - ConsoleView view = (ConsoleView) part; - if (list.contains(view.getConsole())) { - Control control = view.getCurrentPage().getControl(); - if (!control.isDisposed()) { - control.redraw(); - } - } - } - - } - } - } - list.clear(); - } - return Status.OK_STATUS; - } - } - - /** - * Notifies a console listener of additions or removals - */ - class ConsoleNotifier implements ISafeRunnable { - - private IConsoleListener fListener; - private int fType; - private IConsole[] fChanged; - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable) - */ - public void handleException(Throwable exception) { - IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.ConsoleManager_0, exception); - ConsolePlugin.log(status); - } - - /* (non-Javadoc) - * @see org.eclipse.core.runtime.ISafeRunnable#run() - */ - public void run() throws Exception { - switch (fType) { - case ADDED: - fListener.consolesAdded(fChanged); - break; - case REMOVED: - fListener.consolesRemoved(fChanged); - break; - } - } - - /** - * Notifies the given listener of the adds/removes - * - * @param consoles the consoles that changed - * @param update the type of change - */ - public void notify(IConsole[] consoles, int update) { - if (fListeners == null) { - return; - } - fChanged = consoles; - fType = update; - Object[] copiedListeners= fListeners.getListeners(); - for (int i= 0; i < copiedListeners.length; i++) { - fListener = (IConsoleListener)copiedListeners[i]; - SafeRunner.run(this); - } - fChanged = null; - fListener = null; - } - } - - public void registerConsoleView(ConsoleView view) { - synchronized (fConsoleViews) { - fConsoleViews.add(view); - } - } - public void unregisterConsoleView(ConsoleView view) { - synchronized (fConsoleViews) { - fConsoleViews.remove(view); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#addConsoleListener(org.eclipse.ui.console.IConsoleListener) - */ - public void addConsoleListener(IConsoleListener listener) { - if (fListeners == null) { - fListeners = new ListenerList(); - } - fListeners.add(listener); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#removeConsoleListener(org.eclipse.ui.console.IConsoleListener) - */ - public void removeConsoleListener(IConsoleListener listener) { - if (fListeners != null) { - fListeners.remove(listener); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#addConsoles(org.eclipse.ui.console.IConsole[]) - */ - public void addConsoles(IConsole[] consoles) { - List added = new ArrayList(consoles.length); - synchronized (fConsoles) { - for (int i = 0; i < consoles.length; i++) { - IConsole console = consoles[i]; - if(console instanceof TextConsole) { - TextConsole ioconsole = (TextConsole)console; - createPatternMatchListeners(ioconsole); - } - if (!fConsoles.contains(console)) { - fConsoles.add(console); - added.add(console); - } - } - } - if (!added.isEmpty()) { - fireUpdate((IConsole[])added.toArray(new IConsole[added.size()]), ADDED); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#removeConsoles(org.eclipse.ui.console.IConsole[]) - */ - public void removeConsoles(IConsole[] consoles) { - List removed = new ArrayList(consoles.length); - synchronized (fConsoles) { - for (int i = 0; i < consoles.length; i++) { - IConsole console = consoles[i]; - if (fConsoles.remove(console)) { - removed.add(console); - } - } - } - if (!removed.isEmpty()) { - fireUpdate((IConsole[])removed.toArray(new IConsole[removed.size()]), REMOVED); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#getConsoles() - */ - public IConsole[] getConsoles() { - synchronized (fConsoles) { - return (IConsole[])fConsoles.toArray(new IConsole[fConsoles.size()]); - } - } - - /** - * Fires notification. - * - * @param consoles consoles added/removed - * @param type ADD or REMOVE - */ - private void fireUpdate(IConsole[] consoles, int type) { - new ConsoleNotifier().notify(consoles, type); - } - - - private class ShowConsoleViewJob extends WorkbenchJob { - private IConsole console; - - ShowConsoleViewJob() { - super("Show Console View"); //$NON-NLS-1$ - setSystem(true); - setPriority(Job.SHORT); - } - - void setConsole(IConsole console) { - this.console = console; - } - - public IStatus runInUIThread(IProgressMonitor monitor) { - boolean consoleFound = false; - IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window != null && console != null) { - IWorkbenchPage page= window.getActivePage(); - if (page != null) { - synchronized (fConsoleViews) { - for (Iterator iter = fConsoleViews.iterator(); iter.hasNext();) { - ConsoleView consoleView = (ConsoleView) iter.next(); - if (consoleView.getSite().getPage().equals(page)) { - boolean consoleVisible = page.isPartVisible(consoleView); - if (consoleVisible) { - consoleFound = true; - boolean bringToTop = shouldBringToTop(console, consoleView); - if (bringToTop) { - page.bringToTop(consoleView); - } - consoleView.display(console); - } - } - } - } - - if (!consoleFound) { - try { - IConsoleView consoleView = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW, null, IWorkbenchPage.VIEW_CREATE); - boolean bringToTop = shouldBringToTop(console, consoleView); - if (bringToTop) { - page.bringToTop(consoleView); - } - consoleView.display(console); - } catch (PartInitException pie) { - ConsolePlugin.log(pie); - } - } - } - } - console = null; - return Status.OK_STATUS; - } - } - - private ShowConsoleViewJob showJob = new ShowConsoleViewJob(); - /** - * @see IConsoleManager#showConsoleView(IConsole) - */ - public void showConsoleView(final IConsole console) { - showJob.setConsole(console); - showJob.schedule(100); - } - - /** - * Returns whether the given console view should be brought to the top. - * The view should not be brought to the top if the view is pinned on - * a console other than the given console. - */ - private boolean shouldBringToTop(IConsole console, IViewPart consoleView) { - boolean bringToTop= true; - if (consoleView instanceof IConsoleView) { - IConsoleView cView= (IConsoleView)consoleView; - if (cView.isPinned()) { - IConsole pinnedConsole= cView.getConsole(); - bringToTop = console.equals(pinnedConsole); - } - } - return bringToTop; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#warnOfContentChange(org.eclipse.ui.console.IConsole) - */ - public void warnOfContentChange(final IConsole console) { - if (!fWarnQueued) { - fWarnQueued = true; - Job job = new UIJob(ConsolePlugin.getStandardDisplay(), ConsoleMessages.ConsoleManager_consoleContentChangeJob) { - public IStatus runInUIThread(IProgressMonitor monitor) { - IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window != null) { - IWorkbenchPage page= window.getActivePage(); - if (page != null) { - IConsoleView consoleView= (IConsoleView)page.findView(IConsoleConstants.ID_CONSOLE_VIEW); - if (consoleView != null) { - consoleView.warnOfContentChange(console); - } - } - } - fWarnQueued = false; - return Status.OK_STATUS; - } - }; - job.setSystem(true); - job.schedule(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#getPatternMatchListenerDelegates(org.eclipse.ui.console.IConsole) - */ - public IPatternMatchListener[] createPatternMatchListeners(IConsole console) { - if (fPatternMatchListeners == null) { - fPatternMatchListeners = new ArrayList(); - IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.EXTENSION_POINT_CONSOLE_PATTERN_MATCH_LISTENERS); - IConfigurationElement[] elements = extensionPoint.getConfigurationElements(); - for (int i = 0; i < elements.length; i++) { - IConfigurationElement config = elements[i]; - PatternMatchListenerExtension extension = new PatternMatchListenerExtension(config); - fPatternMatchListeners.add(extension); - } - } - ArrayList list = new ArrayList(); - for(Iterator i = fPatternMatchListeners.iterator(); i.hasNext(); ) { - PatternMatchListenerExtension extension = (PatternMatchListenerExtension) i.next(); - try { - if (extension.getEnablementExpression() == null) { - i.remove(); - continue; - } - - if (console instanceof TextConsole && extension.isEnabledFor(console)) { - TextConsole textConsole = (TextConsole) console; - PatternMatchListener patternMatchListener = new PatternMatchListener(extension); - try { - textConsole.addPatternMatchListener(patternMatchListener); - list.add(patternMatchListener); - } catch (PatternSyntaxException e) { - ConsolePlugin.log(e); - i.remove(); - } - } - } catch (CoreException e) { - ConsolePlugin.log(e); - } - } - return (PatternMatchListener[])list.toArray(new PatternMatchListener[0]); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#getPageParticipants(org.eclipse.ui.console.IConsole) - */ - public IConsolePageParticipant[] getPageParticipants(IConsole console) { - if(fPageParticipants == null) { - fPageParticipants = new ArrayList(); - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.EXTENSION_POINT_CONSOLE_PAGE_PARTICIPANTS); - IConfigurationElement[] elements = extensionPoint.getConfigurationElements(); - for(int i = 0; i < elements.length; i++) { - IConfigurationElement config = elements[i]; - ConsolePageParticipantExtension extension = new ConsolePageParticipantExtension(config); - fPageParticipants.add(extension); - } - } - ArrayList list = new ArrayList(); - for(Iterator i = fPageParticipants.iterator(); i.hasNext(); ) { - ConsolePageParticipantExtension extension = (ConsolePageParticipantExtension) i.next(); - try { - if (extension.isEnabledFor(console)) { - list.add(extension.createDelegate()); - } - } catch (CoreException e) { - ConsolePlugin.log(e); - } - } - return (IConsolePageParticipant[]) list.toArray(new IConsolePageParticipant[0]); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleManager#getConsoleFactories() - */ - public ConsoleFactoryExtension[] getConsoleFactoryExtensions() { - if (fConsoleFactoryExtensions == null) { - fConsoleFactoryExtensions = new ArrayList(); - IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.EXTENSION_POINT_CONSOLE_FACTORIES); - IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements(); - for (int i = 0; i < configurationElements.length; i++) { - fConsoleFactoryExtensions.add(new ConsoleFactoryExtension(configurationElements[i])); - } - } - return (ConsoleFactoryExtension[]) fConsoleFactoryExtensions.toArray(new ConsoleFactoryExtension[0]); - } - - - public void refresh(final IConsole console) { - fRepaintJob.addConsole(console); - fRepaintJob.schedule(50); - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java deleted file mode 100644 index e6212af78..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.java +++ /dev/null @@ -1,70 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.internal.console; - -import org.eclipse.osgi.util.NLS; - -public class ConsoleMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.ui.internal.console.ConsoleMessages";//$NON-NLS-1$ - - public static String AbstractConsole_0; - - public static String ConsoleDropDownAction_0; - public static String ConsoleDropDownAction_1; - - public static String ConsoleManager_0; - - public static String ConsoleManager_consoleContentChangeJob; - - public static String ConsoleView_0; - - public static String PinConsoleAction_0; - public static String PinConsoleAction_1; - - public static String ClearOutputAction_title; - public static String ClearOutputAction_toolTipText; - - public static String TextViewerGotoLineAction_Enter_line_number__8; - public static String TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2; - public static String TextViewerGotoLineAction_Go_to__Line____Ctrl_L_4; - public static String TextViewerGotoLineAction_Go_To_Line_1; - public static String TextViewerGotoLineAction_Line_number_out_of_range_1; - public static String TextViewerGotoLineAction_Not_a_number_2; - - public static String ScrollLockAction_0; - public static String ScrollLockAction_1; - public static String FollowHyperlinkAction_0; - public static String FollowHyperlinkAction_1; - public static String OpenConsoleAction_0; - public static String OpenConsoleAction_1; - public static String CloseConsoleAction_0; - public static String CloseConsoleAction_1; - - public static String TextConsolePage_SelectAllDescrip; - public static String TextConsolePage_SelectAllText; - public static String TextConsolePage_CutText; - public static String TextConsolePage_CutDescrip; - public static String TextConsolePage_CopyText; - public static String TextConsolePage_CopyDescrip; - public static String TextConsolePage_PasteText; - public static String TextConsolePage_PasteDescrip; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ConsoleMessages.class); - } - - public static String PatternMatchListenerExtension_3; - - public static String PatternMatchListenerExtension_4; - - public static String PatternMatchListenerExtension_5; -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties deleted file mode 100644 index d873a37bd..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleMessages.properties +++ /dev/null @@ -1,54 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2010 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -############################################################################### - -AbstractConsole_0=Exception occurred during console property change notification. - -ConsoleDropDownAction_0=Select Console -ConsoleDropDownAction_1=Display Selected Console - -ConsoleManager_0=An exception occurred during console notification -ConsoleManager_consoleContentChangeJob=Console content change - -ConsoleView_0=No consoles to display at this time. - -PinConsoleAction_0=Pi&n Console -PinConsoleAction_1=Pin Console - -ClearOutputAction_title=Clea&r -ClearOutputAction_toolTipText=Clear Console - -TextViewerGotoLineAction_Enter_line_number__8=Enter line number (1...{0}): -TextViewerGotoLineAction_Exceptions_occurred_attempt_to_go_to_line_2=Exceptions occurred attempt to go to line -TextViewerGotoLineAction_Go_to__Line____Ctrl_L_4=Go to &Line...@Ctrl+L -TextViewerGotoLineAction_Go_To_Line_1=Go to Line -TextViewerGotoLineAction_Line_number_out_of_range_1=Line number out of range -TextViewerGotoLineAction_Not_a_number_2=Not a number - -ScrollLockAction_0=&Scroll Lock -ScrollLockAction_1=Scroll Lock -FollowHyperlinkAction_0=&Open Link -FollowHyperlinkAction_1=Follow the selected hyperlink -OpenConsoleAction_0=Open Console -OpenConsoleAction_1=Open Console -CloseConsoleAction_0=&Close Console -CloseConsoleAction_1=Close Console - -TextConsolePage_SelectAllDescrip=Select All -TextConsolePage_SelectAllText=Select &All -TextConsolePage_CutText=C&ut -TextConsolePage_CutDescrip=Cut -TextConsolePage_CopyText=&Copy -TextConsolePage_CopyDescrip=Copy -TextConsolePage_PasteText=&Paste -TextConsolePage_PasteDescrip=Paste -PatternMatchListenerExtension_3=Console Pattern Match Listener -PatternMatchListenerExtension_4=contributed by -PatternMatchListenerExtension_5=is missing required enablement expression and will be removed diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePageParticipantExtension.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePageParticipantExtension.java deleted file mode 100644 index 37a522f51..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePageParticipantExtension.java +++ /dev/null @@ -1,73 +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.ui.internal.console; - -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.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.ui.IPluginContribution; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsolePageParticipant; - -public class ConsolePageParticipantExtension implements IPluginContribution { - - private IConfigurationElement fConfig; - private Expression fEnablementExpression; - - public ConsolePageParticipantExtension(IConfigurationElement config) { - fConfig = config; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPluginContribution#getLocalId() - */ - public String getLocalId() { - return fConfig.getAttribute("id"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPluginContribution#getPluginId() - */ - public String getPluginId() { - return fConfig.getContributor().getName(); - } - - public boolean isEnabledFor(IConsole console) throws CoreException { - EvaluationContext context = new EvaluationContext(null, console); - Expression expression = getEnablementExpression(); - if (expression != null){ - EvaluationResult evaluationResult = expression.evaluate(context); - return evaluationResult == EvaluationResult.TRUE; - } - return true; - } - - public Expression getEnablementExpression() throws CoreException { - if (fEnablementExpression == null) { - IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); - IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; - - if (enablement != null) { - fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); - } - } - return fEnablementExpression; - } - - public IConsolePageParticipant createDelegate() throws CoreException { - return (IConsolePageParticipant) fConfig.createExecutableExtension("class"); //$NON-NLS-1$; - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java deleted file mode 100644 index e1d9abe3d..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.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.ui.internal.console; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -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.text.BadLocationException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IPatternMatchListener; -import org.eclipse.ui.console.PatternMatchEvent; -import org.eclipse.ui.console.TextConsole; - -public class ConsolePatternMatcher implements IDocumentListener { - - private MatchJob fMatchJob = new MatchJob(); - - /** - * Collection of compiled pattern match listeners - */ - private ArrayList fPatterns = new ArrayList(); - - private TextConsole fConsole; - - private boolean fFinalMatch; - - private boolean fScheduleFinal; - - public ConsolePatternMatcher(TextConsole console) { - fConsole = console; - } - - private class MatchJob extends Job { - MatchJob() { - super("Match 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) { - IDocument doc = fConsole.getDocument(); - String text = null; - int prevBaseOffset = -1; - if (doc != null && !monitor.isCanceled()) { - int endOfSearch = doc.getLength(); - int indexOfLastChar = endOfSearch; - if (indexOfLastChar > 0) { - indexOfLastChar--; - } - int lastLineToSearch = 0; - int offsetOfLastLineToSearch = 0; - try { - lastLineToSearch = doc.getLineOfOffset(indexOfLastChar); - offsetOfLastLineToSearch = doc.getLineOffset(lastLineToSearch); - } catch (BadLocationException e) { - // perhaps the buffer was re-set - return Status.OK_STATUS; - } - Object[] patterns = null; - synchronized (fPatterns) { - patterns = fPatterns.toArray(); - } - for (int i = 0; i < patterns.length; i++) { - if (monitor.isCanceled()) { - break; - } - CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) patterns[i]; - int baseOffset = notifier.end; - int lengthToSearch = endOfSearch - baseOffset; - if (lengthToSearch > 0) { - try { - if (prevBaseOffset != baseOffset) { - // reuse the text string if possible - text = doc.get(baseOffset, lengthToSearch); - } - Matcher reg = notifier.pattern.matcher(text); - Matcher quick = null; - if (notifier.qualifier != null) { - quick = notifier.qualifier.matcher(text); - } - int startOfNextSearch = 0; - int endOfLastMatch = -1; - int lineOfLastMatch = -1; - while ((startOfNextSearch < lengthToSearch) && !monitor.isCanceled()) { - if (quick != null) { - if (quick.find(startOfNextSearch)) { - // start searching on the beginning - // of the line where the potential - // match was found, or after the - // last match on the same line - int matchLine = doc.getLineOfOffset(baseOffset + quick.start()); - if (lineOfLastMatch == matchLine) { - startOfNextSearch = endOfLastMatch; - } else { - startOfNextSearch = doc.getLineOffset(matchLine) - baseOffset; - } - } else { - startOfNextSearch = lengthToSearch; - } - } - if (startOfNextSearch < 0) { - startOfNextSearch = 0; - } - if (startOfNextSearch < lengthToSearch) { - if (reg.find(startOfNextSearch)) { - endOfLastMatch = reg.end(); - lineOfLastMatch = doc.getLineOfOffset(baseOffset + endOfLastMatch - 1); - int regStart = reg.start(); - IPatternMatchListener listener = notifier.listener; - if (listener != null && !monitor.isCanceled()) { - listener.matchFound(new PatternMatchEvent(fConsole, baseOffset + regStart, endOfLastMatch - regStart)); - } - startOfNextSearch = endOfLastMatch; - } else { - startOfNextSearch = lengthToSearch; - } - } - } - // update start of next search to the last line - // searched - // or the end of the last match if it was on the - // line that - // was last searched - if (lastLineToSearch == lineOfLastMatch) { - notifier.end = baseOffset + endOfLastMatch; - } else { - notifier.end = offsetOfLastLineToSearch; - } - } catch (BadLocationException e) { - ConsolePlugin.log(e); - } - } - prevBaseOffset = baseOffset; - } - } - - if (fFinalMatch) { - disconnect(); - fConsole.matcherFinished(); - } else if (fScheduleFinal) { - fFinalMatch = true; - schedule(); - } - - return Status.OK_STATUS; - } - - public boolean belongsTo(Object family) { - return family == fConsole; - } - - - } - - private class CompiledPatternMatchListener { - Pattern pattern; - - Pattern qualifier; - - IPatternMatchListener listener; - - int end = 0; - - CompiledPatternMatchListener(Pattern pattern, Pattern qualifier, IPatternMatchListener matchListener) { - this.pattern = pattern; - this.listener = matchListener; - this.qualifier = qualifier; - } - - public void dispose() { - listener.disconnect(); - pattern = null; - qualifier = null; - listener = null; - } - } - - /** - * Adds the given pattern match listener to this console. The listener will - * be connected and receive match notifications. - * - * @param matchListener - * the pattern match listener to add - */ - public void addPatternMatchListener(IPatternMatchListener matchListener) { - synchronized (fPatterns) { - - // check for dups - for (Iterator iter = fPatterns.iterator(); iter.hasNext();) { - CompiledPatternMatchListener element = (CompiledPatternMatchListener) iter.next(); - if (element.listener == matchListener) { - return; - } - } - - if (matchListener == null || matchListener.getPattern() == null) { - throw new IllegalArgumentException("Pattern cannot be null"); //$NON-NLS-1$ - } - - Pattern pattern = Pattern.compile(matchListener.getPattern(), matchListener.getCompilerFlags()); - String qualifier = matchListener.getLineQualifier(); - Pattern qPattern = null; - if (qualifier != null) { - qPattern = Pattern.compile(qualifier, matchListener.getCompilerFlags()); - } - CompiledPatternMatchListener notifier = new CompiledPatternMatchListener(pattern, qPattern, matchListener); - fPatterns.add(notifier); - matchListener.connect(fConsole); - fMatchJob.schedule(); - } - } - - /** - * 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. - */ - public void removePatternMatchListener(IPatternMatchListener matchListener) { - synchronized (fPatterns) { - for (Iterator iter = fPatterns.iterator(); iter.hasNext();) { - CompiledPatternMatchListener element = (CompiledPatternMatchListener) iter.next(); - if (element.listener == matchListener) { - iter.remove(); - matchListener.disconnect(); - } - } - } - } - - public void disconnect() { - fMatchJob.cancel(); - synchronized (fPatterns) { - Iterator iterator = fPatterns.iterator(); - while (iterator.hasNext()) { - CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) iterator.next(); - notifier.dispose(); - } - fPatterns.clear(); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) - */ - public void documentAboutToBeChanged(DocumentEvent event) { - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent) - */ - public void documentChanged(DocumentEvent event) { - if (event.fLength > 0) { - synchronized (fPatterns) { - if (event.fDocument.getLength() == 0) { - // document has been cleared, reset match listeners - Iterator iter = fPatterns.iterator(); - while (iter.hasNext()) { - CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) iter.next(); - notifier.end = 0; - } - } else { - if (event.fOffset == 0) { - //document was trimmed - Iterator iter = fPatterns.iterator(); - while (iter.hasNext()) { - CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) iter.next(); - notifier.end = notifier.end > event.fLength ? notifier.end-event.fLength : 0; - } - } - } - } - } - fMatchJob.schedule(); - } - - - public void forceFinalMatching() { - fScheduleFinal = true; - fMatchJob.schedule(); - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java deleted file mode 100644 index c5abc8c6f..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePluginImages.java +++ /dev/null @@ -1,158 +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.ui.internal.console; - - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleConstants; - -/** - * The images provided by the debug plugin. - */ -public class ConsolePluginImages { - - /** - * The image registry containing Images and the ImageDescriptors. - */ - private static ImageRegistry imageRegistry; - - /* Declare Common paths */ - private static URL ICON_BASE_URL= null; - - static { - String pathSuffix = "icons/full/"; //$NON-NLS-1$ - ICON_BASE_URL= ConsolePlugin.getDefault().getBundle().getEntry(pathSuffix); - } - - // Use IPath and toOSString to build the names to ensure they have the slashes correct - private final static String LOCALTOOL= "clcl16/"; //basic colors - size 16x16 //$NON-NLS-1$ - private final static String DLCL= "dlcl16/"; //disabled - size 16x16 //$NON-NLS-1$ - private final static String ELCL= "elcl16/"; //enabled - size 16x16 //$NON-NLS-1$ - private final static String VIEW= "cview16/"; // views //$NON-NLS-1$ - - /** - * Declare all images - */ - private static void declareImages() { - // Actions - - //local toolbars - declareRegistryImage(IConsoleConstants.IMG_LCL_CLEAR, LOCALTOOL + "clear_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_LCL_PIN, LOCALTOOL + "pin.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_LCL_LOCK, LOCALTOOL + "lock_co.gif"); //$NON-NLS-1$ - - // disabled local toolbars - declareRegistryImage(IInternalConsoleConstants.IMG_DLCL_CLEAR, DLCL + "clear_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_DLCL_PIN, DLCL + "pin.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_DLCL_LOCK, DLCL + "lock_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_DLCL_CLOSE, DLCL + "rem_co.gif"); //$NON-NLS-1$ - - // enabled local toolbars - declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_CLEAR, ELCL + "clear_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_PIN, ELCL + "pin.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_LOCK, ELCL + "lock_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_CLOSE, ELCL + "rem_co.gif"); //$NON-NLS-1$ - declareRegistryImage(IInternalConsoleConstants.IMG_ELCL_NEW_CON, ELCL + "new_con.gif"); //$NON-NLS-1$ - - // Views - declareRegistryImage(IConsoleConstants.IMG_VIEW_CONSOLE, VIEW + "console_view.gif"); //$NON-NLS-1$ - } - - /** - * 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(); - try { - desc= ImageDescriptor.createFromURL(makeIconFileURL(path)); - } catch (MalformedURLException me) { - ConsolePlugin.log(me); - } - imageRegistry.put(key, desc); - } - - /** - * Returns the ImageRegistry. - */ - public static ImageRegistry getImageRegistry() { - if (imageRegistry == null) { - initializeImageRegistry(); - } - return imageRegistry; - } - - /** - * 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 static ImageRegistry initializeImageRegistry() { - imageRegistry= new ImageRegistry(ConsolePlugin.getStandardDisplay()); - declareImages(); - return imageRegistry; - } - - /** - * Returns the Image identified by the given key, - * or null if it does not exist. - */ - public static Image getImage(String key) { - return getImageRegistry().get(key); - } - - /** - * Returns the ImageDescriptor identified by the given key, - * or null if it does not exist. - */ - public static ImageDescriptor getImageDescriptor(String key) { - return getImageRegistry().getDescriptor(key); - } - - private static URL makeIconFileURL(String iconPath) throws MalformedURLException { - if (ICON_BASE_URL == null) { - throw new MalformedURLException(); - } - - return new URL(ICON_BASE_URL, iconPath); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.java deleted file mode 100644 index 33b7d8568..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.java +++ /dev/null @@ -1,35 +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.ui.internal.console; - -import java.util.MissingResourceException; -import java.util.ResourceBundle; - -public class ConsoleResourceBundleMessages { - private static final String BUNDLE_NAME = "org.eclipse.ui.internal.console.ConsoleResourceBundleMessages"; //$NON-NLS-1$ - - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); - - private ConsoleResourceBundleMessages() { - } - - public static String getString(String key) { - try { - return RESOURCE_BUNDLE.getString(key); - } catch (MissingResourceException e) { - return '!' + key + '!'; - } - } - - public static ResourceBundle getBundle() { - return RESOURCE_BUNDLE; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.properties b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.properties deleted file mode 100644 index 9aeb0ef43..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleResourceBundleMessages.properties +++ /dev/null @@ -1,19 +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 -############################################################################### - - -# These strings are used by the Find Replace Action and loaded as a Resource Bundle. -# See TextConsolePage.createActions() - -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.ui.console/src/org/eclipse/ui/internal/console/ConsoleTypePropertyTester.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleTypePropertyTester.java deleted file mode 100644 index 46dc213fe..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleTypePropertyTester.java +++ /dev/null @@ -1,32 +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.ui.internal.console; - -import org.eclipse.core.expressions.PropertyTester; -import org.eclipse.ui.console.IConsole; - -/** - * Tests if an IOConsole's type matches the expected value - * - * @since 3.1 - */ -public class ConsoleTypePropertyTester 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) { - IConsole console = (IConsole) receiver; - String type = console.getType(); - return type != null ? type.equals(expectedValue) : false; - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java deleted file mode 100644 index 31c867809..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java +++ /dev/null @@ -1,809 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2010 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.internal.console; - -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.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.ToolBar; -import org.eclipse.swt.widgets.ToolItem; - -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.action.ToolBarManager; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.jface.viewers.IBasicPropertyConstants; - -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.PlatformUI; -import org.eclipse.ui.console.AbstractConsole; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.IConsoleListener; -import org.eclipse.ui.console.IConsoleManager; -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.part.IPage; -import org.eclipse.ui.part.IPageBookViewPage; -import org.eclipse.ui.part.MessagePage; -import org.eclipse.ui.part.PageBook; -import org.eclipse.ui.part.PageBookView; -import org.eclipse.ui.part.PageSwitcher; -import org.eclipse.ui.progress.IWorkbenchSiteProgressService; - -/** - * Page book console view. - * - * @since 3.0 - */ -public class ConsoleView extends PageBookView implements IConsoleView, IConsoleListener, IPropertyChangeListener, IPartListener2 { - - /** - * Whether this console is pinned. - */ - private boolean fPinned = false; - - /** - * Stack of consoles in MRU order - */ - private List fStack = new ArrayList(); - - /** - * The console being displayed, or null if none - */ - private IConsole fActiveConsole = null; - - /** - * Map of consoles to dummy console parts (used to close pages) - */ - private Map fConsoleToPart; - - /** - * Map of consoles to array of page participants - */ - private Map fConsoleToPageParticipants; - - /** - * Map of parts to consoles - */ - private Map fPartToConsole; - - /** - * Whether this view is active - */ - private boolean fActive = false; - - /** - * 'In Console View' context - */ - private IContextActivation fActivatedContext; - - // actions - private PinConsoleAction fPinAction = null; - private ConsoleDropDownAction fDisplayConsoleAction = null; - - private OpenConsoleAction fOpenConsoleAction = null; - - private boolean fScrollLock; - - private boolean isAvailable() { - return getPageBook() != null && !getPageBook().isDisposed(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) - */ - public void propertyChange(PropertyChangeEvent event) { - Object source = event.getSource(); - if (source instanceof IConsole && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) { - if (source.equals(getConsole())) { - updateTitle(); - } - } - - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart) - */ - public void partClosed(IWorkbenchPart part) { - super.partClosed(part); - fPinAction.update(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.internal.ui.console.IConsoleView#getConsole() - */ - public IConsole getConsole() { - return fActiveConsole; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.PageBookView#showPageRec(org.eclipse.ui.part.PageBookView.PageRec) - */ - protected void showPageRec(PageRec pageRec) { - // don't show the page when pinned, unless this is the first console to be added - // or its the default page - if (fActiveConsole != null && pageRec.page != getDefaultPage() && fPinned && fConsoleToPart.size() > 1) { - IConsole console = (IConsole)fPartToConsole.get(pageRec.part); - if (!fStack.contains(console)) { - fStack.add(console); - } - return; - } - - IConsole recConsole = (IConsole)fPartToConsole.get(pageRec.part); - if (recConsole!=null && recConsole.equals(fActiveConsole)) { - return; - } - - super.showPageRec(pageRec); - fActiveConsole = recConsole; - IConsole tos = null; - if (!fStack.isEmpty()) { - tos = (IConsole) fStack.get(0); - } - if (tos != null && !tos.equals(fActiveConsole)) { - deactivateParticipants(tos); - } - if (fActiveConsole != null && !fActiveConsole.equals(tos)) { - fStack.remove(fActiveConsole); - fStack.add(0,fActiveConsole); - activateParticipants(fActiveConsole); - } - updateTitle(); - updateHelp(); - // update console actions - if (fPinAction != null) { - fPinAction.update(); - } - IPage page = getCurrentPage(); - if (page instanceof IOConsolePage) { - ((IOConsolePage)page).setAutoScroll(!fScrollLock); - } - } - - /** - * Activates the participants for the given console, if any. - * - * @param console - */ - private void activateParticipants(IConsole console) { - // activate - if (console != null && fActive) { - final ListenerList listeners = getParticipants(console); - if (listeners != null) { - Object[] participants = listeners.getListeners(); - for (int i = 0; i < participants.length; i++) { - final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i]; - SafeRunner.run(new ISafeRunnable() { - public void run() throws Exception { - participant.activated(); - } - public void handleException(Throwable exception) { - ConsolePlugin.log(exception); - listeners.remove(participant); - } - }); - } - } - } - } - - /** - * Returns a stack of consoles in the view in MRU order. - * - * @return a stack of consoles in the view in MRU order - */ - protected List getConsoleStack() { - return fStack; - } - - /** - * Updates the view title based on the active console - */ - protected void updateTitle() { - IConsole console = getConsole(); - if (console == null) { - setContentDescription(ConsoleMessages.ConsoleView_0); - } else { - String newName = console.getName(); - String oldName = getContentDescription(); - if (newName!=null && !(newName.equals(oldName))) { - setContentDescription(console.getName()); - } - } - } - - protected void updateHelp() { - IConsole console = getConsole(); - String helpContextId = null; - if (console instanceof AbstractConsole) { - AbstractConsole abs = (AbstractConsole) console; - helpContextId = abs.getHelpContextId(); - } - if (helpContextId == null) { - helpContextId = IConsoleHelpContextIds.CONSOLE_VIEW; - } - PlatformUI.getWorkbench().getHelpSystem().setHelp(getPageBook().getParent(), helpContextId); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec) - */ - protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) { - IConsole console = (IConsole)fPartToConsole.get(part); - - // dispose page participants - ListenerList listeners = (ListenerList) fConsoleToPageParticipants.remove(console); - if (listeners != null) { - Object[] participants = listeners.getListeners(); - for (int i = 0; i < participants.length; i++) { - final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i]; - SafeRunner.run(new ISafeRunnable() { - public void run() throws Exception { - participant.dispose(); - } - public void handleException(Throwable exception) { - ConsolePlugin.log(exception); - } - }); - } - } - - IPage page = pageRecord.page; - page.dispose(); - pageRecord.dispose(); - console.removePropertyChangeListener(this); - - // empty cross-reference cache - fPartToConsole.remove(part); - fConsoleToPart.remove(console); - if (fPartToConsole.isEmpty()) { - fActiveConsole = null; - } - - // update console actions - fPinAction.update(); - } - - /** - * Returns the page participants registered for the given console, or null - * - * @param console - * @return registered page participants or null - */ - private ListenerList getParticipants(IConsole console) { - return (ListenerList) fConsoleToPageParticipants.get(console); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart) - */ - protected PageRec doCreatePage(IWorkbenchPart dummyPart) { - ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)dummyPart; - final IConsole console = part.getConsole(); - final IPageBookViewPage page = console.createPage(this); - initPage(page); - page.createControl(getPageBook()); - console.addPropertyChangeListener(this); - - // initialize page participants - IConsolePageParticipant[] consoleParticipants = ((ConsoleManager)getConsoleManager()).getPageParticipants(console); - final ListenerList participants = new ListenerList(); - for (int i = 0; i < consoleParticipants.length; i++) { - participants.add(consoleParticipants[i]); - } - fConsoleToPageParticipants.put(console, participants); - Object[] listeners = participants.getListeners(); - for (int i = 0; i < listeners.length; i++) { - final IConsolePageParticipant participant = (IConsolePageParticipant) listeners[i]; - SafeRunner.run(new ISafeRunnable() { - public void run() throws Exception { - participant.init(page, console); - } - public void handleException(Throwable exception) { - ConsolePlugin.log(exception); - participants.remove(participant); - } - }); - } - - PageRec rec = new PageRec(dummyPart, page); - return rec; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.PageBookView#isImportant(org.eclipse.ui.IWorkbenchPart) - */ - protected boolean isImportant(IWorkbenchPart part) { - return part instanceof ConsoleWorkbenchPart; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IWorkbenchPart#dispose() - */ - public void dispose() { - IViewSite site = getViewSite(); - if(site != null) { - site.getPage().removePartListener((IPartListener2)this); - } - super.dispose(); - ConsoleManager consoleManager = (ConsoleManager) ConsolePlugin.getDefault().getConsoleManager(); - consoleManager.removeConsoleListener(this); - consoleManager.unregisterConsoleView(this); - } - - /** - * Returns the console manager. - * - * @return the console manager - */ - private IConsoleManager getConsoleManager() { - return ConsolePlugin.getDefault().getConsoleManager(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.PageBookView#createDefaultPage(org.eclipse.ui.part.PageBook) - */ - protected IPage createDefaultPage(PageBook book) { - MessagePage page = new MessagePage(); - page.createControl(getPageBook()); - initPage(page); - return page; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[]) - */ - public void consolesAdded(final IConsole[] consoles) { - if (isAvailable()) { - Runnable r = new Runnable() { - public void run() { - for (int i = 0; i < consoles.length; i++) { - if (isAvailable()) { - IConsole console = consoles[i]; - // ensure it's still registered since this is done asynchronously - IConsole[] allConsoles = getConsoleManager().getConsoles(); - for (int j = 0; j < allConsoles.length; j++) { - IConsole registered = allConsoles[j]; - if (registered.equals(console)) { - ConsoleWorkbenchPart part = new ConsoleWorkbenchPart(console, getSite()); - fConsoleToPart.put(console, part); - fPartToConsole.put(part, console); - partActivated(part); - break; - } - } - - } - } - } - }; - asyncExec(r); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[]) - */ - public void consolesRemoved(final IConsole[] consoles) { - if (isAvailable()) { - Runnable r = new Runnable() { - public void run() { - for (int i = 0; i < consoles.length; i++) { - if (isAvailable()) { - IConsole console = consoles[i]; - fStack.remove(console); - ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)fConsoleToPart.get(console); - if (part != null) { - partClosed(part); - } - if (getConsole() == null) { - IConsole[] available = getConsoleManager().getConsoles(); - if (available.length > 0) { - display(available[available.length - 1]); - } - } - } - } - } - }; - asyncExec(r); - } - } - - /** - * Constructs a console view - */ - public ConsoleView() { - super(); - fConsoleToPart = new HashMap(); - fPartToConsole = new HashMap(); - fConsoleToPageParticipants = new HashMap(); - - ConsoleManager consoleManager = (ConsoleManager) ConsolePlugin.getDefault().getConsoleManager(); - consoleManager.registerConsoleView(this); - } - - protected void createActions() { - fPinAction = new PinConsoleAction(this); - fDisplayConsoleAction = new ConsoleDropDownAction(this); - ConsoleFactoryExtension[] extensions = ((ConsoleManager)ConsolePlugin.getDefault().getConsoleManager()).getConsoleFactoryExtensions(); - if (extensions.length > 0) { - fOpenConsoleAction = new OpenConsoleAction(); - } - } - - protected void configureToolBar(IToolBarManager mgr) { - mgr.add(new Separator(IConsoleConstants.LAUNCH_GROUP)); - mgr.add(new Separator(IConsoleConstants.OUTPUT_GROUP)); - mgr.add(new Separator("fixedGroup")); //$NON-NLS-1$ - mgr.add(fPinAction); - mgr.add(fDisplayConsoleAction); - if (fOpenConsoleAction != null) { - mgr.add(fOpenConsoleAction); - if (mgr instanceof ToolBarManager) { - ToolBarManager tbm= (ToolBarManager) mgr; - final ToolBar tb= tbm.getControl(); - tb.addMouseListener(new MouseAdapter() { - public void mouseDown(MouseEvent e) { - ToolItem ti= tb.getItem(new Point(e.x, e.y)); - if (ti != null) { - if (ti.getData() instanceof ActionContributionItem) { - ActionContributionItem actionContributionItem= (ActionContributionItem) ti.getData(); - IAction action= actionContributionItem.getAction(); - if (action == fOpenConsoleAction) { - Event event= new Event(); - event.widget= ti; - event.x= e.x; - event.y= e.y; - action.runWithEvent(event); - } - } - } - } - }); - } - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleView#display(org.eclipse.ui.console.IConsole) - */ - public void display(IConsole console) { - if (fPinned && fActiveConsole != null) { - return; - } - if (console.equals(fActiveConsole)) { - return; - } - ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)fConsoleToPart.get(console); - if (part != null) { - partActivated(part); - } - } - - /*/* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleView#pin(org.eclipse.ui.console.IConsole) - */ - public void setPinned(boolean pin) { - fPinned = pin; - if (fPinAction != null) { - fPinAction.update(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleView#isPinned() - */ - public boolean isPinned() { - return fPinned; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.part.PageBookView#getBootstrapPart() - */ - protected IWorkbenchPart getBootstrapPart() { - return null; - } - - /** - * 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()) { - getPageBook().getDisplay().asyncExec(r); - } - } - - /** - * 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 REMOVE_ACTION 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:
                                - *
                              • createViewer(Composite) - the context - * menu is hooked to the viewer's control.
                              • - *
                              • createActions()
                              • - *
                              • configureToolBar(IToolBarManager)
                              • - *
                              • getHelpContextId()
                              • - *
                              - * @see IWorkbenchPart#createPartControl(Composite) - */ - public void createPartControl(Composite parent) { - super.createPartControl(parent); - createActions(); - IToolBarManager tbm= getViewSite().getActionBars().getToolBarManager(); - configureToolBar(tbm); - updateForExistingConsoles(); - getViewSite().getActionBars().updateActionBars(); - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IConsoleHelpContextIds.CONSOLE_VIEW); - getViewSite().getPage().addPartListener((IPartListener2)this); - initPageSwitcher(); - } - - /** - * Initialize the PageSwitcher. - */ - private void initPageSwitcher() { - new PageSwitcher(this) { - public void activatePage(Object page) { - ShowConsoleAction.showConsole((IConsole) page, ConsoleView.this); - } - - public ImageDescriptor getImageDescriptor(Object page) { - return ((IConsole) page).getImageDescriptor(); - } - - public String getName(Object page) { - return ((IConsole) page).getName(); - } - - public Object[] getPages() { - return getConsoleManager().getConsoles(); - } - - public int getCurrentPageIndex() { - IConsole currentConsole= getConsole(); - IConsole[] consoles= getConsoleManager().getConsoles(); - for (int i= 0; i < consoles.length; i++) { - if (consoles[i].equals(currentConsole)) - return i; - } - return super.getCurrentPageIndex(); - } - }; - } - - /** - * Initialize for existing consoles - */ - private void updateForExistingConsoles() { - IConsoleManager manager = getConsoleManager(); - // create pages for consoles - IConsole[] consoles = manager.getConsoles(); - consolesAdded(consoles); - // add as a listener - manager.addConsoleListener(this); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleView#warnOfContentChange(org.eclipse.ui.console.IConsole) - */ - public void warnOfContentChange(IConsole console) { - IWorkbenchPart part = (IWorkbenchPart)fConsoleToPart.get(console); - if (part != null) { - IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) part.getSite().getAdapter(IWorkbenchSiteProgressService.class); - if (service != null) { - service.warnOfContentChange(); - } - } - } - - public Object getAdapter(Class key) { - Object adpater = super.getAdapter(key); - if (adpater == null) { - IConsole console = getConsole(); - if (console != null) { - ListenerList listeners = getParticipants(console); - // an adapter can be asked for before the console participants are created - if (listeners != null) { - Object[] participants = listeners.getListeners(); - for (int i = 0; i < participants.length; i++) { - IConsolePageParticipant participant = (IConsolePageParticipant) participants[i]; - adpater = participant.getAdapter(key); - if (adpater != null) { - return adpater; - } - } - } - } - } - return adpater; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference) - */ - public void partActivated(IWorkbenchPartReference partRef) { - if (isThisPart(partRef)) { - fActive = true; - IContextService contextService = (IContextService)getSite().getService(IContextService.class); - if(contextService != null) { - fActivatedContext = contextService.activateContext(IConsoleConstants.ID_CONSOLE_VIEW); - activateParticipants(fActiveConsole); - } - } - } - - /* (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) { - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference) - */ - public void partDeactivated(IWorkbenchPartReference partRef) { - if (isThisPart(partRef)) { - fActive = false; - IContextService contextService = (IContextService)getSite().getService(IContextService.class); - if(contextService != null) { - contextService.deactivateContext(fActivatedContext); - deactivateParticipants(fActiveConsole); - } - } - } - - /** - * Returns if the specified part reference is to this view part (if the part - * reference is the console view or not) - * @param partRef - * @return true if the specified part reference is the console view - */ - protected boolean isThisPart(IWorkbenchPartReference partRef) { - if (partRef instanceof IViewReference) { - IViewReference viewRef = (IViewReference) partRef; - if (getViewSite() != null && viewRef.getId().equals(getViewSite().getId())) { - String secId = viewRef.getSecondaryId(); - String mySec = null; - if (getSite() instanceof IViewSite) { - mySec = ((IViewSite)getSite()).getSecondaryId(); - } - if (mySec == null) { - return secId == null; - } - return mySec.equals(secId); - } - } - return false; - } - - /** - * Deactivates participants for the given console, if any. - * - * @param console console to deactivate - */ - private void deactivateParticipants(IConsole console) { - // deactivate - if (console != null) { - final ListenerList listeners = getParticipants(console); - if (listeners != null) { - Object[] participants = listeners.getListeners(); - for (int i = 0; i < participants.length; i++) { - final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i]; - SafeRunner.run(new ISafeRunnable() { - public void run() throws Exception { - participant.deactivated(); - } - public void handleException(Throwable exception) { - ConsolePlugin.log(exception); - listeners.remove(participant); - } - }); - } - } - } - } - - /* (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.ui.console.IConsoleView#setScrollLock(boolean) - */ - public void setScrollLock(boolean scrollLock) { - fScrollLock = scrollLock; - - IPage page = getCurrentPage(); - if (page instanceof IOConsolePage) { - ((IOConsolePage)page).setAutoScroll(!scrollLock); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleView#getScrollLock() - */ - public boolean getScrollLock() { - return fScrollLock; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleView#pin(org.eclipse.ui.console.IConsole) - */ - public void pin(IConsole console) { - if (console == null) { - setPinned(false); - } else { - if (isPinned()) { - setPinned(false); - } - display(console); - setPinned(true); - } - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleViewConsoleFactory.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleViewConsoleFactory.java deleted file mode 100644 index 8a32fc8c1..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleViewConsoleFactory.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.ui.internal.console; - -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.IConsoleFactory; - -public class ConsoleViewConsoleFactory implements IConsoleFactory { - - int counter = 1; - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.console.IConsoleFactory#openConsole() - */ - public void openConsole() { - IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); - if (window != null) { - IWorkbenchPage page = window.getActivePage(); - if (page != null) { - try { - String secondaryId = "Console View #" + counter; //$NON-NLS-1$ - page.showView(IConsoleConstants.ID_CONSOLE_VIEW, secondaryId, 1); - counter++; - } catch (PartInitException e) { - ConsolePlugin.log(e); - } - } - } - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java deleted file mode 100644 index e3377a4dc..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java +++ /dev/null @@ -1,125 +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.ui.internal.console; - -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; -import org.eclipse.ui.console.IConsole; - -/** - * Fake part to use as keys in page book for console pages - */ -public class ConsoleWorkbenchPart implements IWorkbenchPart { - - private IConsole fConsole = null; - private IWorkbenchPartSite fSite = null; - - /* (non-Javadoc) - * @see java.lang.Object#equals(java.lang.Object) - */ - public boolean equals(Object obj) { - return (obj instanceof ConsoleWorkbenchPart) && - fConsole.equals(((ConsoleWorkbenchPart)obj).fConsole); - } - - /* (non-Javadoc) - * @see java.lang.Object#hashCode() - */ - public int hashCode() { - return fConsole.hashCode(); - } - - /** - * Constructs a part for the given console that binds to the given - * site - */ - public ConsoleWorkbenchPart(IConsole console, IWorkbenchPartSite site) { - fConsole = console; - 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; - } - - /** - * Returns the console associated with this part. - * - * @return console associated with this part - */ - protected IConsole getConsole() { - return fConsole; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java deleted file mode 100644 index 492dfd552..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java +++ /dev/null @@ -1,55 +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.ui.internal.console; - -import org.eclipse.jface.action.Action; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.IHyperlink; -import org.eclipse.ui.console.TextConsoleViewer; - -/** - * Follows a hyperlink in the console - * - * @since 3.1 - */ -public class FollowHyperlinkAction extends Action { - - private TextConsoleViewer viewer; - - /** - * Constructs a follow link action - */ - public FollowHyperlinkAction(TextConsoleViewer consoleViewer) { - super(ConsoleMessages.FollowHyperlinkAction_0); - setToolTipText(ConsoleMessages.FollowHyperlinkAction_1); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_OPEN_LINK_ACTION); - this.viewer = consoleViewer; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#isEnabled() - */ - public boolean isEnabled() { - return viewer.getHyperlink() != null; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - IHyperlink link = viewer.getHyperlink(); - if (link != null) { - link.linkActivated(); - } - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/HyperlinkUpdater.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/HyperlinkUpdater.java deleted file mode 100644 index 3ed6aa714..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/HyperlinkUpdater.java +++ /dev/null @@ -1,56 +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.ui.internal.console; - -import org.eclipse.jface.text.BadPositionCategoryException; -import org.eclipse.jface.text.DefaultPositionUpdater; -import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition; - -/** - * When any region of a hyperlink is replaced, the hyperlink needs to be deleted. - * - * @since 3.3 - */ -public class HyperlinkUpdater extends DefaultPositionUpdater { - - /** - * @param category - */ - public HyperlinkUpdater() { - super(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY); - } - /** - * When any region of a hyperlink is replaced, the hyperlink needs to be deleted. - * - * @return true if position has NOT been deleted - */ - protected boolean notDeleted() { - - int positionEnd = fPosition.offset + fPosition.length - 1; - int editEnd = fOffset + fLength - 1; - if ((fOffset <= fPosition.offset && (editEnd > fPosition.offset)) || - (fOffset < positionEnd && (editEnd > positionEnd)) || - (fOffset >= fPosition.offset && fOffset <= positionEnd) || - (editEnd >= fPosition.offset && editEnd <= positionEnd)) { - - fPosition.delete(); - - try { - fDocument.removePosition(ConsoleHyperlinkPosition.HYPER_LINK_CATEGORY, fPosition); - } catch (BadPositionCategoryException x) { - } - - return false; - } - - return true; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java deleted file mode 100644 index 85a4e69b2..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IConsoleHelpContextIds.java +++ /dev/null @@ -1,46 +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.ui.internal.console; - -import org.eclipse.ui.console.IConsoleConstants; - -/** - * Help context ids for the console plugin. - *

                              - * This interface contains constants only; it is not intended to be implemented - * or extended. - *

                              - * - */ -public interface IConsoleHelpContextIds { - - public static final String PREFIX = IConsoleConstants.PLUGIN_ID + "."; //$NON-NLS-1$ - - // Actions - public static final String CLEAR_CONSOLE_ACTION = PREFIX + "clear_console_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_SCROLL_LOCK_ACTION = PREFIX + "console_scroll_lock_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_SELECT_ALL_ACTION = PREFIX + "console_select_all_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_COPY_ACTION = PREFIX + "copy_to_clipboard_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_CUT_ACTION = PREFIX + "console_cut_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_PASTE_ACTION = PREFIX + "console_paste_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_FIND_REPLACE_ACTION = PREFIX + "console_find_replace_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_OPEN_LINK_ACTION = PREFIX + "console_open_link_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_OPEN_CONSOLE_ACTION = PREFIX + "console_open_console_action_context"; //$NON-NLS-1$ - public static final String CONSOLE_DISPLAY_CONSOLE_ACTION = PREFIX + "console_display_console_action"; //$NON-NLS-1$ - public static final String CONSOLE_PIN_CONSOLE_ACITON = PREFIX + "console_pin_console_action"; //$NON-NLS-1$ - - // Views - public static final String CONSOLE_VIEW = PREFIX + "console_view_context"; //$NON-NLS-1$ - - // Preference pages - public static final String CONSOLE_PREFERENCE_PAGE = PREFIX + "console_preference_page_context"; //$NON-NLS-1$ -} - diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java deleted file mode 100644 index 00f5cbc3b..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IInternalConsoleConstants.java +++ /dev/null @@ -1,31 +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.ui.internal.console; - -public interface IInternalConsoleConstants { - - // tool images - public static final String IMG_LCL_PIN = "IMG_LCL_PIN"; //$NON-NLS-1$ - public static final String IMG_LCL_LOCK = "IMG_LCL_LOCK"; //$NON-NLS-1$ - - // disabled local tool images - public static final String IMG_DLCL_PIN = "IMG_DLCL_PIN"; //$NON-NLS-1$ - public static final String IMG_DLCL_CLEAR= "IMG_DLCL_CLEAR"; //$NON-NLS-1$ - public static final String IMG_DLCL_LOCK = "IMG_DLCL_LOCK"; //$NON-NLS-1$ - public static final String IMG_DLCL_CLOSE = "IMG_DLCL_CLOSE"; //$NON-NLS-1$ - - // enabled local tool images - public static final String IMG_ELCL_PIN = "IMG_ELCL_PIN"; //$NON-NLS-1$ - public static final String IMG_ELCL_CLEAR= "IMG_ELCL_CLEAR"; //$NON-NLS-1$ - public static final String IMG_ELCL_LOCK = "IMG_ELCL_LOCK"; //$NON-NLS-1$ - public static final String IMG_ELCL_CLOSE = "IMG_ELCL_CLOSE"; //$NON-NLS-1$ - public static final String IMG_ELCL_NEW_CON = "IMG_ELCL_NEW_CON"; //$NON-NLS-1$ -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java deleted file mode 100644 index 3f8d72fe9..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java +++ /dev/null @@ -1,141 +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.ui.internal.console; - -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.util.IPropertyChangeListener; -import org.eclipse.jface.util.PropertyChangeEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.actions.ActionFactory; -import org.eclipse.ui.console.IConsoleConstants; -import org.eclipse.ui.console.IConsoleView; -import org.eclipse.ui.console.TextConsole; -import org.eclipse.ui.console.TextConsolePage; -import org.eclipse.ui.console.TextConsoleViewer; - -/** - * A page for an IOConsole - * - * @since 3.1 - * - */ -public class IOConsolePage extends TextConsolePage { - - private ScrollLockAction fScrollLockAction; - - private boolean fReadOnly; - - private IPropertyChangeListener fPropertyChangeListener; - - public IOConsolePage(TextConsole console, IConsoleView view) { - super(console, view); - - fPropertyChangeListener = new IPropertyChangeListener() { - public void propertyChange(PropertyChangeEvent event) { - String property = event.getProperty(); - if (property.equals(IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE)) { - setReadOnly(); - } - } - }; - console.addPropertyChangeListener(fPropertyChangeListener); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - if (fReadOnly) { - IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); - viewer.setReadOnly(); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.console.TextConsolePage#createViewer(org.eclipse.swt.widgets.Composite, - * org.eclipse.ui.console.TextConsole) - */ - protected TextConsoleViewer createViewer(Composite parent) { - return new IOConsoleViewer(parent, (TextConsole)getConsole()); - } - - public void setAutoScroll(boolean scroll) { - IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); - if (viewer != null) { - viewer.setAutoScroll(scroll); - fScrollLockAction.setChecked(!scroll); - } - } - - /** - * Informs the viewer that it's text widget should not be editable. - */ - public void setReadOnly() { - fReadOnly = true; - IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); - if (viewer != null) { - viewer.setReadOnly(); - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.TextConsolePage#createActions() - */ - protected void createActions() { - super.createActions(); - fScrollLockAction = new ScrollLockAction(getConsoleView()); - setAutoScroll(!fScrollLockAction.isChecked()); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.TextConsolePage#contextMenuAboutToShow(org.eclipse.jface.action.IMenuManager) - */ - protected void contextMenuAboutToShow(IMenuManager menuManager) { - super.contextMenuAboutToShow(menuManager); - menuManager.add(fScrollLockAction); - IOConsoleViewer viewer = (IOConsoleViewer) getViewer(); - if (!viewer.isReadOnly()) { - menuManager.remove(ActionFactory.CUT.getId()); - menuManager.remove(ActionFactory.PASTE.getId()); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.console.TextConsolePage#configureToolBar(org.eclipse.jface.action.IToolBarManager) - */ - protected void configureToolBar(IToolBarManager mgr) { - super.configureToolBar(mgr); - mgr.appendToGroup(IConsoleConstants.OUTPUT_GROUP, fScrollLockAction); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.ui.part.IPage#dispose() - */ - public void dispose() { - if (fScrollLockAction != null) { - fScrollLockAction.dispose(); - fScrollLockAction = null; - } - getConsole().removePropertyChangeListener(fPropertyChangeListener); - super.dispose(); - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java deleted file mode 100644 index 519cbc76b..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java +++ /dev/null @@ -1,209 +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.ui.internal.console; - -import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.swt.custom.StyleRange; -import org.eclipse.swt.graphics.Color; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IOConsoleInputStream; -import org.eclipse.ui.console.IOConsoleOutputStream; - -/** - * A region in an IOConsole's document. - * - * @since 3.1 - */ -public class IOConsolePartition implements ITypedRegion { - public static final String OUTPUT_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".io_console_output_partition_type"; //$NON-NLS-1$ - public static final String INPUT_PARTITION_TYPE = ConsolePlugin.getUniqueIdentifier() + ".io_console_input_partition_type"; //$NON-NLS-1$ - - /** - * The data contained by this partition. - */ - private StringBuffer buffer; - private String type; - private int offset; - /** - * Output partitions are all read only. - * Input partitions are read only once they have been appended to the console's input stream. - */ - private boolean readOnly; - - /** - * Only one of inputStream or outputStream will be null depending on the partitions type. - */ - private IOConsoleOutputStream outputStream; - private IOConsoleInputStream inputStream; - private int length; - - /** - * Creates a new partition to contain output to console. - */ - public IOConsolePartition(IOConsoleOutputStream outputStream, int length) { - this.outputStream = outputStream; - this.length = length; - this.type = OUTPUT_PARTITION_TYPE; - this.readOnly = true; - } - - /** - * Creates a new partition to contain input from a console - */ - public IOConsolePartition(IOConsoleInputStream inputStream, String text) { - this.inputStream = inputStream; - buffer = new StringBuffer(text); - length = text.length(); - this.type = INPUT_PARTITION_TYPE; - this.readOnly = false; - } - - /** - * Inserts a string into this partition. - * @param s The string to insert - * @param offset the offset in the partition - */ - public void insert(String s, int insertOffset) { - buffer.insert(insertOffset, s); - length += s.length(); - } - - /** - * Deletes data from this partition. - * @param delOffset - * @param delLength - */ - public void delete(int delOffset, int delLength) { - buffer.delete(delOffset, delOffset+delLength); - length -= delLength; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.ITypedRegion#getType() - */ - public String getType() { - return type; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IRegion#getLength() - */ - public int getLength() { - return length; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IRegion#getOffset() - */ - public int getOffset() { - return offset; - } - - /** - * Sets this partitions offset in the document. - * - * @param offset This partitions offset in the document. - */ - public void setOffset(int offset) { - this.offset = offset; - } - - /** - * Sets this partition's length. - * - * @param length - */ - public void setLength(int length) { - this.length = length; - } - - /** - * Returns the data contained in this partition. - * @return The data contained in this partition. - */ - public String getString() { - return buffer.toString(); - } - - /** - * Returns a StyleRange object which may be used for setting the style - * of this partition in a viewer. - */ - public StyleRange getStyleRange(int rangeOffset, int rangeLength) { - return new StyleRange(rangeOffset, rangeLength, getColor(), null, getFontStyle()); - } - - /** - * Returns the font of the input stream if the type of the partition - * is INPUT_PARTITION_TYPE, otherwise it returns the output - * stream font - * - * @return the font of one of the backing streams - */ - private int getFontStyle() { - if (type.equals(INPUT_PARTITION_TYPE)) { - return inputStream.getFontStyle(); - } - return outputStream.getFontStyle(); - } - - /** - * Returns the colour of the input stream if the type of the partition - * is INPUT_PARTITION_TYPE, otherwise it returns the output - * stream colour - * - * @return the colour of one of the backing streams - */ - public Color getColor() { - if (type.equals(INPUT_PARTITION_TYPE)) { - return inputStream.getColor(); - } - return outputStream.getColor(); - } - - /** - * Returns if this partition is read-only. - * - * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int) - * @return if this partition is read-only - */ - public boolean isReadOnly() { - return readOnly; - } - - /** - * Sets the read-only state of this partition to true. - * - * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int) - */ - public void setReadOnly() { - readOnly = true; - } - - /** - * Clears the contents of the buffer - */ - public void clearBuffer() { - buffer.setLength(0); - } - - /** - * Returns the underlying output stream - * - * @return the underlying output stream - */ - IOConsoleOutputStream getStream() { - return outputStream; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java deleted file mode 100644 index 5a74807b2..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java +++ /dev/null @@ -1,699 +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.ui.internal.console; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.OperationCanceledException; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.runtime.jobs.IJobManager; -import org.eclipse.core.runtime.jobs.Job; -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentPartitionerExtension; -import org.eclipse.jface.text.IRegion; -import org.eclipse.jface.text.ITypedRegion; -import org.eclipse.jface.text.Region; -import org.eclipse.swt.custom.StyleRange; -import org.eclipse.swt.widgets.Display; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleDocumentPartitioner; -import org.eclipse.ui.console.IOConsole; -import org.eclipse.ui.console.IOConsoleInputStream; -import org.eclipse.ui.console.IOConsoleOutputStream; -import org.eclipse.ui.progress.UIJob; -import org.eclipse.ui.progress.WorkbenchJob; - -/** - * Partitions an IOConsole's document - * @since 3.1 - * - */ -public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocumentPartitionerExtension { - private PendingPartition consoleClosedPartition; - private IDocument document; - private ArrayList partitions; - /** - * Blocks of data that have not yet been appended to the document. - */ - private ArrayList pendingPartitions; - /** - * A list of PendingPartitions to be appended by the updateJob - */ - private ArrayList updatePartitions; - /** - * The last partition appended to the document - */ - private IOConsolePartition lastPartition; - /** - * Job that appends pending partitions to the document. - */ - private QueueProcessingJob queueJob; - /** - * The input stream attached to this document. - */ - private IOConsoleInputStream inputStream; - /** - * Flag to indicate that the updateJob is updating the document. - */ - private boolean updateInProgress; - /** - * A list of partitions containing input from the console, that have - * not been appended to the input stream yet. - */ - private ArrayList inputPartitions; - /** - * offset used by updateJob - */ - private int firstOffset; - /** - * An array of legal line delimiters - */ - private String[] lld; - private int highWaterMark = -1; - private int lowWaterMark = -1; - private boolean connected = false; - - private IOConsole console; - - private TrimJob trimJob = new TrimJob(); - /** - * Lock for appending to and removing from the document - used - * to synchronize addition of new text/partitions in the update - * job and handling buffer overflow/clearing of the console. - */ - private Object overflowLock = new Object(); - - - private int fBuffer; - - public IOConsolePartitioner(IOConsoleInputStream inputStream, IOConsole console) { - this.inputStream = inputStream; - this.console = console; - trimJob.setRule(console.getSchedulingRule()); - } - - public IDocument getDocument() { - return document; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#connect(org.eclipse.jface.text.IDocument) - */ - public void connect(IDocument doc) { - document = doc; - document.setDocumentPartitioner(this); - lld = document.getLegalLineDelimiters(); - partitions = new ArrayList(); - pendingPartitions = new ArrayList(); - inputPartitions = new ArrayList(); - queueJob = new QueueProcessingJob(); - queueJob.setSystem(true); - queueJob.setPriority(Job.INTERACTIVE); - queueJob.setRule(console.getSchedulingRule()); - connected = true; - } - - public int getHighWaterMark() { - return highWaterMark; - } - - public int getLowWaterMark() { - return lowWaterMark; - } - - public void setWaterMarks(int low, int high) { - lowWaterMark = low; - highWaterMark = high; - ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { - public void run() { - checkBufferSize(); - } - }); - } - - /** - * Notification from the console that all of its streams have been closed. - */ - public void streamsClosed() { - consoleClosedPartition = new PendingPartition(null, null); - synchronized (pendingPartitions) { - pendingPartitions.add(consoleClosedPartition); - } - queueJob.schedule(); //ensure that all pending partitions are processed. - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#disconnect() - */ - public void disconnect() { - synchronized (overflowLock) { - document = null; - partitions.clear(); - connected = false; - try { - inputStream.close(); - } catch (IOException e) { - } - } - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent) - */ - public void documentAboutToBeChanged(DocumentEvent event) { - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(org.eclipse.jface.text.DocumentEvent) - */ - public boolean documentChanged(DocumentEvent event) { - return documentChanged2(event) != null; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes() - */ - public String[] getLegalContentTypes() { - return new String[] { IOConsolePartition.OUTPUT_PARTITION_TYPE, IOConsolePartition.INPUT_PARTITION_TYPE }; - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int) - */ - public String getContentType(int offset) { - return getPartition(offset).getType(); - } - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#computePartitioning(int, int) - */ - public ITypedRegion[] computePartitioning(int offset, int length) { - int rangeEnd = offset + length; - int left= 0; - int right= partitions.size() - 1; - int mid= 0; - IOConsolePartition position= null; - - if (left == right) { - return new IOConsolePartition[]{(IOConsolePartition) partitions.get(0)}; - } - while (left < right) { - - mid= (left + right) / 2; - - position= (IOConsolePartition) partitions.get(mid); - if (rangeEnd < position.getOffset()) { - if (left == mid) - right= left; - else - right= mid -1; - } else if (offset > (position.getOffset() + position.getLength() - 1)) { - if (right == mid) - left= right; - else - left= mid +1; - } else { - left= right= mid; - } - } - - - List list = new ArrayList(); - int index = left - 1; - if (index >= 0) { - position= (IOConsolePartition) partitions.get(index); - while (index >= 0 && (position.getOffset() + position.getLength()) > offset) { - index--; - if (index >= 0) { - position= (IOConsolePartition) partitions.get(index); - } - } - } - index++; - position= (IOConsolePartition) partitions.get(index); - while (index < partitions.size() && (position.getOffset() < rangeEnd)) { - list.add(position); - index++; - if (index < partitions.size()) { - position= (IOConsolePartition) partitions.get(index); - } - } - - return (ITypedRegion[]) list.toArray(new IOConsolePartition[list.size()]); - } - - - /* - * (non-Javadoc) - * @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int) - */ - public ITypedRegion getPartition(int offset) { - for (int i = 0; i < partitions.size(); i++) { - ITypedRegion partition = (ITypedRegion) partitions.get(i); - int start = partition.getOffset(); - int end = start + partition.getLength(); - if (offset >= start && offset < end) { - return partition; - } - } - - if (lastPartition == null) { - synchronized(partitions) { - lastPartition = new IOConsolePartition(inputStream, ""); //$NON-NLS-1$ - lastPartition.setOffset(offset); - partitions.add(lastPartition); - inputPartitions.add(lastPartition); - } - } - return lastPartition; - } - - /** - * Enforces the buffer size. - * When the number of lines in the document exceeds the high water mark, the - * beginning of the document is trimmed until the number of lines equals the - * low water mark. - */ - private void checkBufferSize() { - if (document != null && highWaterMark > 0) { - int length = document.getLength(); - if (length > highWaterMark) { - if (trimJob.getState() == Job.NONE) { //if the job isn't already running - trimJob.setOffset(length - lowWaterMark); - trimJob.schedule(); - } - } - } - } - - /** - * Clears the console - */ - public void clearBuffer() { - synchronized (overflowLock) { - trimJob.setOffset(-1); - trimJob.schedule(); - } - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.IDocumentPartitionerExtension#documentChanged2(org.eclipse.jface.text.DocumentEvent) - */ - public IRegion documentChanged2(DocumentEvent event) { - if (document == null) { - return null; //another thread disconnected the partitioner - } - if (document.getLength() == 0) { //document cleared - if (lastPartition != null && lastPartition.getType().equals(IOConsolePartition.INPUT_PARTITION_TYPE)) { - synchronized (partitions) { - partitions.remove(lastPartition); - inputPartitions.remove(lastPartition); - } - } - lastPartition = null; - return new Region(0, 0); - } - - - if (updateInProgress) { - synchronized(partitions) { - if (updatePartitions != null) { - for (Iterator i = updatePartitions.iterator(); i.hasNext(); ) { - PendingPartition pp = (PendingPartition) i.next(); - if (pp == consoleClosedPartition) { - continue; - } - - int ppLen = pp.text.length(); - if (lastPartition != null && lastPartition.getStream() == pp.stream) { - int len = lastPartition.getLength(); - lastPartition.setLength(len + ppLen); - } else { - IOConsolePartition partition = new IOConsolePartition(pp.stream, ppLen); - partition.setOffset(firstOffset); - lastPartition = partition; - partitions.add(partition); - } - firstOffset += ppLen; - } - } - } - } else {// user input. - int amountDeleted = event.getLength() ; - - if (amountDeleted > 0) { - int offset = event.fOffset; - IOConsolePartition partition = (IOConsolePartition) getPartition(offset); - if(partition == lastPartition) { - partition.delete(event.fOffset-partition.getOffset(), amountDeleted); - } - } - - synchronized(partitions) { - if (lastPartition == null || lastPartition.isReadOnly()) { - lastPartition = new IOConsolePartition(inputStream, event.fText); - lastPartition.setOffset(event.fOffset); - partitions.add(lastPartition); - inputPartitions.add(lastPartition); - } else { - lastPartition.insert(event.fText, (event.fOffset-lastPartition.getOffset())); - } - - int lastLineDelimiter = -1; - String partitionText = lastPartition.getString(); - for (int i = 0; i < lld.length; i++) { - String ld = lld[i]; - int index = partitionText.lastIndexOf(ld); - if (index != -1) { - index += ld.length(); - } - if (index > lastLineDelimiter) { - lastLineDelimiter = index; - } - } - if (lastLineDelimiter != -1) { - StringBuffer input = new StringBuffer(); - Iterator it = inputPartitions.iterator(); - while (it.hasNext()) { - IOConsolePartition partition = (IOConsolePartition) it.next(); - if (partition.getOffset() + partition.getLength() <= event.fOffset + lastLineDelimiter) { - if (partition == lastPartition) { - lastPartition = null; - } - input.append(partition.getString()); - partition.clearBuffer(); - partition.setReadOnly(); - it.remove(); - } else { - //create a new partition containing everything up to the line delimiter - //and append that to the string buffer. - String contentBefore = partitionText.substring(0, lastLineDelimiter); - IOConsolePartition newPartition = new IOConsolePartition(inputStream, contentBefore); - newPartition.setOffset(partition.getOffset()); - newPartition.setReadOnly(); - newPartition.clearBuffer(); - int index = partitions.indexOf(partition); - partitions.add(index, newPartition); - input.append(contentBefore); - //delete everything that has been appended to the buffer. - partition.delete(0, lastLineDelimiter); - partition.setOffset(lastLineDelimiter + partition.getOffset()); - lastLineDelimiter = 0; - } - } - if (input.length() > 0) { - inputStream.appendData(input.toString()); - } - - } - } - } - - return new Region(event.fOffset, event.fText.length()); - } - - private void setUpdateInProgress(boolean b) { - updateInProgress = b; - } - - /** - * A stream has been appended, add to pendingPartions list and schedule updateJob. - * updateJob is scheduled with a slight delay, this allows the console to run the job - * less frequently and update the document with a greater amount of data each time - * the job is run - * @param stream The stream that was written to. - * @param s The string that should be appended to the document. - */ - public void streamAppended(IOConsoleOutputStream stream, String s) throws IOException { - if (document == null) { - throw new IOException("Document is closed"); //$NON-NLS-1$ - } - synchronized(pendingPartitions) { - PendingPartition last = (PendingPartition) (pendingPartitions.size() > 0 ? pendingPartitions.get(pendingPartitions.size()-1) : null); - if (last != null && last.stream == stream) { - last.append(s); - } else { - pendingPartitions.add(new PendingPartition(stream, s)); - if (fBuffer > 1000) { - queueJob.schedule(); - } else { - queueJob.schedule(50); - } - } - - if (fBuffer > 160000) { - if(Display.getCurrent() == null){ - try { - pendingPartitions.wait(); - } catch (InterruptedException e) { - } - } else { - /* - * if we are in UI thread we cannot lock it, so process - * queued output. - */ - processQueue(); - } - } - } - } - - /** - * Holds data until updateJob can be run and the document can be updated. - */ - private class PendingPartition { - StringBuffer text = new StringBuffer(8192); - IOConsoleOutputStream stream; - - PendingPartition(IOConsoleOutputStream stream, String text) { - this.stream = stream; - if (text != null) { - append(text); - } - } - - void append(String moreText) { - text.append(moreText); - fBuffer += moreText.length(); - } - } - - /** - * Updates the document. Will append everything that is available before - * finishing. - */ - private class QueueProcessingJob extends UIJob { - - QueueProcessingJob() { - super("IOConsole Updater"); //$NON-NLS-1$ - } - - /* - * (non-Javadoc) - * @see org.eclipse.core.internal.jobs.InternalJob#run(org.eclipse.core.runtime.IProgressMonitor) - */ - public IStatus runInUIThread(IProgressMonitor monitor) { - processQueue(); - return Status.OK_STATUS; - } - - /* - * Job will process as much as it can each time it's run, but it gets - * scheduled everytime a PendingPartition is added to the list, meaning - * that this job could get scheduled unnecessarily in cases of heavy output. - * Note however, that schedule() will only reschedule a running/scheduled Job - * once even if it's called many times. - */ - public boolean shouldRun() { - boolean shouldRun = connected && pendingPartitions != null && pendingPartitions.size() > 0; - return shouldRun; - } - } - - void processQueue() { - synchronized (overflowLock) { - ArrayList pendingCopy = new ArrayList(); - StringBuffer buffer = null; - boolean consoleClosed = false; - synchronized(pendingPartitions) { - pendingCopy.addAll(pendingPartitions); - pendingPartitions.clear(); - fBuffer = 0; - pendingPartitions.notifyAll(); - } - // determine buffer size - int size = 0; - for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) { - PendingPartition pp = (PendingPartition) i.next(); - if (pp != consoleClosedPartition) { - size+= pp.text.length(); - } - } - buffer = new StringBuffer(size); - for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) { - PendingPartition pp = (PendingPartition) i.next(); - if (pp != consoleClosedPartition) { - buffer.append(pp.text); - } else { - consoleClosed = true; - } - } - - if (connected) { - setUpdateInProgress(true); - updatePartitions = pendingCopy; - firstOffset = document.getLength(); - try { - if (buffer != null) { - document.replace(firstOffset, 0, buffer.toString()); - } - } catch (BadLocationException e) { - } - updatePartitions = null; - setUpdateInProgress(false); - } - if (consoleClosed) { - console.partitionerFinished(); - } - checkBufferSize(); - } - - } - - /** - * Job to trim the console document, runs in the UI thread. - */ - private class TrimJob extends WorkbenchJob { - - /** - * trims output up to the line containing the given offset, - * or all output if -1. - */ - private int truncateOffset; - - /** - * Creates a new job to trim the buffer. - */ - TrimJob() { - super("Trim Job"); //$NON-NLS-1$ - setSystem(true); - } - - /** - * Sets the trim offset. - * - * @param offset trims output up to the line containing the given offset - */ - public void setOffset(int offset) { - truncateOffset = offset; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor) - */ - public IStatus runInUIThread(IProgressMonitor monitor) { - IJobManager jobManager = Job.getJobManager(); - try { - jobManager.join(console, monitor); - } catch (OperationCanceledException e1) { - return Status.CANCEL_STATUS; - } catch (InterruptedException e1) { - return Status.CANCEL_STATUS; - } - if (document == null) { - return Status.OK_STATUS; - } - - int length = document.getLength(); - if (truncateOffset < length) { - synchronized (overflowLock) { - try { - if (truncateOffset < 0) { - // clear - setUpdateInProgress(true); - document.set(""); //$NON-NLS-1$ - setUpdateInProgress(false); - partitions.clear(); - } else { - // overflow - int cutoffLine = document.getLineOfOffset(truncateOffset); - int cutOffset = document.getLineOffset(cutoffLine); - - - // set the new length of the first partition - IOConsolePartition partition = (IOConsolePartition) getPartition(cutOffset); - partition.setLength(partition.getOffset() + partition.getLength() - cutOffset); - - setUpdateInProgress(true); - document.replace(0, cutOffset, ""); //$NON-NLS-1$ - setUpdateInProgress(false); - - //remove partitions and reset Partition offsets - int index = partitions.indexOf(partition); - for (int i = 0; i < index; i++) { - partitions.remove(0); - } - - int offset = 0; - for (Iterator i = partitions.iterator(); i.hasNext(); ) { - IOConsolePartition p = (IOConsolePartition) i.next(); - p.setOffset(offset); - offset += p.getLength(); - } - } - } catch (BadLocationException e) { - } - } - } - return Status.OK_STATUS; - } - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int) - */ - public boolean isReadOnly(int offset) { - return ((IOConsolePartition)getPartition(offset)).isReadOnly(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IConsoleDocumentPartitioner#computeStyleRange(int, int) - */ - public StyleRange[] getStyleRanges(int offset, int length) { - if (!connected) { - return new StyleRange[0]; - } - IOConsolePartition[] computedPartitions = (IOConsolePartition[])computePartitioning(offset, length); - StyleRange[] styles = new StyleRange[computedPartitions.length]; - for (int i = 0; i < computedPartitions.length; i++) { - int rangeStart = Math.max(computedPartitions[i].getOffset(), offset); - int rangeLength = computedPartitions[i].getLength(); - styles[i] = computedPartitions[i].getStyleRange(rangeStart, rangeLength); - } - return styles; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java deleted file mode 100644 index e686955f0..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java +++ /dev/null @@ -1,144 +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.ui.internal.console; - -import org.eclipse.jface.text.BadLocationException; -import org.eclipse.jface.text.DocumentEvent; -import org.eclipse.jface.text.IDocument; -import org.eclipse.jface.text.IDocumentListener; -import org.eclipse.swt.custom.StyledText; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleDocumentPartitioner; -import org.eclipse.ui.console.TextConsole; -import org.eclipse.ui.console.TextConsoleViewer; - -/** - * Viewer used to display an IOConsole - * - * @since 3.1 - */ -public class IOConsoleViewer extends TextConsoleViewer { - /** - * will always scroll with output if value is true. - */ - private boolean fAutoScroll = true; - - private IDocumentListener fDocumentListener; - - public IOConsoleViewer(Composite parent, TextConsole console) { - super(parent, console); - } - - public boolean isAutoScroll() { - return fAutoScroll; - } - - public void setAutoScroll(boolean scroll) { - fAutoScroll = scroll; - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.jface.text.TextViewer#handleVerifyEvent(org.eclipse.swt.events.VerifyEvent) - */ - protected void handleVerifyEvent(VerifyEvent e) { - IDocument doc = getDocument(); - String[] legalLineDelimiters = doc.getLegalLineDelimiters(); - String eventString = e.text; - try { - IConsoleDocumentPartitioner partitioner = (IConsoleDocumentPartitioner) doc.getDocumentPartitioner(); - if (!partitioner.isReadOnly(e.start)) { - boolean isCarriageReturn = false; - for (int i = 0; i < legalLineDelimiters.length; i++) { - if (e.text.equals(legalLineDelimiters[i])) { - isCarriageReturn = true; - break; - } - } - - if (!isCarriageReturn) { - super.handleVerifyEvent(e); - return; - } - } - - int length = doc.getLength(); - if (e.start == length) { - super.handleVerifyEvent(e); - } else { - try { - doc.replace(length, 0, eventString); - } catch (BadLocationException e1) { - } - e.doit = false; - } - } finally { - StyledText text = (StyledText) e.widget; - text.setCaretOffset(text.getCharCount()); - } - } - - /** - * makes the associated text widget uneditable. - */ - public void setReadOnly() { - ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() { - public void run() { - StyledText text = getTextWidget(); - if (text != null && !text.isDisposed()) { - text.setEditable(false); - } - } - }); - } - - /** - * @return false if text is editable - */ - public boolean isReadOnly() { - return !getTextWidget().getEditable(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.text.ITextViewer#setDocument(org.eclipse.jface.text.IDocument) - */ - public void setDocument(IDocument document) { - IDocument oldDocument= getDocument(); - - super.setDocument(document); - - if (oldDocument != null) { - oldDocument.removeDocumentListener(getDocumentListener()); - } - if (document != null) { - document.addDocumentListener(getDocumentListener()); - } - } - - private IDocumentListener getDocumentListener() { - if (fDocumentListener == null) { - fDocumentListener= new IDocumentListener() { - public void documentAboutToBeChanged(DocumentEvent event) { - } - - public void documentChanged(DocumentEvent event) { - if (fAutoScroll) { - revealEndOfDocument(); - } - } - }; - } - return fDocumentListener; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/OpenConsoleAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/OpenConsoleAction.java deleted file mode 100644 index ab8d900a7..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/OpenConsoleAction.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.ui.internal.console; - -import org.eclipse.core.runtime.CoreException; - -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.ToolItem; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IMenuCreator; -import org.eclipse.jface.resource.ImageDescriptor; - -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.activities.WorkbenchActivityHelper; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsoleFactory; - -/** - * @since 3.1 - */ -public class OpenConsoleAction extends Action implements IMenuCreator { - - private ConsoleFactoryExtension[] fFactoryExtensions; - private Menu fMenu; - - public OpenConsoleAction() { - fFactoryExtensions = ((ConsoleManager)ConsolePlugin.getDefault().getConsoleManager()).getConsoleFactoryExtensions(); - setText(ConsoleMessages.OpenConsoleAction_0); - setToolTipText(ConsoleMessages.OpenConsoleAction_1); - setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_NEW_CON)); - setMenuCreator(this); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_OPEN_CONSOLE_ACTION); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IMenuCreator#dispose() - */ - public void dispose() { - fFactoryExtensions = null; - } - - /* - * @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event) - * @since 3.5 - */ - public void runWithEvent(Event event) { - if (event.widget instanceof ToolItem) { - ToolItem toolItem= (ToolItem) event.widget; - Control control= toolItem.getParent(); - Menu menu= getMenu(control); - - Rectangle bounds= toolItem.getBounds(); - Point topLeft= new Point(bounds.x, bounds.y + bounds.height); - menu.setLocation(control.toDisplay(topLeft)); - menu.setVisible(true); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control) - */ - public Menu getMenu(Control parent) { - if (fMenu != null) { - fMenu.dispose(); - } - - fMenu= new Menu(parent); - int accel = 1; - for (int i = 0; i < fFactoryExtensions.length; i++) { - ConsoleFactoryExtension extension = fFactoryExtensions[i]; - if (!WorkbenchActivityHelper.filterItem(extension) && extension.isEnabled()) { - String label = extension.getLabel(); - ImageDescriptor image = extension.getImageDescriptor(); - addActionToMenu(fMenu, new ConsoleFactoryAction(label, image, extension), accel); - accel++; - } - } - return fMenu; - } - - private void addActionToMenu(Menu parent, Action action, int accelerator) { - if (accelerator < 10) { - StringBuffer label= new StringBuffer(); - //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(parent, -1); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu) - */ - public Menu getMenu(Menu parent) { - return null; - } - - private class ConsoleFactoryAction extends Action { - - private ConsoleFactoryExtension fConfig; - private IConsoleFactory fFactory; - - public ConsoleFactoryAction(String label, ImageDescriptor image, ConsoleFactoryExtension extension) { - setText(label); - if (image != null) { - setImageDescriptor(image); - } - fConfig = extension; - } - - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - try { - if (fFactory == null) { - fFactory = fConfig.createFactory(); - } - - fFactory.openConsole(); - } catch (CoreException e) { - ConsolePlugin.log(e); - } - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event) - */ - public void runWithEvent(Event event) { - run(); - } - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListener.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListener.java deleted file mode 100644 index eab75136a..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListener.java +++ /dev/null @@ -1,71 +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.ui.internal.console; - -import org.eclipse.core.runtime.CoreException; -import org.eclipse.ui.console.IPatternMatchListener; -import org.eclipse.ui.console.IPatternMatchListenerDelegate; -import org.eclipse.ui.console.PatternMatchEvent; -import org.eclipse.ui.console.TextConsole; - -public class PatternMatchListener implements IPatternMatchListener { - - private PatternMatchListenerExtension fExtension; - private IPatternMatchListenerDelegate fDelegate; - - public PatternMatchListener(PatternMatchListenerExtension extension) throws CoreException { - fExtension = extension; - fDelegate = fExtension.createDelegate(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IPatternMatchListener#getPattern() - */ - public String getPattern() { - return fExtension.getPattern(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IPatternMatchListener#getCompilerFlags() - */ - public int getCompilerFlags() { - return fExtension.getCompilerFlags(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IPatternMatchListener#matchFound(org.eclipse.ui.console.PatternMatchEvent) - */ - public void matchFound(PatternMatchEvent event) { - fDelegate.matchFound(event); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IPatternMatchListenerDelegate#connect(org.eclipse.ui.console.TextConsole) - */ - public void connect(TextConsole console) { - fDelegate.connect(console); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IPatternMatchListener#disconnect() - */ - public void disconnect() { - fDelegate.disconnect(); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.console.IPatternMatchListener#getQuickPattern() - */ - public String getLineQualifier() { - return fExtension.getQuickPattern(); - } - -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java deleted file mode 100644 index b4081dfe6..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java +++ /dev/null @@ -1,153 +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.ui.internal.console; - -import java.lang.reflect.Field; - -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.runtime.CoreException; -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.VariablesPlugin; -import org.eclipse.ui.IPluginContribution; -import org.eclipse.ui.console.ConsolePlugin; -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IPatternMatchListenerDelegate; - -import com.ibm.icu.text.MessageFormat; - -public class PatternMatchListenerExtension implements IPluginContribution { - - private IConfigurationElement fConfig; - private Expression fEnablementExpression; - private String fPattern; - private String fQualifier; - private int fFlags = -1; - - public PatternMatchListenerExtension(IConfigurationElement extension) { - fConfig = extension; - } - - /* - * returns the integer value of the flags defined in java.util.regex.Pattern. - * Both Pattern.MULTILINE and MULTILINE will return - * the same value. - */ - public int parseFlags(String flagsElement) { - int val = 0; - if (flagsElement == null) { - return val; - } - - try { - flagsElement = flagsElement.replaceAll("Pattern.", ""); //$NON-NLS-1$ //$NON-NLS-2$ - String[] tokens = flagsElement.split("\\s\\|\\s"); //$NON-NLS-1$ - Class clazz = Class.forName("java.util.regex.Pattern"); //$NON-NLS-1$ - - for (int i = 0; i < tokens.length; i++) { - Field field = clazz.getDeclaredField(tokens[i]); - val |= field.getInt(null); - } - } catch (ClassNotFoundException e) { - ConsolePlugin.log(e); - } catch (NoSuchFieldException e) { - ConsolePlugin.log(e); - } catch (IllegalAccessException e) { - ConsolePlugin.log(e); - } - return val; - } - - public boolean isEnabledFor(IConsole console) throws CoreException { - EvaluationContext context = new EvaluationContext(null, console); - EvaluationResult evaluationResult = getEnablementExpression().evaluate(context); - return evaluationResult == EvaluationResult.TRUE; - } - - public IPatternMatchListenerDelegate createDelegate() throws CoreException { - return (IPatternMatchListenerDelegate) fConfig.createExecutableExtension("class"); //$NON-NLS-1$ - } - - public Expression getEnablementExpression() throws CoreException { - if (fEnablementExpression == null) { - IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); - if (elements.length == 0) { - String message = MessageFormat.format("{0} " +getLocalId() + " {1} " + getPluginId() + " {2}", new String[] {ConsoleMessages.PatternMatchListenerExtension_3,ConsoleMessages.PatternMatchListenerExtension_4,ConsoleMessages.PatternMatchListenerExtension_5}); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ConsolePlugin.log(new Status(IStatus.WARNING, ConsolePlugin.getUniqueIdentifier(), IStatus.OK, message, null)); - } - IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; - - if (enablement != null) { - fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); - } - } - return fEnablementExpression; - } - - /* - * returns the regular expression to be matched. - */ - public String getPattern() { - if (fPattern == null) { - fPattern = fConfig.getAttribute("regex"); //$NON-NLS-1$ - try { - fPattern = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(fPattern, false); - } catch (CoreException e) { - ConsolePlugin.log(e); - } - } - return fPattern; - } - - /* - * returns the flags to be used by Pattern.compile(pattern, flags) - */ - public int getCompilerFlags() { - if(fFlags < 0) { - String flagsAttribute = fConfig.getAttribute("flags"); //$NON-NLS-1$ - fFlags = parseFlags(flagsAttribute); - } - return fFlags; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPluginContribution#getLocalId() - */ - public String getLocalId() { - return fConfig.getAttribute("id"); //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.ui.IPluginContribution#getPluginId() - */ - public String getPluginId() { - return fConfig.getContributor().getName(); - } - - public String getQuickPattern() { - if (fQualifier == null) { - fQualifier = fConfig.getAttribute("qualifier"); //$NON-NLS-1$ - try { - if (fQualifier != null) { - fQualifier = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(fQualifier, false); - } - } catch (CoreException e) { - ConsolePlugin.log(e); - } - } - return fQualifier; - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java deleted file mode 100644 index 61d307407..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java +++ /dev/null @@ -1,54 +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.ui.internal.console; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.IConsoleView; -import org.eclipse.ui.texteditor.IUpdate; - -/** - * Pins the currently visible console in a console view. - */ -public class PinConsoleAction extends Action implements IUpdate { - - private IConsoleView fView = null; - - /** - * Constructs a 'pin console' action - */ - public PinConsoleAction(IConsoleView view) { - super(ConsoleMessages.PinConsoleAction_0, IAction.AS_CHECK_BOX); - setToolTipText(ConsoleMessages.PinConsoleAction_1); - setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_PIN)); - setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_PIN)); - setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_LCL_PIN)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_PIN_CONSOLE_ACITON); - fView = view; - update(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - fView.setPinned(isChecked()); - } - - /* (non-Javadoc) - * @see org.eclipse.ui.texteditor.IUpdate#update() - */ - public void update() { - setEnabled(fView.getConsole() != null); - setChecked(fView.isPinned()); - } -} diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ScrollLockAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ScrollLockAction.java deleted file mode 100644 index e0b2ad268..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ScrollLockAction.java +++ /dev/null @@ -1,51 +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.ui.internal.console; - -import org.eclipse.jface.action.Action; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.console.IConsoleView; - -/** - * Toggles console auto-scroll - * - * @since 3.1 - */ -public class ScrollLockAction extends Action { - - private IConsoleView fConsoleView; - - public ScrollLockAction(IConsoleView consoleView) { - super(ConsoleMessages.ScrollLockAction_0); - fConsoleView = consoleView; - - setToolTipText(ConsoleMessages.ScrollLockAction_1); - setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_LCL_LOCK)); - setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_LOCK)); - setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_LOCK)); - PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_SCROLL_LOCK_ACTION); - boolean checked = fConsoleView.getScrollLock(); - setChecked(checked); - } - - /** - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - fConsoleView.setScrollLock(isChecked()); - } - - public void dispose() { - fConsoleView = null; - } - -} - diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java deleted file mode 100644 index ed846b0cf..000000000 --- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java +++ /dev/null @@ -1,64 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2008 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.internal.console; - -import org.eclipse.jface.action.Action; - -import org.eclipse.ui.console.IConsole; -import org.eclipse.ui.console.IConsoleView; - -/** - * Shows a specific console in the console view - */ -public class ShowConsoleAction extends Action { - - private IConsole fConsole; - private IConsoleView fView; - - /* (non-Javadoc) - * @see org.eclipse.jface.action.IAction#run() - */ - public void run() { - showConsole(fConsole, fView); - } - - /** - * Shows the given console in the given console view. - * - * @param console the console to show - * @param consoleView the console view - */ - public static void showConsole(IConsole console, IConsoleView consoleView) { - if (!console.equals(consoleView.getConsole())) { - boolean pinned = consoleView.isPinned(); - if (pinned) { - consoleView.setPinned(false); - } - consoleView.display(console); - if (pinned) { - consoleView.setPinned(true); - } - } - } - - /** - * Constructs an action to display the given console. - * - * @param view the console view in which the given console is contained - * @param console the console - */ - public ShowConsoleAction(IConsoleView view, IConsole console) { - super(console.getName(), AS_RADIO_BUTTON); - fConsole = console; - fView = view; - setImageDescriptor(console.getImageDescriptor()); - } -} diff --git a/org.eclipse.ui.externaltools/.classpath b/org.eclipse.ui.externaltools/.classpath deleted file mode 100644 index 435706608..000000000 --- a/org.eclipse.ui.externaltools/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.eclipse.ui.externaltools/.cvsignore b/org.eclipse.ui.externaltools/.cvsignore deleted file mode 100644 index 1fb8f5b9f..000000000 --- a/org.eclipse.ui.externaltools/.cvsignore +++ /dev/null @@ -1,4 +0,0 @@ -bin -externaltools.jar -build.xml -temp.folder diff --git a/org.eclipse.ui.externaltools/.project b/org.eclipse.ui.externaltools/.project deleted file mode 100644 index 657184697..000000000 --- a/org.eclipse.ui.externaltools/.project +++ /dev/null @@ -1,34 +0,0 @@ - - - org.eclipse.ui.externaltools - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.api.tools.apiAnalysisBuilder - - - - - - org.eclipse.jdt.core.javanature - org.eclipse.pde.PluginNature - org.eclipse.pde.api.tools.apiAnalysisNature - - diff --git a/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 6cec79c72..000000000 --- a/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,97 +0,0 @@ -#Mon Dec 01 09:56:45 PST 2008 -eclipse.preferences.version=1 -org.eclipse.jdt.core.builder.cleanOutputFolder=clean -org.eclipse.jdt.core.builder.duplicateResourceTask=warning -org.eclipse.jdt.core.builder.invalidClasspath=abort -org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch -org.eclipse.jdt.core.circularClasspath=error -org.eclipse.jdt.core.classpath.exclusionPatterns=enabled -org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2 -org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.4 -org.eclipse.jdt.core.compiler.debug.lineNumber=generate -org.eclipse.jdt.core.compiler.debug.localVariable=generate -org.eclipse.jdt.core.compiler.debug.sourceFile=generate -org.eclipse.jdt.core.compiler.doc.comment.support=enabled -org.eclipse.jdt.core.compiler.maxProblemPerUnit=100 -org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning -org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning -org.eclipse.jdt.core.compiler.problem.autoboxing=ignore -org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning -org.eclipse.jdt.core.compiler.problem.deadCode=warning -org.eclipse.jdt.core.compiler.problem.deprecation=warning -org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled -org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled -org.eclipse.jdt.core.compiler.problem.discouragedReference=warning -org.eclipse.jdt.core.compiler.problem.emptyStatement=warning -org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning -org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore -org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled -org.eclipse.jdt.core.compiler.problem.fieldHiding=warning -org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore -org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning -org.eclipse.jdt.core.compiler.problem.forbiddenReference=ignore -org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning -org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning -org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore -org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning -org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled -org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning -org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning -org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning -org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public -org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled -org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=private -org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore -org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning -org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning -org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning -org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning -org.eclipse.jdt.core.compiler.problem.nullReference=warning -org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning -org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning -org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning -org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning -org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning -org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning -org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning -org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled -org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning -org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled -org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore -org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning -org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore -org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning -org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning -org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore -org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled -org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled -org.eclipse.jdt.core.compiler.problem.unusedImport=error -org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -org.eclipse.jdt.core.compiler.problem.unusedLocal=warning -org.eclipse.jdt.core.compiler.problem.unusedParameter=warning -org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled -org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled -org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning -org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning -org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.source=1.3 -org.eclipse.jdt.core.incompatibleJDKLevel=ignore -org.eclipse.jdt.core.incompleteClasspath=error diff --git a/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.ui.prefs deleted file mode 100644 index 60a514d1b..000000000 --- a/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.ui.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Wed Feb 22 12:19:21 PST 2006 -eclipse.preferences.version=1 -internal.default.compliance=default diff --git a/org.eclipse.ui.externaltools/.settings/org.eclipse.pde.prefs b/org.eclipse.ui.externaltools/.settings/org.eclipse.pde.prefs deleted file mode 100644 index c1830b7fc..000000000 --- a/org.eclipse.ui.externaltools/.settings/org.eclipse.pde.prefs +++ /dev/null @@ -1,29 +0,0 @@ -#Mon Dec 14 12:09:21 CST 2009 -compilers.f.unresolved-features=1 -compilers.f.unresolved-plugins=1 -compilers.incompatible-environment=1 -compilers.p.build=1 -compilers.p.build.missing.output=1 -compilers.p.deprecated=1 -compilers.p.discouraged-class=1 -compilers.p.illegal-att-value=0 -compilers.p.internal=1 -compilers.p.missing-packages=2 -compilers.p.missing-version-export-package=2 -compilers.p.missing-version-import-package=2 -compilers.p.missing-version-require-bundle=2 -compilers.p.no-required-att=0 -compilers.p.not-externalized-att=1 -compilers.p.unknown-attribute=0 -compilers.p.unknown-class=1 -compilers.p.unknown-element=0 -compilers.p.unknown-identifier=1 -compilers.p.unknown-resource=1 -compilers.p.unresolved-ex-points=0 -compilers.p.unresolved-import=0 -compilers.p.unused-element-or-attribute=1 -compilers.s.create-docs=false -compilers.s.doc-folder=doc -compilers.s.open-tags=1 -compilers.use-project=true -eclipse.preferences.version=1 diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java deleted file mode 100644 index 35af87097..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java +++ /dev/null @@ -1,384 +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 - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.launchConfigurations; - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.ui.AbstractLaunchConfigurationTab; -import org.eclipse.jface.viewers.IStructuredContentProvider; -import org.eclipse.jface.viewers.Viewer; -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.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.dialogs.ListSelectionDialog; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsImages; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * A launch configuration tab which allows the user to specify - * which resources should be built before a build (a build scope) - *

                              - * This class may be instantiated; this class is not intended - * to be subclassed. - *

                              - * A generalized version of AntBuildTab which was removed after the work of bug 165371 - * @since 3.4 - */ -public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab { - // Check Buttons - private Button fBuildButton; - - // Group box - private Group fGroup; - - // Radio Buttons - private Button fProjectButton; - private Button fSpecificProjectsButton; - private Button fWorkspaceButton; - - // Push Button - private Button fSelectButton; - - // whether to include referenced projects - private Button fReferencedProjects; - - // projects to build (empty if none) - private List fProjects = new ArrayList(); - - class ProjectsContentProvider implements IStructuredContentProvider { - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object) - */ - public Object[] getElements(Object inputElement) { - return ((IWorkspace)inputElement).getRoot().getProjects(); - } - - /* (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) { - } - - } - /** - * @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); - - GridLayout layout = new GridLayout(); - GridData gd = new GridData(GridData.FILL_HORIZONTAL); - mainComposite.setLayout(layout); - mainComposite.setLayoutData(gd); - mainComposite.setFont(parent.getFont()); - - fBuildButton = createCheckButton(mainComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_1); - fBuildButton.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, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_2); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - fWorkspaceButton.setLayoutData(gd); - fWorkspaceButton.addSelectionListener(adapter); - - fProjectButton = createRadioButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_3); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 2; - fProjectButton.setLayoutData(gd); - fProjectButton.addSelectionListener(adapter); - - fSpecificProjectsButton = createRadioButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_4); - gd = new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = 1; - fSpecificProjectsButton.setLayoutData(gd); - fSpecificProjectsButton.addSelectionListener(adapter); - - fSelectButton = createPushButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_5, null); - gd = (GridData)fSelectButton.getLayoutData(); - gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END; - fSelectButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - selectResources(); - } - }); - - createVerticalSpacer(mainComposite, 1); - fReferencedProjects = createCheckButton(mainComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_6); - } - - /** - * Prompts the user to select the projects to build. - */ - private void selectResources() { - ListSelectionDialog dialog = new ListSelectionDialog(getShell(), ResourcesPlugin.getWorkspace(), new ProjectsContentProvider(), new WorkbenchLabelProvider(), ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_7); - dialog.setInitialElementSelections(fProjects); - if (dialog.open() == Window.CANCEL) { - return; - } - Object[] res = dialog.getResult(); - fProjects = new ArrayList(res.length); - for (int i = 0; i < res.length; i++) { - fProjects.add(res[i]); - } - 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) { - updateScope(configuration); - updateReferencedProjects(configuration); - updateEnabledState(); - } - - private void updateReferencedProjects(ILaunchConfiguration configuration) { - boolean ref = false; - try { - ref = configuration.getAttribute(IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS, true); - } catch (CoreException e) { - ExternalToolsPlugin.getDefault().log("Exception reading launch configuration", e); //$NON-NLS-1$ - } - fReferencedProjects.setSelection(ref); - } - - /** - * Updates the tab to display the build scope specified by the launch config - */ - private void updateScope(ILaunchConfiguration configuration) { - String scope = null; - try { - scope= configuration.getAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, (String)null); - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log("Exception reading launch configuration", ce); //$NON-NLS-1$ - } - fBuildButton.setSelection(scope != null); - fWorkspaceButton.setSelection(false); - fProjectButton.setSelection(false); - fSpecificProjectsButton.setSelection(false); - fProjects.clear(); - if (scope == null) { - // select the workspace by default - fBuildButton.setSelection(true); - fWorkspaceButton.setSelection(true); - } else { - if (scope.equals("${none}")) { //$NON-NLS-1$ - fBuildButton.setSelection(false); - } else if (scope.equals("${project}")) { //$NON-NLS-1$ - fProjectButton.setSelection(true); - } else if (scope.startsWith("${projects:")) { //$NON-NLS-1$ - fSpecificProjectsButton.setSelection(true); - IProject[] projects = getBuildProjects(configuration, IExternalToolConstants.ATTR_BUILD_SCOPE); - fProjects = new ArrayList(projects.length); - for (int i = 0; i < projects.length; i++) { - fProjects.add(projects[i]); - } - } - } - } - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - String scope = generateScopeMemento(); - configuration.setAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, scope); - if (fReferencedProjects.getSelection()) { - // default is true - configuration.setAttribute(IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS, (String)null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS, false); - } - } - - /** - * Generates a memento for the build scope. - */ - private String generateScopeMemento() { - if (fBuildButton.getSelection()) { - if (fWorkspaceButton.getSelection()) { - return null; - } - if (fProjectButton.getSelection()) { - return "${project}"; //$NON-NLS-1$ - } - if (fSpecificProjectsButton.getSelection()) { - return getBuildScopeAttribute(fProjects); - } - return null; - - } - return "${none}"; //$NON-NLS-1$ - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_8; - } - - /** - * Updates the enablement state of the fields. - */ - private void updateEnabledState() { - boolean enabled= fBuildButton.getSelection(); - fGroup.setEnabled(enabled); - fWorkspaceButton.setEnabled(enabled); - fProjectButton.setEnabled(enabled); - fSpecificProjectsButton.setEnabled(enabled); - fSelectButton.setEnabled(enabled && fSpecificProjectsButton.getSelection()); - if (!enabled) { - super.setErrorMessage(null); - } - if (enabled) { - if (!fWorkspaceButton.getSelection() && !fProjectButton.getSelection() && - !fSpecificProjectsButton.getSelection()) { - fWorkspaceButton.setSelection(true); - } - } - fReferencedProjects.setEnabled(fBuildButton.getSelection() && (fProjectButton.getSelection() || fSpecificProjectsButton.getSelection())); - } - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return ExternalToolsImages.getImage(org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.IMG_TAB_BUILD); - } - - public boolean isValid(ILaunchConfiguration launchConfig) { - setErrorMessage(null); - setMessage(null); - if (fBuildButton.getSelection() && fSpecificProjectsButton.getSelection() && fProjects.isEmpty()) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_9); - return false; - } - return true; - } - - /** - * Returns a collection of projects referenced by a build scope attribute. - * - * @return collection of projects referred to by configuration - */ - public static IProject[] getBuildProjects(ILaunchConfiguration configuration, String buildScopeId) { - return ExternalToolsCoreUtil.getBuildProjects(configuration, - buildScopeId); - - } - - /** - * Whether referenced projects should be considered when building. Only valid - * when a set of projects is to be built. - * - * @param configuration - * @return whether referenced projects should be considerd when building - * @throws CoreException if unable to access the associated attribute - */ - public static boolean isIncludeReferencedProjects(ILaunchConfiguration configuration, String includeReferencedProjectsId) throws CoreException { - return ExternalToolsCoreUtil.isIncludeReferencedProjects(configuration, - includeReferencedProjectsId); - } - - /** - * Creates and returns a memento for the given project set, to be used as a - * build scope attribute. - * - * @param projects list of projects - * @return an equivalent refresh attribute - */ - public static String getBuildScopeAttribute(List projects) { - StringBuffer buf = new StringBuffer(); - buf.append("${projects:"); //$NON-NLS-1$ - Iterator iterator = projects.iterator(); - while (iterator.hasNext()) { - IProject project = (IProject) iterator.next(); - buf.append(project.getName()); - if (iterator.hasNext()) { - buf.append(","); //$NON-NLS-1$ - } - } - buf.append("}"); //$NON-NLS-1$ - return buf.toString(); - } - - /* (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 - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java deleted file mode 100644 index 5b0c0a46b..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java +++ /dev/null @@ -1,531 +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 - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.launchConfigurations; - - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -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.ui.AbstractLaunchConfigurationTab; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.debug.ui.RefreshTab; -import org.eclipse.debug.ui.StringVariableSelectionDialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.wizard.WizardDialog; -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.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.FileDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.IWorkingSet; -import org.eclipse.ui.IWorkingSetManager; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.ElementTreeSelectionDialog; -import org.eclipse.ui.dialogs.IWorkingSetEditWizard; -import org.eclipse.ui.externaltools.internal.model.BuilderUtils; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; -import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; -import org.eclipse.ui.ide.IDE; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; -import org.eclipse.ui.views.navigator.ResourceComparator; - -public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab { - - protected Button afterClean; - protected Button fDuringClean; - protected Button autoBuildButton; - protected Button manualBuild; - protected Button workingSetButton; - protected Button specifyResources; - protected Button fLaunchInBackgroundButton; - protected IWorkingSet workingSet; - protected ILaunchConfiguration fConfiguration; - - private boolean fCreateBuildScheduleComponent= true; - - // Console Output widgets - private Button fConsoleOutput; - private Button fFileOutput; - private Button fFileBrowse; - private Text fFileText; - private Button fVariables; - private Button fAppend; - private Button fWorkspaceBrowse; - - public ExternalToolsBuilderTab() { - } - - public ExternalToolsBuilderTab(boolean createBuildScheduleComponent) { - fCreateBuildScheduleComponent= createBuildScheduleComponent; - } - - protected SelectionListener selectionListener= new SelectionAdapter() { - /* (non-Javadoc) - * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent) - */ - public void widgetSelected(SelectionEvent e) { - boolean enabled= !fCreateBuildScheduleComponent || autoBuildButton.getSelection() || manualBuild.getSelection(); - workingSetButton.setEnabled(enabled); - specifyResources.setEnabled(enabled && workingSetButton.getSelection()); - updateLaunchConfigurationDialog(); - } - }; - - public void createControl(Composite parent) { - Composite mainComposite = new Composite(parent, SWT.NONE); - setControl(mainComposite); - PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_BUILDER_TAB); - - GridLayout layout = new GridLayout(); - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.horizontalSpan = 2; - layout.numColumns = 2; - layout.makeColumnsEqualWidth = false; - mainComposite.setLayout(layout); - mainComposite.setLayoutData(gridData); - mainComposite.setFont(parent.getFont()); - createOutputCaptureComponent(mainComposite); - createLaunchInBackgroundComposite(mainComposite); - createBuildScheduleComponent(mainComposite); - } - - /** - * 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 createLaunchInBackgroundComposite(Composite parent) { - fLaunchInBackgroundButton = createCheckButton(parent, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_14); - GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - data.horizontalSpan = 2; - fLaunchInBackgroundButton.setLayoutData(data); - fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }); - } - - protected void createBuildScheduleComponent(Composite parent) { - if (fCreateBuildScheduleComponent) { - Label label= new Label(parent, SWT.NONE); - label.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Run_this_builder_for__1); - label.setFont(parent.getFont()); - afterClean= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab__Full_builds_2, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Full, 2); - manualBuild= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab__Incremental_builds_4, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Inc, 2); - autoBuildButton= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab__Auto_builds__Not_recommended__6, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Auto, 2); - fDuringClean= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_0, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_1, 2); - - createVerticalSpacer(parent, 2); - } - - workingSetButton= createButton(parent, selectionListener, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_workingSet_label, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_workingSet_tooltip, 1); - specifyResources= createPushButton(parent, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_13, null); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END); - specifyResources.setLayoutData(gd); - specifyResources.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - selectResources(); - } - }); - Label label= new Label(parent, SWT.NONE); - label.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_2); - label.setFont(parent.getFont()); - } - - private void createOutputCaptureComponent(Composite parent) { - Group group = new Group(parent, SWT.NONE); - group.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_17); - GridData gd = new GridData(SWT.FILL, SWT.NONE, true, false); - gd.horizontalSpan = 2; - group.setLayoutData(gd); - GridLayout layout = new GridLayout(5, false); - group.setLayout(layout); - group.setFont(parent.getFont()); - - fConsoleOutput = createCheckButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_18); - 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(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_19); - fFileOutput.setLayoutData(new GridData(SWT.BEGINNING, SWT.NORMAL, false, false)); - - fFileText = new Text(group, SWT.SINGLE | SWT.BORDER); - gd = new GridData(SWT.FILL, SWT.NORMAL, true, false); - gd.horizontalSpan = 4; - fFileText.setLayoutData(gd); - fFileText.setFont(parent.getFont()); - - Label spacer = new Label(group,SWT.NONE); - gd = new GridData(SWT.FILL, SWT.NORMAL, true, false); - gd.horizontalSpan=2; - spacer.setLayoutData(gd); - fWorkspaceBrowse = createPushButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_20, null); - fFileBrowse = createPushButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_21, null); - fVariables = createPushButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_22, null); - - spacer = new Label(group,SWT.NONE); - spacer.setLayoutData(new GridData(SWT.FILL, SWT.NORMAL, false, false)); - fAppend = createCheckButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_23); - gd = new GridData(SWT.LEFT, SWT.TOP, true, false); - gd.horizontalSpan = 4; - fAppend.setLayoutData(gd); - - fFileOutput.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - boolean enabled = fFileOutput.getSelection(); - fFileText.setEnabled(enabled); - fFileBrowse.setEnabled(enabled); - fWorkspaceBrowse.setEnabled(enabled); - fVariables.setEnabled(enabled); - fAppend.setEnabled(enabled); - updateLaunchConfigurationDialog(); - } - }); - - fAppend.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider()); - dialog.setTitle(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_24); - dialog.setMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_25); - dialog.setInput(ResourcesPlugin.getWorkspace().getRoot()); - dialog.setComparator(new ResourceComparator(ResourceComparator.NAME)); - int buttonId = dialog.open(); - if (buttonId == IDialogConstants.OK_ID) { - IResource resource = (IResource) dialog.getFirstResult(); - String arg = resource.getFullPath().toString(); - String fileLoc = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", arg); //$NON-NLS-1$ - fFileText.setText(fileLoc); - } - } - }); - - 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); - } - } - }); - - fFileText.addModifyListener(new ModifyListener() { - public void modifyText(ModifyEvent e) { - updateLaunchConfigurationDialog(); - } - }); - - 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) { - } - }); - } - - /* - * Creates a check button in the given composite with the given text - */ - protected Button createButton(Composite parent, SelectionListener listener, String text, String tooltipText, int columns) { - Button button= createCheckButton(parent, text); - button.setToolTipText(tooltipText); - button.addSelectionListener(listener); - GridData gd= new GridData(GridData.FILL_HORIZONTAL); - gd.horizontalSpan = columns; - button.setLayoutData(gd); - return button; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { - StringBuffer buffer= new StringBuffer(IExternalToolConstants.BUILD_TYPE_FULL); - buffer.append(','); - buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL); - buffer.append(','); - configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString()); - configuration.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, false); - configuration.setAttribute(IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED, true); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration configuration) { - fConfiguration= configuration; - if (fCreateBuildScheduleComponent) { - afterClean.setSelection(false); - manualBuild.setSelection(false); - autoBuildButton.setSelection(false); - fDuringClean.setSelection(false); - } - - String buildKindString= null; - String buildScope= null; - try { - buildKindString= configuration.getAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, ""); //$NON-NLS-1$ - buildScope= configuration.getAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, (String)null); - } catch (CoreException e) { - } - - workingSetButton.setSelection(buildScope != null); - workingSetButton.setEnabled(buildScope != null); - - if (buildScope != null) { - workingSet = RefreshTab.getWorkingSet(buildScope); - } - - if (fCreateBuildScheduleComponent) { - int buildTypes[]= BuilderUtils.buildTypesToArray(buildKindString); - for (int i = 0; i < buildTypes.length; i++) { - switch (buildTypes[i]) { - case IncrementalProjectBuilder.FULL_BUILD: - afterClean.setSelection(true); - break; - case IncrementalProjectBuilder.INCREMENTAL_BUILD: - manualBuild.setSelection(true); - break; - case IncrementalProjectBuilder.AUTO_BUILD: - autoBuildButton.setSelection(true); - break; - case IncrementalProjectBuilder.CLEAN_BUILD: - fDuringClean.setSelection(true); - break; - } - } - } - - boolean enabled= true; - if (fCreateBuildScheduleComponent) { - enabled= autoBuildButton.getSelection() || manualBuild.getSelection(); - } - workingSetButton.setEnabled(enabled); - specifyResources.setEnabled(enabled && workingSetButton.getSelection()); - updateRunInBackground(configuration); - updateConsoleOutput(configuration); - } - - protected void updateRunInBackground(ILaunchConfiguration configuration) { - fLaunchInBackgroundButton.setSelection(ExternalToolsCoreUtil.isAsynchronousBuild(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); - fFileText.setEnabled(haveOutputFile); - fFileBrowse.setEnabled(haveOutputFile); - fWorkspaceBrowse.setEnabled(haveOutputFile); - fVariables.setEnabled(haveOutputFile); - fAppend.setEnabled(haveOutputFile); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - if (fCreateBuildScheduleComponent) { - StringBuffer buffer= new StringBuffer(); - if (afterClean.getSelection()) { - buffer.append(IExternalToolConstants.BUILD_TYPE_FULL).append(','); - } - if (manualBuild.getSelection()){ - buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL).append(','); - } - if (autoBuildButton.getSelection()) { - buffer.append(IExternalToolConstants.BUILD_TYPE_AUTO).append(','); - } - - if (fDuringClean.getSelection()) { - buffer.append(IExternalToolConstants.BUILD_TYPE_CLEAN); - } - configuration.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString()); - } - if (workingSetButton.getSelection()) { - String scope = RefreshTab.getRefreshAttribute(workingSet); - configuration.setAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, scope); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_BUILDER_SCOPE, (String)null); - } - configuration.setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, fLaunchInBackgroundButton.getSelection()); - - 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 ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Build_Options_9; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return PlatformUI.getWorkbench().getSharedImages().getImage(IDE.SharedImages.IMG_OBJ_PROJECT); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration launchConfig) { - setErrorMessage(null); - setMessage(null); - if (fCreateBuildScheduleComponent) { - boolean buildKindSelected= afterClean.getSelection() || manualBuild.getSelection() || autoBuildButton.getSelection() || fDuringClean.getSelection(); - if (!buildKindSelected) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_buildKindError); - return false; - } - } - if (workingSetButton.getSelection() && (workingSet == null || workingSet.getElements().length == 0)) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_16); - return false; - } - - return validateRedirectFile(); - } - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave() - */ - public boolean canSave() { - return isValid(null); - } - - /** - * Prompts the user to select the working set that triggers the build. - */ - private void selectResources() { - IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager(); - - if (workingSet == null){ - workingSet = workingSetManager.createWorkingSet(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_15, new IAdaptable[0]); - } - IWorkingSetEditWizard wizard= workingSetManager.createWorkingSetEditWizard(workingSet); - WizardDialog dialog = new WizardDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell(), wizard); - dialog.create(); - - if (dialog.open() == Window.CANCEL) { - return; - } - workingSet = wizard.getSelection(); - updateLaunchConfigurationDialog(); - } - /* (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 - } - - private boolean validateRedirectFile() { - if(fFileOutput.getSelection()) { - int len = fFileText.getText().trim().length(); - if (len == 0) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_26); - return false; - } - } - return true; - } -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java deleted file mode 100644 index bd7651f0c..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.java +++ /dev/null @@ -1,100 +0,0 @@ -/********************************************************************** - * Copyright (c) 2000, 2010 IBM Corporation and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM - Initial API and implementation - * dakshinamurthy.karra@gmail.com - bug 165371 - **********************************************************************/ -package org.eclipse.ui.externaltools.internal.launchConfigurations; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsLaunchConfigurationMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsLaunchConfigurationMessages";//$NON-NLS-1$ - - public static String ExternalToolsMainTab__Location___2; - public static String ExternalToolsMainTab__Browse_Workspace____3; - public static String ExternalToolsMainTab_Brows_e_File_System____4; - public static String ExternalToolsMainTab_Working__Directory__5; - public static String ExternalToolsMainTab_Browse_Wor_kspace____6; - public static String ExternalToolsMainTab_Browse_F_ile_System____7; - public static String ExternalToolsMainTab_Error_reading_configuration_10; - public static String ExternalToolsMainTab__Main_17; - public static String ExternalToolsMainTab_External_tool_location_cannot_be_empty_18; - public static String ExternalToolsMainTab_External_tool_location_does_not_exist_19; - public static String ExternalToolsMainTab_External_tool_location_specified_is_not_a_file_20; - public static String ExternalToolsMainTab_External_tool_working_directory_does_not_exist_or_is_invalid_21; - public static String ExternalToolsMainTab_Select_a_resource_22; - public static String ExternalToolsMainTab_23; - public static String ExternalToolsMainTab__Arguments___1; - public static String ExternalToolsMainTab_Varia_bles____2; - public static String ExternalToolsMainTab_3; - public static String ExternalToolsMainTab_Error_reading_configuration_7; - public static String ExternalToolsMainTab_Not_a_directory; - public static String ExternalToolsMainTab_30; - public static String ExternalToolsMainTab_31; - public static String ExternalToolsMainTab_32; - - public static String ExternalToolsBuildTab_1; - public static String ExternalToolsBuildTab_2; - public static String ExternalToolsBuildTab_3; - public static String ExternalToolsBuildTab_4; - public static String ExternalToolsBuildTab_5; - public static String ExternalToolsBuildTab_6; - public static String ExternalToolsBuildTab_7; - public static String ExternalToolsBuildTab_8; - public static String ExternalToolsBuildTab_9; - - // these messages are present for compatibility with 3.4 - see bug 301183 - public static String ExternalToolsUtil_Location_not_specified_by__0__1; - public static String ExternalToolsUtil_invalidLocation__0_; - public static String ExternalToolsUtil_invalidDirectory__0_; - // end - - public static String ExternalToolsBuilderTab_Run_this_builder_for__1; - public static String ExternalToolsBuilderTab__Full_builds_2; - public static String ExternalToolsBuilderTab_Full; - public static String ExternalToolsBuilderTab__Incremental_builds_4; - public static String ExternalToolsBuilderTab_Inc; - public static String ExternalToolsBuilderTab__Auto_builds__Not_recommended__6; - public static String ExternalToolsBuilderTab_Auto; - public static String ExternalToolsBuilderTab_Build_Options_9; - public static String ExternalToolsBuilderTab_workingSet_label; - public static String ExternalToolsBuilderTab_workingSet_tooltip; - public static String ExternalToolsBuilderTab_buildKindError; - public static String ExternalToolsBuilderTab_14; - public static String ExternalToolsBuilderTab_13; - public static String ExternalToolsBuilderTab_16; - public static String ExternalToolsBuilderTab_15; - public static String ExternalToolsBuilderTab_0; - public static String ExternalToolsBuilderTab_1; - public static String ExternalToolsBuilderTab_2; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ExternalToolsLaunchConfigurationMessages.class); - } - - public static String ExternalToolsBuilderTab_17; - - public static String ExternalToolsBuilderTab_18; - - public static String ExternalToolsBuilderTab_19; - - public static String ExternalToolsBuilderTab_20; - - public static String ExternalToolsBuilderTab_21; - - public static String ExternalToolsBuilderTab_22; - - public static String ExternalToolsBuilderTab_23; - - public static String ExternalToolsBuilderTab_24; - - public static String ExternalToolsBuilderTab_25; - - public static String ExternalToolsBuilderTab_26; -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties deleted file mode 100644 index b4374c9fe..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsLaunchConfigurationMessages.properties +++ /dev/null @@ -1,79 +0,0 @@ -############################################################################### -# Copyright (c) 2000, 2010 IBM Corporation and others. -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v1.0 -# which accompanies this distribution, and is available at -# http://www.eclipse.org/legal/epl-v10.html -# -# Contributors: -# IBM Corporation - initial API and implementation -# dakshinamurthy.karra@gmail.com - bug 165371 -############################################################################### - -ExternalToolsMainTab__Location___2=&Location: -ExternalToolsMainTab__Browse_Workspace____3=Browse Works&pace... -ExternalToolsMainTab_Brows_e_File_System____4=Brows&e File System... -ExternalToolsMainTab_Working__Directory__5=Working &Directory: -ExternalToolsMainTab_Browse_Wor_kspace____6=Browse Wor&kspace... -ExternalToolsMainTab_Browse_F_ile_System____7=Browse File Syste&m... -ExternalToolsMainTab_Error_reading_configuration_10=Error reading configuration -ExternalToolsMainTab__Main_17=Main -ExternalToolsMainTab_External_tool_location_cannot_be_empty_18=External tool location cannot be empty -ExternalToolsMainTab_External_tool_location_does_not_exist_19=External tool location does not exist -ExternalToolsMainTab_External_tool_location_specified_is_not_a_file_20=External tool location specified is not a file -ExternalToolsMainTab_External_tool_working_directory_does_not_exist_or_is_invalid_21=External tool working directory does not exist or is invalid -ExternalToolsMainTab_Select_a_resource_22=Select a resource: -ExternalToolsMainTab_23=Select a working directory: -ExternalToolsMainTab__Arguments___1=&Arguments: -ExternalToolsMainTab_Varia_bles____2=Variable&s... -ExternalToolsMainTab_3=Note: Enclose an argument containing spaces using double-quotes (\"). -ExternalToolsMainTab_Error_reading_configuration_7=Error reading configuration -ExternalToolsMainTab_Not_a_directory=The specified location is not a directory -ExternalToolsMainTab_30=Please specify the location of the external tool you would like to configure. -ExternalToolsMainTab_31=Var&iables... -ExternalToolsMainTab_32=Varia&bles... - -ExternalToolsBuildTab_1=&Build before launch -ExternalToolsBuildTab_2=The &entire workspace -ExternalToolsBuildTab_3=The &project containing the selected resource -ExternalToolsBuildTab_4=&Specific projects -ExternalToolsBuildTab_5=P&rojects... -ExternalToolsBuildTab_6=Include referenced pro&jects -ExternalToolsBuildTab_7=Select &Projects: -ExternalToolsBuildTab_8=Build -ExternalToolsBuildTab_9=No projects specified - -# these messages are present for compatibility with 3.4 - see bug 301183 -ExternalToolsUtil_Location_not_specified_by__0__1=Location not specified by {0} -ExternalToolsUtil_invalidLocation__0_ = The file does not exist for the external tool named {0}. -ExternalToolsUtil_invalidDirectory__0_ = The working directory {0} does not exist for the external tool named {1}. -# end - -ExternalToolsBuilderTab_Run_this_builder_for__1=Run the builder: -ExternalToolsBuilderTab__Full_builds_2=A&fter a \"Clean\" -ExternalToolsBuilderTab_Full=Runs on the first build that occurs after a clean. -ExternalToolsBuilderTab__Incremental_builds_4=&During manual builds -ExternalToolsBuilderTab_Inc=Runs whenever the user invokes a build (but not for auto-build). -ExternalToolsBuilderTab__Auto_builds__Not_recommended__6=During a&uto builds -ExternalToolsBuilderTab_Auto=Runs whenever a resource in the workspace is modified if autobuilding is enabled. Enabling this option should be paired with a specifying a resource working set. -ExternalToolsBuilderTab_Build_Options_9=&Build Options -ExternalToolsBuilderTab_workingSet_label=Specify working set of &relevant resources -ExternalToolsBuilderTab_workingSet_tooltip=The working set of resources that if changed from a manual or auto build will trigger the external tool builder -ExternalToolsBuilderTab_buildKindError=At least one type of build kind must be selected -ExternalToolsBuilderTab_14=Launch in bac&kground -ExternalToolsBuilderTab_13=&Specify Resources... -ExternalToolsBuilderTab_16=Must select resources in working set. -ExternalToolsBuilderTab_15=workingSet -ExternalToolsBuilderTab_17=Standard Input and Output -ExternalToolsBuilderTab_18=Allocate &Console (necessary for input) -ExternalToolsBuilderTab_19=Fi&le -ExternalToolsBuilderTab_0=During a "&Clean" -ExternalToolsBuilderTab_1=Runs when a "clean" has been initiated -ExternalToolsBuilderTab_2=Note: Not applied for the builds during or after a \"Clean\" -ExternalToolsBuilderTab_20=Browse Worksp&ace... -ExternalToolsBuilderTab_21=Browse File Syste&m... -ExternalToolsBuilderTab_22=Varia&bles... -ExternalToolsBuilderTab_23=A&ppend -ExternalToolsBuilderTab_24=Select a Resource -ExternalToolsBuilderTab_25=Select a resource to redirect output to: -ExternalToolsBuilderTab_26=No file specified for process output diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java deleted file mode 100644 index d1bf2d994..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java +++ /dev/null @@ -1,646 +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.ui.externaltools.internal.launchConfigurations; - - -import java.io.File; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -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.ui.AbstractLaunchConfigurationTab; -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.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.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.DirectoryDialog; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.ContainerSelectionDialog; -import org.eclipse.ui.dialogs.ResourceSelectionDialog; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsImages; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; - -/** - * The external tools main tab allows the user to configure primary attributes - * of external tool launch configurations such as the location, working directory, - * and arguments. - */ -public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTab { - public final static String FIRST_EDIT = "editedByExternalToolsMainTab"; //$NON-NLS-1$ - - protected Text locationField; - protected Text workDirectoryField; - protected Button fileLocationButton; - protected Button workspaceLocationButton; - protected Button variablesLocationButton; - protected Button fileWorkingDirectoryButton; - protected Button workspaceWorkingDirectoryButton; - protected Button variablesWorkingDirectoryButton; - - protected Text argumentField; - protected Button argumentVariablesButton; - - protected SelectionAdapter selectionAdapter; - - protected boolean fInitializing= false; - private boolean userEdited= false; - - protected WidgetListener fListener= new WidgetListener(); - - /** - * A listener to update for text modification and widget selection. - */ - protected class WidgetListener extends SelectionAdapter implements ModifyListener { - public void modifyText(ModifyEvent e) { - if (!fInitializing) { - setDirty(true); - userEdited= true; - updateLaunchConfigurationDialog(); - } - } - public void widgetSelected(SelectionEvent e) { - setDirty(true); - Object source= e.getSource(); - if (source == workspaceLocationButton) { - handleWorkspaceLocationButtonSelected(); - } else if (source == fileLocationButton) { - handleFileLocationButtonSelected(); - } else if (source == workspaceWorkingDirectoryButton) { - handleWorkspaceWorkingDirectoryButtonSelected(); - } else if (source == fileWorkingDirectoryButton) { - handleFileWorkingDirectoryButtonSelected(); - } else if (source == argumentVariablesButton) { - handleVariablesButtonSelected(argumentField); - } else if (source == variablesLocationButton) { - handleVariablesButtonSelected(locationField); - } else if (source == variablesWorkingDirectoryButton) { - handleVariablesButtonSelected(workDirectoryField); - } - } - - } - - /* (non-Javadoc) - * @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); - mainComposite.setFont(parent.getFont()); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - mainComposite.setLayout(layout); - mainComposite.setLayoutData(gridData); - - createLocationComponent(mainComposite); - createWorkDirectoryComponent(mainComposite); - createArgumentComponent(mainComposite); - createVerticalSpacer(mainComposite, 1); - - Dialog.applyDialogFont(parent); - } - - /** - * Creates the controls needed to edit the location - * attribute of an external tool - * - * @param parent the composite to create the controls in - */ - protected void createLocationComponent(Composite parent) { - Group group = new Group(parent, SWT.NONE); - String locationLabel = getLocationLabel(); - group.setText(locationLabel); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - group.setLayout(layout); - group.setLayoutData(gridData); - - locationField = new Text(group, SWT.BORDER); - gridData = new GridData(GridData.FILL_HORIZONTAL); - gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - locationField.setLayoutData(gridData); - locationField.addModifyListener(fListener); - addControlAccessibleListener(locationField, group.getText()); - - Composite buttonComposite = new Composite(group, SWT.NONE); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 3; - gridData = new GridData(GridData.HORIZONTAL_ALIGN_END); - buttonComposite.setLayout(layout); - buttonComposite.setLayoutData(gridData); - buttonComposite.setFont(parent.getFont()); - - workspaceLocationButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Browse_Workspace____3, null); - workspaceLocationButton.addSelectionListener(fListener); - addControlAccessibleListener(workspaceLocationButton, group.getText() + " " + workspaceLocationButton.getText()); //$NON-NLS-1$ - - fileLocationButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Brows_e_File_System____4, null); - fileLocationButton.addSelectionListener(fListener); - addControlAccessibleListener(fileLocationButton, group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$ - - variablesLocationButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_31, null); - variablesLocationButton.addSelectionListener(fListener); - addControlAccessibleListener(variablesLocationButton, group.getText() + " " + variablesLocationButton.getText()); //$NON-NLS-1$ - } - - /** - * Returns the label used for the location widgets. Subclasses may wish to override. - */ - protected String getLocationLabel() { - return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Location___2; - } - - /** - * Creates the controls needed to edit the working directory - * attribute of an external tool - * - * @param parent the composite to create the controls in - */ - protected void createWorkDirectoryComponent(Composite parent) { - Group group = new Group(parent, SWT.NONE); - String groupName = getWorkingDirectoryLabel(); - group.setText(groupName); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_HORIZONTAL); - group.setLayout(layout); - group.setLayoutData(gridData); - - workDirectoryField = new Text(group, SWT.BORDER); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - workDirectoryField.setLayoutData(data); - workDirectoryField.addModifyListener(fListener); - addControlAccessibleListener(workDirectoryField,group.getText()); - - Composite buttonComposite = new Composite(group, SWT.NONE); - layout = new GridLayout(); - layout.marginWidth = 0; - layout.marginHeight = 0; - layout.numColumns = 3; - gridData = new GridData(GridData.HORIZONTAL_ALIGN_END); - buttonComposite.setLayout(layout); - buttonComposite.setLayoutData(gridData); - buttonComposite.setFont(parent.getFont()); - - workspaceWorkingDirectoryButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Browse_Wor_kspace____6, null); - workspaceWorkingDirectoryButton.addSelectionListener(fListener); - addControlAccessibleListener(workspaceWorkingDirectoryButton, group.getText() + " " + workspaceWorkingDirectoryButton.getText()); //$NON-NLS-1$ - - fileWorkingDirectoryButton= createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Browse_F_ile_System____7, null); - fileWorkingDirectoryButton.addSelectionListener(fListener); - addControlAccessibleListener(fileWorkingDirectoryButton, group.getText() + " " + fileLocationButton.getText()); //$NON-NLS-1$ - - variablesWorkingDirectoryButton = createPushButton(buttonComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_32, null); - variablesWorkingDirectoryButton.addSelectionListener(fListener); - addControlAccessibleListener(variablesWorkingDirectoryButton, group.getText() + " " + variablesWorkingDirectoryButton.getText()); //$NON-NLS-1$ - } - - /** - * Return the String to use as the label for the working directory field. - * Subclasses may wish to override. - */ - protected String getWorkingDirectoryLabel() { - return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Working__Directory__5; - } - - /** - * Creates the controls needed to edit the argument and - * prompt for argument attributes of an external tool - * - * @param parent the composite to create the controls in - */ - protected void createArgumentComponent(Composite parent) { - Group group = new Group(parent, SWT.NONE); - String groupName = ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Arguments___1; - group.setText(groupName); - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - GridData gridData = new GridData(GridData.FILL_BOTH); - group.setLayout(layout); - group.setLayoutData(gridData); - group.setFont(parent.getFont()); - - argumentField = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL); - gridData = new GridData(GridData.FILL_BOTH); - gridData.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; - gridData.heightHint = 30; - argumentField.setLayoutData(gridData); - argumentField.addModifyListener(fListener); - addControlAccessibleListener(argumentField, group.getText()); - - Composite composite = new Composite(group, SWT.NONE); - layout = new GridLayout(); - layout.numColumns= 1; - layout.marginHeight= 0; - layout.marginWidth= 0; - gridData = new GridData(GridData.HORIZONTAL_ALIGN_END); - composite.setLayout(layout); - composite.setLayoutData(gridData); - composite.setFont(parent.getFont()); - - argumentVariablesButton= createPushButton(composite, ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Varia_bles____2, null); - argumentVariablesButton.addSelectionListener(fListener); - addControlAccessibleListener(argumentVariablesButton, argumentVariablesButton.getText()); // need to strip the mnemonic from buttons - - Label instruction = new Label(group, SWT.NONE); - instruction.setText(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_3); - gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL); - gridData.horizontalSpan = 2; - instruction.setLayoutData(gridData); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void setDefaults(ILaunchConfigurationWorkingCopy configuration) { - configuration.setAttribute(FIRST_EDIT, true); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) - */ - public void initializeFrom(ILaunchConfiguration configuration) { - fInitializing= true; - updateLocation(configuration); - updateWorkingDirectory(configuration); - updateArgument(configuration); - fInitializing= false; - setDirty(false); - } - - /** - * Updates the working directory widgets to match the state of the given launch - * configuration. - */ - protected void updateWorkingDirectory(ILaunchConfiguration configuration) { - String workingDir= ""; //$NON-NLS-1$ - try { - workingDir= configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_10, ce); - } - workDirectoryField.setText(workingDir); - } - - /** - * Updates the location widgets to match the state of the given launch - * configuration. - */ - protected void updateLocation(ILaunchConfiguration configuration) { - String location= ""; //$NON-NLS-1$ - try { - location= configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_10, ce); - } - locationField.setText(location); - } - - /** - * Updates the argument widgets to match the state of the given launch - * configuration. - */ - protected void updateArgument(ILaunchConfiguration configuration) { - String arguments= ""; //$NON-NLS-1$ - try { - arguments= configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, ""); //$NON-NLS-1$ - } catch (CoreException ce) { - ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_7, ce); - } - argumentField.setText(arguments); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void performApply(ILaunchConfigurationWorkingCopy configuration) { - String location= locationField.getText().trim(); - if (location.length() == 0) { - configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, (String)null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, location); - } - - String workingDirectory= workDirectoryField.getText().trim(); - if (workingDirectory.length() == 0) { - configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String)null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, workingDirectory); - } - - String arguments= argumentField.getText().trim(); - if (arguments.length() == 0) { - configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, (String)null); - } else { - configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments); - } - - if(userEdited) { - configuration.setAttribute(FIRST_EDIT, (String)null); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName() - */ - public String getName() { - return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Main_17; - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration) - */ - public boolean isValid(ILaunchConfiguration launchConfig) { - setErrorMessage(null); - setMessage(null); - boolean newConfig = false; - try { - newConfig = launchConfig.getAttribute(FIRST_EDIT, false); - } catch (CoreException e) { - //assume false is correct - } - return validateLocation(newConfig) && validateWorkDirectory(); - } - - /** - * Validates the content of the location field. - */ - protected boolean validateLocation(boolean newConfig) { - String location = locationField.getText().trim(); - if (location.length() < 1) { - if (newConfig) { - setErrorMessage(null); - setMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_30); - } else { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_location_cannot_be_empty_18); - setMessage(null); - } - return false; - } - - String expandedLocation= null; - try { - expandedLocation= resolveValue(location); - if (expandedLocation == null) { //a variable that needs to be resolved at runtime - return true; - } - } catch (CoreException e) { - setErrorMessage(e.getStatus().getMessage()); - return false; - } - - File file = new File(expandedLocation); - if (!file.exists()) { // The file does not exist. - if (!newConfig) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_location_does_not_exist_19); - } - return false; - } - if (!file.isFile()) { - if (!newConfig) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_location_specified_is_not_a_file_20); - } - return false; - } - return true; - } - - /** - * Validates the variables of the given string to determine if all variables are valid - * - * @param expression expression with variables - * @exception CoreException if a variable is specified that does not exist - */ - private void validateVaribles(String expression) throws CoreException { - IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); - manager.validateStringVariables(expression); - } - - private String resolveValue(String expression) throws CoreException { - String expanded= null; - try { - expanded= getValue(expression); - } catch (CoreException e) { //possibly just a variable that needs to be resolved at runtime - validateVaribles(expression); - return null; - } - return expanded; - } - - /** - * Validates the value of the given string to determine if any/all variables are valid - * - * @param expression expression with variables - * @return whether the expression contained any variable values - * @exception CoreException if variable resolution fails - */ - private String getValue(String expression) throws CoreException { - IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager(); - return manager.performStringSubstitution(expression); - } - - /** - * Validates the content of the working directory field. - */ - protected boolean validateWorkDirectory() { - String dir = workDirectoryField.getText().trim(); - if (dir.length() <= 0) { - return true; - } - - String expandedDir= null; - try { - expandedDir= resolveValue(dir); - if (expandedDir == null) { //a variable that needs to be resolved at runtime - return true; - } - } catch (CoreException e) { - setErrorMessage(e.getStatus().getMessage()); - return false; - } - - File file = new File(expandedDir); - if (!file.exists()) { // The directory does not exist. - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_External_tool_working_directory_does_not_exist_or_is_invalid_21); - return false; - } - if (!file.isDirectory()) { - setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Not_a_directory); - return false; - } - return true; - } - - /** - * Prompts the user to choose a location from the filesystem and - * sets the location as the full path of the selected file. - */ - protected void handleFileLocationButtonSelected() { - FileDialog fileDialog = new FileDialog(getShell(), SWT.NONE); - fileDialog.setFileName(locationField.getText()); - String text= fileDialog.open(); - if (text != null) { - locationField.setText(text); - } - } - - /** - * Prompts the user for a workspace location within the workspace and sets - * the location as a String containing the workspace_loc variable or - * null if no location was obtained from the user. - */ - protected void handleWorkspaceLocationButtonSelected() { - ResourceSelectionDialog dialog; - dialog = new ResourceSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Select_a_resource_22); - dialog.open(); - Object[] results = dialog.getResult(); - if (results == null || results.length < 1) { - return; - } - IResource resource = (IResource)results[0]; - locationField.setText(newVariableExpression("workspace_loc", resource.getFullPath().toString())); //$NON-NLS-1$ - } - - /** - * Prompts the user for a working directory location within the workspace - * and sets the working directory as a String containing the workspace_loc - * variable or null if no location was obtained from the user. - */ - protected void handleWorkspaceWorkingDirectoryButtonSelected() { - ContainerSelectionDialog containerDialog; - containerDialog = new ContainerSelectionDialog( - getShell(), - ResourcesPlugin.getWorkspace().getRoot(), - false, - ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_23); - containerDialog.open(); - Object[] resource = containerDialog.getResult(); - String text= null; - if (resource != null && resource.length > 0) { - text= newVariableExpression("workspace_loc", ((IPath)resource[0]).toString()); //$NON-NLS-1$ - } - if (text != null) { - workDirectoryField.setText(text); - } - } - - /** - * Returns a new variable expression with the given variable and the given argument. - * @see IStringVariableManager#generateVariableExpression(String, String) - */ - protected String newVariableExpression(String varName, String arg) { - return VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression(varName, arg); - } - - /** - * Prompts the user to choose a working directory from the filesystem. - */ - protected void handleFileWorkingDirectoryButtonSelected() { - DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SAVE); - dialog.setMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_23); - dialog.setFilterPath(workDirectoryField.getText()); - String text= dialog.open(); - if (text != null) { - workDirectoryField.setText(text); - } - } - - /** - * A variable entry button has been pressed for the given text - * field. Prompt the user for a variable and enter the result - * in the given field. - */ - private void handleVariablesButtonSelected(Text textField) { - String variable = getVariable(); - if (variable != null) { - textField.insert(variable); - } - } - - /** - * Prompts the user to choose and configure a variable and returns - * the resulting string, suitable to be used as an attribute. - */ - private String getVariable() { - StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell()); - dialog.open(); - return dialog.getVariableExpression(); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage() - */ - public Image getImage() { - return ExternalToolsImages.getImage(org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.IMG_TAB_MAIN); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) - */ - public void activated(ILaunchConfigurationWorkingCopy workingCopy) { - } - - /* - * Fix for Bug 60163 Accessibility: New Builder Dialog missing object info for textInput controls - */ - public void addControlAccessibleListener(Control control, String controlName) { - //strip mnemonic (&) - String[] strs = controlName.split("&"); //$NON-NLS-1$ - StringBuffer stripped = new StringBuffer(); - for (int i = 0; i < strs.length; i++) { - stripped.append(strs[i]); - } - control.getAccessible().addAccessibleListener(new ControlAccessibleListener(stripped.toString())); - } - - private class ControlAccessibleListener extends AccessibleAdapter { - private String controlName; - ControlAccessibleListener(String name) { - controlName = name; - } - public void getName(AccessibleEvent e) { - e.result = controlName; - } - - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java deleted file mode 100644 index 8f7a871b2..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsUtil.java +++ /dev/null @@ -1,147 +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 - * Keith Seitz (keiths@redhat.com) - Bug 27243 (environment variables contribution) - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.launchConfigurations; - - -import org.eclipse.core.externaltools.internal.launchConfigurations.ExternalToolsCoreUtil; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Status; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; - -/** - * Utilities for external tool launch configurations. - *

                              - * This class it not intended to be instantiated. - *

                              - */ -public class ExternalToolsUtil { - - /** - * Throws a core exception with an error status object built from - * the given message, lower level exception, and error code. - * - * @param message the status message - * @param exception lower level exception associated with the - * error, or null if none - * @param code error code - */ - protected static void abort(String message, Throwable exception, int code) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, code, message, exception)); - } - - /** - * Expands and returns the location attribute of the given launch - * configuration. The location is - * verified to point to an existing file, in the local file system. - * - * @param configuration launch configuration - * @return an absolute path to a file in the local file system - * @throws CoreException if unable to retrieve the associated launch - * configuration attribute, if unable to resolve any variables, or if the - * resolved location does not point to an existing file in the local file - * system - */ - public static IPath getLocation(ILaunchConfiguration configuration) throws CoreException { - return ExternalToolsCoreUtil.getLocation(configuration); - } - - /** - * Returns a boolean specifying whether or not output should be captured for - * the given configuration - * - * @param configuration the configuration from which the value will be - * extracted - * @return boolean specifying whether or not output should be captured - * @throws CoreException if unable to access the associated attribute - */ - public static boolean getCaptureOutput(ILaunchConfiguration configuration) throws CoreException { - return ExternalToolsCoreUtil.getCaptureOutput(configuration); - } - - /** - * Expands and returns the working directory attribute of the given launch - * configuration. Returns null if a working directory is not - * specified. If specified, the working is verified to point to an existing - * directory in the local file system. - * - * @param configuration launch configuration - * @return an absolute path to a directory in the local file system, or - * null if unspecified - * @throws CoreException if unable to retrieve the associated launch - * configuration attribute, if unable to resolve any variables, or if the - * resolved location does not point to an existing directory in the local - * file system - */ - public static IPath getWorkingDirectory(ILaunchConfiguration configuration) throws CoreException { - return ExternalToolsCoreUtil.getWorkingDirectory(configuration); - } - - /** - * Expands and returns the arguments attribute of the given launch - * configuration. Returns null if arguments are not specified. - * - * @param configuration launch configuration - * @return an array of resolved arguments, or null if - * unspecified - * @throws CoreException if unable to retrieve the associated launch - * configuration attribute, or if unable to resolve any variables - */ - public static String[] getArguments(ILaunchConfiguration configuration) throws CoreException { - return ExternalToolsCoreUtil.getArguments(configuration); - } - - /** - * Returns whether the given launch configuration is enabled. This property - * is intended only to apply to external tool builder configurations and - * determines whether the project builder will launch the configuration - * when it builds. - * - * @param configuration the configuration for which the enabled state should - * be determined. - * @return whether the given configuration is enabled to be run when a build occurs. - * @throws CoreException if unable to access the associated attribute - */ - public static boolean isBuilderEnabled(ILaunchConfiguration configuration) throws CoreException { - return ExternalToolsCoreUtil.isBuilderEnabled(configuration); - } - - /** - * Returns the collection of resources for the build scope as specified by the given launch configuration. - * - * @param configuration launch configuration - * @throws CoreException if an exception occurs while retrieving the resources - */ - public static IResource[] getResourcesForBuildScope(ILaunchConfiguration configuration) throws CoreException { - return ExternalToolsCoreUtil.getResourcesForBuildScope(configuration); - } - - /** - * Parses the argument text into an array of individual - * strings using the space character as the delimiter. - * An individual argument containing spaces must have a - * double quote (") at the start and end. Two double - * quotes together is taken to mean an embedded double - * quote in the argument text. - * - * @param arguments the arguments as one string - * @return the array of arguments - */ - public static String[] parseStringIntoList(String arguments) { - return ExternalToolsCoreUtil.parseStringIntoList(arguments); - } - -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java deleted file mode 100644 index ab3f41e18..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java +++ /dev/null @@ -1,47 +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.ui.externaltools.internal.launchConfigurations; - -import java.util.Comparator; - -public class IgnoreWhiteSpaceComparator 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; - int i1 = 0; - int i2 = 0; - int l1 = one.length(); - int l2 = two.length(); - char ch1 = ' '; - char ch2 = ' '; - while (i1 < l1 && i2 < l2) { - while (i1 < l1 && Character.isWhitespace(ch1 = one.charAt(i1))) { - i1++; - } - while (i2 < l2 && Character.isWhitespace(ch2 = two.charAt(i2))) { - i2++; - } - if (i1 == l1 && i2 == l2) { - return 0; - } - if (ch1 != ch2) { - return -1; - } - i1++; - i2++; - } - return 0; - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java deleted file mode 100644 index a92fc2da6..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/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.ui.externaltools.internal.launchConfigurations; - -import java.util.Comparator; - -import org.eclipse.debug.ui.RefreshTab; -import org.eclipse.ui.IWorkingSet; - -/** - * Comparator for refresh scope launch configuration attribute - * ATTR_REFRESH_SCOPE. - */ -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.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/ExternalToolMenuDelegate.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/ExternalToolMenuDelegate.java deleted file mode 100644 index a5dc2081c..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/ExternalToolMenuDelegate.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 Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.menu; - -import org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction; -import org.eclipse.jface.action.IAction; -import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants; - -/** - * This action delegate is responsible for producing the - * Run > External Tools sub menu contents, which includes - * an items to run last tool, favorite tools, and show the - * external tools launch configuration dialog. - */ -public class ExternalToolMenuDelegate extends AbstractLaunchToolbarAction { - - /** - * Creates the action delegate - */ - public ExternalToolMenuDelegate() { - super(IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_GROUP); - } - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.actions.AbstractLaunchToolbarAction#getOpenDialogAction() - */ - protected IAction getOpenDialogAction() { - IAction action= new OpenExternalToolsConfigurations(); - action.setActionDefinitionId("org.eclipse.ui.externalTools.commands.OpenExternalToolsConfigurations"); //$NON-NLS-1$ - return action; - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/OpenExternalToolsConfigurations.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/OpenExternalToolsConfigurations.java deleted file mode 100644 index dcb105fd0..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/OpenExternalToolsConfigurations.java +++ /dev/null @@ -1,24 +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.ui.externaltools.internal.menu; - -import org.eclipse.debug.ui.actions.OpenLaunchDialogAction; -import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants; - -/** - * Opens the launch config dialog on the external tools launch group. - */ -public class OpenExternalToolsConfigurations extends OpenLaunchDialogAction { - - public OpenExternalToolsConfigurations() { - super(IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_GROUP); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java deleted file mode 100644 index 82115029d..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java +++ /dev/null @@ -1,185 +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.ui.externaltools.internal.model; - -import java.util.Map; - -import org.eclipse.core.externaltools.internal.model.BuilderCoreUtils; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -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.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.widgets.Shell; - -/** - * Utility methods for working with external tool project builders. - */ -public class BuilderUtils { - - // Extension point constants. - private static final String TAG_CONFIGURATION_MAP = "configurationMap"; //$NON-NLS-1$ - private static final String TAG_SOURCE_TYPE = "sourceType"; //$NON-NLS-1$ - private static final String TAG_BUILDER_TYPE = "builderType"; //$NON-NLS-1$ - - /** - * Returns a launch configuration from the given ICommand arguments. If the - * given arguments are from an old-style external tool, an unsaved working - * copy will be created from the arguments and returned. - * - * @param commandArgs the builder ICommand arguments - * @return a launch configuration, a launch configuration working copy, or - * null if not possible. - */ - public static ILaunchConfiguration configFromBuildCommandArgs(IProject project, Map commandArgs, String[] version) { - return BuilderCoreUtils.configFromBuildCommandArgs(project, commandArgs, version); - } - - /** - * Returns an ICommand from the given launch configuration. - * - * @param project the project the ICommand is relevant to - * @param config the launch configuration to create the command from - * @return the new command. null can be returned if problems occur during - * the translation. - */ - public static ICommand commandFromLaunchConfig(IProject project, ILaunchConfiguration config) { - ICommand newCommand = null; - try { - newCommand = project.getDescription().newCommand(); - newCommand = toBuildCommand(project, config, newCommand); - configureTriggers(config, newCommand); - } catch (CoreException exception) { - Shell shell= ExternalToolsPlugin.getActiveWorkbenchShell(); - if (shell != null) { - MessageDialog.openError(shell, ExternalToolsModelMessages.BuilderUtils_5, ExternalToolsModelMessages.BuilderUtils_6); - } - return null; - } - return newCommand; - } - - public static void configureTriggers(ILaunchConfiguration config, ICommand newCommand) throws CoreException { - BuilderCoreUtils.configureTriggers(config, newCommand); - } - - /** - * Returns whether the given configuration is an "unmigrated" builder. - * Unmigrated builders are external tools that are stored in an old format - * but have not been migrated by the user. Old format builders are always - * translated into launch config working copies in memory, but they're not - * considered "migrated" until the config has been saved and the project spec - * updated. - * @param config the config to examine - * @return whether the given config represents an unmigrated builder - */ - public static boolean isUnmigratedConfig(ILaunchConfiguration config) { - return BuilderCoreUtils.isUnmigratedConfig(config); - } - - /** - * Converts the given config to a build command which is stored in the - * given command. - * - * @return the configured build command - */ - public static ICommand toBuildCommand(IProject project, ILaunchConfiguration config, ICommand command) throws CoreException { - return BuilderCoreUtils.toBuildCommand(project, config, command); - } - - /** - * Returns the type of launch configuration that should be created when - * duplicating the given configuration as a project builder. Queries to see - * if an extension has been specified to explicitly declare the mapping. - */ - public static ILaunchConfigurationType getConfigurationDuplicationType(ILaunchConfiguration config) throws CoreException { - IExtensionPoint ep= Platform.getExtensionRegistry().getExtensionPoint(ExternalToolsPlugin.PLUGIN_ID, IExternalToolConstants.EXTENSION_POINT_CONFIGURATION_DUPLICATION_MAPS); - IConfigurationElement[] elements = ep.getConfigurationElements(); - String sourceType= config.getType().getIdentifier(); - String builderType= null; - for (int i= 0; i < elements.length; i++) { - IConfigurationElement element= elements[i]; - if (element.getName().equals(TAG_CONFIGURATION_MAP) && sourceType.equals(element.getAttribute(TAG_SOURCE_TYPE))) { - builderType= element.getAttribute(TAG_BUILDER_TYPE); - break; - } - } - if (builderType != null) { - ILaunchConfigurationType type= DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(builderType); - if (type != null) { - return type; - } - } - return config.getType(); - } - - /** - * Returns the folder where project builders should be stored or - * null if the folder could not be created - */ - public static IFolder getBuilderFolder(IProject project, boolean create) { - return BuilderCoreUtils.getBuilderFolder(project, create); - } - - /** - * Returns a duplicate of the given configuration. The new configuration - * will be of the same type as the given configuration or of the duplication - * type registered for the given configuration via the extension point - * IExternalToolConstants.EXTENSION_POINT_CONFIGURATION_DUPLICATION_MAPS. - */ - public static ILaunchConfiguration duplicateConfiguration(IProject project, ILaunchConfiguration config) throws CoreException { - Map attributes= config.getAttributes(); - String newName= new StringBuffer(config.getName()).append(ExternalToolsModelMessages.BuilderUtils_7).toString(); - newName= DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(newName); - ILaunchConfigurationType newType= getConfigurationDuplicationType(config); - ILaunchConfigurationWorkingCopy newWorkingCopy= newType.newInstance(getBuilderFolder(project, true), newName); - newWorkingCopy.setAttributes(attributes); - return newWorkingCopy.doSave(); - } - - /** - * Migrates the launch configuration working copy, which is based on an old- - * style external tool builder, to a new, saved launch configuration. The - * returned launch configuration will contain the same attributes as the - * given working copy with the exception of the configuration name, which - * may be changed during the migration. The name of the configuration will - * only be changed if the current name is not a valid name for a saved - * config. - * - * @param workingCopy the launch configuration containing attributes from an - * old-style project builder. - * @return ILaunchConfiguration a new, saved launch configuration whose - * attributes match those of the given working copy as well as possible - * @throws CoreException if an exception occurs while attempting to save the - * new launch configuration - */ - public static ILaunchConfiguration migrateBuilderConfiguration(IProject project, ILaunchConfigurationWorkingCopy workingCopy) throws CoreException { - return BuilderCoreUtils.migrateBuilderConfiguration(project, workingCopy); - } - - /** - * Converts the build types string into an array of - * build kinds. - * - * @param buildTypes the string of built types to convert - * @return the array of build kinds. - */ - public static int[] buildTypesToArray(String buildTypes) { - return BuilderCoreUtils.buildTypesToArray(buildTypes); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsImages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsImages.java deleted file mode 100644 index f21865edf..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsImages.java +++ /dev/null @@ -1,205 +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 - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.model; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.resource.CompositeImageDescriptor; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.graphics.Image; - -/** - * The images provided by the external tools plugin. - */ -public class ExternalToolsImages { - - /** - * The image registry containing Images. - */ - private static ImageRegistry imageRegistry; - - /** - * The registry for composite images - */ - private static ImageDescriptorRegistry imageDescriptorRegistry; - - /* Declare Common paths */ - private static URL ICON_BASE_URL= null; - - static { - String pathSuffix = "icons/full/"; //$NON-NLS-1$ - ICON_BASE_URL= ExternalToolsPlugin.getDefault().getBundle().getEntry(pathSuffix); - } - - // Use IPath and toOSString to build the names to ensure they have the slashes correct - private final static String OBJECT= "obj16/"; //basic colors - size 16x16 //$NON-NLS-1$ - - /** - * Declare all images - */ - private static void declareImages() { - // Objects - declareRegistryImage(IExternalToolConstants.IMG_TAB_MAIN, OBJECT + "main_tab.gif"); //$NON-NLS-1$ - declareRegistryImage(IExternalToolConstants.IMG_TAB_BUILD, OBJECT + "build_tab.gif"); //$NON-NLS-1$ - } - - /** - * 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(); - try { - desc= ImageDescriptor.createFromURL(makeIconFileURL(path)); - } catch (MalformedURLException me) { - } - imageRegistry.put(key, desc); - } - - /** - * Returns the ImageRegistry. - */ - public static ImageRegistry getImageRegistry() { - if (imageRegistry == null) { - initializeImageRegistry(); - } - return imageRegistry; - } - - /** - * 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 static ImageRegistry initializeImageRegistry() { - imageRegistry= new ImageRegistry(ExternalToolsPlugin.getStandardDisplay()); - declareImages(); - return imageRegistry; - } - - /** - * Returns the Image identified by the given key, - * or null if it does not exist. - */ - public static Image getImage(String key) { - return getImageRegistry().get(key); - } - - /** - * Returns the ImageDescriptor identified by the given key, - * or null if it does not exist. - */ - public static ImageDescriptor getImageDescriptor(String key) { - return getImageRegistry().getDescriptor(key); - } - - private static URL makeIconFileURL(String iconPath) throws MalformedURLException { - if (ICON_BASE_URL == null) { - throw new MalformedURLException(); - } - - return new URL(ICON_BASE_URL, iconPath); - } - - /** - * Sets the three image descriptors for enabled, disabled, and hovered to an action. The actions - * are retrieved from the *lcl16 folders. - */ - public static void setLocalImageDescriptors(IAction action, String iconName) { - setImageDescriptors(action, "lcl16", iconName); //$NON-NLS-1$ - } - - private static void setImageDescriptors(IAction action, String type, String relPath) { - - try { - ImageDescriptor id= ImageDescriptor.createFromURL(makeIconFileURL("d" + type, relPath)); //$NON-NLS-1$ - if (id != null) - action.setDisabledImageDescriptor(id); - } catch (MalformedURLException e) { - ExternalToolsPlugin.getDefault().log(e); - } - - try { - ImageDescriptor id= ImageDescriptor.createFromURL(makeIconFileURL("c" + type, relPath)); //$NON-NLS-1$ - if (id != null) - action.setHoverImageDescriptor(id); - } catch (MalformedURLException e) { - ExternalToolsPlugin.getDefault().log(e); - } - - action.setImageDescriptor(create("e" + type, relPath)); //$NON-NLS-1$ - } - - private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException { - if (ICON_BASE_URL == null) { - throw new MalformedURLException(); - } - - StringBuffer buffer= new StringBuffer(prefix); - buffer.append('/'); - buffer.append(name); - return new URL(ICON_BASE_URL, buffer.toString()); - } - - private static ImageDescriptor create(String prefix, String name) { - try { - return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); - } catch (MalformedURLException e) { - ExternalToolsPlugin.getDefault().log(e); - return ImageDescriptor.getMissingImageDescriptor(); - } - } - - /** - * Returns the image for the given composite descriptor. - */ - public static Image getImage(CompositeImageDescriptor imageDescriptor) { - if (imageDescriptorRegistry == null) { - imageDescriptorRegistry = new ImageDescriptorRegistry(); - } - return imageDescriptorRegistry.get(imageDescriptor); - } - - public static void disposeImageDescriptorRegistry() { - if (imageDescriptorRegistry != null) { - imageDescriptorRegistry.dispose(); - } - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.java deleted file mode 100644 index 3b66a05c5..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.java +++ /dev/null @@ -1,26 +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.ui.externaltools.internal.model; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsModelMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.model.ExternalToolsModelMessages";//$NON-NLS-1$ - - public static String ImageDescriptorRegistry_Allocating_image_for_wrong_display_1; - public static String BuilderUtils_5; - public static String BuilderUtils_6; - public static String BuilderUtils_7; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ExternalToolsModelMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties deleted file mode 100644 index cb3e2a61a..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsModelMessages.properties +++ /dev/null @@ -1,15 +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 -############################################################################### - -ImageDescriptorRegistry_Allocating_image_for_wrong_display_1=Allocating image for wrong display -BuilderUtils_5=Command Error -BuilderUtils_6=An error occurred while saving the build commands of the project -BuilderUtils_7=\ [Builder] diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java deleted file mode 100644 index f3b82cbdb..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java +++ /dev/null @@ -1,288 +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.ui.externaltools.internal.model; - -import java.net.MalformedURLException; -import java.net.URL; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -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.ILaunch; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchListener; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.IWindowListener; -import org.eclipse.ui.IWorkbenchPage; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.externaltools.internal.program.launchConfigurations.ExternalToolsProgramMessages; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; - -/** - * External tools plug-in class - */ -public final class ExternalToolsPlugin extends AbstractUIPlugin implements - ILaunchListener { - - public static final String PLUGIN_ID = "org.eclipse.ui.externaltools"; //$NON-NLS-1$ - - /** - * Status representing no problems encountered during operation. - */ - public static final IStatus OK_STATUS = new Status(IStatus.OK, PLUGIN_ID, 0, "", null); //$NON-NLS-1$ - - private static ExternalToolsPlugin plugin; - - private static final String EMPTY_STRING = ""; //$NON-NLS-1$ - - private static IWindowListener fWindowListener; - - private static ILaunchManager launchManager; - - /** - * A window listener that warns the user about any running programs when the - * workbench closes. Programs are killed when the VM exits. - */ - private class ProgramLaunchWindowListener implements IWindowListener { - public void windowActivated(IWorkbenchWindow window) { - } - - public void windowDeactivated(IWorkbenchWindow window) { - } - - public void windowClosed(IWorkbenchWindow window) { - IWorkbenchWindow windows[] = PlatformUI.getWorkbench() - .getWorkbenchWindows(); - if (windows.length > 1) { - // There are more windows still open. - return; - } - ILaunchManager manager = DebugPlugin.getDefault() - .getLaunchManager(); - ILaunchConfigurationType programType = manager - .getLaunchConfigurationType(IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE); - if (programType == null) { - return; - } - ILaunch launches[] = manager.getLaunches(); - ILaunchConfigurationType configType; - ILaunchConfiguration config; - for (int i = 0; i < launches.length; i++) { - try { - config = launches[i].getLaunchConfiguration(); - if (config == null) { - continue; - } - configType = config.getType(); - } catch (CoreException e) { - continue; - } - if (configType.equals(programType)) { - if (!launches[i].isTerminated()) { - MessageDialog - .openWarning( - window.getShell(), - ExternalToolsProgramMessages.ProgramLaunchDelegate_Workbench_Closing_1, - ExternalToolsProgramMessages.ProgramLaunchDelegate_The_workbench_is_exiting); - break; - } - } - } - } - - public void windowOpened(IWorkbenchWindow window) { - } - } - - /** - * Create an instance of the External Tools plug-in. - */ - public ExternalToolsPlugin() { - super(); - plugin = this; - } - - /** - * Returns the default instance of the receiver. - * This represents the runtime plugin. - */ - public static ExternalToolsPlugin getDefault() { - return plugin; - } - - /** - * Returns a new IStatus for this plug-in - */ - public static IStatus newErrorStatus(String message, Throwable exception) { - if (message == null) { - message= EMPTY_STRING; - } - return new Status(IStatus.ERROR, PLUGIN_ID, 0, message, exception); - } - - /** - * Returns a new CoreException for this plug-in - */ - public static CoreException newError(String message, Throwable exception) { - return new CoreException(new Status(IStatus.ERROR, PLUGIN_ID, 0, message, exception)); - } - - /** - * Writes the message to the plug-in's log - * - * @param message the text to write to the log - */ - public void log(String message, Throwable exception) { - IStatus status = newErrorStatus(message, exception); - getLog().log(status); - } - - public void log(Throwable exception) { - //this message is intentionally not internationalized, as an exception may - // be due to the resource bundle itself - getLog().log(newErrorStatus("Internal error logged from External Tools UI: ", exception)); //$NON-NLS-1$ - } - - /** - * Returns the ImageDescriptor for the icon with the given path - * - * @return the ImageDescriptor object - */ - public ImageDescriptor getImageDescriptor(String path) { - try { - Bundle bundle= getDefault().getBundle(); - URL installURL = bundle.getEntry("/"); //$NON-NLS-1$ - URL url = new URL(installURL, path); - return ImageDescriptor.createFromURL(url); - } catch (MalformedURLException e) { - return null; - } - } - - /** - * Returns the active workbench window or null if none - */ - public static IWorkbenchWindow getActiveWorkbenchWindow() { - return getDefault().getWorkbench().getActiveWorkbenchWindow(); - } - - /** - * Returns the active workbench page or null if none. - */ - public static IWorkbenchPage getActivePage() { - IWorkbenchWindow window= getActiveWorkbenchWindow(); - if (window != null) { - return window.getActivePage(); - } - return null; - } - - /** - * Returns the active workbench shell or null if none. - */ - public static Shell getActiveWorkbenchShell() { - IWorkbenchWindow window = getActiveWorkbenchWindow(); - if (window != null) { - return window.getShell(); - } - return null; - } - - /** - * Returns the standard display to be used. The method first checks, if - * the thread calling this method has an associated display. If so, this - * display is returned. Otherwise the method returns the default display. - */ - public static Display getStandardDisplay() { - Display display = Display.getCurrent(); - if (display == null) { - display = Display.getDefault(); - } - return display; - } - - /* (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry() - */ - protected ImageRegistry createImageRegistry() { - return ExternalToolsImages.initializeImageRegistry(); - } - - /* (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - try { - ExternalToolsImages.disposeImageDescriptorRegistry(); - } finally { - super.stop(context); - } - } - - public void start(BundleContext context) throws Exception { - super.start(context); - // Listen to launches to lazily create "launch processors" - launchManager = DebugPlugin.getDefault().getLaunchManager(); - ILaunch[] launches = launchManager.getLaunches(); - if (launches.length > 0) { - if (fWindowListener == null) { - fWindowListener = new ProgramLaunchWindowListener(); - PlatformUI.getWorkbench().addWindowListener(fWindowListener); - } - } else { - // if no launches, wait for first launch to initialize processors - launchManager.addLaunchListener(this); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch) - */ - public void launchAdded(ILaunch launch) { - ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration(); - try { - ILaunchConfigurationType launchConfigurationType = launchConfiguration.getType(); - if (launchConfigurationType.getIdentifier().equals( - IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE)) { - if (fWindowListener == null) { - fWindowListener = new ProgramLaunchWindowListener(); - PlatformUI.getWorkbench().addWindowListener(fWindowListener); - launchManager.removeLaunchListener(this); - } - } - } catch (CoreException e) { - log(e); - } - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch) - */ - public void launchChanged(ILaunch launch) { - } - - /* (non-Javadoc) - * @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch) - */ - public void launchRemoved(ILaunch launch) { - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPreferenceInitializer.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPreferenceInitializer.java deleted file mode 100644 index b7bbb8b37..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPreferenceInitializer.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 API and implementation - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.model; - -import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; -import org.eclipse.jface.preference.IPreferenceStore; - -public class ExternalToolsPreferenceInitializer extends AbstractPreferenceInitializer { - - public ExternalToolsPreferenceInitializer() { - super(); - } - - /* - * (non-Javadoc) - * - * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences() - */ - public void initializeDefaultPreferences() { - IPreferenceStore prefs = ExternalToolsPlugin.getDefault().getPreferenceStore(); - prefs.setDefault(IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION, true); - prefs.setDefault(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION, true); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java deleted file mode 100644 index 4c8dd3ca1..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.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 Corporation - initial API and implementation - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.model; - -/** - * Defines the constants available for client use. - *

                              - * This interface is not intended to be extended or implemented by clients. - *

                              - */ -public interface IExternalToolConstants { - /** - * Plugin identifier for external tools (value org.eclipse.ui.externaltools). - */ - public static final String PLUGIN_ID = "org.eclipse.ui.externaltools"; //$NON-NLS-1$; - - // ------- Extensions Points ------- - /** - * Extension point to declare the launch configuration type that should be - * created when duplicating an existing configuration as a project builder. - */ - public static final String EXTENSION_POINT_CONFIGURATION_DUPLICATION_MAPS = "configurationDuplicationMaps"; //$NON-NLS-1$ - // ------- Refresh Variables ------- - /** - * Variable that expands to the workspace root object (value workspace). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_WORKSPACE} - */ - public static final String VAR_WORKSPACE = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_WORKSPACE; - /** - * Variable that expands to the project resource (value project). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_PROJECT} - */ - public static final String VAR_PROJECT = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_PROJECT; - /** - * Variable that expands to the container resource (value container). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_CONTAINER} - */ - public static final String VAR_CONTAINER = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_CONTAINER; - /** - * Variable that expands to a resource (value resource). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_RESOURCE} - */ - public static final String VAR_RESOURCE = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_RESOURCE; - /** - * Variable that expands to the working set object (value working_set). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_WORKING_SET} - */ - public static final String VAR_WORKING_SET = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_WORKING_SET; - // ------- Tool Types ------- - /** - * External tool type for programs such as executables, batch files, - * shell scripts, etc (value programType). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#TOOL_TYPE_PROGRAM} - */ - public static final String TOOL_TYPE_PROGRAM = org.eclipse.core.externaltools.internal.IExternalToolConstants.TOOL_TYPE_PROGRAM; - - // ------- Build Types ------- - /** - * Build type indicating an incremental project build request for - * the external tool running as a builder (value incremental). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_INCREMENTAL} - */ - public static final String BUILD_TYPE_INCREMENTAL = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_INCREMENTAL; - - /** - * Build type indicating a full project build request for - * the external tool running as a builder (value full). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_FULL} - */ - public static final String BUILD_TYPE_FULL = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_FULL; - - /** - * Build type indicating an automatic project build request for - * the external tool running as a builder (value auto). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_AUTO} - */ - public static final String BUILD_TYPE_AUTO = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_AUTO; - - /** - * Build type indicating a clean project build request for - * the external tool running as a builder (value clean). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_CLEAN} - */ - public static final String BUILD_TYPE_CLEAN = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_CLEAN; - - /** - * Build type indicating no project build request for - * the external tool running as a builder (value none). - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_NONE} - */ - public static final String BUILD_TYPE_NONE = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_NONE; - - // ------- Images ------- - - /** - * Main tab image. - */ - public static final String IMG_TAB_MAIN = PLUGIN_ID + ".IMG_TAB_MAIN"; //$NON-NLS-1$ - - /** - * Build tab image - */ - public static final String IMG_TAB_BUILD = PLUGIN_ID + ".IMG_TAB_BUILD"; //$NON-NLS-1$ - - // ------- Launch configuration types -------- - /** - * Program launch configuration type identifier. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE} - */ - public static final String ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE; - - /** - * Program builder launch configuration type identifier. Program project - * builders are of this type. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE} - */ - public static final String ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ID_PROGRAM_BUILDER_LAUNCH_CONFIGURATION_TYPE; - - // ------- Launch configuration category -------- - /** - * Identifier for external tools launch configuration category. Launch - * configuration types for external tools that appear in the external tools - * launch configuration dialog should belong to this category. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY} - */ - public static final String ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY = org.eclipse.core.externaltools.internal.IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY; - /** - * Identifier for external tools launch configuration builders category. - * Launch configuration types that can be added as project builders should - * belong to this category. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY} - */ - public static final String ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY = org.eclipse.core.externaltools.internal.IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY; - - // ------- Launch configuration groups -------- - /** - * Identifier for external tools launch configuration group. The external - * tools launch configuration group corresponds to the external tools - * category in run mode. - */ - public static final String ID_EXTERNAL_TOOLS_LAUNCH_GROUP = "org.eclipse.ui.externaltools.launchGroup"; //$NON-NLS-1$ - /** - * Identifier for external tools launch configuration group - */ - public static final String ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_GROUP = "org.eclipse.ui.externaltools.launchGroup.builder"; //$NON-NLS-1$ - - // ------- Common External Tool Launch Configuration Attributes ------- - - /** - * Boolean attribute indicating if external tool output should be captured. - * Default value is false. - * @deprecated since 3.1 Replaced by org.eclipse.debug.core.DebugPlugin.ATTR_CAPTURE_OUTPUT - */ - public static final String ATTR_CAPTURE_OUTPUT = PLUGIN_ID + ".ATTR_CAPTURE_OUTPUT"; //$NON-NLS-1$ - /** - * String attribute identifying the location of an external. Default value - * is null. Encoding is tool specific. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_LOCATION} - */ - public static final String ATTR_LOCATION = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_LOCATION; - - /** - * Boolean attribute indicating if the user should be prompted for - * arguments before running a tool. Default value is false. - * THIS ATTRIBUTE IS NOT USED. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_PROMPT_FOR_ARGUMENTS} - */ - public static final String ATTR_PROMPT_FOR_ARGUMENTS = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_PROMPT_FOR_ARGUMENTS; - - /** - * String attribute identifying the scope of resources that should trigger an - * external tool to run. Default value is null - * indicating that the builder will be triggered for all changes. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_BUILDER_SCOPE} - */ - public static final String ATTR_BUILDER_SCOPE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_BUILDER_SCOPE; - - /** - * String attribute containing an array of build kinds for which an - * external tool builder should be run. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_RUN_BUILD_KINDS} - */ - public static final String ATTR_RUN_BUILD_KINDS = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_RUN_BUILD_KINDS; - - /** - * Boolean attribute indicating if the console should be shown on external - * tool output. Default value is false. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_SHOW_CONSOLE} - */ - public static final String ATTR_SHOW_CONSOLE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_SHOW_CONSOLE; - - /** - * String attribute containing the arguments that should be passed to the - * tool. Default value is null, and encoding is tool specific. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_TOOL_ARGUMENTS} - */ - public static final String ATTR_TOOL_ARGUMENTS = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_TOOL_ARGUMENTS; - - /** - * String attribute identifying the working directory of an external tool. - * Default value is null, which indicates a default working - * directory, which is tool specific. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_WORKING_DIRECTORY} - */ - public static final String ATTR_WORKING_DIRECTORY = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_WORKING_DIRECTORY; - - /** - * String attribute identifying whether an external tool builder configuration - * is enabled. The default value is true, which indicates - * that the configuration will be executed as appropriate by the builder. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_BUILDER_ENABLED} - */ - public static final String ATTR_BUILDER_ENABLED = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_BUILDER_ENABLED; - - /** - * Status code indicating an unexpected internal error. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ERR_INTERNAL_ERROR} - */ - public static final int ERR_INTERNAL_ERROR = org.eclipse.core.externaltools.internal.IExternalToolConstants.ERR_INTERNAL_ERROR; - - /** - * String attribute identifying a non-external tool builder launch configuration that is disabled - * The value is the name of the disabled builder. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_DISABLED_BUILDER} - */ - public static final String ATTR_DISABLED_BUILDER = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_DISABLED_BUILDER; - - /** - * boolean attribute identifying that an external tool builder has been configured for triggering - * using the ICommand.setBuilding(int) mechanism - * @since 3.1 - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_TRIGGERS_CONFIGURED} - */ - public static final String ATTR_TRIGGERS_CONFIGURED = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED; - - /** - * String attribute identifying the build scope for a launch configuration. - * null indicates the default workspace build. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_BUILD_SCOPE} - */ - public static final String ATTR_BUILD_SCOPE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_BUILD_SCOPE; - - /** - * Attribute identifier specifying whether referenced projects should be - * considered when computing the projects to build. Default value is - * true. - * @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_INCLUDE_REFERENCED_PROJECTS} - */ - public static final String ATTR_INCLUDE_REFERENCED_PROJECTS = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_INCLUDE_REFERENCED_PROJECTS; -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.java deleted file mode 100644 index 0bbfd05bc..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolsHelpContextIds.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.ui.externaltools.internal.model; - - -/** - * Help context ids for the external tools. - *

                              - * This interface contains constants only; it is not intended to be implemented - * or extended. - *

                              - */ -public interface IExternalToolsHelpContextIds { - public static final String PREFIX = "org.eclipse.ui.externaltools."; //$NON-NLS-1$ - - // Preference Pages - public static final String EXTERNAL_TOOLS_PREFERENCE_PAGE = PREFIX + "preference_page_context"; //$NON-NLS-1$ - - // Property Pages - public static final String EXTERNAL_TOOLS_BUILDER_PROPERTY_PAGE = PREFIX + "builder_property_page_context"; //$NON-NLS-1$ - - //Dialogs - public static final String MESSAGE_WITH_TOGGLE_DIALOG = PREFIX + "message_with_toggle_dialog_context"; //$NON-NLS-1$ - public static final String FILE_SELECTION_DIALOG = PREFIX + "file_selection_dialog_context"; //$NON-NLS-1$ - - //Launch configuration dialog tabs - public static final String EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_BUILDER_TAB = PREFIX + "builders_tab_context"; //$NON-NLS-1$ - public static final String EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_PROGRAM_MAIN_TAB = PREFIX + "program_main_tab_context"; //$NON-NLS-1$ -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IPreferenceConstants.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IPreferenceConstants.java deleted file mode 100644 index ab0944c78..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IPreferenceConstants.java +++ /dev/null @@ -1,33 +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.ui.externaltools.internal.model; - - -/** - * Constants used to identify user preferences. - */ -public interface IPreferenceConstants { - - /** - * Boolean preference key which indicates whether or not the user should be prompted - * before an external tool project builder is migrated to the new builder format. - * This is used before an old-style (Eclipse 1.0 or 2.0) builder is migrated to - * the new format (launch configurations). - */ - public static final String PROMPT_FOR_TOOL_MIGRATION = "externaltools.builders.promptForMigration"; //$NON-NLS-1$ - /** - * Boolean preference key which indicates whether or not the user should be prompted - * before a project is migrated tot he new builder handle format. - * This is used before an old-style (Eclipse 2.1) project handle is migrated - * from the old format (launch config handles) to the new format (path to the launch). - */ - public static final String PROMPT_FOR_PROJECT_MIGRATION = "externaltools.builders.promptForProjectMigration"; //$NON-NLS-1$ -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java deleted file mode 100644 index 346f60c85..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java +++ /dev/null @@ -1,91 +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.ui.externaltools.internal.model; - - -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 ImageDescriptors to Image. - */ -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(ExternalToolsPlugin.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 null - * 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 == ExternalToolsPlugin.getStandardDisplay(), ExternalToolsModelMessages.ImageDescriptorRegistry_Allocating_image_for_wrong_display_1); - 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.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderLabelProvider.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderLabelProvider.java deleted file mode 100644 index 3d6dc5b61..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderLabelProvider.java +++ /dev/null @@ -1,132 +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.ui.externaltools.internal.ui; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.Platform; -import org.eclipse.debug.core.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugModelPresentation; -import org.eclipse.jface.viewers.LabelProvider; -import org.eclipse.osgi.util.NLS; -import org.eclipse.swt.graphics.Image; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; -import org.eclipse.ui.externaltools.internal.ui.BuilderPropertyPage.ErrorConfig; - - -class BuilderLabelProvider extends LabelProvider { - private static final String IMG_BUILDER = "icons/full/obj16/builder.gif"; //$NON-NLS-1$; - private static final String IMG_INVALID_BUILD_TOOL = "icons/full/obj16/invalid_build_tool.gif"; //$NON-NLS-1$ - IDebugModelPresentation debugModelPresentation= DebugUITools.newDebugModelPresentation(); - - private Image builderImage = ExternalToolsPlugin.getDefault().getImageDescriptor(IMG_BUILDER).createImage(); - private Image invalidBuildToolImage = ExternalToolsPlugin.getDefault().getImageDescriptor(IMG_INVALID_BUILD_TOOL).createImage(); - - public String getText(Object element) { - if (element instanceof ICommand) { - return getCommandText((ICommand) element); - } else if (element instanceof ILaunchConfiguration || element instanceof ILaunchConfigurationType) { - return getDebugModelText(element); - } else if (element instanceof ErrorConfig) { - return ExternalToolsUIMessages.BuilderPropertyPage_invalidBuildTool; - } - return super.getText(element); - } - - public Image getImage(Object element) { - if (element instanceof ICommand) { - return getCommandImage(); - } else if (element instanceof ILaunchConfiguration || element instanceof ILaunchConfigurationType) { - return getDebugModelImage(element); - } else if (element instanceof ErrorConfig) { - return invalidBuildToolImage; - } - return super.getImage(element); - } - - public String getCommandText(ICommand command) { - String builderID = command.getBuilderName(); - return getBuilderName(builderID); - } - - private String getBuilderName(String builderID) { - // Get the human-readable name of the builder - IExtension extension = Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, builderID); - String builderName; - if (extension != null) { - builderName = extension.getLabel(); - } else { - builderName = NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_missingBuilder, new Object[] { builderID }); - } - return builderName; - } - - /** - * Returns the image for build commands. - * - * @return the build command image - */ - public Image getCommandImage() { - return builderImage; - } - - /** - * Returns a text label for the given object from a debug - * model presentation. - * @param element the element - * @return a text label from a debug model presentation - */ - public String getDebugModelText(Object element) { - if (element instanceof ILaunchConfiguration) { - try { - String disabledBuilderName= ((ILaunchConfiguration) element).getAttribute(IExternalToolConstants.ATTR_DISABLED_BUILDER, (String)null); - if (disabledBuilderName != null) { - //really a disabled builder wrapped as a launch configuration - return getBuilderName(disabledBuilderName); - } - } catch (CoreException e) { - } - } - return debugModelPresentation.getText(element); - } - - /** - * Returns an image for the given object from a debug - * model presentation. - * @param element the element - * @return an image from a debug model presentation - */ - public Image getDebugModelImage(Object element) { - if (element instanceof ILaunchConfiguration) { - try { - String disabledBuilderName= ((ILaunchConfiguration) element).getAttribute(IExternalToolConstants.ATTR_DISABLED_BUILDER, (String)null); - if (disabledBuilderName != null) { - //really a disabled builder wrapped as a launch configuration - return builderImage; - } - } catch (CoreException e) { - } - } - return debugModelPresentation.getImage(element); - } - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose() - */ - public void dispose() { - builderImage.dispose(); - invalidBuildToolImage.dispose(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java deleted file mode 100644 index 3f97506f2..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java +++ /dev/null @@ -1,1242 +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.ui.externaltools.internal.ui; - - -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.externaltools.internal.model.BuilderCoreUtils; -import org.eclipse.core.externaltools.internal.model.ExternalToolBuilder; -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IFolder; -import org.eclipse.core.resources.IProject; -import org.eclipse.core.resources.IProjectDescription; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IWorkspace; -import org.eclipse.core.resources.IWorkspaceDescription; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.core.runtime.IExtension; -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.ILaunchConfiguration; -import org.eclipse.debug.core.ILaunchConfigurationListener; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; -import org.eclipse.debug.core.ILaunchManager; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.MessageDialogWithToggle; -import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.preference.IPreferenceStore; -import org.eclipse.jface.viewers.CheckStateChangedEvent; -import org.eclipse.jface.viewers.CheckboxTableViewer; -import org.eclipse.jface.viewers.ICheckStateListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.window.Window; -import org.eclipse.osgi.util.NLS; -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.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.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.dialogs.ElementListSelectionDialog; -import org.eclipse.ui.dialogs.PropertyPage; -import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab; -import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsUtil; -import org.eclipse.ui.externaltools.internal.launchConfigurations.IgnoreWhiteSpaceComparator; -import org.eclipse.ui.externaltools.internal.model.BuilderUtils; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; -import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; -import org.eclipse.ui.externaltools.internal.model.IPreferenceConstants; -import org.eclipse.ui.progress.IProgressService; - -/** - * Property page to add external tools builders. - */ -public final class BuilderPropertyPage extends PropertyPage implements ICheckStateListener { - - //locally mark a command's enabled state so it can be processed correctly on performOK - private static final String COMMAND_ENABLED= "CommandEnabled"; //$NON-NLS-1$ - - private Button upButton, downButton, newButton, importButton, editButton, removeButton; - - private boolean userHasMadeChanges= false; - - private List configsToBeDeleted= null; - private List commandsToBeDeleted= null; - - private CheckboxTableViewer viewer= null; - - private boolean fWarned = false; - - private ILabelProvider labelProvider= new BuilderLabelProvider(); - - /** - * Error configs are objects representing entries pointing to - * invalid launch configurations - */ - public class ErrorConfig { - private ICommand command; - public ErrorConfig(ICommand command) { - this.command= command; - } - public ICommand getCommand() { - return command; - } - } - - /** - * Collection of configurations created while the page is open. - * Stored here so they can be deleted if the page is cancelled. - */ - private List newConfigList= new ArrayList(); - - private SelectionListener buttonListener= new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleButtonPressed((Button) e.widget); - } - }; - - /** - * Launch configuration listener which is responsible for updating items in - * the tree when the user renames configurations in the dialog. - * - * This is necessary because when we tell the configuration dialog to open - * on a launch config and the user renames that config, the old config (the - * one in the tree) is made obsolete and a new config is created. This - * listener hears when new configurations are created this way and replaces - * the old configuration with the new. - */ - private ILaunchConfigurationListener configurationListener= new ILaunchConfigurationListener() { - /** - * A launch configuration has been added. If this config has been - * movedFrom a configuration in the tree, replace the old config with - * the new. - */ - public void launchConfigurationAdded(final ILaunchConfiguration configuration) { - ILaunchManager manager= DebugPlugin.getDefault().getLaunchManager(); - final ILaunchConfiguration oldConfig= manager.getMovedFrom(configuration); - if (oldConfig == null) { - return; - } - //Replace the movedFrom config in the list of newly created configs - if (newConfigList.remove(oldConfig)) { - newConfigList.add(configuration); - } - - Display.getDefault().asyncExec(new Runnable() { - public void run() { - TableItem[] items= viewer.getTable().getItems(); - for (int i = 0; i < items.length; i++) { - TableItem item = items[i]; - Object data= item.getData(); - if (data == oldConfig) { - // Found the movedFrom config in the tree. Replace it with the new config - item.setData(configuration); - viewer.update(configuration, null); - break; - } - } - } - }); - } - public void launchConfigurationChanged(ILaunchConfiguration configuration) { - } - public void launchConfigurationRemoved(ILaunchConfiguration configuration) { - } - }; - - /** - * Creates an initialized property page - */ - public BuilderPropertyPage() { - super(); - noDefaultAndApplyButton(); - } - - /** - * Add the project's build to the table viewer. - */ - private void addBuildersToTable() { - IProject project = getInputProject(); - if (project == null) { - return; - } - //add build spec entries to the table - ICommand[] commands= null; - try { - commands = project.getDescription().getBuildSpec(); - } catch (CoreException e) { - handleException(e); - return; - } - - boolean projectNeedsMigration= false; - for (int i = 0; i < commands.length; i++) { - String[] version= new String[] {""}; //$NON-NLS-1$ - ILaunchConfiguration config = BuilderUtils.configFromBuildCommandArgs(project, commands[i].getArguments(), version); - if (BuilderCoreUtils.VERSION_2_1.equals(version[0])) { - // Storing the .project file of a project with 2.1 configs, will - // edit the file in a way that isn't backwards compatible. - projectNeedsMigration= true; - } - Object element= null; - if (config != null) { - if (!config.isWorkingCopy() && !config.exists()) { - Shell shell= getShell(); - if (shell == null) { - return; - } - IStatus status = new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, 0, NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_Exists, new String[]{config.getName()}), null); - ErrorDialog.openError(getShell(), ExternalToolsUIMessages.BuilderPropertyPage_errorTitle, - NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_External_Tool_Builder__0__Not_Added_2, new String[]{config.getName()}), - status); - userHasMadeChanges= true; - } else { - element= config; - } - } else { - String builderID = commands[i].getBuilderName(); - if (builderID.equals(ExternalToolBuilder.ID) && commands[i].getArguments().get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE) != null) { - // An invalid external tool entry. - element= new ErrorConfig(commands[i]); - } else { - element= commands[i]; - } - } - if (element != null) { - viewer.add(element); - viewer.setChecked(element, isEnabled(element)); - } - } - if (projectNeedsMigration) { - IPreferenceStore store= ExternalToolsPlugin.getDefault().getPreferenceStore(); - boolean prompt= store.getBoolean(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION); - boolean proceed= true; - if (prompt) { - Shell shell= getShell(); - if (shell == null) { - return; - } - MessageDialogWithToggle dialog= MessageDialogWithToggle.openYesNoQuestion(shell, ExternalToolsUIMessages.BuilderPropertyPage_0, ExternalToolsUIMessages.BuilderPropertyPage_1, ExternalToolsUIMessages.BuilderPropertyPage_2, false, null, null); - proceed= dialog.getReturnCode() == IDialogConstants.YES_ID; - store.setValue(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION, !dialog.getToggleState()); - } - if (!proceed) { - // Open the page read-only - viewer.getTable().setEnabled(false); - downButton.setEnabled(false); - editButton.setEnabled(false); - importButton.setEnabled(false); - newButton.setEnabled(false); - removeButton.setEnabled(false); - } - } - } - - /** - * Creates and returns a button with the given label, id, and enablement. - */ - private Button createButton(Composite parent, String label) { - Button button = new Button(parent, SWT.PUSH); - button.setFont(parent.getFont()); - button.setText(label); - button.setEnabled(false); - button.addSelectionListener(buttonListener); - GridData data = new GridData(GridData.FILL_HORIZONTAL); - data.grabExcessHorizontalSpace = true; - button.setLayoutData(data); - int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH); - data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x); - return button; - } - - /* (non-Javadoc) - * Method declared on PreferencePage. - */ - protected Control createContents(Composite parent) { - - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IExternalToolsHelpContextIds.EXTERNAL_TOOLS_BUILDER_PROPERTY_PAGE); - - Font font = parent.getFont(); - - Composite topLevel = new Composite(parent, SWT.NONE); - GridLayout layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - topLevel.setLayout(layout); - topLevel.setLayoutData(new GridData(GridData.FILL_BOTH)); - - Label description = new Label(topLevel, SWT.WRAP); - description.setText(ExternalToolsUIMessages.BuilderPropertyPage_description); - description.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - description.setFont(font); - - Composite tableAndButtons = new Composite(topLevel, SWT.NONE); - tableAndButtons.setLayoutData(new GridData(GridData.FILL_BOTH)); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - layout.numColumns = 2; - tableAndButtons.setLayout(layout); - - // table of builders and tools - viewer= CheckboxTableViewer.newCheckList(tableAndButtons, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.BORDER); - viewer.setLabelProvider(labelProvider); - viewer.addCheckStateListener(this); - Table builderTable= viewer.getTable(); - builderTable.setLayoutData(new GridData(GridData.FILL_BOTH)); - builderTable.setFont(font); - builderTable.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - handleTableSelectionChanged(); - } - }); - - builderTable.addListener(SWT.MouseDoubleClick, new Listener() { - public void handleEvent(Event event) { - handleEditButtonPressed(); - } - }); - - //button area - Composite buttonArea = new Composite(tableAndButtons, SWT.NONE); - layout = new GridLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - buttonArea.setLayout(layout); - buttonArea.setFont(font); - buttonArea.setLayoutData(new GridData(GridData.FILL_VERTICAL)); - newButton = createButton(buttonArea, ExternalToolsUIMessages.BuilderPropertyPage_newButton); - importButton = createButton(buttonArea, ExternalToolsUIMessages.BuilderPropertyPage__Import____3); - editButton = createButton(buttonArea, ExternalToolsUIMessages.BuilderPropertyPage_editButton); - removeButton = createButton(buttonArea, ExternalToolsUIMessages.BuilderPropertyPage_removeButton); - new Label(buttonArea, SWT.LEFT); - upButton = createButton(buttonArea, ExternalToolsUIMessages.BuilderPropertyPage_upButton); - downButton = createButton(buttonArea, ExternalToolsUIMessages.BuilderPropertyPage_downButton); - - newButton.setEnabled(true); - importButton.setEnabled(true); - - //populate widget contents - addBuildersToTable(); - - return topLevel; - } - - /** - * Turns auto-building on or off in the workspace. - */ - private void setAutobuild(boolean newState) throws CoreException { - IWorkspace workspace= ResourcesPlugin.getWorkspace(); - IWorkspaceDescription wsDescription= workspace.getDescription(); - boolean oldState= wsDescription.isAutoBuilding(); - if (oldState != newState) { - wsDescription.setAutoBuilding(newState); - workspace.setDescription(wsDescription); - } - } - - /** - * Returns the project that is the input for this property page, - * or null. - */ - private IProject getInputProject() { - IAdaptable element = getElement(); - if (element instanceof IProject) { - return (IProject) element; - } - Object resource = element.getAdapter(IResource.class); - if (resource instanceof IProject) { - return (IProject) resource; - } - return null; - } - - /** - * One of the buttons has been pressed, act accordingly. - */ - private void handleButtonPressed(Button button) { - if (button == newButton) { - handleNewButtonPressed(); - } else if (button == importButton) { - handleImportButtonPressed(); - } else if (button == editButton) { - handleEditButtonPressed(); - } else if (button == removeButton) { - handleRemoveButtonPressed(); - } else if (button == upButton) { - moveSelectionUp(); - } else if (button == downButton) { - moveSelectionDown(); - } - if (getControl().isDisposed()) { - return; - } - handleTableSelectionChanged(); - viewer.getTable().setFocus(); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent) - */ - public void checkStateChanged(CheckStateChangedEvent event) { - Object element= event.getElement(); - boolean checked = event.getChecked(); - if (element instanceof ILaunchConfiguration) { - enableLaunchConfiguration((ILaunchConfiguration) element, checked); - } else if (element instanceof ICommand) { - Shell shell= getShell(); - if (shell == null) { - return; - } - if (checked) { - enableCommand((ICommand)element, checked); - return; - } else if (!fWarned) { - if(MessageDialog.openConfirm(shell, ExternalToolsUIMessages.BuilderPropertyPage_6, ExternalToolsUIMessages.BuilderPropertyPage_7)) { - fWarned = true; - } - } - if(fWarned) { - enableCommand((ICommand)element, checked); - } - else { - viewer.removeCheckStateListener(this); - viewer.setChecked(element, true); - viewer.addCheckStateListener(this); - } - - } - } - - private void enableLaunchConfiguration(ILaunchConfiguration configuration, boolean enable) { - ILaunchConfigurationWorkingCopy workingCopy= null; - try { - if (configuration instanceof ILaunchConfigurationWorkingCopy) { - workingCopy = (ILaunchConfigurationWorkingCopy) configuration; - } else { - // Replace the config with a working copy - TableItem[] items= viewer.getTable().getItems(); - for (int i = 0; i < items.length; i++) { - TableItem item = items[i]; - if (item.getData() == configuration) { - workingCopy = configuration.getWorkingCopy(); - item.setData(workingCopy); - } - } - } - if (workingCopy != null) { - workingCopy.setAttribute(IExternalToolConstants.ATTR_BUILDER_ENABLED, enable); - } - } catch (CoreException e) { - return; - } - userHasMadeChanges= true; - } - - private void enableCommand(ICommand command, boolean enable) { - Map args= command.getArguments(); - if (args == null) { - args= new HashMap(1); - } - args.put(COMMAND_ENABLED, Boolean.valueOf(enable)); - command.setArguments(args); - userHasMadeChanges= true; - } - - /** - * The user has pressed the import button. Prompt them to select a - * configuration to import from the workspace. - */ - private void handleImportButtonPressed() { - ILaunchManager manager= DebugPlugin.getDefault().getLaunchManager(); - List toolTypes= getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY); - List configurations= new ArrayList(); - Iterator iter= toolTypes.iterator(); - while (iter.hasNext()) { - try { - ILaunchConfiguration[] configs= manager.getLaunchConfigurations((ILaunchConfigurationType) iter.next()); - for (int i = 0; i < configs.length; i++) { - ILaunchConfiguration launchConfiguration = configs[i]; - if (!DebugUITools.isPrivate(launchConfiguration)) { - configurations.add(launchConfiguration); - } - } - } catch (CoreException e) { - } - } - Shell shell= getShell(); - if (shell == null) { - return; - } - ElementListSelectionDialog dialog= new ElementListSelectionDialog(shell, new BuilderLabelProvider()); - dialog.setTitle(ExternalToolsUIMessages.BuilderPropertyPage_4); - dialog.setMessage(ExternalToolsUIMessages.BuilderPropertyPage_5); - dialog.setElements(configurations.toArray()); - if (dialog.open() == Window.CANCEL) { - return; - } - Object results[]= dialog.getResult(); - if (results.length == 0) { //OK pressed with nothing selected - return; - } - ILaunchConfiguration config= (ILaunchConfiguration) results[0]; - ILaunchConfiguration newConfig= null; - boolean wasAutobuilding= ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); - try { - setAutobuild(false); - newConfig= BuilderUtils.duplicateConfiguration(getInputProject(), config); - } catch (CoreException e) { - handleException(e); - } finally { - try { - setAutobuild(wasAutobuilding); - } catch (CoreException e) { - handleException(e); - } - } - if (newConfig != null) { - userHasMadeChanges= true; - viewer.add(newConfig); - viewer.setChecked(newConfig, isEnabled(newConfig)); - newConfigList.add(newConfig); - } - } - - /** - * The user has pressed the remove button. Delete the selected builder. - */ - private void handleRemoveButtonPressed() { - IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); - if (selection != null) { - int numSelected= selection.size(); - userHasMadeChanges= true; - Iterator iterator= selection.iterator(); - while (iterator.hasNext()) { - Object item= iterator.next(); - if (item instanceof ILaunchConfiguration) { - if (configsToBeDeleted == null) { - configsToBeDeleted= new ArrayList(numSelected); - } - configsToBeDeleted.add(item); - } else if (item instanceof ICommand) { - if (commandsToBeDeleted == null) { - commandsToBeDeleted= new ArrayList(numSelected); - } - commandsToBeDeleted.add(item); - } - viewer.remove(item); - } - } - } - - /** - * The user has pressed the new button. Create a new configuration and open - * the launch configuration edit dialog on the new config. - */ - private void handleNewButtonPressed() { - ILaunchConfigurationType type = promptForConfigurationType(); - if (type == null) { - return; - } - boolean wasAutobuilding= ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); - try { - ILaunchConfigurationWorkingCopy workingCopy = null; - String name= DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(ExternalToolsUIMessages.BuilderPropertyPage_New_Builder_7); - workingCopy = type.newInstance(BuilderUtils.getBuilderFolder(getInputProject(), true), name); - - StringBuffer buffer= new StringBuffer(IExternalToolConstants.BUILD_TYPE_FULL); - buffer.append(','); - buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL); - buffer.append(','); - workingCopy.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, buffer.toString()); - workingCopy.setAttribute(ExternalToolsMainTab.FIRST_EDIT, true); - ILaunchConfiguration config = null; - setAutobuild(false); - config = workingCopy.doSave(); - //needs to be added here in case the user hits apply in the edit dialog - //then we can correctly update the list with the new config. - newConfigList.add(config); - int code= editConfiguration(config); - if (code == Window.CANCEL) { - // If the user cancelled, delete the newly created config - newConfigList.remove(config); - config.delete(); - } else { - userHasMadeChanges= true; - //retrieve the last "new" config - //may have been changed by the user pressing apply in the edit dialog - config= (ILaunchConfiguration)newConfigList.get(newConfigList.size() - 1); - viewer.add(config); - viewer.setChecked(config, isEnabled(config)); - } - } catch (CoreException e) { - handleException(e); - } finally { - try { - setAutobuild(wasAutobuilding); - } catch (CoreException e) { - handleException(e); - } - } - } - - /** - * Prompts the user to edit the given launch configuration. Returns the - * return code from opening the launch configuration dialog. - */ - private int editConfiguration(ILaunchConfiguration config) { - ILaunchManager manager= DebugPlugin.getDefault().getLaunchManager(); - manager.addLaunchConfigurationListener(configurationListener); - Shell shell= getShell(); - if (shell == null) { - return Window.CANCEL; - } - int code= DebugUITools.openLaunchConfigurationPropertiesDialog(shell, config, org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_GROUP); - manager.removeLaunchConfigurationListener(configurationListener); - return code; - } - - /** - * Prompts the user to choose a launch configuration type to create and - * returns the type the user selected or null if the user - * cancelled. - * - * @return the configuration type selected by the user or null - * if the user cancelled. - */ - private ILaunchConfigurationType promptForConfigurationType() { - List externalToolTypes= getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY); - Shell shell= getShell(); - if (shell == null) { - return null; - } - ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new BuilderLabelProvider()); - dialog.setElements(externalToolTypes.toArray()); - dialog.setMultipleSelection(false); - dialog.setTitle(ExternalToolsUIMessages.BuilderPropertyPage_Choose_configuration_type_8); - dialog.setMessage(ExternalToolsUIMessages.BuilderPropertyPage_Choose_an_external_tool_type_to_create_9); - dialog.open(); - Object result[] = dialog.getResult(); - if (result == null || result.length == 0) { - return null; - } - return (ILaunchConfigurationType) result[0]; - } - - /** - * Returns the launch configuration types of the given category - */ - private List getConfigurationTypes(String category) { - ILaunchConfigurationType types[] = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes(); - List externalToolTypes = new ArrayList(); - for (int i = 0; i < types.length; i++) { - ILaunchConfigurationType configurationType = types[i]; - if (category.equals(configurationType.getCategory())) { - externalToolTypes.add(configurationType); - } - } - return externalToolTypes; - } - - /** - * The user has pressed the edit button or double-clicked. Open the launch configuration edit - * dialog on the selection after migrating the tool if necessary. - */ - private void handleEditButtonPressed() { - TableItem[] items= viewer.getTable().getSelection(); - if (items.length == 0) { - return; - } - TableItem selection= items[0]; - if (selection != null) { - Object data = selection.getData(); - if (data instanceof ILaunchConfiguration) { - ILaunchConfiguration config= (ILaunchConfiguration) data; - if (BuilderUtils.isUnmigratedConfig(config)) { - if (!shouldProceedWithMigration()) { - return; - } - try { - config= BuilderUtils.migrateBuilderConfiguration(getInputProject(), (ILaunchConfigurationWorkingCopy) config); - } catch (CoreException e) { - handleException(e); - return; - } - // Replace the working copy in the table with the migrated configuration - selection.setData(config); - } - userHasMadeChanges= true; - boolean wasAutobuilding= ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); - try { - setAutobuild(false); - editConfiguration(config); - } catch (CoreException e) { - handleException(e); - } finally { - try { - setAutobuild(wasAutobuilding); - } catch (CoreException e) { - handleException(e); - } - } - } else if (data instanceof ICommand) { - ICommand command= (ICommand) data; - if (command.isConfigurable()) { - if (editCommand(command)) { - userHasMadeChanges= true; - } - } - } - } - } - - private boolean editCommand(ICommand data) { - EditCommandDialog dialog= new EditCommandDialog(getShell(), data); - return Window.OK == dialog.open(); - } - - /** - * Prompts the user to proceed with the migration of a project builder from - * the old format to the new, launch configuration-based, format and returns - * whether or not the user wishes to proceed with the migration. - * - * @return boolean whether or not the user wishes to proceed with migration - */ - private boolean shouldProceedWithMigration() { - if (!ExternalToolsPlugin.getDefault().getPreferenceStore().getBoolean(IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION)) { - // User has asked not to be prompted - return true; - } - Shell shell= getShell(); - if (shell == null) { - return false; - } - // Warn the user that editing an old config will cause storage migration. - MessageDialogWithToggle dialog= MessageDialogWithToggle.openYesNoQuestion(getShell(), - ExternalToolsUIMessages.BuilderPropertyPage_Migrate_project_builder_10, - ExternalToolsUIMessages.BuilderPropertyPage_Not_Support, - ExternalToolsUIMessages.BuilderPropertyPage_Prompt, - false, - ExternalToolsPlugin.getDefault().getPreferenceStore(), - IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION); - return dialog.getReturnCode() == IDialogConstants.YES_ID; - } - - /** - * Handles unexpected internal exceptions - */ - private void handleException(Exception e) { - final IStatus[] status= new IStatus[1]; - if (e instanceof CoreException) { - status[0] = ((CoreException) e).getStatus(); - } else { - status[0] = new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, 0, ExternalToolsUIMessages.BuilderPropertyPage_statusMessage, e); - } - Display.getDefault().asyncExec(new Runnable() { - public void run() { - Shell shell= getShell(); - if (shell != null) { - ErrorDialog.openError(shell, ExternalToolsUIMessages.BuilderPropertyPage_errorTitle, - ExternalToolsUIMessages.BuilderPropertyPage_errorMessage, - status[0]); - } - } - }); - } - - /** - * The user has selected a different builder in table. - * Update button enablement. - */ - private void handleTableSelectionChanged() { - newButton.setEnabled(true); - Table builderTable= viewer.getTable(); - TableItem[] items = builderTable.getSelection(); - boolean enableEdit = false; - boolean enableRemove = false; - boolean enableUp = false; - boolean enableDown = false; - if(items != null) { - boolean validSelection = items.length > 0; - enableEdit = validSelection; - enableRemove = validSelection; - enableUp = validSelection; - enableDown = validSelection; - if (items.length > 1) { - enableEdit= false; - } - int indices[]= builderTable.getSelectionIndices(); - int max = builderTable.getItemCount(); - if(indices.length > 0) { - enableUp = indices[0] != 0; - enableDown = indices[indices.length - 1] < max - 1; - } - for (int i = 0; i < items.length; i++) { - TableItem item = items[i]; - Object data= item.getData(); - if (data instanceof ILaunchConfiguration) { - ILaunchConfiguration config= (ILaunchConfiguration)data; - String builderName= null; - try { - builderName = config.getAttribute(IExternalToolConstants.ATTR_DISABLED_BUILDER, (String)null); - } catch (CoreException e) { - } - if (builderName != null) { - //do not allow "wrapped" builders to be removed or edited if they are valid - IExtension ext= Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, builderName); - enableEdit= false; - enableRemove= ext == null; - } - } else { - if (data instanceof ErrorConfig) { - enableEdit= false; - continue; - } - ICommand command= (ICommand) data; - enableEdit= command.isConfigurable(); - IExtension ext= Platform.getExtensionRegistry().getExtension(ResourcesPlugin.PI_RESOURCES, ResourcesPlugin.PT_BUILDERS, command.getBuilderName()); - enableRemove= ext == null; - break; - } - } - } - editButton.setEnabled(enableEdit); - removeButton.setEnabled(enableRemove); - upButton.setEnabled(enableUp); - downButton.setEnabled(enableDown); - } - - /** - * Returns whether the given element (command or launch config) - * is enabled. - * - * @param element the element - * @return whether the given element is enabled - */ - private boolean isEnabled(Object element) { - if (element instanceof ICommand) { - Boolean enabled= (Boolean)((ICommand) element).getArguments().get(COMMAND_ENABLED); - if (enabled != null) { - return enabled.booleanValue(); - } - } else if (element instanceof ILaunchConfiguration) { - try { - return ExternalToolsUtil.isBuilderEnabled((ILaunchConfiguration) element); - } catch (CoreException e) { - } - } else if (element instanceof ErrorConfig) { - return false; - } - return true; - } - - /** - * Moves an entry in the builder table to the given index. - */ - private void move(TableItem item, int index) { - userHasMadeChanges= true; - Object data = item.getData(); - item.dispose(); - viewer.insert(data, index); - viewer.setChecked(data, isEnabled(data)); - } - - /** - * Move the current selection in the build list down. - */ - private void moveSelectionDown() { - Table builderTable= viewer.getTable(); - int indices[]= builderTable.getSelectionIndices(); - if (indices.length < 1) { - return; - } - int newSelection[]= new int[indices.length]; - int max= builderTable.getItemCount() - 1; - for (int i = indices.length - 1; i >= 0; i--) { - int index= indices[i]; - if (index < max) { - move (builderTable.getItem(index), index + 1); - newSelection[i]= index + 1; - } - } - builderTable.setSelection(newSelection); - } - - /** - * Move the current selection in the build list up. - */ - private void moveSelectionUp() { - Table builderTable= viewer.getTable(); - int indices[]= builderTable.getSelectionIndices(); - int newSelection[]= new int[indices.length]; - for (int i = 0; i < indices.length; i++) { - int index= indices[i]; - if (index > 0) { - move (builderTable.getItem(index), index - 1); - newSelection[i]= index - 1; - } - } - builderTable.setSelection(newSelection); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performOk() - */ - public boolean performOk() { - if (!userHasMadeChanges) { - return super.performOk(); - } - userHasMadeChanges= false; - Table builderTable= viewer.getTable(); - int numCommands = builderTable.getItemCount(); - final Object[] itemData= new Object[numCommands]; - for (int i = 0; i < numCommands; i++) { - itemData[i]= builderTable.getItem(i).getData(); - } - IRunnableWithProgress runnable= new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) - throws InvocationTargetException, InterruptedException { - doPerformOk(monitor, itemData); - if (monitor.isCanceled()) { - throw new InterruptedException(); - } - } - }; - - IProgressService service= PlatformUI.getWorkbench().getProgressService(); - try { - service.busyCursorWhile(runnable); - } catch (InvocationTargetException e) { - return false; - } catch (InterruptedException e) { - return false; - } - return super.performOk(); - } - - private void doPerformOk(IProgressMonitor monitor, Object[] itemData) { - if (monitor.isCanceled()) { - return; - } - - IProject project = getInputProject(); - //get all the build commands - int numCommands = itemData.length; - monitor.beginTask(ExternalToolsUIMessages.BuilderPropertyPage_3, numCommands + 1); - List possibleCommands= new ArrayList(numCommands); - for (int i = 0; i < numCommands; i++) { - Object data = itemData[i]; - if (data instanceof ICommand) { - if (commandsToBeDeleted != null && commandsToBeDeleted.contains(data)) { - //command specified to be removed - data= null; - } - ICommand command= (ICommand)data; - Map args= command.getArguments(); - Boolean enabled= (Boolean)args.get(COMMAND_ENABLED); - if (enabled != null && enabled.equals(Boolean.FALSE)) { - ILaunchConfiguration config= disableCommand(command); - if (config != null) { - data= BuilderUtils.commandFromLaunchConfig(project,config); - } - } else { - args.remove(COMMAND_ENABLED); - command.setArguments(args); - } - } else if (data instanceof ILaunchConfiguration) { - ILaunchConfiguration config= (ILaunchConfiguration) data; - String disabledBuilderName; - try { - disabledBuilderName = config.getAttribute(IExternalToolConstants.ATTR_DISABLED_BUILDER, (String)null); - if (disabledBuilderName != null && ExternalToolsUtil.isBuilderEnabled(config)) { - possibleCommands.add(translateBackToCommand(config, project)); - continue; - } - } catch (CoreException e1) { - } - - if (!BuilderUtils.isUnmigratedConfig(config) && (config instanceof ILaunchConfigurationWorkingCopy)) { - ILaunchConfigurationWorkingCopy workingCopy= ((ILaunchConfigurationWorkingCopy) config); - // Save any changes to the config (such as enable/disable) - if (workingCopy.isDirty()) { - try { - workingCopy.doSave(); - } catch (CoreException e) { - Shell shell= getShell(); - if (shell != null) { - MessageDialog.openError(shell, ExternalToolsUIMessages.BuilderPropertyPage_39, NLS.bind(ExternalToolsUIMessages.BuilderPropertyPage_40, new String[] {workingCopy.getName()})); - } - } - } - } - data= BuilderUtils.commandFromLaunchConfig(project, config); - } else if (data instanceof ErrorConfig) { - data= ((ErrorConfig) data).getCommand(); - } - if (data != null) { - possibleCommands.add(data); - } - monitor.worked(1); - } - ICommand[] commands= new ICommand[possibleCommands.size()]; - possibleCommands.toArray(commands); - if (checkCommandsForChange(commands)) { - //set the build spec - try { - IProjectDescription desc = project.getDescription(); - desc.setBuildSpec(commands); - project.setDescription(desc, IResource.FORCE, monitor); - } catch (CoreException e) { - handleException(e); - performCancel(); - } - } - - if (configsToBeDeleted != null) { - deleteConfigurations(); - } - monitor.done(); - } - - private void checkBuilderFolder() { - try { - IFolder builderFolder= BuilderUtils.getBuilderFolder(getInputProject(), false); - if (builderFolder != null && builderFolder.exists() && builderFolder.members().length == 0) { - // All files in the builder folder have been deleted. Clean up - builderFolder.delete(true, false, null); - } - } catch (CoreException e) { - handleException(e); - } - } - - /** - * A non-external tool builder builder was disabled. - * It has been re-enabled. Translate the disabled external tool builder launch configuration - * wrapper back into the full fledged builder command. - */ - private ICommand translateBackToCommand(ILaunchConfiguration config, IProject project) { - try { - ICommand newCommand = project.getDescription().newCommand(); - String builderName= config.getAttribute(IExternalToolConstants.ATTR_DISABLED_BUILDER, (String)null); - Map args= config.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, new HashMap(0)); - - newCommand.setBuilderName(builderName); - newCommand.setArguments(args); - if (configsToBeDeleted == null) { - configsToBeDeleted= new ArrayList(); - } - configsToBeDeleted.add(config); - return newCommand; - } catch (CoreException exception) { - Shell shell= getShell(); - if (shell != null) { - MessageDialog.openError(shell, ExternalToolsUIMessages.BuilderPropertyPage_13, ExternalToolsUIMessages.BuilderPropertyPage_error); - } - return null; - } - } - - /** - * Disables a builder by wrappering the builder command as a disabled external tool builder. - * The details of the command is persisted in the launch configuration. - */ - private ILaunchConfiguration disableCommand(ICommand command) { - Map arguments= command.getArguments(); - if (arguments != null) { - arguments.remove(COMMAND_ENABLED); - } - List externalToolTypes= getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY); - if (externalToolTypes.size() == 0) { - return null; - } - ILaunchConfigurationType type= (ILaunchConfigurationType)externalToolTypes.get(0); - if (type == null) { - return null; - } - boolean wasAutobuilding= ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); - try { - ILaunchConfigurationWorkingCopy workingCopy = null; - String builderName = command.getBuilderName(); - String name= DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(builderName); - workingCopy = type.newInstance(BuilderUtils.getBuilderFolder(getInputProject(), true), name); - - workingCopy.setAttribute(IExternalToolConstants.ATTR_DISABLED_BUILDER, builderName); - if (arguments != null) { - workingCopy.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments); - } - workingCopy.setAttribute(IExternalToolConstants.ATTR_BUILDER_ENABLED, false); - ILaunchConfiguration config = null; - setAutobuild(false); - config = workingCopy.doSave(); - return config; - } catch (CoreException e) { - handleException(e); - } finally { - try { - setAutobuild(wasAutobuilding); - } catch (CoreException e) { - handleException(e); - } - } - return null; - } - - private void deleteConfigurations() { - boolean wasAutobuilding= ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); - try { - setAutobuild(false); - - Iterator itr= configsToBeDeleted.iterator(); - while (itr.hasNext()) { - ILaunchConfiguration element = (ILaunchConfiguration) itr.next(); - element.delete(); - } - - checkBuilderFolder(); - } catch (CoreException e) { - handleException(e); - } finally { - try { - setAutobuild(wasAutobuilding); - } catch (CoreException e) { - handleException(e); - } - } - } - - /** - * Returns whether any of the commands have changed. - */ - private boolean checkCommandsForChange(ICommand[] newCommands) { - try { - ICommand[] oldCommands = getInputProject().getDescription().getBuildSpec(); - if (oldCommands.length != newCommands.length) { - return true; - } - IgnoreWhiteSpaceComparator comparator= new IgnoreWhiteSpaceComparator(); - for (int i = 0; i < oldCommands.length; i++) { - ICommand oldCommand = oldCommands[i]; - ICommand newCommand= newCommands[i]; - String oldName= oldCommand.getBuilderName(); - String newName= newCommand.getBuilderName(); - if (oldName == null && newName != null) { - return true; - } - - if(oldName != null && !oldName.equals(newName)) { - return true; - } - Map oldArgs= oldCommand.getArguments(); - Map newArgs= newCommand.getArguments(); - if (oldArgs == null) { - if(newArgs != null) { - return true; - } - continue; - } - if(oldArgs.size() != newArgs.size()) { - return true; - } - Iterator keySet= oldArgs.keySet().iterator(); - while (keySet.hasNext()) { - Object key = keySet.next(); - Object oldArg= oldArgs.get(key); - Object newArg= newArgs.get(key); - if (oldArg instanceof String && newArg instanceof String) { - if (comparator.compare(oldArg, newArg) != 0) { - return true; - } - } else if (!oldArg.equals(newArg)){ - return true; - } - } - - if (oldCommand.isBuilding(IncrementalProjectBuilder.AUTO_BUILD) != newCommand.isBuilding(IncrementalProjectBuilder.AUTO_BUILD) - || oldCommand.isBuilding(IncrementalProjectBuilder.CLEAN_BUILD) != newCommand.isBuilding(IncrementalProjectBuilder.CLEAN_BUILD) - || oldCommand.isBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD) != newCommand.isBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD) - || oldCommand.isBuilding(IncrementalProjectBuilder.FULL_BUILD) != newCommand.isBuilding(IncrementalProjectBuilder.FULL_BUILD)) { - return true; - } - } - } catch (CoreException ce) { - return true; - } - return false; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.preference.IPreferencePage#performCancel() - */ - public boolean performCancel() { - Iterator iter= newConfigList.iterator(); - while (iter.hasNext()) { - try { - ((ILaunchConfiguration) iter.next()).delete(); - } catch (CoreException e) { - handleException(e); - } - } - - checkBuilderFolder(); - - //remove the local marking of the enabled state of the commands - Table builderTable= viewer.getTable(); - int numCommands = builderTable.getItemCount(); - for (int i = 0; i < numCommands; i++) { - Object data = builderTable.getItem(i).getData(); - if (data instanceof ICommand) { - ICommand command= (ICommand)data; - Map args= command.getArguments(); - args.remove(COMMAND_ENABLED); - command.setArguments(args); - } - } - return super.performCancel(); - } - - public Shell getShell() { - if (getControl().isDisposed()) { - return null; - } - return super.getShell(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/EditCommandDialog.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/EditCommandDialog.java deleted file mode 100644 index 4a2befedc..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/EditCommandDialog.java +++ /dev/null @@ -1,79 +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.ui.externaltools.internal.ui; - -import org.eclipse.core.resources.ICommand; -import org.eclipse.core.resources.IncrementalProjectBuilder; -import org.eclipse.jface.dialogs.Dialog; -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.Label; -import org.eclipse.swt.widgets.Shell; - -/** - * Dialog to alter the triggers of an ICommand that represents a builder. - */ -public class EditCommandDialog extends Dialog { - - private Button fFullButton; - private Button fIncrementalButton; - private Button fAutoButton; - private Button fCleanButton; - - private ICommand fCommand; - - public EditCommandDialog(Shell parentShell, ICommand command) { - super(parentShell); - fCommand= command; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite) - */ - protected Control createDialogArea(Composite parent) { - - getShell().setText(ExternalToolsUIMessages.EditCommandDialog_0); - Composite composite = (Composite)super.createDialogArea(parent); - - Label label= new Label(composite, SWT.NONE); - label.setText(ExternalToolsUIMessages.EditCommandDialog_1); - - fFullButton = new Button(composite, SWT.CHECK); - fFullButton.setText(ExternalToolsUIMessages.EditCommandDialog_2); - fFullButton.setSelection(fCommand.isBuilding(IncrementalProjectBuilder.FULL_BUILD)); - fIncrementalButton = new Button(composite, SWT.CHECK); - fIncrementalButton.setText(ExternalToolsUIMessages.EditCommandDialog_3); - fIncrementalButton.setSelection(fCommand.isBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD)); - fAutoButton = new Button(composite, SWT.CHECK); - fAutoButton.setText(ExternalToolsUIMessages.EditCommandDialog_4); - fAutoButton.setSelection(fCommand.isBuilding(IncrementalProjectBuilder.AUTO_BUILD)); - - fCleanButton = new Button(composite, SWT.CHECK); - fCleanButton.setText(ExternalToolsUIMessages.EditCommandDialog_5); - fCleanButton.setSelection(fCommand.isBuilding(IncrementalProjectBuilder.CLEAN_BUILD)); - applyDialogFont(composite); - return composite; - } - - /* (non-Javadoc) - * @see org.eclipse.jface.dialogs.Dialog#okPressed() - */ - protected void okPressed() { - fCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, fFullButton.getSelection()); - fCommand.setBuilding(IncrementalProjectBuilder.INCREMENTAL_BUILD, fIncrementalButton.getSelection()); - fCommand.setBuilding(IncrementalProjectBuilder.AUTO_BUILD, fAutoButton.getSelection()); - fCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, fCleanButton.getSelection()); - - super.okPressed(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsPreferencePage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsPreferencePage.java deleted file mode 100644 index 46c8cdf0f..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsPreferencePage.java +++ /dev/null @@ -1,97 +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.ui.externaltools.internal.ui; - - -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.ui.IWorkbench; -import org.eclipse.ui.IWorkbenchPreferencePage; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; -import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; -import org.eclipse.ui.externaltools.internal.model.IPreferenceConstants; - -/** - * Preference page that allows the user to customize external tools - */ -public class ExternalToolsPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { - - private Button promptForToolMigrationButton; - private Button promptForProjectMigrationButton; - - public ExternalToolsPreferencePage() { - setPreferenceStore(ExternalToolsPlugin.getDefault().getPreferenceStore()); - setDescription(ExternalToolsUIMessages.ExternalToolsPreferencePage_External_tool_project_builders_migration_2); - } - - /** - * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite) - */ - protected Control createContents(Composite parent) { - PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IExternalToolsHelpContextIds.EXTERNAL_TOOLS_PREFERENCE_PAGE); - //The main composite - Composite composite = new Composite(parent, SWT.NULL); - GridLayout layout = new GridLayout(); - layout.marginHeight=0; - layout.marginWidth=0; - composite.setLayout(layout); - composite.setFont(parent.getFont()); - - promptForToolMigrationButton= createCheckButton(composite, ExternalToolsUIMessages.ExternalToolsPreferencePage_Prompt_before_migrating_3, IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION); - promptForProjectMigrationButton= createCheckButton(composite, ExternalToolsUIMessages.ExternalToolsPreferencePage_1, IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION); - - applyDialogFont(composite); - - return composite; - } - - /** - * Returns a new check button with the given label for the given preference. - */ - private Button createCheckButton(Composite parent, String label, String preferenceKey) { - Button button= new Button(parent, SWT.CHECK | SWT.LEFT); - button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING)); - button.setFont(parent.getFont()); - button.setText(label); - button.setSelection(getPreferenceStore().getBoolean(preferenceKey)); - return button; - } - - /** - * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench) - */ - public void init(IWorkbench workbench) { - } - - /** - * @see org.eclipse.jface.preference.PreferencePage#performOk() - */ - public boolean performOk() { - getPreferenceStore().setValue(IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION, promptForToolMigrationButton.getSelection()); - getPreferenceStore().setValue(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION, promptForProjectMigrationButton.getSelection()); - return super.performOk(); - } - - /** - * @see org.eclipse.jface.preference.PreferencePage#performDefaults() - */ - protected void performDefaults() { - promptForToolMigrationButton.setSelection(getPreferenceStore().getDefaultBoolean(IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION)); - promptForToolMigrationButton.setSelection(getPreferenceStore().getDefaultBoolean(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION)); - super.performDefaults(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.java deleted file mode 100644 index e51a01194..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.java +++ /dev/null @@ -1,69 +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.ui.externaltools.internal.ui; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsUIMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.ui.ExternalToolsUIMessages";//$NON-NLS-1$ - - public static String BuilderPropertyPage_description; - public static String BuilderPropertyPage_newButton; - public static String BuilderPropertyPage_editButton; - public static String BuilderPropertyPage_removeButton; - public static String BuilderPropertyPage_upButton; - public static String BuilderPropertyPage_downButton; - public static String BuilderPropertyPage_statusMessage; - public static String BuilderPropertyPage_errorTitle; - public static String BuilderPropertyPage_errorMessage; - public static String BuilderPropertyPage_invalidBuildTool; - public static String BuilderPropertyPage_missingBuilder; - public static String BuilderPropertyPage_Exists; - public static String BuilderPropertyPage_External_Tool_Builder__0__Not_Added_2; - public static String BuilderPropertyPage__Import____3; - public static String BuilderPropertyPage_New_Builder_7; - public static String BuilderPropertyPage_Choose_configuration_type_8; - public static String BuilderPropertyPage_Choose_an_external_tool_type_to_create_9; - public static String BuilderPropertyPage_Migrate_project_builder_10; - public static String BuilderPropertyPage_Not_Support; - public static String BuilderPropertyPage_Prompt; - public static String BuilderPropertyPage_error; - public static String BuilderPropertyPage_0; - public static String BuilderPropertyPage_2; - public static String BuilderPropertyPage_1; - public static String BuilderPropertyPage_4; - public static String BuilderPropertyPage_5; - public static String BuilderPropertyPage_13; - public static String BuilderPropertyPage_39; - public static String BuilderPropertyPage_3; - public static String BuilderPropertyPage_6; - public static String BuilderPropertyPage_7; - public static String BuilderPropertyPage_40; - - public static String FileSelectionDialog_Choose_Location_1; - public static String FileSelectionDialog_Ok_2; - public static String FileSelectionDialog_Cancel_3; - - public static String ExternalToolsPreferencePage_External_tool_project_builders_migration_2; - public static String ExternalToolsPreferencePage_Prompt_before_migrating_3; - public static String ExternalToolsPreferencePage_1; - - public static String EditCommandDialog_0; - public static String EditCommandDialog_1; - public static String EditCommandDialog_2; - public static String EditCommandDialog_3; - public static String EditCommandDialog_4; - public static String EditCommandDialog_5; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ExternalToolsUIMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.properties deleted file mode 100644 index ddb921b88..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsUIMessages.properties +++ /dev/null @@ -1,58 +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 -############################################################################### - -BuilderPropertyPage_description = Configure the builders for the &project: -BuilderPropertyPage_newButton = &New... -BuilderPropertyPage_editButton = &Edit... -BuilderPropertyPage_removeButton = &Remove -BuilderPropertyPage_upButton = &Up -BuilderPropertyPage_downButton = &Down -BuilderPropertyPage_statusMessage = Internal error -BuilderPropertyPage_errorTitle = External Tool Builder Problem -BuilderPropertyPage_errorMessage = Internal error -BuilderPropertyPage_invalidBuildTool = Invalid External Tool Builder -BuilderPropertyPage_missingBuilder = Missing builder ({0}) -BuilderPropertyPage_Exists=Builder launch configuration {0} no longer exists -BuilderPropertyPage_External_Tool_Builder__0__Not_Added_2=External Tool Builder {0} Not Added -BuilderPropertyPage__Import____3=&Import... -BuilderPropertyPage_New_Builder_7=New_Builder -BuilderPropertyPage_Choose_configuration_type_8=Choose configuration type -BuilderPropertyPage_Choose_an_external_tool_type_to_create_9=&Choose an external tool type to create: -BuilderPropertyPage_Migrate_project_builder_10=Migrate project builder -BuilderPropertyPage_Not_Support=This project builder is stored in a format that is no longer supported. If you wish to edit this builder, it will first be migrated to a new format. If you proceed, this project builder will not be understood by installations using the old format.\n\nProceed with migration? -BuilderPropertyPage_Prompt=&Do not prompt before migrating project builders -BuilderPropertyPage_error=An error occurred while saving the project\'s build commands -BuilderPropertyPage_0=Project Migration -BuilderPropertyPage_2=&Do not prompt before migrating projects -BuilderPropertyPage_1=This project stores its builders in a format that is no longer supported. If any changes are made, the project will be migrated to the new format which will not be understood by installations using the old format.\n\nProceed? (Selecting "No" will open the page read-only) -BuilderPropertyPage_4=Import launch configuration -BuilderPropertyPage_5=&Choose a launch configuration from the workspace to import.\nThis will create a copy of the selected configuration. -BuilderPropertyPage_13=Command error -BuilderPropertyPage_39=Error Saving Builder -BuilderPropertyPage_3=Updating builders... -BuilderPropertyPage_6=Confirm Disable Builder -BuilderPropertyPage_7=This is an advanced operation. Disabling a project builder can have many side-effects. Continue? -BuilderPropertyPage_40=An exception occurred while attempting to save builder {0} - -FileSelectionDialog_Choose_Location_1=Choose Location -FileSelectionDialog_Ok_2=OK -FileSelectionDialog_Cancel_3=Cancel - -ExternalToolsPreferencePage_External_tool_project_builders_migration_2=External tool project builders stored in an old format will be migrated to a new format when edited. Projects which store builders using an old format will be migrated whenever a change is made. Once migrated, project builders will not be understood by installations using these older formats. -ExternalToolsPreferencePage_Prompt_before_migrating_3=&Confirm before migrating external tool project builders for edit -ExternalToolsPreferencePage_1=C&onfirm before migrating projects to the new format - -EditCommandDialog_0=Configure Builder -EditCommandDialog_1=Run this builder: -EditCommandDialog_2=After a "&Clean" -EditCommandDialog_3=During &manual builds -EditCommandDialog_4=During &auto builds -EditCommandDialog_5=&During a "Clean" diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java deleted file mode 100644 index db5a4b10d..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java +++ /dev/null @@ -1,245 +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.ui.externaltools.internal.ui; - -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Pattern; -import org.eclipse.core.resources.IContainer; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IAdaptable; -import org.eclipse.jface.dialogs.IDialogConstants; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -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.swt.SWT; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.events.ControlListener; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; -import org.eclipse.ui.model.WorkbenchContentProvider; -import org.eclipse.ui.model.WorkbenchLabelProvider; - -/** - * Dialog for selecting a file in the workspace. Derived from - * org.eclipse.ui.dialogs.ResourceSelectionDialog - */ -public class FileSelectionDialog extends MessageDialog { - // the root element to populate the viewer with - private IAdaptable root; - - // the visual selection widget group - private TreeAndListGroup selectionGroup; - // constants - private final static int SIZING_SELECTION_WIDGET_WIDTH = 400; - private final static int SIZING_SELECTION_WIDGET_HEIGHT = 300; - /** - * The file(s) selected by the user. - */ - private IStructuredSelection result = null; - - private boolean allowMultiselection= false; - - private Pattern fPattern; - /** - * Creates a resource selection dialog rooted at the given element. - * - * @param parentShell - * the parent shell - * @param rootElement - * the root element to populate this dialog with - * @param message - * the message to be displayed at the top of this dialog, or - * null to display a default message - */ - public FileSelectionDialog(Shell parentShell, IAdaptable rootElement, String message) { - super(parentShell, ExternalToolsUIMessages.FileSelectionDialog_Choose_Location_1, null, message, MessageDialog.NONE, new String[] { ExternalToolsUIMessages.FileSelectionDialog_Ok_2, ExternalToolsUIMessages.FileSelectionDialog_Cancel_3}, 0); - root = rootElement; - setShellStyle(getShellStyle() | SWT.RESIZE); - } - - /** - * Limits the files displayed in this dialog to files matching the given - * pattern. The string can be a filename or a regular expression containing - * '*' for any series of characters or '?' for any single character. - * - * @param pattern - * a pattern used to filter the displayed files or null - * to display all files. If a pattern is supplied, only files - * whose names match the given pattern will be available for - * selection. - * @param ignoreCase - * if true, case is ignored. If the pattern argument is null, - * this argument is ignored. - */ - public void setFileFilter(String pattern, boolean ignoreCase) { - if (pattern != null) { - if (ignoreCase) { - fPattern = Pattern.compile(pattern, Pattern.CASE_INSENSITIVE); - } else { - fPattern = Pattern.compile(pattern); - } - } else { - fPattern = null; - } - } - - /* - * (non-Javadoc) Method declared in Window. - */ - protected void configureShell(Shell shell) { - super.configureShell(shell); - PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IExternalToolsHelpContextIds.FILE_SELECTION_DIALOG); - } - - protected void createButtonsForButtonBar(Composite parent) { - super.createButtonsForButtonBar(parent); - initializeDialog(); - } - - /* - * (non-Javadoc) Method declared on Dialog. - */ - protected Control createDialogArea(Composite parent) { - // page group - Composite composite = (Composite) super.createDialogArea(parent); - - //create the input element, which has the root resource - //as its only child - selectionGroup = - new TreeAndListGroup( - composite, - root, - getResourceProvider( - IResource.FOLDER | IResource.PROJECT | IResource.ROOT), - new WorkbenchLabelProvider(), - getResourceProvider(IResource.FILE), - new WorkbenchLabelProvider(), - SWT.NONE, - // since this page has no other significantly-sized - // widgets we need to hardcode the combined widget's - // size, otherwise it will open too small - SIZING_SELECTION_WIDGET_WIDTH, SIZING_SELECTION_WIDGET_HEIGHT, - allowMultiselection); - - composite.addControlListener(new ControlListener() { - public void controlMoved(ControlEvent e) { - } - public void controlResized(ControlEvent e) { - //Also try and reset the size of the columns as appropriate - TableColumn[] columns = - selectionGroup.getListTable().getColumns(); - for (int i = 0; i < columns.length; i++) { - columns[i].pack(); - } - } - }); - - return composite; - } - /** - * Returns a content provider for IResource s that returns - * only children of the given resource type. - */ - private ITreeContentProvider getResourceProvider(final int resourceType) { - return new WorkbenchContentProvider() { - public Object[] getChildren(Object o) { - if (o instanceof IContainer) { - IResource[] members = null; - try { - members = ((IContainer) o).members(); - List accessibleMembers = new ArrayList(members.length); - for (int i = 0; i < members.length; i++) { - IResource resource = members[i]; - if (resource.isAccessible()) { - accessibleMembers.add(resource); - } - } - members = - (IResource[]) accessibleMembers.toArray( - new IResource[accessibleMembers.size()]); - } catch (CoreException e) { - //just return an empty set of children - return new Object[0]; - } - - //filter out the desired resource types - ArrayList results = new ArrayList(); - for (int i = 0; i < members.length; i++) { - //And the test bits with the resource types to see if - // they are what we want - if ((members[i].getType() & resourceType) > 0) { - if (members[i].getType() == IResource.FILE - && fPattern != null - && !fPattern.matcher(members[i].getName()).find()) { - continue; - } - results.add(members[i]); - } - } - return results.toArray(); - } - - return new Object[0]; - } - }; - } - /** - * Initializes this dialog's controls. - */ - private void initializeDialog() { - selectionGroup - .addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - getButton(IDialogConstants.OK_ID).setEnabled( - !selectionGroup.getListTableSelection().isEmpty()); - } - }); - selectionGroup.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent event) { - buttonPressed(IDialogConstants.OK_ID); - } - }); - - getButton(IDialogConstants.OK_ID).setEnabled(false); - } - - /** - * Returns the file the user chose or null if none. - */ - public IStructuredSelection getResult() { - return result; - } - - protected void buttonPressed(int buttonId) { - if (buttonId == IDialogConstants.OK_ID) { - result= selectionGroup.getListTableSelection(); - } - super.buttonPressed(buttonId); - } - /** - * Sets whether this dialog will allow multi-selection. - * Must be called before open - * @param allowMultiselection whether to allow multi-selection in the dialog - */ - public void setAllowMultiselection(boolean allowMultiselection) { - this.allowMultiselection= allowMultiselection; - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java deleted file mode 100644 index 0c3f2cf17..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java +++ /dev/null @@ -1,315 +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.ui.externaltools.internal.ui; - - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelection; -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.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.ViewerComparator; -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.Table; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.views.navigator.ResourceComparator; - -/** - * This class was derived from org.eclipse.ui.internal.misc.CheckboxTreeAndListGroup - * - */ -public class TreeAndListGroup implements ISelectionChangedListener { - private Object root; - private Object currentTreeSelection; - private List selectionChangedListeners = new ArrayList(); - private List doubleClickListeners= new ArrayList(); - - private ITreeContentProvider treeContentProvider; - private IStructuredContentProvider listContentProvider; - private ILabelProvider treeLabelProvider; - private ILabelProvider listLabelProvider; - - // widgets - private TreeViewer treeViewer; - private TableViewer listViewer; - private boolean allowMultiselection= false; - - /** - * Create an instance of this class. Use this constructor if you wish to specify - * the width and/or height of the combined widget (to only hardcode one of the - * sizing dimensions, specify the other dimension's value as -1) - * - * @param parent org.eclipse.swt.widgets.Composite - * @param style int - * @param rootObject java.lang.Object - * @param width int - * @param height int - * @param allowMultiselection Whether to allow multi-selection in the list viewer. - */ - public TreeAndListGroup(Composite parent, Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, int width, int height, boolean allowMultiselection) { - - root = rootObject; - this.treeContentProvider = treeContentProvider; - this.listContentProvider = listContentProvider; - this.treeLabelProvider = treeLabelProvider; - this.listLabelProvider = listLabelProvider; - this.allowMultiselection= allowMultiselection; - createContents(parent, width, height, style); - } - /** - * This method must be called just before this window becomes visible. - */ - public void aboutToOpen() { - currentTreeSelection = null; - - //select the first element in the list - Object[] elements = treeContentProvider.getElements(root); - Object primary = elements.length > 0 ? elements[0] : null; - if (primary != null) { - treeViewer.setSelection(new StructuredSelection(primary)); - } - treeViewer.getControl().setFocus(); - } - /** - * Add the passed listener to collection of clients - * that listen for changes to list viewer selection state - * - * @param listener ISelectionChangedListener - */ - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * Add the given listener to the collection of clients that listen to - * double-click events in the list viewer - * - * @param listener IDoubleClickListener - */ - public void addDoubleClickListener(IDoubleClickListener listener) { - doubleClickListeners.add(listener); - } - - /** - * Notify all selection listeners that a selection has occurred in the list - * viewer - */ - protected void notifySelectionListeners(SelectionChangedEvent event) { - Iterator iter = selectionChangedListeners.iterator(); - while (iter.hasNext()) { - ((ISelectionChangedListener) iter.next()).selectionChanged(event); - } - } - - /** - * Notify all double click listeners that a double click event has occurred - * in the list viewer - */ - protected void notifyDoubleClickListeners(DoubleClickEvent event) { - Iterator iter= doubleClickListeners.iterator(); - while (iter.hasNext()) { - ((IDoubleClickListener) iter.next()).doubleClick(event); - } - } - - /** - * Lay out and initialize self's visual components. - * - * @param parent org.eclipse.swt.widgets.Composite - * @param width int - * @param height int - */ - protected void createContents(Composite parent, int width, int height, int style) { - // group pane - Composite composite = new Composite(parent, style); - composite.setFont(parent.getFont()); - GridLayout layout = new GridLayout(); - layout.numColumns = 2; - layout.makeColumnsEqualWidth = true; - layout.marginHeight = 0; - layout.marginWidth = 0; - composite.setLayout(layout); - composite.setLayoutData(new GridData(GridData.FILL_BOTH)); - - createTreeViewer(composite, width / 2, height); - createListViewer(composite, width / 2, height); - - initialize(); - } - /** - * Create this group's list viewer. - */ - protected void createListViewer(Composite parent, int width, int height) { - int style; - if (allowMultiselection) { - style= SWT.MULTI; - } else { - style= SWT.SINGLE; - } - listViewer = new TableViewer(parent, SWT.BORDER | style); - GridData data = new GridData(GridData.FILL_BOTH); - data.widthHint = width; - data.heightHint = height; - listViewer.getTable().setLayoutData(data); - listViewer.getTable().setFont(parent.getFont()); - listViewer.setContentProvider(listContentProvider); - listViewer.setLabelProvider(listLabelProvider); - listViewer.setComparator(new ResourceComparator(ResourceComparator.NAME)); - listViewer.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - notifySelectionListeners(event); - } - }); - listViewer.addDoubleClickListener(new IDoubleClickListener() { - public void doubleClick(DoubleClickEvent event) { - if (!event.getSelection().isEmpty()) { - notifyDoubleClickListeners(event); - } - } - }); - } - /** - * Create this group's tree viewer. - */ - protected void createTreeViewer(Composite parent, int width, int height) { - Tree tree = new Tree(parent, SWT.BORDER); - GridData data = new GridData(GridData.FILL_BOTH); - data.widthHint = width; - data.heightHint = height; - tree.setLayoutData(data); - tree.setFont(parent.getFont()); - - treeViewer = new TreeViewer(tree); - treeViewer.setContentProvider(treeContentProvider); - treeViewer.setLabelProvider(treeLabelProvider); - treeViewer.setComparator(new ResourceComparator(ResourceComparator.NAME)); - treeViewer.addSelectionChangedListener(this); - } - - public Table getListTable() { - return listViewer.getTable(); - } - - public IStructuredSelection getListTableSelection() { - ISelection selection= this.listViewer.getSelection(); - if (selection instanceof IStructuredSelection) { - return (IStructuredSelection)selection; - } - return StructuredSelection.EMPTY; - } - - protected void initialListItem(Object element) { - Object parent = treeContentProvider.getParent(element); - selectAndRevealFolder(parent); - } - - public void selectAndRevealFolder(Object treeElement) { - treeViewer.reveal(treeElement); - IStructuredSelection selection = new StructuredSelection(treeElement); - treeViewer.setSelection(selection); - } - - public void selectAndRevealFile(Object treeElement) { - listViewer.reveal(treeElement); - IStructuredSelection selection = new StructuredSelection(treeElement); - listViewer.setSelection(selection); - } - - /** - * Initialize this group's viewers after they have been laid out. - */ - protected void initialize() { - treeViewer.setInput(root); - } - - /* (non-Javadoc) - * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent) - */ - public void selectionChanged(SelectionChangedEvent event) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - Object selectedElement = selection.getFirstElement(); - if (selectedElement == null) { - currentTreeSelection = null; - listViewer.setInput(currentTreeSelection); - return; - } - - // ie.- if not an item deselection - if (selectedElement != currentTreeSelection) { - listViewer.setInput(selectedElement); - } - - currentTreeSelection = selectedElement; - } - /** - * Set the list viewer's providers to those passed - * - * @param contentProvider ITreeContentProvider - * @param labelProvider ILabelProvider - */ - public void setListProviders(IStructuredContentProvider contentProvider, ILabelProvider labelProvider) { - listViewer.setContentProvider(contentProvider); - listViewer.setLabelProvider(labelProvider); - } - /** - * Set the sorter that is to be applied to self's list viewer - */ - public void setListSorter(ViewerComparator comparator) { - listViewer.setComparator(comparator); - } - /** - * Set the root of the widget to be new Root. Regenerate all of the tables and lists from this - * value. - * @param newRoot - */ - public void setRoot(Object newRoot) { - root = newRoot; - initialize(); - } - - /** - * Set the tree viewer's providers to those passed - * - * @param contentProvider ITreeContentProvider - * @param labelProvider ILabelProvider - */ - public void setTreeProviders(ITreeContentProvider contentProvider, ILabelProvider labelProvider) { - treeViewer.setContentProvider(contentProvider); - treeViewer.setLabelProvider(labelProvider); - } - /** - * Set the comparator that is to be applied to self's tree viewer - */ - public void setTreeComparator(ViewerComparator comparator) { - treeViewer.setComparator(comparator); - } - - /** - * Set the focus on to the list widget. - */ - public void setFocus() { - treeViewer.getTree().setFocus(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java deleted file mode 100644 index 88960d6b3..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java +++ /dev/null @@ -1,136 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007, 2009 Matthew 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: - * Matthew Conway - initial API and implementation - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.variables; - -import java.util.LinkedHashSet; -import java.util.Set; - -import org.eclipse.core.externaltools.internal.model.ExternalToolBuilder; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; - -public class BuildFilesResolver implements IDynamicVariableResolver -{ - private static final char ARG_REMOVED = 'r'; - private static final char ARG_CHANGED = 'c'; - private static final char ARG_ADDED = 'a'; - private static final char ARG_DIRS = 'd'; - private static final char ARG_FILES = 'f'; - - // Use a space as a separator as this is a more natural fit for sending a - // list of files to a unix command - private static final String FILE_LIST_SEPARATOR = " "; //$NON-NLS-1$ - - public String resolveValue(IDynamicVariable variable, String argument) throws CoreException - { - String result = null; - - IResourceDelta buildDelta = ExternalToolBuilder.getBuildDelta(); - if (buildDelta != null) - { - final StringBuffer fileList = new StringBuffer(); - final Set changedResources = new LinkedHashSet(); - - // Use the argument to determine which deltas to visit - if none, - // then defaults to all - int deltas = 0; - boolean dirs = false, files = false; - if (argument != null) - { - // Check delta kinds - if (argument.indexOf(ARG_ADDED) > -1) - { - deltas |= IResourceDelta.ADDED; - } - if (argument.indexOf(ARG_CHANGED) > -1) - { - deltas |= IResourceDelta.CHANGED; - } - if (argument.indexOf(ARG_REMOVED) > -1) - { - deltas |= IResourceDelta.REMOVED; - } - - // Check wether to include files and/or directories - if (argument.indexOf(ARG_DIRS) > -1) - { - dirs = true; - } - if (argument.indexOf(ARG_FILES) > -1) - { - files = true; - } - - } - if (deltas == 0) - { - deltas = IResourceDelta.ADDED | IResourceDelta.CHANGED | IResourceDelta.REMOVED; - } - if (!dirs && !files) - { - dirs = true; - files = true; - } - final int trackDeltas = deltas; - final boolean trackDirs = dirs; - final boolean trackFiles = files; - - - buildDelta.accept(new IResourceDeltaVisitor() - { - public boolean visit(IResourceDelta delta) throws CoreException - { - IResource resource = delta.getResource(); - - // Only track files with the right kind of delta - boolean isTracked = (delta.getKind() & trackDeltas) > 0; - if (isTracked) - { - // Only track dirs if desired - isTracked = trackDirs && resource.getType() != IResource.FILE; - // Only track files if desired - isTracked |= trackFiles && resource.getType() == IResource.FILE; - } - - // If tracking a change, then add it to the change set for inclusion in the variable's output - if (isTracked) - { - String osPath = resource.getLocation().toOSString(); - if (changedResources.add(osPath)) - { - if (fileList.length() > 0) - { - fileList.append(FILE_LIST_SEPARATOR); - } - - // Since space is our separator, we need to add quotes - // around each file to handle filenames with embedded - // spaces. We also need to escape out embedded quotes in - // the filename so they don't conflict with these - // special quotes. - // - osPath = osPath.replaceAll("\"", "\\\\\""); //$NON-NLS-1$ //$NON-NLS-2$ - fileList.append("\"" + osPath + "\""); //$NON-NLS-1$ //$NON-NLS-2$ - } - } - return true; - } - }, deltas); - result = fileList.toString(); - } - - return result; - } -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java deleted file mode 100644 index e44873975..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java +++ /dev/null @@ -1,74 +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.ui.externaltools.internal.variables; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -import org.eclipse.core.externaltools.internal.model.ExternalToolBuilder; -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.core.runtime.Path; -import org.eclipse.core.runtime.Status; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; -import org.eclipse.osgi.util.NLS; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; - - -public class BuildProjectResolver 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= ExternalToolBuilder.getBuildProject(); - if (argument != null && resource != null) { - resource = ((IProject)resource).findMember(new Path(argument)); - } - if (resource != null && resource.exists()) { - return resource.getLocation().toOSString(); - } - abort(NLS.bind(VariableMessages.BuildProjectResolver_3, new String[]{getReferenceExpression(variable, argument)}), null); - return null; - } - - /** - * Throws an exception with the given message and underlying exception. - * - * @param message exception message - * @param exception underlying exception or null - * @throws CoreException - */ - protected void abort(String message, Throwable exception) throws CoreException { - throw new CoreException(new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, IExternalToolConstants.ERR_INTERNAL_ERROR, message, exception)); - } - - /** - * Returns an expression used to reference the given variable and optional argument. - * For example, ${var_name:arg}. - * - * @param variable referenced variable - * @param argument referenced argument or null - * @return vraiable reference expression - */ - protected String getReferenceExpression(IDynamicVariable variable, String argument) { - StringBuffer reference = new StringBuffer(); - reference.append("${"); //$NON-NLS-1$ - reference.append(variable.getName()); - if (argument != null) { - reference.append(":"); //$NON-NLS-1$ - reference.append(argument); - } - reference.append("}"); //$NON-NLS-1$ - return reference.toString(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeResolver.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeResolver.java deleted file mode 100644 index 64f8d47a1..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeResolver.java +++ /dev/null @@ -1,26 +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.ui.externaltools.internal.variables; - -import org.eclipse.core.externaltools.internal.model.ExternalToolBuilder; -import org.eclipse.core.variables.IDynamicVariable; -import org.eclipse.core.variables.IDynamicVariableResolver; - - -public class BuildTypeResolver 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) { - return ExternalToolBuilder.getBuildType(); - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java deleted file mode 100644 index dbcfce370..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java +++ /dev/null @@ -1,67 +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 - * Wieant (wieant@tasking.com) - Bug 138007 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.variables; - -import java.io.File; -import java.util.Map; -import java.util.StringTokenizer; - -import org.eclipse.core.externaltools.internal.IExternalToolConstants; -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.DebugPlugin; -import org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin; - -public class SystemPathResolver 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 { - if (argument == null) { - throw new CoreException(new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, IExternalToolConstants.ERR_INTERNAL_ERROR, VariableMessages.SystemPathResolver_0, null)); - } - Map map= DebugPlugin.getDefault().getLaunchManager().getNativeEnvironment(); - String path= (String) map.get("PATH"); //$NON-NLS-1$ - if (path == null) { - return argument; - } - // On MS Windows the PATHEXT environment variable defines which file extensions - // mark files that are executable (e.g. .EXE, .COM, .BAT) - String pathext = (String) map.get("PATHEXT"); //$NON-NLS-1$ - StringTokenizer tokenizer= new StringTokenizer(path, File.pathSeparator); - while (tokenizer.hasMoreTokens()) { - String pathElement= tokenizer.nextToken(); - File pathElementFile= new File(pathElement); - if (pathElementFile.isDirectory()) { - File toolFile= new File(pathElementFile, argument); - if (toolFile.exists()) { - return toolFile.getAbsolutePath(); - } - if ( pathext != null ) { - StringTokenizer pathextTokenizer = new StringTokenizer(pathext, File.pathSeparator); - while (pathextTokenizer.hasMoreTokens()) { - String pathextElement = pathextTokenizer.nextToken(); - toolFile = new File(pathElementFile, argument + pathextElement); - if (toolFile.exists()) { - return toolFile.getAbsolutePath(); - } - } - } - } - } - return argument; - } -} diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.java deleted file mode 100644 index 959a71486..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.java +++ /dev/null @@ -1,24 +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 - Initial API and implementation - **********************************************************************/ -package org.eclipse.ui.externaltools.internal.variables; - -import org.eclipse.osgi.util.NLS; - -public class VariableMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.variables.VariableMessages";//$NON-NLS-1$ - - public static String BuildProjectResolver_3; - public static String SystemPathResolver_0; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, VariableMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.properties b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.properties deleted file mode 100644 index 65a694e77..000000000 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/VariableMessages.properties +++ /dev/null @@ -1,13 +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 -############################################################################### - -BuildProjectResolver_3=Variable references non-existent resource : {0} -SystemPathResolver_0=External tool argument must be specified for the system_path variable diff --git a/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF b/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF deleted file mode 100644 index b7213c6dc..000000000 --- a/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF +++ /dev/null @@ -1,24 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: %Plugin.name -Bundle-SymbolicName: org.eclipse.ui.externaltools; singleton:=true -Bundle-Version: 3.2.0.qualifier -Bundle-Activator: org.eclipse.ui.externaltools.internal.model.ExternalToolsPlugin -Bundle-Vendor: %Plugin.providerName -Bundle-Localization: plugin -Export-Package: org.eclipse.ui.externaltools.internal.launchConfigurations;x-friends:="org.eclipse.ant.ui", - org.eclipse.ui.externaltools.internal.menu;x-internal:=true, - org.eclipse.ui.externaltools.internal.model;x-friends:="org.eclipse.ant.ui", - org.eclipse.ui.externaltools.internal.program.launchConfigurations;x-friends:="org.eclipse.ant.ui", - org.eclipse.ui.externaltools.internal.ui;x-friends:="org.eclipse.ant.ui", - org.eclipse.ui.externaltools.internal.variables;x-internal:=true -Require-Bundle: org.eclipse.ui.ide;bundle-version="[3.2.0,4.0.0)";resolution:=optional, - org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.variables;bundle-version="[3.1.0,4.0.0)", - org.eclipse.ui;bundle-version="[3.2.0,4.0.0)", - org.eclipse.debug.core;bundle-version="[3.2.0,4.0.0)", - org.eclipse.debug.ui;bundle-version="[3.2.0,4.0.0)", - org.eclipse.core.runtime;bundle-version="[3.1.0,4.0.0)", - org.eclipse.core.externaltools;bundle-version="[1.0.0,2.0.0)" -Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.java deleted file mode 100644 index 82687b476..000000000 --- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.java +++ /dev/null @@ -1,28 +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.ui.externaltools.internal.program.launchConfigurations; - -import org.eclipse.osgi.util.NLS; - -public class ExternalToolsProgramMessages extends NLS { - private static final String BUNDLE_NAME = "org.eclipse.ui.externaltools.internal.program.launchConfigurations.ExternalToolsProgramMessages";//$NON-NLS-1$ - - public static String BackgroundResourceRefresher_0; - - public static String ProgramLaunchDelegate_Workbench_Closing_1; - public static String ProgramLaunchDelegate_The_workbench_is_exiting; - - public static String ProgramMainTab_Select; - - static { - // load message values from bundle file - NLS.initializeMessages(BUNDLE_NAME, ExternalToolsProgramMessages.class); - } -} \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties deleted file mode 100644 index 5687b92fc..000000000 --- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ExternalToolsProgramMessages.properties +++ /dev/null @@ -1,17 +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 -############################################################################### - -BackgroundResourceRefresher_0=Refreshing resources... - -ProgramLaunchDelegate_Workbench_Closing_1=Workbench Closing -ProgramLaunchDelegate_The_workbench_is_exiting=The workbench is exiting and a program launched from an external tool appears to still be running. These programs will be terminated when the workbench exits. It is recommended that you exit any external programs launched from the workbench before you proceed.\n\nClick OK to continue exiting the workbench. - -ProgramMainTab_Select=&Select a program: diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java deleted file mode 100644 index 4bfb827a0..000000000 --- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java +++ /dev/null @@ -1,35 +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.ui.externaltools.internal.program.launchConfigurations; - - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.EnvironmentTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.debug.ui.RefreshTab; -import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsBuilderTab; - -public class ProgramBuilderTabGroup extends AbstractLaunchConfigurationTabGroup { - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - new ProgramMainTab(), - new RefreshTab(), - new EnvironmentTab(), - new ExternalToolsBuilderTab(), - }; - setTabs(tabs); - } -} diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java deleted file mode 100644 index 6969274f6..000000000 --- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.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.ui.externaltools.internal.program.launchConfigurations; - - -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsMainTab; -import org.eclipse.ui.externaltools.internal.model.IExternalToolsHelpContextIds; -import org.eclipse.ui.externaltools.internal.ui.FileSelectionDialog; - -public class ProgramMainTab extends ExternalToolsMainTab { - - /** - * Prompts the user for a program location within the workspace and sets the - * location as a String containing the workspace_loc variable or - * null if no location was obtained from the user. - */ - protected void handleWorkspaceLocationButtonSelected() { - FileSelectionDialog dialog; - dialog = new FileSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), ExternalToolsProgramMessages.ProgramMainTab_Select); - dialog.open(); - IStructuredSelection result = dialog.getResult(); - if (result == null) { - return; - } - Object file= result.getFirstElement(); - if (file instanceof IFile) { - StringBuffer expression = new StringBuffer(); - expression.append("${workspace_loc:"); //$NON-NLS-1$ - expression.append(((IFile)file).getFullPath().toString()); - expression.append("}"); //$NON-NLS-1$ - locationField.setText(expression.toString()); - } - } - - - /* (non-Javadoc) - * @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite) - */ - public void createControl(Composite parent) { - super.createControl(parent); - PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_PROGRAM_MAIN_TAB); - } -} diff --git a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java b/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java deleted file mode 100644 index 7da41166c..000000000 --- a/org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java +++ /dev/null @@ -1,37 +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 - * dakshinamurthy.karra@gmail.com - bug 165371 - *******************************************************************************/ -package org.eclipse.ui.externaltools.internal.program.launchConfigurations; - -import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; -import org.eclipse.debug.ui.CommonTab; -import org.eclipse.debug.ui.EnvironmentTab; -import org.eclipse.debug.ui.ILaunchConfigurationDialog; -import org.eclipse.debug.ui.ILaunchConfigurationTab; -import org.eclipse.debug.ui.RefreshTab; -import org.eclipse.ui.externaltools.internal.launchConfigurations.ExternalToolsBuildTab; - -public class ProgramTabGroup extends AbstractLaunchConfigurationTabGroup { - - /** - * @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String) - */ - public void createTabs(ILaunchConfigurationDialog dialog, String mode) { - ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { - new ProgramMainTab(), - new RefreshTab(), - new ExternalToolsBuildTab(), - new EnvironmentTab(), - new CommonTab() - }; - setTabs(tabs); - } -} diff --git a/org.eclipse.ui.externaltools/about.html b/org.eclipse.ui.externaltools/about.html deleted file mode 100644 index 460233046..000000000 --- a/org.eclipse.ui.externaltools/about.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - -About - - -

                              About This Content

                              - -

                              June 2, 2006

                              -

                              License

                              - -

                              The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise -indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available -at http://www.eclipse.org/legal/epl-v10.html. -For purposes of the EPL, "Program" will mean the Content.

                              - -

                              If you did not receive this Content directly from the Eclipse Foundation, the Content is -being redistributed by another party ("Redistributor") and different terms and conditions may -apply to your use of any object code in the Content. Check the Redistributor's license that was -provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise -indicated below, the terms and conditions of the EPL still apply to any source code in the Content -and such source code may be obtained at http://www.eclipse.org.

                              - - - \ No newline at end of file diff --git a/org.eclipse.ui.externaltools/build.properties b/org.eclipse.ui.externaltools/build.properties deleted file mode 100644 index c21f4c355..000000000 --- a/org.eclipse.ui.externaltools/build.properties +++ /dev/null @@ -1,22 +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 -############################################################################### -source.. = External Tools Base/,\ - Program Tools Support/ - -src.includes=about.html - -bin.includes = icons/,\ - plugin.properties,\ - plugin.xml,\ - about.html,\ - .,\ - META-INF/ -output.. = bin/ diff --git a/org.eclipse.ui.externaltools/buildfiles/exportplugin.xml b/org.eclipse.ui.externaltools/buildfiles/exportplugin.xml deleted file mode 100644 index c0b6754e0..000000000 --- a/org.eclipse.ui.externaltools/buildfiles/exportplugin.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.ui.externaltools/icons/full/dtool16/external_tools.gif b/org.eclipse.ui.externaltools/icons/full/dtool16/external_tools.gif deleted file mode 100644 index 4122d9a26..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/dtool16/external_tools.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/etool16/external_tools.gif b/org.eclipse.ui.externaltools/icons/full/etool16/external_tools.gif deleted file mode 100644 index b05bf3e3d..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/etool16/external_tools.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/obj16/build_tab.gif b/org.eclipse.ui.externaltools/icons/full/obj16/build_tab.gif deleted file mode 100644 index 4fcb208b4..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/obj16/build_tab.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/obj16/builder.gif b/org.eclipse.ui.externaltools/icons/full/obj16/builder.gif deleted file mode 100644 index 903bbec3b..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/obj16/builder.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/obj16/classpath.gif b/org.eclipse.ui.externaltools/icons/full/obj16/classpath.gif deleted file mode 100644 index cb55e33b5..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/obj16/classpath.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/obj16/external_tools.gif b/org.eclipse.ui.externaltools/icons/full/obj16/external_tools.gif deleted file mode 100644 index b05bf3e3d..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/obj16/external_tools.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/obj16/invalid_build_tool.gif b/org.eclipse.ui.externaltools/icons/full/obj16/invalid_build_tool.gif deleted file mode 100644 index 0bc60689c..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/obj16/invalid_build_tool.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/obj16/main_tab.gif b/org.eclipse.ui.externaltools/icons/full/obj16/main_tab.gif deleted file mode 100644 index 0193dbeab..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/obj16/main_tab.gif and /dev/null differ diff --git a/org.eclipse.ui.externaltools/icons/full/wizban/ext_tools_wiz.png b/org.eclipse.ui.externaltools/icons/full/wizban/ext_tools_wiz.png deleted file mode 100644 index 66335ad33..000000000 Binary files a/org.eclipse.ui.externaltools/icons/full/wizban/ext_tools_wiz.png and /dev/null differ diff --git a/org.eclipse.ui.externaltools/plugin.properties b/org.eclipse.ui.externaltools/plugin.properties deleted file mode 100644 index fa9aba8b5..000000000 --- a/org.eclipse.ui.externaltools/plugin.properties +++ /dev/null @@ -1,38 +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 -############################################################################### - -Plugin.name = External Tools -Plugin.providerName = Eclipse.org - -build_type.description= Returns the type of build being performed - "incremental", "full", "auto", or "none". -build_project.description= Returns the absolute file system path of the project currently being built, or the absolute file system path of the resource identified by an optional argument interpreted as a path relative to the project currently being built. -build_files.description= Returns the set of absolute file system paths whose modification caused the current build. A list of the characters, 'a' (added), 'c' (changed), 'r' (removed), 'f' (files only), 'd' (directories only), can be supplied as an argument to limit the file list to just those types of deltas. Defaults to all deltas. -system_path.description= Returns the absolute file system path of the external tool. Resolved by finding the first occurrence of the named tool based on the system path specification. The tool name must be supplied as an argument. - -ExtPoint.configurationDuplicationMaps = Launch Configuration Duplication Maps -ExternalToolsLaunchGroup.label = &External Tools -ExternalToolsLaunchGroup.title = Select or configure an external tool to run -Menu.run = &Run -ActionSet.externalTools = External Tools -Action.externalTools = &External Tools -Action.externalToolsTip = Run Last Tool -PropertyPage.externalToolsBuilders = Builders - -PreferencePage.externalToolsPreferences = External Tools - -programLaunchConfigurationTabGroup.description=Run a program -programBuilderLaunchConfigurationTabGroup.description=Create a configuration that will run a program during builds - -ActionDefinition.externalToolMenuDelegateToolbar.name=Run Last Launched External Tool -ActionDefinition.externalToolMenuDelegateToolbar.description=Runs the last launched external Tool - -ActionDefinition.openExternalToolsConfigurations.name=External Tools... -ActionDefinition.openExternalToolsConfigurations.description=Open external tools launch configuration dialog diff --git a/org.eclipse.ui.externaltools/plugin.xml b/org.eclipse.ui.externaltools/plugin.xml deleted file mode 100644 index 8360fdadf..000000000 --- a/org.eclipse.ui.externaltools/plugin.xml +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.eclipse.ui.externaltools/schema/configurationDuplicationMaps.exsd b/org.eclipse.ui.externaltools/schema/configurationDuplicationMaps.exsd deleted file mode 100644 index 2708f4d25..000000000 --- a/org.eclipse.ui.externaltools/schema/configurationDuplicationMaps.exsd +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - This is an internal extension point to declare the launch configuration type that -should be created when duplicating an existing configuration as a project builder. - -Clients are not intended to use this extension point. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - specifies the identifier of the launch configuration type for which this mapping is provided - - - - - - - - - - specifies the identifier of the launch configuration type which should be created when a configuration of type "sourceType" is imported to be a project builder - - - - - - - - - - - - - - - 3.0 - - - - - - - - - The following example specifies that when the user chooses to import a launch configuration -of the type "org.eclipse.ui.externaltools.ProgramLaunchConfigurationType", a new launch -configuration of the type"org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType" -should be created. - -<pre> -<extension - point="org.eclipse.ui.externaltools.configurationDuplicationMaps"> - <configurationMap - sourceType="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType" - builderType="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"> - </configurationMap> -</extension> -</pre> - - - - - - - - - - - - Copyright (c) 2003, 2005 IBM Corporation and others.<br> -All rights reserved. This program and the accompanying materials are made -available under the terms of the Eclipse Public License v1.0 which -accompanies this distribution, and is available at -<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> - - - - -- cgit v1.2.3