Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.core.externaltools/.classpath2
-rw-r--r--org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.core.externaltools/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/ExternalToolsCore.java32
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/IExternalToolConstants.java43
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/BackgroundResourceRefresher.java22
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ProgramLaunchDelegate.java26
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/BuilderCoreUtils.java38
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/model/ExternalToolBuilder.java63
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/registry/ExternalToolMigration.java125
-rw-r--r--org.eclipse.core.variables/.classpath4
-rw-r--r--org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.core.variables/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.core.variables/build.properties2
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ContributedValueVariable.java30
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/DynamicVariable.java14
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java13
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringSubstitutionEngine.java131
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariable.java20
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/StringVariableManager.java155
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/ValueVariable.java22
-rw-r--r--org.eclipse.debug.core/.classpath4
-rw-r--r--org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.debug.core/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java99
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java508
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java189
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java117
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java108
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java42
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java169
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java253
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java104
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/commands/AbstractDebugCommand.java98
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java96
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/DebugElement.java62
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IExpression.java21
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IFilteredStep.java5
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/LaunchConfigurationDelegate.java149
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/LineBreakpoint.java11
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/RuntimeProcess.java111
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupDirector.java285
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/AbstractSourceLookupParticipant.java42
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/AbstractSourceContainer.java46
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ArchiveSourceContainer.java53
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/CompositeSourceContainer.java30
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ContainerSourceContainer.java68
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DefaultSourceContainer.java35
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/DirectorySourceContainer.java58
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ExternalArchiveSourceContainer.java118
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/FolderSourceContainer.java13
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/LocalFileStorage.java40
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ProjectSourceContainer.java34
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/WorkspaceSourceContainer.java23
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/sourcelookup/containers/ZipEntryStorage.java46
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/BreakpointManager.java404
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugOptions.java21
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/DebugPreferenceInitializer.java5
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/EnvironmentVariableResolver.java25
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/ExpressionManager.java192
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/InputStreamMonitor.java42
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java301
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationComparator.java33
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationInfo.java369
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationType.java188
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfigurationWorkingCopy.java239
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchDelegate.java87
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchManager.java1097
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchMode.java28
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchablePropertyTester.java3
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureManager.java78
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LogicalStructureType.java44
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/MemoryBlockManager.java120
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java34
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/OutputStreamMonitor.java46
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/PreferredDelegateModifyListener.java12
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RefreshScopeComparator.java13
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StepFilterManager.java25
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/StreamsProxy.java24
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemPropertyResolver.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/SystemVariableResolver.java12
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/WatchExpression.java57
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/XMLMemento.java44
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/CommandAdapterFactory.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DebugCommandRequest.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DisconnectCommand.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/DropToFrameCommand.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ForEachCommand.java10
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/Request.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/ResumeCommand.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepCommand.java20
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepFiltersCommand.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepIntoCommand.java7
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepOverCommand.java7
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/StepReturnCommand.java7
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/SuspendCommand.java10
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/commands/TerminateCommand.java8
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceContainerType.java27
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLocatorMementoComparator.java30
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourceLookupUtils.java42
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/SourcePathComputer.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ArchiveSourceContainerType.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DefaultSourceContainerType.java18
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/DirectorySourceContainerType.java18
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ExternalArchiveSourceContainerType.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/FolderSourceContainerType.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/ProjectSourceContainerType.java16
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/sourcelookup/containers/WorkspaceSourceContainerType.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ContainerResolver.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/DateTimeResolver.java9
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ProjectResolver.java7
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/ResourceResolver.java35
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/WorkspaceResolver.java18
-rw-r--r--org.eclipse.debug.core/pom.xml2
-rw-r--r--org.eclipse.debug.examples.core/.classpath4
-rw-r--r--org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.debug.examples.core/META-INF/MANIFEST.MF8
-rw-r--r--org.eclipse.debug.examples.core/pdavm/src/org/eclipse/debug/examples/pdavm/PDAVirtualMachine.java460
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/ClockControl.java4
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/LengthControl.java1
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunch.java8
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/MidiLaunchDelegate.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/SequencerControl.java2
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TempoControl.java4
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/midi/launcher/TimeControl.java4
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/DebugCorePlugin.java2
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDALineBreakpoint.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDARunToLineBreakpoint.java2
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/breakpoints/PDAWatchpoint.java22
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/launcher/PDALaunchDelegate.java46
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java2
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArrayEntry.java9
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugElement.java1
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java135
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java5
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackFrame.java26
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAStackValue.java21
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAThread.java158
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAValue.java11
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAVariable.java9
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java2
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDABitFieldData.java16
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAChildrenCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAClearBreakpointCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADropFrameCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEvalCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java16
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAGroupsCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAListResult.java14
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDANoSuchLabelEvent.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPopDataCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAPushDataCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegisterData.java17
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARegistersCommandResult.java14
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARestartCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAResumeCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetBreakpointCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetDataCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASetVarCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackCommandResult.java14
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStackDepthCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepReturnCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDASuspendCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMResumeCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAWatchCommand.java3
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupDirector.java1
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourceLookupParticipant.java1
-rw-r--r--org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/sourcelookup/PDASourcePathComputerDelegate.java1
-rw-r--r--org.eclipse.debug.examples.core/src_ant/org/eclipse/debug/examples/ant/tasks/PreProcessor.java65
-rw-r--r--org.eclipse.debug.examples.ui/.classpath4
-rw-r--r--org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF8
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/CheckboxModelProxyFactory.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlCellModifier.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEditor.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlEventHandler.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlLabelProvider.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/ControlsMementoProvider.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiAdapterFactory.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventLabelProvider.java20
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiEventModelProxy.java7
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/MidiStepOverHandler.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnFactory.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerColumnPresentation.java5
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerContentProvider.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerControlsModelProxy.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/SequencerModelProxyFactory.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnFactory.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackColumnPresentation.java5
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackContentProvider.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackLabelProvider.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/adapters/TrackModelProxy.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ClockSliderDetailPane.java9
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/ControlDetailPaneFactory.java17
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/detailpanes/TempoSliderDetailPane.java9
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/ExampleLaunchStatusHandler.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiLaunchShortcut.java28
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiMainTab.java11
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/MidiTabGroup.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/DebugUIPlugin.java59
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AdapterFactory.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AddPDAMemoryBlockAction.java5
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/CommandAdapterFactory.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/ModelProxyFactory.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetContentProvider.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDADebugTargetProxy.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDARestartDebugCommand.java9
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAThreadEventHandler.java8
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAViewActionProvider.java14
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java144
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDABreakpointAdapter.java12
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAEditorAdapterFactory.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDARunToLineAdapter.java2
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTarget.java16
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/breakpoints/PDAToggleWatchpointsTargetFactory.java43
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/AnnotationHover.java11
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistProcessor.java28
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAContentAssistant.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAEditor.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDAScanner.java12
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PDASourceViewerConfiguration.java10
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/PopFrameActionDelegate.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/editor/TextHover.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java6
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDAMainTab.java9
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDATabGroup.java1
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/presentation/PDAModelPresentation.java5
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/AbstractDataStackViewHandler.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CanPushTester.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/CheckboxView.java3
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/DataStackView.java16
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PopHandler.java11
-rw-r--r--org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/views/PushHandler.java3
-rw-r--r--org.eclipse.debug.tests/.classpath2
-rw-r--r--org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs38
-rw-r--r--org.eclipse.debug.tests/META-INF/MANIFEST.MF6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/ArgumentParsingTests.java80
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileStore.java29
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/DebugFileSystem.java39
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchConfigurationTests.java460
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchFavoriteTests.java72
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/LaunchManagerTests.java35
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/TestLaunchDelegate.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/DynamicRenderingBindings.java9
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryBlock.java9
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/MemoryRenderingTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/view/memory/RenderingTypeDelegate.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/CheckTests.java9
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ChildrenUpdateTests.java99
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ColumnPresentationTests.java20
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ContentTests.java164
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/DeltaTests.java239
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java18
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTransformTests.java1
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerCheckTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerContentTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerDeltaTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerFilterTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerLazyTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPerformanceTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerPopupTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerSelectionTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerStateTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java12
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerUpdateTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java9
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PerformanceTests.java12
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/PopupTests.java76
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/SelectionTests.java87
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/StateTests.java305
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModel.java255
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TestModelUpdatesListener.java404
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreeModelViewerAutopopulateAgent.java37
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreePathWrapper.java9
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/UpdateTests.java254
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerContentTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerDeltaTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerFilterTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerLazyModeTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPerformanceTests.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerPopupTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerSelectionTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerStateTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerUpdateTests.java3
-rw-r--r--org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VisibleVirtualItemValidator.java6
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java2
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java34
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java115
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/statushandlers/StatusHandler.java1
-rw-r--r--org.eclipse.debug.ui/.classpath4
-rw-r--r--org.eclipse.debug.ui/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.debug.ui/META-INF/MANIFEST.MF10
-rw-r--r--org.eclipse.debug.ui/pom.xml2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java79
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java73
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java170
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java50
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowTargetBreakpointsAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandHandler.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java44
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java101
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java94
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultBreakpointsViewInput.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java416
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/WatchExpressionCellModifier.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointsPathDecorator.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java27
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java185
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java43
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java63
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java135
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java301
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java500
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java2767
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java119
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java139
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/WatchExpressionEditor.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java168
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java55
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java82
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java145
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java28
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java135
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java89
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java151
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java268
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java271
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java290
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java127
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java212
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java57
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java54
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java69
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java51
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointManagerProxy.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java115
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java165
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java111
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java76
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java39
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java168
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java59
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java36
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java369
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java121
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java111
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java118
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java345
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java300
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java475
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java30
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java16
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java458
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java711
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java384
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java180
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java105
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java34
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java215
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java86
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java46
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java1185
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java77
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java194
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java87
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java62
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java305
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java78
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java60
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java33
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java418
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java107
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java66
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java38
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java440
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java102
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java53
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java109
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java32
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java65
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java92
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java37
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java101
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java42
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java26
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java8
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java61
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java14
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java29
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java45
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java52
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManager.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java80
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java24
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java25
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java48
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java9
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java17
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java409
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java4
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java13
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java7
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java18
-rw-r--r--org.eclipse.ui.console/.classpath4
-rw-r--r--org.eclipse.ui.console/.settings/.api_filters12
-rw-r--r--org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.ui.console/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java105
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java54
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java73
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java43
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java118
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java90
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java77
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java71
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java196
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java151
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java163
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/actions/ClearOutputAction.java24
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/actions/CloseConsoleAction.java13
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerAction.java18
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/actions/TextViewerGotoLineAction.java38
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.java35
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java179
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java29
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleFactoryExtension.java14
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleHyperlinkPosition.java14
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleManager.java163
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePageParticipantExtension.java16
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsolePatternMatcher.java75
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleTypePropertyTester.java9
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java205
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleViewConsoleFactory.java9
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleWorkbenchPart.java20
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/FollowHyperlinkAction.java14
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/HyperlinkUpdater.java6
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePage.java37
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartition.java65
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsolePartitioner.java252
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/IOConsoleViewer.java33
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/OpenConsoleAction.java63
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListener.java28
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PatternMatchListenerExtension.java38
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/PinConsoleAction.java16
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ScrollLockAction.java19
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ShowConsoleAction.java12
-rw-r--r--org.eclipse.ui.externaltools/.classpath16
-rw-r--r--org.eclipse.ui.externaltools/.settings/.api_filters11
-rw-r--r--org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs40
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuildTab.java95
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsBuilderTab.java163
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/ExternalToolsMainTab.java140
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/IgnoreWhiteSpaceComparator.java30
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/launchConfigurations/WorkingSetComparator.java27
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/menu/ExternalToolMenuDelegate.java9
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java26
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java34
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPreferenceInitializer.java7
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/IExternalToolConstants.java57
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java44
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderLabelProvider.java21
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java231
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/EditCommandDialog.java24
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/ExternalToolsPreferencePage.java20
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/FileSelectionDialog.java36
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/TreeAndListGroup.java38
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildFilesResolver.java35
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildProjectResolver.java13
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/BuildTypeResolver.java5
-rw-r--r--org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/variables/SystemPathResolver.java15
-rw-r--r--org.eclipse.ui.externaltools/META-INF/MANIFEST.MF10
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramBuilderTabGroup.java5
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramMainTab.java10
-rw-r--r--org.eclipse.ui.externaltools/Program Tools Support/org/eclipse/ui/externaltools/internal/program/launchConfigurations/ProgramTabGroup.java5
-rw-r--r--org.eclipse.ui.externaltools/buildfiles/exportplugin.xml40
1014 files changed, 22787 insertions, 17400 deletions
diff --git a/org.eclipse.core.externaltools/.classpath b/org.eclipse.core.externaltools/.classpath
index 2fbb7a23e..ad32c83a7 100644
--- a/org.eclipse.core.externaltools/.classpath
+++ b/org.eclipse.core.externaltools/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.core.externaltools/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.core.externaltools/META-INF/MANIFEST.MF b/org.eclipse.core.externaltools/META-INF/MANIFEST.MF
index 1ecf7ced9..180170a8a 100644
--- a/org.eclipse.core.externaltools/META-INF/MANIFEST.MF
+++ b/org.eclipse.core.externaltools/META-INF/MANIFEST.MF
@@ -6,10 +6,10 @@ Bundle-SymbolicName: org.eclipse.core.externaltools;singleton:=true
Bundle-Version: 1.0.300.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)",
+ org.eclipse.debug.core;bundle-version="[3.9.0,4.0.0)",
+ org.eclipse.core.variables;bundle-version="[3.2.800,4.0.0)",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
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",
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
index b0e2bf115..8bc56c98a 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,16 +23,16 @@ public class ExternalToolsCore extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.core.externaltools"; //$NON-NLS-1$
-
+
/**
* Status code indicating an unexpected internal error.
* @since 2.1
*/
- public static final int INTERNAL_ERROR = 120;
+ public static final int INTERNAL_ERROR = 120;
// The shared instance
private static ExternalToolsCore plugin;
-
+
/**
* The constructor
*/
@@ -43,6 +43,7 @@ public class ExternalToolsCore extends Plugin {
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -52,6 +53,7 @@ public class ExternalToolsCore extends Plugin {
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
@@ -65,11 +67,11 @@ public class ExternalToolsCore extends Plugin {
public static ExternalToolsCore getDefault() {
return plugin;
}
-
+
/**
* Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to 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$
@@ -78,33 +80,33 @@ public class ExternalToolsCore extends Plugin {
/**
* Logs the specified status with this plug-in's log.
- *
- * @param status status
+ *
+ * @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 <code>IStatus</code> for this plug-in
*/
public static IStatus newErrorStatus(String message, Throwable exception) {
if (message == null) {
- return new Status(IStatus.ERROR, PLUGIN_ID, 0, IExternalToolConstants.EMPTY_STRING, exception);
- }
+ return new Status(IStatus.ERROR, PLUGIN_ID, 0, IExternalToolConstants.EMPTY_STRING, exception);
+ }
return new Status(IStatus.ERROR, PLUGIN_ID, 0, message, exception);
}
-
+
/**
* Returns a new <code>CoreException</code> for this plug-in
*/
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
index b276e212b..fda6c2310 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -18,19 +18,19 @@ package org.eclipse.core.externaltools.internal;
* </p>
*/
public interface IExternalToolConstants {
-
+
/**
* Constant for the empty {@link String}
- *
+ *
* @since org.eclipse.core.externaltools 1.0.100
*/
public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-
+
/**
* Plug-in identifier for external tools UI (value <code>org.eclipse.ui.externaltools</code>).
*/
public static final String UI_PLUGIN_ID = "org.eclipse.ui.externaltools"; //$NON-NLS-1$;
-
+
/**
* Plug-in identifier for external tools core (value <code>org.eclipse.core.externaltools</code>).
*/
@@ -59,7 +59,7 @@ public interface IExternalToolConstants {
public static final String VAR_WORKING_SET = "working_set"; //$NON-NLS-1$
// ------- Tool Types -------
/**
- * External tool type for programs such as executables, batch files,
+ * External tool type for programs such as executables, batch files,
* shell scripts, etc (value <code>programType</code>).
*/
public static final String TOOL_TYPE_PROGRAM = "programType"; //$NON-NLS-1$;
@@ -82,7 +82,7 @@ public interface IExternalToolConstants {
* the external tool running as a builder (value <code>auto</code>).
*/
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 <code>clean</code>).
@@ -100,13 +100,13 @@ public interface IExternalToolConstants {
* 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$
-
+ 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
@@ -128,6 +128,7 @@ public interface IExternalToolConstants {
* Default value is <code>false</code>.
* @deprecated since 3.1 Replaced by <code>org.eclipse.debug.core.DebugPlugin.ATTR_CAPTURE_OUTPUT</code>
*/
+ @Deprecated
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
@@ -141,20 +142,20 @@ public interface IExternalToolConstants {
* 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
+ * String attribute identifying the scope of resources that should trigger an
* external tool to run. Default value is <code>null</code>
* 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 <code>false</code>.
@@ -173,21 +174,21 @@ public interface IExternalToolConstants {
* 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 <code>true</code>, 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 <code>false</code>) or asynchronously (value <code>true</code>).
- * Default value is
+ * 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.
*/
@@ -198,7 +199,7 @@ public interface IExternalToolConstants {
* 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 <code>ICommand.setBuilding(int)</code> mechanism
@@ -213,7 +214,7 @@ public interface IExternalToolConstants {
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
+ * Attribute identifier specifying whether referenced projects should be
* considered when computing the projects to build. Default value is
* <code>true</code>.
*/
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
index de772967d..4ab5d4d0e 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -25,21 +25,21 @@ import org.eclipse.debug.core.RefreshUtil;
import org.eclipse.debug.core.model.IProcess;
/**
- * Refreshes resources as specified by a launch configuration, when
+ * 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
@@ -54,10 +54,11 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener {
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
@@ -68,19 +69,20 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener {
}
}
}
-
+
/**
* Submits a job to do the refresh
*/
protected void refresh() {
Job job= new Job(ExternalToolsProgramMessages.BackgroundResourceRefresher_0) {
+ @Override
public IStatus run(IProgressMonitor monitor) {
try {
RefreshUtil.refreshResources(fConfiguration, monitor);
} catch (CoreException e) {
ExternalToolsCore.log(e);
return e.getStatus();
- }
+ }
return Status.OK_STATUS;
}
};
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
index 022279070..0086da7e6 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ 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 <code>true</code>.
@@ -51,6 +51,7 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate {
* java.lang.String, org.eclipse.debug.core.ILaunch,
* org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void launch(ILaunchConfiguration configuration, String mode,
ILaunch launch, IProgressMonitor monitor) throws CoreException {
@@ -110,7 +111,7 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate {
IProcess process = null;
// add process type to process attributes
- Map processAttributes = new HashMap();
+ Map<String, String> processAttributes = new HashMap<String, String>();
String programName = location.lastSegment();
String extension = location.getFileExtension();
if (extension != null) {
@@ -125,12 +126,12 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate {
ExternalToolsProgramMessages.ProgramLaunchDelegate_3,
new String[] { configuration.getName() }),
IProgressMonitor.UNKNOWN);
- process = DebugPlugin.newProcess(launch, p, location.toOSString(),
- processAttributes);
+ process = DebugPlugin.newProcess(launch, p, location.toOSString(), processAttributes);
}
if (p == null || process == null) {
- if (p != null)
+ if (p != null) {
p.destroy();
+ }
throw new CoreException(new Status(IStatus.ERROR,
IExternalToolConstants.PLUGIN_ID,
IExternalToolConstants.ERR_INTERNAL_ERROR,
@@ -165,8 +166,9 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate {
}
private String generateCommandLine(String[] commandLine) {
- if (commandLine.length < 1)
+ if (commandLine.length < 1) {
return IExternalToolConstants.EMPTY_STRING;
+ }
StringBuffer buf = new StringBuffer();
for (int i = 0; i < commandLine.length; i++) {
buf.append(' ');
@@ -195,11 +197,12 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.core.model.LaunchConfigurationDelegate#getBuildOrder
* (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
*/
+ @Override
protected IProject[] getBuildOrder(ILaunchConfiguration configuration,
String mode) throws CoreException {
IProject[] projects = ExternalToolsCoreUtil.getBuildProjects(
@@ -214,14 +217,15 @@ public class ProgramLaunchDelegate extends LaunchConfigurationDelegate {
}
return computeBuildOrder(projects);
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#saveBeforeLaunch
- * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String,
+ * (org.eclipse.debug.core.ILaunchConfiguration, java.lang.String,
* org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected boolean saveBeforeLaunch(ILaunchConfiguration configuration,
String mode, IProgressMonitor monitor) throws CoreException {
if (IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY
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
index d8e7d750b..28f8070cc 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,7 +41,7 @@ public class BuilderCoreUtils {
public static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$
/**
* Constant added to the build command to determine if we are doing an incremental build after a clean
- *
+ *
* @since 3.7
*/
public static final String INC_CLEAN = "incclean"; //$NON-NLS-1$
@@ -71,15 +71,14 @@ public class BuilderCoreUtils {
* 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
* <code>null</code> if not possible.
*/
- public static ILaunchConfiguration configFromBuildCommandArgs(
- IProject project, Map commandArgs, String[] version) {
- String configHandle = (String) commandArgs.get(LAUNCH_CONFIG_HANDLE);
+ public static ILaunchConfiguration configFromBuildCommandArgs(IProject project, Map<String, String> commandArgs, String[] version) {
+ String configHandle = commandArgs.get(LAUNCH_CONFIG_HANDLE);
if (configHandle == null) {
// Probably an old-style (Eclipse 1.0 or 2.0) external tool. Try to
// migrate.
@@ -143,12 +142,14 @@ public class BuilderCoreUtils {
case IncrementalProjectBuilder.CLEAN_BUILD:
newCommand.setBuilding(IncrementalProjectBuilder.CLEAN_BUILD, true);
break;
+ default:
+ break;
}
}
if(!isfull && isinc) {
- Map args = newCommand.getArguments();
+ Map<String, String> args = newCommand.getArguments();
if(args == null) {
- args = new HashMap();
+ args = new HashMap<String, String>();
}
newCommand.setBuilding(IncrementalProjectBuilder.FULL_BUILD, true);
args.put(INC_CLEAN, Boolean.TRUE.toString());
@@ -168,7 +169,7 @@ public class BuilderCoreUtils {
* 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
@@ -181,12 +182,11 @@ public class BuilderCoreUtils {
/**
* 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;
+ public static ICommand toBuildCommand(IProject project, ILaunchConfiguration config, ICommand command) throws CoreException {
+ Map<String, String> 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
@@ -204,20 +204,20 @@ public class BuilderCoreUtils {
}
}
} else {
+ ILaunchConfiguration temp = config;
if (config instanceof ILaunchConfigurationWorkingCopy) {
ILaunchConfigurationWorkingCopy workingCopy = (ILaunchConfigurationWorkingCopy) config;
if (workingCopy.getOriginal() != null) {
- config = workingCopy.getOriginal();
+ temp = workingCopy.getOriginal();
}
}
- args = new HashMap();
+ args = new HashMap<String, String>();
// 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));
+ buffer.append('/').append(temp.getFile().getFullPath().removeFirstSegments(1));
args.put(LAUNCH_CONFIG_HANDLE, buffer.toString());
}
command.setBuilderName(ExternalToolBuilder.ID);
@@ -249,7 +249,7 @@ public class BuilderCoreUtils {
* 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.
@@ -282,7 +282,7 @@ public class BuilderCoreUtils {
/**
* 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.
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
index dd809de7f..548058711 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@ import org.osgi.framework.Bundle;
/**
* This project builder implementation will run an external tool during the
- * build process.
+ * build process.
*/
public final class ExternalToolBuilder extends IncrementalProjectBuilder {
private final class IgnoreTeamPrivateChanges implements IResourceDeltaVisitor {
@@ -46,6 +46,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
super();
fTrueChange= trueChange;
}
+ @Override
public boolean visit(IResourceDelta visitDelta) throws CoreException {
IResource resource= visitDelta.getResource();
if (resource instanceof IFile) {
@@ -59,18 +60,19 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
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 {
+ @Override
+ protected IProject[] build(int kind, Map<String, String> 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);
@@ -87,7 +89,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
if (kindCompatible && configEnabled(config)) {
doBuildBasedOnScope(resources, kind, config, args, monitor);
}
-
+
return projectsWithinScope;
}
@@ -117,22 +119,22 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
}
return true;
}
-
+
private int getBuilderCommandIndex(ICommand[] buildSpec, ICommand command) {
- Map commandArgs= command.getArguments();
+ Map<String, String> commandArgs = command.getArguments();
if (commandArgs == null) {
return -1;
}
- String handle= (String) commandArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
+ String handle= 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();
+ Map<String, String> buildSpecArgs = buildSpecCommand.getArguments();
if (buildSpecArgs != null) {
- String buildSpecHandle= (String) buildSpecArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
+ String buildSpecHandle= buildSpecArgs.get(BuilderCoreUtils.LAUNCH_CONFIG_HANDLE);
if (handle.equals(buildSpecHandle)) {
return i;
}
@@ -144,7 +146,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
/**
* Returns whether the given builder config is enabled or not.
- *
+ *
* @param config the config to examine
* @return whether the config is enabled
*/
@@ -157,7 +159,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
return true;
}
- private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfiguration config, Map args, IProgressMonitor monitor) throws CoreException {
+ private void doBuildBasedOnScope(IResource[] resources, int kind, ILaunchConfiguration config, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
boolean buildForChange = true;
if (kind != FULL_BUILD) { //scope not applied for full builds
if (resources != null && resources.length > 0) {
@@ -169,8 +171,8 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
launchBuild(kind, config, args, monitor);
}
}
-
- private void launchBuild(int kind, ILaunchConfiguration config, Map args, IProgressMonitor monitor) throws CoreException {
+
+ private void launchBuild(int kind, ILaunchConfiguration config, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
monitor.subTask(NLS.bind(ExternalToolsModelMessages.ExternalToolBuilder_Running__0_____1, new String[] { config.getName()}));
buildStarted(kind, args);
// The default value for "launch in background" is true in debug core. If
@@ -185,17 +187,17 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
/**
* Returns the build type being performed if the
* external tool is being run as a project builder.
- *
+ *
* @return one of the <code>IExternalToolConstants.BUILD_TYPE_*</code> constants.
*/
public static String getBuildType() {
return buildType;
}
-
+
/**
* Returns the project that is being built and has triggered the current external
* tool builder. <code>null</code> is returned if no build is currently occurring.
- *
+ *
* @return project being built or <code>null</code>.
*/
public static IProject getBuildProject() {
@@ -205,19 +207,19 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
/**
* Returns the <code>IResourceDelta</code> that is being built and has triggered the current external
* tool builder. <code>null</code> is returned if no build is currently occurring.
- *
+ *
* @return resource delta for the build or <code>null</code>
*/
public static IResourceDelta getBuildDelta() {
return buildDelta;
}
-
+
/**
* Stores the currently active build kind and build project when a build begins
* @param buildKind
* @param args the arguments passed into the builder
*/
- private void buildStarted(int buildKind, Map args) {
+ private void buildStarted(int buildKind, Map<String, String> args) {
switch (buildKind) {
case IncrementalProjectBuilder.INCREMENTAL_BUILD :
buildType = IExternalToolConstants.BUILD_TYPE_INCREMENTAL;
@@ -245,7 +247,7 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
}
buildProject= getProject();
}
-
+
/**
* Clears the current build kind, build project and build delta when a build finishes.
*/
@@ -254,14 +256,14 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
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) {
@@ -272,26 +274,27 @@ public final class ExternalToolBuilder extends IncrementalProjectBuilder {
} 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 {
+
+ @Override
+ 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, null, monitor);
}
} \ No newline at end of file
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
index a06bc8782..a1b2fe933 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -38,31 +38,31 @@ public final class ExternalToolMigration {
public static final class VariableDefinition {
/**
* Index in the source text where the variable started
- * or <code>-1</code> if no valid variable start tag
+ * or <code>-1</code> 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 <code>-1</code> if no
+ * the end of the variable or <code>-1</code> if no
* valid variable end tag found.
*/
public int end = -1;
-
+
/**
* The variable's name found in the source text, or
* <code>null</code> if no valid variable found.
*/
public String name = null;
-
+
/**
* The variable's argument found in the source text, or
* <code>null</code> if no valid variable found or if
* the variable did not specify an argument
*/
public String argument = null;
-
+
/**
* Create an initialized variable definition.
*/
@@ -70,14 +70,14 @@ public final class ExternalToolMigration {
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$
-
+ private static final String VAR_TAG_SEP = ":"; //$NON-NLS-1$
+
/**
* External tool type for Ant build files (value <code>antBuildType</code>).
*/
@@ -87,7 +87,7 @@ public final class ExternalToolMigration {
* 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$;
/**
@@ -99,7 +99,7 @@ public final class ExternalToolMigration {
* for migration.
*/
public static final String ATTR_ANT_TARGETS = IExternalToolConstants.UI_PLUGIN_ID + ".ATTR_ANT_TARGETS"; //$NON-NLS-1$
-
+
/*
* 2.0 External Tool Tags
*/
@@ -155,46 +155,47 @@ public final class ExternalToolMigration {
* 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);
+ public static ILaunchConfigurationWorkingCopy configFromArgumentMap(Map<String, String> args) {
+ String version = 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);
-
+ public static ILaunchConfigurationWorkingCopy configFrom21ArgumentMap(Map<String, String> commandArgs) {
+ String name = commandArgs.get(TAG_NAME);
+ String type = 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(IExternalToolConstants.ATTR_LOCATION, commandArgs.get(TAG_LOCATION));
+ config.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, 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_SCOPE, 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);
+ config.setAttribute(IExternalToolConstants.ATTR_RUN_BUILD_KINDS, commandArgs.get(TAG_RUN_BUILD_KINDS));
+
+ String args = commandArgs.get(TAG_ARGS);
if (args != null) {
config.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, args);
}
- String extraAttributes = (String) commandArgs.get(TAG_EXTRA_ATTR);
+ String extraAttributes = 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())
+ if (!tokenizer.hasMoreTokens()) {
break;
+ }
String value = tokenizer.nextToken();
if (key.equals(RUN_TARGETS_ATTRIBUTE)) {
// 2.1 implementation only defined 1 "extra attribute"
@@ -208,9 +209,9 @@ public final class ExternalToolMigration {
/**
* Creates an external tool from the map.
*/
- public static ILaunchConfigurationWorkingCopy configFrom20ArgumentMap(Map args) {
+ public static ILaunchConfigurationWorkingCopy configFrom20ArgumentMap(Map<String, String> args) {
// Update the type...
- String type = (String) args.get(TAG_TOOL_TYPE);
+ String type = args.get(TAG_TOOL_TYPE);
if (TOOL_TYPE_ANT.equals(type)) {
type = TOOL_TYPE_ANT_BUILD;
} else if (TOOL_TYPE_PROGRAM.equals(type)){
@@ -219,19 +220,19 @@ public final class ExternalToolMigration {
return null;
}
- String name = (String) args.get(TAG_TOOL_NAME);
-
+ String name = 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);
+ String location = args.get(TAG_TOOL_LOCATION);
config.setAttribute(IExternalToolConstants.ATTR_LOCATION, location);
// Update the refresh scope...
- String refresh = (String) args.get(TAG_TOOL_REFRESH);
+ String refresh = args.get(TAG_TOOL_REFRESH);
if (refresh != null) {
VariableDefinition varDef = extractVariableDefinition(refresh, 0);
if ("none".equals(varDef.name)) { //$NON-NLS-1$
@@ -241,12 +242,12 @@ public final class ExternalToolMigration {
}
// Update the arguments
- String arguments = (String) args.get(TAG_TOOL_ARGUMENTS);
+ String arguments = 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();
+ ArrayList<String> targets = new ArrayList<String>();
StringBuffer buffer = new StringBuffer();
VariableDefinition varDef = extractVariableDefinition(arguments, start);
while (varDef.end != -1) {
@@ -261,10 +262,10 @@ public final class ExternalToolMigration {
}
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);
+ String target = targets.get(i);
if (target != null && target.length() > 0) {
buffer.append(target);
buffer.append(","); //$NON-NLS-1$
@@ -282,12 +283,12 @@ public final class ExternalToolMigration {
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);
+ String buildKinds= 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));
+ config.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, args.get(TAG_TOOL_DIRECTORY));
return config;
}
@@ -317,23 +318,23 @@ public final class ExternalToolMigration {
}
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);
+ public static String getNameFromCommandArgs(Map<String, String> commandArgs) {
+ String name= commandArgs.get(TAG_NAME);
if (name == null) {
- name= (String) commandArgs.get(TAG_TOOL_NAME);
+ name= 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
*/
@@ -359,52 +360,52 @@ public final class ExternalToolMigration {
try {
ILaunchConfigurationWorkingCopy workingCopy= config.getWorkingCopy();
workingCopy.setAttribute(IExternalToolConstants.ATTR_LAUNCH_IN_BACKGROUND, runInBackground);
- config= workingCopy.doSave();
+ return 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);
+ int strt = start;
+ varDef.start = text.indexOf(VAR_TAG_START, strt);
if (varDef.start < 0){
return varDef;
}
- start = varDef.start + VAR_TAG_START.length();
-
- int end = text.indexOf(VAR_TAG_END, start);
+ strt = varDef.start + VAR_TAG_START.length();
+
+ int end = text.indexOf(VAR_TAG_END, strt);
if (end < 0) {
return varDef;
}
varDef.end = end + VAR_TAG_END.length();
- if (end == start) {
+ if (end == strt) {
return varDef;
}
-
- int mid = text.indexOf(VAR_TAG_SEP, start);
+
+ int mid = text.indexOf(VAR_TAG_SEP, strt);
if (mid < 0 || mid > end) {
- varDef.name = text.substring(start, end);
+ varDef.name = text.substring(strt, end);
} else {
- if (mid > start) {
- varDef.name = text.substring(start, mid);
+ if (mid > strt) {
+ varDef.name = text.substring(strt, mid);
}
mid = mid + VAR_TAG_SEP.length();
if (mid < end) {
varDef.argument = text.substring(mid, end);
}
}
-
+
return varDef;
- }
+ }
}
diff --git a/org.eclipse.core.variables/.classpath b/org.eclipse.core.variables/.classpath
index ce7393340..ad32c83a7 100644
--- a/org.eclipse.core.variables/.classpath
+++ b/org.eclipse.core.variables/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.core.variables/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.core.variables/META-INF/MANIFEST.MF b/org.eclipse.core.variables/META-INF/MANIFEST.MF
index feba5d297..31a058637 100644
--- a/org.eclipse.core.variables/META-INF/MANIFEST.MF
+++ b/org.eclipse.core.variables/META-INF/MANIFEST.MF
@@ -10,4 +10,4 @@ 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
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.eclipse.core.variables/build.properties b/org.eclipse.core.variables/build.properties
index 87f2d7f26..6795a29e7 100644
--- a/org.eclipse.core.variables/build.properties
+++ b/org.eclipse.core.variables/build.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2000, 2012 IBM Corporation and others.
+# Copyright (c) 2000, 2013 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
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
index f53bf67e1..386426a94 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,27 +21,27 @@ import org.eclipse.osgi.util.NLS;
* Implementation of a value variable.
*/
public class ContributedValueVariable extends StringVariable implements IValueVariable {
-
+
/**
- * Variable value or <code>null</code> if none
+ * Variable value or <code>null</code> 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 <code>null</code>
* @param readOnly whether the variable should be a read only variable
@@ -51,10 +51,11 @@ public class ContributedValueVariable extends StringVariable implements IValueVa
super(name, description, configurationElement);
fReadOnly = readOnly;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#setValue(java.lang.String)
*/
+ @Override
public void setValue(String value) {
if (!isReadOnly() || !isInitialized()){
fValue = value;
@@ -62,10 +63,11 @@ public class ContributedValueVariable extends StringVariable implements IValueVa
StringVariableManager.getDefault().notifyChanged(this);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#getValue()
*/
+ @Override
public String getValue() {
if (!isInitialized()) {
initialize();
@@ -111,14 +113,14 @@ public class ContributedValueVariable extends StringVariable implements IValueVa
* <li>its configuration element's initializer</li>
* </ul>
* @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) {
@@ -128,6 +130,7 @@ public class ContributedValueVariable extends StringVariable implements IValueVa
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
return fReadOnly;
}
@@ -135,6 +138,7 @@ public class ContributedValueVariable extends StringVariable implements IValueVa
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#isContributed()
*/
+ @Override
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
index 8f18a3ad1..ef6783fa9 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -23,7 +23,7 @@ import org.eclipse.osgi.util.NLS;
* Dynamic variable
*/
public class DynamicVariable extends StringVariable implements IDynamicVariable {
-
+
/**
* Resolver, or <code>null</code> until needed
*/
@@ -32,11 +32,12 @@ public class DynamicVariable extends StringVariable implements IDynamicVariable
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IContextVariable#getValue(java.lang.String)
*/
+ @Override
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));
+ 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) {
@@ -60,7 +61,7 @@ public class DynamicVariable extends StringVariable implements IDynamicVariable
/**
* Constructs a new context variable.
- *
+ *
* @param name variable name
* @param description variable description or <code>null</code>
* @param configurationElement configuration element
@@ -72,9 +73,10 @@ public class DynamicVariable extends StringVariable implements IDynamicVariable
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariable#supportsArgument()
*/
+ @Override
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
index ac5e100d8..b8e0bb3ae 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -23,17 +23,18 @@ 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 {
+ @Override
+ 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]
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
index 07e8c1769..ce098e850 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -12,9 +12,9 @@ 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;
@@ -28,52 +28,52 @@ 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 = ':';
+ 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;
-
+ private Stack<VariableReference> 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 resolveVariables if the variables should be resolved during the substitution
@@ -85,34 +85,31 @@ public class StringSubstitutionEngine {
*/
public String performStringSubstitution(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException {
substitute(expression, reportUndefinedVariables, resolveVariables, manager);
- List resolvedVariableSets = new ArrayList();
+ List<HashSet<String>> resolvedVariableSets = new ArrayList<HashSet<String>>();
while (fSubs) {
- HashSet resolved = substitute(fResult.toString(), reportUndefinedVariables, true, manager);
-
+ HashSet<String> resolved = substitute(fResult.toString(), reportUndefinedVariables, true, manager);
for(int i=resolvedVariableSets.size()-1; i>=0; i--) {
-
- HashSet prevSet = (HashSet)resolvedVariableSets.get(i);
-
+ HashSet<String> prevSet = resolvedVariableSets.get(i);
if (prevSet.equals(resolved)) {
- HashSet conflictingSet = new HashSet();
- for (; i<resolvedVariableSets.size(); i++)
- conflictingSet.addAll((HashSet)resolvedVariableSets.get(i));
-
+ HashSet<String> conflictingSet = new HashSet<String>();
+ for (; i<resolvedVariableSets.size(); i++) {
+ conflictingSet.addAll(resolvedVariableSets.get(i));
+ }
StringBuffer problemVariableList = new StringBuffer();
- for (Iterator it=conflictingSet.iterator(); it.hasNext(); ) {
- problemVariableList.append(it.next().toString());
+ for (String string : conflictingSet) {
+ problemVariableList.append(string);
problemVariableList.append(", "); //$NON-NLS-1$
}
problemVariableList.setLength(problemVariableList.length()-2); //truncate the last ", "
- throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{problemVariableList.toString()}), null));
- }
- }
-
- resolvedVariableSets.add(resolved);
+ throw new CoreException(new Status(IStatus.ERROR, VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.REFERENCE_CYCLE_ERROR, NLS.bind(VariablesMessages.StringSubstitutionEngine_4, new String[]{problemVariableList.toString()}), null));
+ }
+ }
+
+ resolvedVariableSets.add(resolved);
}
return fResult.toString();
}
-
+
/**
* Performs recursive string validation to ensure that all of the variables
* contained in the expression exist
@@ -124,11 +121,11 @@ public class StringSubstitutionEngine {
public void validateStringVariables(String expression, IStringVariableManager manager) throws CoreException {
performStringSubstitution(expression, true, false, manager);
}
-
+
/**
* Makes a substitution pass of the given expression returns a Set of the variables that were resolved in this
* pass
- *
+ *
* @param expression source expression
* @param reportUndefinedVariables whether to report undefined variables as an error
* @param resolveVariables whether to resolve the value of any variables
@@ -136,12 +133,12 @@ public class StringSubstitutionEngine {
* @return the set of {@link String}s resolved from the given expression
* @exception CoreException if unable to resolve a variable
*/
- private HashSet substitute(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException {
+ private HashSet<String> substitute(String expression, boolean reportUndefinedVariables, boolean resolveVariables, IStringVariableManager manager) throws CoreException {
fResult = new StringBuffer(expression.length());
- fStack = new Stack();
+ fStack = new Stack<VariableReference>();
fSubs = false;
-
- HashSet resolvedVariables = new HashSet();
+
+ HashSet<String> resolvedVariables = new HashSet<String>();
int pos = 0;
int state = SCAN_FOR_START;
@@ -158,7 +155,7 @@ public class StringSubstitutionEngine {
pos = start + 2;
state = SCAN_FOR_END;
- fStack.push(new VariableReference());
+ fStack.push(new VariableReference());
} else {
// done - no more variables
fResult.append(expression.substring(pos));
@@ -171,7 +168,7 @@ public class StringSubstitutionEngine {
int end = expression.indexOf(VARIABLE_END, pos);
if (end < 0) {
// variables are not completed
- VariableReference tos = (VariableReference)fStack.peek();
+ VariableReference tos = fStack.peek();
tos.append(expression.substring(pos));
pos = expression.length();
} else {
@@ -179,18 +176,18 @@ public class StringSubstitutionEngine {
// start of a nested variable
int length = start - pos;
if (length > 0) {
- VariableReference tos = (VariableReference)fStack.peek();
+ VariableReference tos = fStack.peek();
tos.append(expression.substring(pos, start));
}
pos = start + 2;
- fStack.push(new VariableReference());
+ fStack.push(new VariableReference());
} else {
// end of variable reference
- VariableReference tos = (VariableReference)fStack.pop();
- String substring = expression.substring(pos, end);
+ VariableReference tos = 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) {
@@ -202,35 +199,37 @@ public class StringSubstitutionEngine {
state = SCAN_FOR_START;
} else {
// append to previous variable
- tos = (VariableReference)fStack.peek();
+ tos = fStack.peek();
tos.append(value);
}
}
}
break;
+ default:
+ break;
}
}
// process incomplete variable references
while (!fStack.isEmpty()) {
- VariableReference tos = (VariableReference)fStack.pop();
+ VariableReference tos = fStack.pop();
if (fStack.isEmpty()) {
fResult.append(VARIABLE_START);
fResult.append(tos.getText());
} else {
- VariableReference var = (VariableReference)fStack.peek();
+ VariableReference var = fStack.peek();
var.append(VARIABLE_START);
var.append(tos.getText());
}
}
-
+
return resolvedVariables;
}
/**
* Resolve and return the value of the given variable reference,
- * possibly <code>null</code>.
- *
+ * possibly <code>null</code>.
+ *
* @param var the {@link VariableReference} to try and resolve
* @param reportUndefinedVariables whether to report undefined variables as
* an error
@@ -249,7 +248,7 @@ public class StringSubstitutionEngine {
pos++;
if (pos < text.length()) {
arg = text.substring(pos);
- }
+ }
} else {
name = text;
}
@@ -259,30 +258,30 @@ public class StringSubstitutionEngine {
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));
- }
+ 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));
+ 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) {
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
index c819bd1a1..e87c86c1f 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,17 +18,17 @@ import org.eclipse.core.variables.IValueVariable;
* Common implementation of context and value variables
*/
public abstract class StringVariable implements IStringVariable {
-
+
/**
* Variable name
*/
private String fName;
-
+
/**
* Variable description, or <code>null</code>
*/
private String fDescription;
-
+
/**
* Configuration element associated with this variable, or <code>null</code>
*/
@@ -36,7 +36,7 @@ public abstract class StringVariable implements IStringVariable {
/**
* Constructs a new variable with the given name, description and configuration element.
- *
+ *
* @param name variable name
* @param description variable description, or <code>null</code>
* @param configurationElement configuration element or <code>null</code>
@@ -46,10 +46,11 @@ public abstract class StringVariable implements IStringVariable {
fDescription = description;
fConfigurationElement = configurationElement;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getName()
*/
+ @Override
public String getName() {
return fName;
}
@@ -57,20 +58,21 @@ public abstract class StringVariable implements IStringVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariable#getDescription()
*/
+ @Override
public String getDescription() {
return fDescription;
}
-
+
/**
* Returns the configuration element associated with this variable, or <code>null</code>
* if none.
- *
+ *
* @return configuration element or <code>null</code>
*/
protected IConfigurationElement getConfigurationElement() {
return fConfigurationElement;
}
-
+
/**
* @see IValueVariable#setDescription(String)
* @param description the new description to set for the variable
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
index e3e643d6e..09668bad7 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,43 +59,43 @@ import org.w3c.dom.NodeList;
import org.xml.sax.helpers.DefaultHandler;
/**
- * Singleton string variable manager.
+ * Singleton string variable manager.
*/
public class StringVariableManager implements IStringVariableManager, IPreferenceChangeListener {
-
+
/**
* Dynamic variables - maps variable names to variables.
*/
- private Map fDynamicVariables;
-
+ private Map<String, IDynamicVariable> fDynamicVariables;
+
/**
* Value variables - maps variable names to variables.
*/
- private Map fValueVariables;
-
+ private Map<String, IStringVariable> 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;
-
+ 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$
+ 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$
@@ -107,21 +107,22 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
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$
-
+ 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)
*/
+ @Override
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);
@@ -130,6 +131,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -141,12 +143,14 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
case CHANGED:
fListener.variablesChanged(fVariables);
break;
- }
+ default:
+ break;
+ }
}
/**
* Notifies the given listener of the add/change/remove
- *
+ *
* @param variables the {@link IValueVariable}s to notify about
* @param update the type of change
*/
@@ -157,26 +161,26 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
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();
+ // 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() {
@@ -185,13 +189,13 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
}
return fgManager;
}
-
+
/**
- * Constructs a new string variable manager.
+ * Constructs a new string variable manager.
*/
private StringVariableManager() {
fListeners = new ListenerList();
- }
+ }
/**
* Load contributed variables and persisted variables
@@ -199,8 +203,8 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
private synchronized void initialize() {
if (fDynamicVariables == null) {
fInternalChange = true;
- fDynamicVariables = new HashMap(5);
- fValueVariables = new HashMap(5);
+ fDynamicVariables = new HashMap<String, IDynamicVariable>(5);
+ fValueVariables = new HashMap<String, IStringVariable>(5);
loadContributedValueVariables();
loadPersistedValueVariables();
loadDynamicVariables();
@@ -208,7 +212,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
fInternalChange = false;
}
}
-
+
/**
* Loads contributed dynamic variables
*/
@@ -249,7 +253,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
}
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) {
@@ -258,12 +262,12 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
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
+ * 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 <code>null</code>, or
* b) the variable is read-only.
@@ -301,7 +305,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
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);
@@ -313,39 +317,43 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
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()
*/
+ @Override
public synchronized IStringVariable[] getVariables() {
initialize();
- List list = new ArrayList(fDynamicVariables.size() + fValueVariables.size());
+ List<IStringVariable> list = new ArrayList<IStringVariable>(fDynamicVariables.size() + fValueVariables.size());
list.addAll(fDynamicVariables.values());
list.addAll(fValueVariables.values());
- return (IStringVariable[]) list.toArray(new IStringVariable[list.size()]);
+ return list.toArray(new IStringVariable[list.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getValueVariables()
*/
+ @Override
public synchronized IValueVariable[] getValueVariables() {
initialize();
- return (IValueVariable[]) fValueVariables.values().toArray(new IValueVariable[fValueVariables.size()]);
+ return fValueVariables.values().toArray(new IValueVariable[fValueVariables.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getDynamicVariables()
*/
+ @Override
public synchronized IDynamicVariable[] getDynamicVariables() {
initialize();
- return (IDynamicVariable[]) fDynamicVariables.values().toArray(new IDynamicVariable[fDynamicVariables.size()]);
+ return fDynamicVariables.values().toArray(new IDynamicVariable[fDynamicVariables.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#performStringSubstitution(java.lang.String)
*/
+ @Override
public String performStringSubstitution(String expression) throws CoreException {
return performStringSubstitution(expression, true);
}
@@ -353,28 +361,31 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#newValueVariable(java.lang.String, java.lang.String)
*/
+ @Override
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)
*/
+ @Override
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[])
*/
+ @Override
public synchronized void addVariables(IValueVariable[] variables) throws CoreException {
initialize();
- MultiStatus status = new MultiStatus(VariablesPlugin.getUniqueIdentifier(), VariablesPlugin.INTERNAL_ERROR, VariablesMessages.StringVariableManager_26, null);
+ 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));
- }
+ 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++) {
@@ -392,9 +403,10 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#removeVariables(org.eclipse.debug.internal.core.stringsubstitution.IValueVariable[])
*/
+ @Override
public synchronized void removeVariables(IValueVariable[] variables) {
initialize();
- List removed = new ArrayList(variables.length);
+ List<IValueVariable> removed = new ArrayList<IValueVariable>(variables.length);
for (int i = 0; i < variables.length; i++) {
IValueVariable variable = variables[i];
if (fValueVariables.remove(variable.getName()) != null) {
@@ -402,21 +414,23 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
}
}
if (removed.size() > 0) {
- getNotifier().notify((IValueVariable[])removed.toArray(new IValueVariable[removed.size()]), REMOVED);
+ getNotifier().notify(removed.toArray(new IValueVariable[removed.size()]), REMOVED);
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getDynamicVariable(java.lang.String)
*/
+ @Override
public synchronized IDynamicVariable getDynamicVariable(String name) {
initialize();
- return (IDynamicVariable) fDynamicVariables.get(name);
+ return fDynamicVariables.get(name);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#getValueVariable(java.lang.String)
*/
+ @Override
public synchronized IValueVariable getValueVariable(String name) {
initialize();
return (IValueVariable) fValueVariables.get(name);
@@ -426,6 +440,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#addValueVariableListener(org.eclipse.debug.internal.core.stringsubstitution.IValueVariableListener)
*/
+ @Override
public void addValueVariableListener(IValueVariableListener listener) {
fListeners.add(listener);
}
@@ -433,13 +448,14 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#removeValueVariableListener(org.eclipse.debug.internal.core.stringsubstitution.IValueVariableListener)
*/
+ @Override
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.
* @throws ParserConfigurationException if an I/O exception occurs while creating the XML.
@@ -454,7 +470,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
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
+ // 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());
@@ -473,18 +489,18 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
}
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
@@ -492,22 +508,22 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
*/
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$
+
+ return s.toString("UTF8"); //$NON-NLS-1$
}
-
+
/**
* Saves the value variables currently registered in the
- * preference store.
+ * preference store.
*/
private synchronized void storeValueVariables() {
String variableString= ""; //$NON-NLS-1$
@@ -539,7 +555,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/**
* Fire a change notification for the given variable.
- *
+ *
* @param variable the variable that has changed
*/
protected void notifyChanged(IValueVariable variable) {
@@ -550,11 +566,12 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
getNotifier().notify(new IValueVariable[]{variable}, CHANGED);
}
}
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#generateVariableExpression(java.lang.String, java.lang.String)
*/
+ @Override
public String generateVariableExpression(String varName, String arg) {
StringBuffer buffer = new StringBuffer();
buffer.append("${"); //$NON-NLS-1$
@@ -566,10 +583,11 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
buffer.append("}"); //$NON-NLS-1$
return buffer.toString();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IStringVariableManager#performStringSubstitution(java.lang.String, boolean)
*/
+ @Override
public String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException {
return new StringSubstitutionEngine().performStringSubstitution(expression, reportUndefinedVariables, true, this);
}
@@ -577,6 +595,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.core.variables.IStringVariableManager#validateStringVariables(java.lang.String)
*/
+ @Override
public void validateStringVariables(String expression) throws CoreException {
new StringSubstitutionEngine().validateStringVariables(expression, this);
}
@@ -584,7 +603,8 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.core.variables.IStringVariableManager#getContributingPluginId(org.eclipse.core.variables.IStringVariable)
*/
- public String getContributingPluginId(IStringVariable variable) {
+ @Override
+ public String getContributingPluginId(IStringVariable variable) {
if (variable instanceof StringVariable) {
return ((StringVariable) variable).getConfigurationElement().getContributor().getName();
}
@@ -594,6 +614,7 @@ public class StringVariableManager implements IStringVariableManager, IPreferenc
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
*/
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
if (PREF_VALUE_VARIABLES.equals(event.getKey())) {
synchronized (this) {
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
index 3bac3d076..b10b82a6c 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,21 +16,21 @@ import org.eclipse.core.variables.IValueVariable;
* Implementation of a value variable.
*/
public class ValueVariable extends StringVariable implements IValueVariable {
-
+
/**
- * Variable value or <code>null</code> if none
+ * Variable value or <code>null</code> 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 <code>null</code>
* @param readOnly whether the variable should be a read only variable
@@ -41,20 +41,22 @@ public class ValueVariable extends StringVariable implements IValueVariable {
fReadOnly = readOnly;
fValue = value;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#setValue(java.lang.String)
*/
+ @Override
public void setValue(String value) {
if (!isReadOnly()){
fValue = value;
StringVariableManager.getDefault().notifyChanged(this);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#getValue()
*/
+ @Override
public String getValue() {
return fValue;
}
@@ -62,13 +64,15 @@ public class ValueVariable extends StringVariable implements IValueVariable {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
return fReadOnly;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.variables.IValueVariable#isContributed()
*/
+ @Override
public boolean isContributed() {
return false;
}
diff --git a/org.eclipse.debug.core/.classpath b/org.eclipse.debug.core/.classpath
index 3138d4b81..220a8bfaf 100644
--- a/org.eclipse.debug.core/.classpath
+++ b/org.eclipse.debug.core/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="core"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="core"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.core/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.debug.core/META-INF/MANIFEST.MF b/org.eclipse.debug.core/META-INF/MANIFEST.MF
index 35399581e..dc97a26a0 100644
--- a/org.eclipse.debug.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.core; singleton:=true
-Bundle-Version: 3.8.100.qualifier
+Bundle-Version: 3.9.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.debug.core.DebugPlugin
Bundle-Vendor: %providerName
@@ -18,10 +18,10 @@ Export-Package: org.eclipse.debug.core,
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,org.eclipse.jdt.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.variables;bundle-version="[3.2.800,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
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
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
index 1c867f7c8..4bf262163 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugEvent.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,7 +28,7 @@ import org.eclipse.debug.internal.core.DebugCoreMessages;
* 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
+ * 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.
* </p>
* <p>
@@ -135,15 +135,15 @@ import org.eclipse.debug.internal.core.DebugCoreMessages;
* <li><code>IValue</code> - no events are specified for values.
* </li>
* </ul>
- *
+ *
*/
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.
*/
@@ -163,19 +163,19 @@ public final class DebugEvent extends EventObject {
* 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;
+ public static final int MODEL_SPECIFIC= 0x0020;
/**
* Step start detail. Indicates a thread was resumed by a step
@@ -183,47 +183,47 @@ public final class DebugEvent extends EventObject {
* @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;
+ 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.
@@ -231,35 +231,35 @@ public final class DebugEvent extends EventObject {
* 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
+ * State change detail. Indicates the state of a single
* debug element has changed. Only valid for <code>CHANGE</code>
* 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
* <code>CHANGE</code> events.
- *
+ *
* @since 2.0
*/
- public static final int CONTENT = 0x0200;
-
+ 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.
@@ -271,14 +271,14 @@ public final class DebugEvent extends EventObject {
* 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
* <code>UNSPECIFIED</code>.
@@ -302,10 +302,12 @@ public final class DebugEvent extends EventObject {
*/
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);
+ 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;
}
@@ -323,19 +325,19 @@ public final class DebugEvent extends EventObject {
/**
* 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 <code>STEP_INTO</code>, <code>STEP_OVER</code>, or
* <code>STEP_RETURN</code>.
- *
+ *
* @return whether this event's detail indicates the beginning
* of a step event.
* @since 2.0
@@ -343,42 +345,43 @@ public final class DebugEvent extends EventObject {
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 <code>EVALUATION</code>, or <code>EVALUATION_IMPLICIT</code>.
- *
+ *
* @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 <code>null</code> if none
- *
+ *
* @return application defined data, or <code>null</code> if none
* @since 2.1.2
*/
public Object getData() {
return fData;
}
-
+
/**
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer("DebugEvent["); //$NON-NLS-1$
if (getSource() != null) {
@@ -399,7 +402,7 @@ public final class DebugEvent extends EventObject {
break;
case SUSPEND:
buf.append("SUSPEND"); //$NON-NLS-1$
- break;
+ break;
case CHANGE:
buf.append("CHANGE"); //$NON-NLS-1$
break;
@@ -409,6 +412,8 @@ public final class DebugEvent extends EventObject {
case MODEL_SPECIFIC:
buf.append("MODEL_SPECIFIC"); //$NON-NLS-1$
break;
+ default:
+ break;
}
buf.append(", "); //$NON-NLS-1$
switch (getDetail()) {
@@ -435,13 +440,13 @@ public final class DebugEvent extends EventObject {
break;
case EVALUATION_IMPLICIT:
buf.append("EVALUATION_IMPLICIT"); //$NON-NLS-1$
- break;
+ break;
case STATE:
buf.append("STATE"); //$NON-NLS-1$
- break;
+ break;
case CONTENT:
buf.append("CONTENT"); //$NON-NLS-1$
- break;
+ break;
case UNSPECIFIED:
buf.append("UNSPECIFIED"); //$NON-NLS-1$
break;
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
index 5e814fea9..44b3e4adc 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/DebugPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -92,7 +92,7 @@ import com.ibm.icu.text.MessageFormat;
* @noextend This class is not intended to be sub-classed by clients.
*/
public class DebugPlugin extends Plugin {
-
+
/**
* Unique identifier constant (value <code>"org.eclipse.debug.core"</code>)
* for the Debug Core plug-in.
@@ -102,63 +102,63 @@ public class DebugPlugin extends Plugin {
/**
* Simple identifier constant (value <code>"launchConfigurationTypes"</code>)
* for the launch configuration types extension point.
- *
+ *
* @since 2.0
*/
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES= "launchConfigurationTypes"; //$NON-NLS-1$
-
+ public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_TYPES= "launchConfigurationTypes"; //$NON-NLS-1$
+
/**
* Simple identifier constant (value <code>"launchConfigurationComparators"</code>)
* for the launch configuration comparators extension point.
- *
+ *
* @since 2.0
*/
- public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS= "launchConfigurationComparators"; //$NON-NLS-1$
-
+ public static final String EXTENSION_POINT_LAUNCH_CONFIGURATION_COMPARATORS= "launchConfigurationComparators"; //$NON-NLS-1$
+
/**
* Simple identifier constant (value <code>"breakpoints"</code>) for the
* breakpoints extension point.
- *
+ *
* @since 2.0
*/
public static final String EXTENSION_POINT_BREAKPOINTS= "breakpoints"; //$NON-NLS-1$
-
+
/**
* Simple identifier constant (value <code>"statusHandlers"</code>) for the
* status handlers extension point.
- *
+ *
* @since 2.0
*/
- public static final String EXTENSION_POINT_STATUS_HANDLERS= "statusHandlers"; //$NON-NLS-1$
+ public static final String EXTENSION_POINT_STATUS_HANDLERS= "statusHandlers"; //$NON-NLS-1$
/**
* Simple identifier constant (value <code>"sourceLocators"</code>) for the
* source locators extension point.
- *
+ *
* @since 2.0
*/
- public static final String EXTENSION_POINT_SOURCE_LOCATORS= "sourceLocators"; //$NON-NLS-1$
-
+ public static final String EXTENSION_POINT_SOURCE_LOCATORS= "sourceLocators"; //$NON-NLS-1$
+
/**
* Simple identifier constant (value <code>"launchModes"</code>) for the
* source modes extension point.
- *
+ *
* @since 3.0
*/
- public static final String EXTENSION_POINT_LAUNCH_MODES= "launchModes"; //$NON-NLS-1$
-
+ public static final String EXTENSION_POINT_LAUNCH_MODES= "launchModes"; //$NON-NLS-1$
+
/**
* Simple identifier constant (value <code>"launchDelegates"</code>) 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 <code>"processFactories"</code>) for the
* process factories extension point.
- *
+ *
* @since 3.0
*/
public static final String EXTENSION_POINT_PROCESS_FACTORIES = "processFactories"; //$NON-NLS-1$
@@ -166,62 +166,62 @@ public class DebugPlugin extends Plugin {
/**
* Simple identifier constant (value <code>"logicalStructureTypes"</code>) 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 <code>"logicalStructureProviders"</code>) 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 <code>"sourceContainerTypes"</code>) 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 <code>"sourcePathComputers"</code>) 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;
-
+ public static final int ERROR = 125;
+
/**
- * Status code indicating an unexpected internal error. Internal errors
+ * 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;
+ public static final int INTERNAL_ERROR = 120;
/**
* Status code indicating that the Eclipse runtime does not support
@@ -234,7 +234,7 @@ public class DebugPlugin extends Plugin {
* </p>
*/
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
@@ -242,46 +242,46 @@ public class DebugPlugin extends Plugin {
* @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 -
* <code>true</code> or <code>false</code>. When unspecified, the default
* value is considered <code>true</code>.
- *
+ *
* @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.
* <p>
- * For release 3.3, the system encoding is used when unspecified. Since 3.4,
+ * 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 <code>getEncoding(ILaunchConfiguration)</code>.
* </p>
* <p>
- * Value of this constant is the same as the value of the old
+ * Value of this constant is the same as the value of the old
* <code>IDebugUIConstants.ATTR_CONSOLE_ENCODING</code> constant for backward
* compatibility.
* </p>
* @since 3.3
*/
public static final String ATTR_CONSOLE_ENCODING = "org.eclipse.debug.ui.ATTR_CONSOLE_ENCODING"; //$NON-NLS-1$
-
+
/**
* Boolean preference key (value <code>org.eclipse.debug.core.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE</code>) that controls
* whether to delete associated configurations when a project is deleted. Default value is <code>false</code>.
- *
+ *
* @since 3.7
*/
public static final String PREF_DELETE_CONFIGS_ON_PROJECT_DELETE = PI_DEBUG_CORE + ".PREF_DELETE_CONFIGS_ON_PROJECT_DELETE"; //$NON-NLS-1$
@@ -290,7 +290,7 @@ public class DebugPlugin extends Plugin {
* Deleted breakpoint marker attribute (value
* <code>"org.eclipse.debug.core.breakpointIsDeleted"</code>). The attribute is a
* <code>boolean</code> corresponding to the deleted state of a breakpoint.
- *
+ *
* @see org.eclipse.core.resources.IMarker#getAttribute(String, boolean)
* @since 3.7
*/
@@ -305,7 +305,7 @@ public class DebugPlugin extends Plugin {
/**
* Attribute key for the path of the working directory for an {@link IProcess}
- *
+ *
* @see IProcess
* @since 3.8
*/
@@ -313,7 +313,7 @@ public class DebugPlugin extends Plugin {
/**
* Attribute key for path of the executable that launched an {@link IProcess}
- *
+ *
* @see IProcess
* @since 3.8
*/
@@ -328,11 +328,11 @@ public class DebugPlugin extends Plugin {
* The singleton breakpoint manager.
*/
private BreakpointManager fBreakpointManager;
-
+
/**
* The singleton expression manager.
*/
- private ExpressionManager fExpressionManager;
+ private ExpressionManager fExpressionManager;
/**
* The singleton launch manager.
@@ -344,12 +344,12 @@ public class DebugPlugin extends Plugin {
* @since 3.1
*/
private MemoryBlockManager fMemoryBlockManager;
-
+
/**
* The collection of debug event listeners.
*/
private ListenerList fEventListeners = new ListenerList();
-
+
/**
* Event filters, or <code>null</code> if none.
*/
@@ -360,20 +360,20 @@ public class DebugPlugin extends Plugin {
* down.
*/
private boolean fShuttingDown= false;
-
+
/**
* Table of status handlers. Keys are {plug-in identifier, status code}
* pairs, and values are associated <code>IConfigurationElement</code>s.
*/
- private HashMap fStatusHandlers = null;
-
+ private HashMap<StatusHandlerKey, IConfigurationElement> fStatusHandlers = null;
+
/**
* Map of process factories. Keys are process factory IDs
* and values are associated <code>IConfigurationElement</code>s.
* @since 3.0
*/
- private HashMap fProcessFactories = null;
-
+ private HashMap<String, IConfigurationElement> fProcessFactories = null;
+
/**
* Mode constants for the event notifier
*/
@@ -383,11 +383,11 @@ public class DebugPlugin extends Plugin {
/**
* 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();
-
+ private List<Object> fEventQueue = new ArrayList<Object>();
+
/**
* Job to fire events to listeners.
* @since 3.1
@@ -396,11 +396,11 @@ public class DebugPlugin extends Plugin {
/**
* 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();
@@ -408,15 +408,16 @@ public class DebugPlugin extends Plugin {
* Creates a new event dispatch job.
*/
public EventDispatchJob() {
- super(DebugCoreMessages.DebugPlugin_1);
+ 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) {
-
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+
while (!fEventQueue.isEmpty()) {
Object next = null;
synchronized (fEventQueue) {
@@ -432,44 +433,46 @@ public class DebugPlugin extends Plugin {
}
return Status.OK_STATUS;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
- public boolean shouldRun() {
+ @Override
+ public boolean shouldRun() {
return shouldSchedule();
}
/* (non-Javadoc)
* @see org.eclipse.core.internal.jobs.InternalJob#shouldSchedule()
*/
- public boolean shouldSchedule() {
+ @Override
+ 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 <code>null</code>
* 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() {
@@ -479,7 +482,7 @@ public class DebugPlugin extends Plugin {
/**
* Constructs the debug plug-in.
* <p>
- * An instance of this plug-in runtime class is automatically created
+ * An instance of this plug-in runtime class is automatically created
* when the facilities provided by this plug-in are required.
* <b>Clients must never explicitly instantiate a plug-in runtime class.</b>
* </p>
@@ -488,7 +491,7 @@ public class DebugPlugin extends Plugin {
super();
setDefault(this);
}
-
+
/**
* Adds the given listener to the collection of registered debug
* event listeners. Has no effect if an identical listener is already
@@ -499,33 +502,34 @@ public class DebugPlugin extends Plugin {
*/
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())
+ 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
*/
@@ -535,7 +539,7 @@ public class DebugPlugin extends Plugin {
}
fEventDispatchJob.schedule();
}
-
+
/**
* Returns the breakpoint manager.
*
@@ -548,7 +552,7 @@ public class DebugPlugin extends Plugin {
}
return fBreakpointManager;
}
-
+
/**
* Returns the launch manager.
*
@@ -561,7 +565,7 @@ public class DebugPlugin extends Plugin {
}
return fLaunchManager;
}
-
+
/**
* Returns the memory block manager.
* @return the memory block manager.
@@ -574,7 +578,7 @@ public class DebugPlugin extends Plugin {
}
return fMemoryBlockManager;
}
-
+
/**
* Returns the status handler registered for the given
* status, or <code>null</code> if none.
@@ -593,21 +597,21 @@ public class DebugPlugin extends Plugin {
if (fStatusHandlers == null) {
initializeStatusHandlers();
}
- IConfigurationElement config = (IConfigurationElement)fStatusHandlers.get(key);
+ IConfigurationElement config = 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$
+ invalidStatusHandler(null, MessageFormat.format("Registered status handler {0} does not implement required interface IStatusHandler.", new Object[] { config.getDeclaringExtension().getUniqueIdentifier() })); //$NON-NLS-1$
} catch (CoreException e) {
log(e);
}
}
return null;
- }
-
+ }
+
/**
* Returns the expression manager.
*
@@ -620,8 +624,8 @@ public class DebugPlugin extends Plugin {
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
@@ -632,15 +636,16 @@ public class DebugPlugin extends Plugin {
*/
public void removeDebugEventListener(IDebugEventSetListener listener) {
fEventListeners.remove(listener);
- }
+ }
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
try {
setShuttingDown(true);
-
+
if (fLaunchManager != null) {
fLaunchManager.shutdown();
}
@@ -650,10 +655,10 @@ public class DebugPlugin extends Plugin {
if (fMemoryBlockManager != null) {
fMemoryBlockManager.shutdown();
}
-
+
fEventListeners.clear();
fEventFilters.clear();
-
+
SourceLookupUtils.shutdown();
Preferences.savePreferences(DebugPlugin.getUniqueIdentifier());
ResourcesPlugin.getWorkspace().removeSaveParticipant(getUniqueIdentifier());
@@ -662,23 +667,28 @@ public class DebugPlugin extends Plugin {
setDefault(null);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
new DebugOptions(context);
ResourcesPlugin.getWorkspace().addSaveParticipant(getUniqueIdentifier(),
new ISaveParticipant() {
+ @Override
public void saving(ISaveContext saveContext) throws CoreException {
if (fExpressionManager != null) {
fExpressionManager.storeWatchExpressions();
}
Preferences.savePreferences(DebugPlugin.getUniqueIdentifier());
- }
+ }
+ @Override
public void rollback(ISaveContext saveContext) {}
+ @Override
public void prepareToSave(ISaveContext saveContext) throws CoreException {}
+ @Override
public void doneSaving(ISaveContext saveContext) {}
});
//command adapters
@@ -692,7 +702,7 @@ public class DebugPlugin extends Plugin {
manager.registerAdapters(actionFactory, ITerminate.class);
manager.registerAdapters(actionFactory, ILaunch.class);
manager.registerAdapters(actionFactory, IProcess.class);
- manager.registerAdapters(actionFactory, IDebugElement.class);
+ manager.registerAdapters(actionFactory, IDebugElement.class);
}
/**
@@ -715,7 +725,7 @@ public class DebugPlugin extends Plugin {
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
* <code>java.lang.Process</code>. A streams proxy is created
@@ -737,7 +747,7 @@ public class DebugPlugin extends Plugin {
* @see IProcessFactory
* @since 2.1
*/
- public static IProcess newProcess(ILaunch launch, Process process, String label, Map attributes) {
+ public static IProcess newProcess(ILaunch launch, Process process, String label, Map<String, String> attributes) {
ILaunchConfiguration config= launch.getLaunchConfiguration();
String processFactoryID= null;
if (config != null) {
@@ -751,7 +761,7 @@ public class DebugPlugin extends Plugin {
if (plugin.fProcessFactories == null) {
plugin.initializeProcessFactories();
}
- IConfigurationElement element= (IConfigurationElement) plugin.fProcessFactories.get(processFactoryID);
+ IConfigurationElement element= plugin.fProcessFactories.get(processFactoryID);
if (element == null) {
return null;
}
@@ -763,56 +773,56 @@ public class DebugPlugin extends Plugin {
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 <code>null</code> 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 <code>null</code> 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 <code>null</code> 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 <code>null</code> 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
@@ -820,14 +830,14 @@ public class DebugPlugin extends Plugin {
* specification of a working directory, the status handler for error code
* <code>ERR_WORKING_DIRECTORY_NOT_SUPPORTED</code> 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 <code>null</code>
* @return the resulting process or <code>null</code> 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 {
@@ -841,7 +851,7 @@ public class DebugPlugin extends Plugin {
* specification of a working directory, the status handler for error code
* <code>ERR_WORKING_DIRECTORY_NOT_SUPPORTED</code> 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 <code>null</code>
* @param envp the environment variables set in the process, or <code>null</code>
@@ -849,7 +859,7 @@ public class DebugPlugin extends Plugin {
* canceled
* @exception CoreException if the exec fails
* @see Runtime
- *
+ *
* @since 3.0
*/
public static Process exec(String[] cmdLine, File workingDirectory, String[] envp) throws CoreException {
@@ -861,13 +871,13 @@ public class DebugPlugin extends Plugin {
p= Runtime.getRuntime().exec(cmdLine, envp, workingDirectory);
}
} catch (IOException e) {
- Status status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_0, 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);
+ //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()) {
@@ -877,67 +887,67 @@ public class DebugPlugin extends Plugin {
}
return p;
}
-
+
/**
- * Returns whether this plug-in is in the process of
+ * Returns whether this plug-in is in the process of
* being shutdown.
- *
- * @return whether this plug-in is in the process of
+ *
+ * @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
+ * Sets whether this plug-in is in the process of
* being shutdown.
- *
- * @param value whether this plug-in is in the process of
+ *
+ * @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 <code>IDebugEventSetListeners</code>
*/
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
*/
@@ -945,10 +955,10 @@ public class DebugPlugin extends Plugin {
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));
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, MessageFormat.format(DebugCoreMessages.DebugPlugin_2, new Object[] { message }), null));
}
}
-
+
/**
* Logs the given message with this plug-in's log and the given
* throwable or <code>null</code> if none.
@@ -958,41 +968,41 @@ public class DebugPlugin extends Plugin {
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
+ *
+ * @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);
+ fStatusHandlers = new HashMap<StatusHandlerKey, IConfigurationElement>(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));
@@ -1005,17 +1015,17 @@ public class DebugPlugin extends Plugin {
// 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);
+ fProcessFactories = new HashMap<String, IConfigurationElement>(infos.length);
for (int i= 0; i < infos.length; i++) {
IConfigurationElement configurationElement = infos[i];
String id = configurationElement.getAttribute("id"); //$NON-NLS-1$
@@ -1025,32 +1035,35 @@ public class DebugPlugin extends Plugin {
} 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));
+ log(new Status(IStatus.ERROR, DebugPlugin.PI_DEBUG_CORE, ERROR, MessageFormat.format(DebugCoreMessages.DebugPlugin_4, new Object[] {
+ 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));
+ log(new Status(IStatus.ERROR, DebugPlugin.PI_DEBUG_CORE, ERROR, MessageFormat.format(DebugCoreMessages.DebugPlugin_5, new Object[] { 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;
}
-
+
+ @Override
public int hashCode() {
return fPluginId.hashCode() + fCode;
}
-
+
+ @Override
public boolean equals(Object obj) {
if (obj instanceof StatusHandlerKey) {
StatusHandlerKey s = (StatusHandlerKey)obj;
@@ -1062,67 +1075,73 @@ public class DebugPlugin extends Plugin {
/**
* 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)
*/
+ @Override
public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_6, exception);
+ IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_6, exception);
log(status);
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
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)
*/
+ @Override
public void handleException(Throwable exception) {
switch (fMode) {
case NOTIFY_FILTERS:
- IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_7, exception);
+ 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);
+ case NOTIFY_EVENTS:
+ status = new Status(IStatus.ERROR, getUniqueIdentifier(), ERROR, DebugCoreMessages.DebugPlugin_8, exception);
log(status);
break;
+ default:
+ break;
}
}
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fMode) {
case NOTIFY_FILTERS:
@@ -1131,13 +1150,15 @@ public class DebugPlugin extends Plugin {
case NOTIFY_EVENTS:
fListener.handleDebugEvents(fEvents);
break;
+ default:
+ 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) {
@@ -1151,9 +1172,9 @@ public class DebugPlugin extends Plugin {
if (fEvents == null || fEvents.length == 0) {
return;
}
- }
- }
-
+ }
+ }
+
fMode = NOTIFY_EVENTS;
Object[] listeners= getEventListeners();
if (DebugOptions.DEBUG_EVENTS) {
@@ -1162,19 +1183,19 @@ public class DebugPlugin extends Plugin {
}
}
for (int i= 0; i < listeners.length; i++) {
- fListener = (IDebugEventSetListener)listeners[i];
+ fListener = (IDebugEventSetListener)listeners[i];
SafeRunner.run(this);
}
fEvents = null;
fFilter = null;
- fListener = 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
@@ -1184,13 +1205,13 @@ public class DebugPlugin extends Plugin {
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
@@ -1210,7 +1231,7 @@ public class DebugPlugin extends Plugin {
/**
* 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
@@ -1219,7 +1240,7 @@ public class DebugPlugin extends Plugin {
public static Element parseDocument(String document) throws CoreException {
Element root = null;
InputStream stream = null;
- try{
+ try{
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
parser.setErrorHandler(new DefaultHandler());
stream = new ByteArrayInputStream(document.getBytes("UTF8")); //$NON-NLS-1$
@@ -1232,7 +1253,7 @@ public class DebugPlugin extends Plugin {
abort("Unable to parse XML document.", e); //$NON-NLS-1$
} catch (IOException e) {
abort("Unable to parse XML document.", e); //$NON-NLS-1$
- } finally {
+ } finally {
try{
if (stream != null) {
stream.close();
@@ -1240,13 +1261,13 @@ public class DebugPlugin extends Plugin {
} 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 <code>null</code>
* @throws CoreException if a problem is encountered
@@ -1255,10 +1276,10 @@ public class DebugPlugin extends Plugin {
IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, message, exception);
throw new CoreException(status);
}
-
+
private static String[] parseArgumentsWindows(String args) {
// see http://msdn.microsoft.com/en-us/library/a1y7w461.aspx
- List result= new ArrayList();
+ List<String> result = new ArrayList<String>();
final int DEFAULT= 0;
final int ARG= 1;
@@ -1279,16 +1300,18 @@ public class DebugPlugin extends Plugin {
buf.append('\\');
}
if (backslashes == 1) {
- if (state == DEFAULT)
+ if (state == DEFAULT) {
state= ARG;
+ }
buf.append('"');
backslashes= 0;
continue;
} // else fall through to switch
} else {
// false alarm, treat passed backslashes literally...
- if (state == DEFAULT)
+ if (state == DEFAULT) {
state= ARG;
+ }
for (; backslashes > 0; backslashes--) {
buf.append('\\');
}
@@ -1316,7 +1339,7 @@ public class DebugPlugin extends Plugin {
buf.append(ch);
}
break;
-
+
case IN_DOUBLE_QUOTE:
if (ch == '"') {
if (i + 1 < len && args.charAt(i + 1) == '"') {
@@ -1342,21 +1365,22 @@ public class DebugPlugin extends Plugin {
throw new IllegalStateException();
}
}
- if (buf.length() > 0 || state != DEFAULT)
+ if (buf.length() > 0 || state != DEFAULT) {
result.add(buf.toString());
+ }
- return (String[]) result.toArray(new String[result.size()]);
+ return result.toArray(new String[result.size()]);
}
-
+
private static String[] parseArgumentsImpl(String args) {
// man sh, see topic QUOTING
- List result= new ArrayList();
-
+ List<String> result = new ArrayList<String>();
+
final int DEFAULT= 0;
final int ARG= 1;
final int IN_DOUBLE_QUOTE= 2;
final int IN_SINGLE_QUOTE= 3;
-
+
int state= DEFAULT;
StringBuffer buf= new StringBuffer();
int len= args.length();
@@ -1389,7 +1413,7 @@ public class DebugPlugin extends Plugin {
buf.append(ch);
}
break;
-
+
case IN_DOUBLE_QUOTE:
if (ch == '"') {
state= ARG;
@@ -1401,7 +1425,7 @@ public class DebugPlugin extends Plugin {
buf.append(ch);
}
break;
-
+
case IN_SINGLE_QUOTE:
if (ch == '\'') {
state= ARG;
@@ -1409,36 +1433,39 @@ public class DebugPlugin extends Plugin {
buf.append(ch);
}
break;
-
+
default:
throw new IllegalStateException();
}
}
- if (buf.length() > 0 || state != DEFAULT)
+ if (buf.length() > 0 || state != DEFAULT) {
result.add(buf.toString());
-
- return (String[]) result.toArray(new String[result.size()]);
+ }
+
+ return result.toArray(new String[result.size()]);
}
-
+
/**
* Parses the given command line into separate arguments that can be passed to
* <code>DebugPlugin.exec(String[], File)</code>. 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)
+ if (args == null) {
return new String[0];
-
- if (Constants.OS_WIN32.equals(Platform.getOS()))
+ }
+
+ if (Constants.OS_WIN32.equals(Platform.getOS())) {
return parseArgumentsWindows(args);
-
+ }
+
return parseArgumentsImpl(args);
- }
-
+ }
+
/**
* Renders the given array of strings into a single command line.
* <p>
@@ -1446,7 +1473,7 @@ public class DebugPlugin extends Plugin {
* with the offsets of the start positions of arguments 1 to
* <code>arguments.length - 1</code>, as rendered in the resulting string.
* </p>
- *
+ *
* @param arguments
* the command line arguments
* @param segments
@@ -1460,9 +1487,10 @@ public class DebugPlugin extends Plugin {
StringBuffer buf = new StringBuffer();
int count = arguments.length;
for (int i = 0; i < count; i++) {
- if (i > 0)
+ if (i > 0) {
buf.append(' ');
-
+ }
+
boolean containsSpace = false;
char[] characters = arguments[i].toCharArray();
for (int j = 0; j < characters.length; j++) {
@@ -1473,7 +1501,7 @@ public class DebugPlugin extends Plugin {
break;
}
}
-
+
int backslashes = 0;
for (int j = 0; j < characters.length; j++) {
char ch = characters[j];
@@ -1506,7 +1534,7 @@ public class DebugPlugin extends Plugin {
} else if (characters.length == 0) {
buf.append("\"\""); //$NON-NLS-1$
}
-
+
if (segments != null && i < count - 1) {
segments[i] = buf.length() + 1;
}
@@ -1516,8 +1544,8 @@ public class DebugPlugin extends Plugin {
/**
* Sets whether step filters should be applied to step commands. This
- * setting is a global option applied to all registered debug targets.
- *
+ * 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
@@ -1526,10 +1554,10 @@ public class DebugPlugin extends Plugin {
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
@@ -1537,30 +1565,30 @@ public class DebugPlugin extends Plugin {
*/
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 <code>null</code>
* 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 <code>PlatformObject</code>, 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 <code>null</code>
* @since 3.4
*/
- public static Object getAdapter(Object element, Class type) {
+ public static Object getAdapter(Object element, Class<?> type) {
Object adapter = null;
if (element != null) {
if (type.isInstance(element)) {
@@ -1579,9 +1607,9 @@ public class DebugPlugin extends Plugin {
}
}
}
- return adapter;
- }
-
+ return adapter;
+ }
+
}
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
index a5cb36658..020ca26cf 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfiguration.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,7 +26,7 @@ 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
+ * 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.
@@ -61,45 +61,45 @@ import org.eclipse.core.runtime.IProgressMonitor;
* @noextend This interface is not intended to be extended by clients.
*/
public interface ILaunchConfiguration extends IAdaptable {
-
+
/**
* The file extension for launch configuration files
* (value <code>"launch"</code>).
*/
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
+ * 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
+ * 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
@@ -108,7 +108,7 @@ public interface ILaunchConfiguration extends IAdaptable {
* will return <code>null</code> for <code>getOriginal()</code>).
* When the working copy is saved it will not affect 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:
@@ -119,12 +119,12 @@ public interface ILaunchConfiguration extends IAdaptable {
* @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:
* <ul>
* <li>An exception occurs while deleting this configuration's
@@ -132,18 +132,18 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
*/
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 boolean-valued attribute with the given name.
* Returns the given default value if the attribute is undefined.
*
* @param attributeName the name of the attribute
@@ -158,9 +158,9 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
*/
public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException;
-
+
/**
- * Returns the integer-valued attribute with the given name.
+ * 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
@@ -175,9 +175,9 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
*/
public int getAttribute(String attributeName, int defaultValue) throws CoreException;
-
+
/**
- * Returns the <code>java.util.List</code>-valued attribute with the given name.
+ * Returns the <code>java.util.List</code>-valued attribute with the given name.
* Returns the given default value if the attribute is undefined.
*
* @param attributeName the name of the attribute
@@ -191,10 +191,10 @@ public interface ILaunchConfiguration extends IAdaptable {
* have a List value</li>
* </ul>
*/
- public List getAttribute(String attributeName, List defaultValue) throws CoreException;
-
+ public List<String> getAttribute(String attributeName, List<String> defaultValue) throws CoreException;
+
/**
- * Returns the <code>java.util.Set</code>-valued attribute with the given name.
+ * Returns the <code>java.util.Set</code>-valued attribute with the given name.
* Returns the given default value if the attribute is undefined.
*
* @param attributeName the name of the attribute
@@ -207,13 +207,13 @@ public interface ILaunchConfiguration extends IAdaptable {
* <li>An attribute with the given name exists, but does not
* have a List value</li>
* </ul>
- *
+ *
* @since 3.3
*/
- public Set getAttribute(String attributeName, Set defaultValue) throws CoreException;
-
+ public Set<String> getAttribute(String attributeName, Set<String> defaultValue) throws CoreException;
+
/**
- * Returns the <code>java.util.Map</code>-valued attribute with the given name.
+ * Returns the <code>java.util.Map</code>-valued attribute with the given name.
* Returns the given default value if the attribute is undefined.
*
* @param attributeName the name of the attribute
@@ -227,10 +227,10 @@ public interface ILaunchConfiguration extends IAdaptable {
* have a Map value</li>
* </ul>
*/
- public Map getAttribute(String attributeName, Map defaultValue) throws CoreException;
-
+ public Map<String, String> getAttribute(String attributeName, Map<String, String> defaultValue) throws CoreException;
+
/**
- * Returns the string-valued attribute with the given name.
+ * 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
@@ -245,7 +245,7 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
*/
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.
@@ -259,12 +259,12 @@ public interface ILaunchConfiguration extends IAdaptable {
* @exception CoreException unable to generate/retrieve an attribute map
* @since 2.1
*/
- public Map getAttributes() throws CoreException;
-
+ public Map<String, Object> getAttributes() throws CoreException;
+
/**
* Returns this launch configuration's type's category, or <code>null</code>
* if unspecified. This is a handle-only method.
- *
+ *
* @return this launch configuration's type's category, or <code>null</code>
* @exception CoreException if this method fails. Reasons include:
* <ul>
@@ -273,18 +273,18 @@ public interface ILaunchConfiguration extends IAdaptable {
* @since 2.1
*/
public String getCategory() throws CoreException;
-
+
/**
* Returns the file this launch configuration is stored
* in, or <code>null</code> 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 <code>null</code> 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 <code>null</code> if it cannot
@@ -294,7 +294,7 @@ public interface ILaunchConfiguration extends IAdaptable {
* launch configuration is stored in the workspace as an {@link IFile} in
* an external file system ({@link EFS}).
* </p>
- *
+ *
* @return the location of this launch configuration as a
* path file system or <code>null</code> if it cannot be mapped
* to a location in the local file system. Since 3.5, this method
@@ -302,44 +302,45 @@ public interface ILaunchConfiguration extends IAdaptable {
* @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.
*/
+ @Deprecated
public IPath getLocation();
-
+
/**
* Returns the resources this launch configuration is associated with or <code>null</code>
* 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 <code>null</code>
* @throws CoreException unable to get the mapped resource
* @since 3.2
*/
public IResource[] getMappedResources() throws CoreException;
-
+
/**
* Returns a memento for this launch configuration, or <code>null</code>
* 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
+ * 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();
-
+ 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.
+ * on a launch configuration.
* <p>
* Setting launch modes on a configuration allows a launch to be
* performed in mixed mode - for example, debug and profile at the
@@ -349,24 +350,24 @@ public interface ILaunchConfiguration extends IAdaptable {
* @exception CoreException if an exception occurs retrieving modes
* @since 3.3
*/
- public Set getModes() throws CoreException;
-
+ public Set<String> getModes() throws CoreException;
+
/**
* Returns the preferred launch delegate that has been set on this
* configuration or <code>null</code> 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
+ * @return this configuration's preferred launch delegate for the specified mode set, or
* <code>null</code> if one is not specified
* @exception CoreException if an exception occurs retrieving preferred delegate
* @since 3.3
*/
- public ILaunchDelegate getPreferredDelegate(Set modes) throws CoreException;
-
+ public ILaunchDelegate getPreferredDelegate(Set<String> 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:
* <ul>
@@ -374,22 +375,22 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
* @see ILaunchConfigurationType
*/
- public ILaunchConfigurationType getType() throws CoreException;
-
+ 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
+ * 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.
+ * 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.
* <p>
* 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
+ * 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.
* </p>
* @return a working copy of this launch configuration, or a nested working copy if called
@@ -402,49 +403,49 @@ public interface ILaunchConfiguration extends IAdaptable {
* @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 if a problem is encountered
* @see ILaunchConfigurationMigrationDelegate
* @since 3.2
*/
public boolean isMigrationCandidate() throws CoreException ;
-
+
/**
* Returns whether this launch configuration is a working
* copy. Launch configurations which return <code>true</code>
- * to this method can be safely cast to
+ * to this method can be safely cast to
* <code>org.eclipse.debug.core.ILaunchConfigurationWorkingCopy</code>.
* 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
@@ -457,9 +458,9 @@ public interface ILaunchConfiguration extends IAdaptable {
* defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
* @param monitor progress monitor, or <code>null</code>. 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.
+ * 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:<ul>
* <li>unable to instantiate the underlying launch configuration delegate</li>
@@ -467,7 +468,7 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
*/
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
@@ -502,16 +503,16 @@ public interface ILaunchConfiguration extends IAdaptable {
* defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
* @param monitor progress monitor, or <code>null</code>. 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.
+ * 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;
-
+ 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
@@ -550,9 +551,9 @@ public interface ILaunchConfiguration extends IAdaptable {
* defined by <code>ILaunchManager</code> - <code>RUN_MODE</code> or <code>DEBUG_MODE</code>.
* @param monitor progress monitor, or <code>null</code>. 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.
+ * 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
@@ -560,7 +561,7 @@ public interface ILaunchConfiguration extends IAdaptable {
* @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.
@@ -570,11 +571,11 @@ public interface ILaunchConfiguration extends IAdaptable {
* @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 <code>ILaunchManager</code> - <code>RUN_MODE</code> or
* <code>DEBUG_MODE</code>.
@@ -586,14 +587,14 @@ public interface ILaunchConfiguration extends IAdaptable {
* </ul>
*/
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();
+ public boolean isReadOnly();
}
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
index 375dc34ca..cd78a8ca4 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationType.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.core;
-
+
import java.util.Set;
import org.eclipse.core.resources.IContainer;
@@ -29,7 +29,7 @@ import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
* type extension.
* <pre>
* &lt;extension point="org.eclipse.debug.core.launchConfigurationTypes"&gt;
- * &lt;launchConfigurationType
+ * &lt;launchConfigurationType
* id="com.example.ExampleIdentifier"
* delegate="com.example.ExampleLaunchConfigurationDelegate"
* modes="run, debug"
@@ -81,47 +81,48 @@ import org.eclipse.debug.core.sourcelookup.ISourcePathComputer;
* @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 <code>null</code> if
* unspecified.
- *
+ *
* @param attributeName attribute name
* @return the specified extension attribute, or <code>null</code>
* @since 2.1
*/
public String getAttribute(String attributeName);
-
+
/**
* Returns this launch configuration type's category, or <code>null</code>
* if unspecified. This corresponds to the category attribute specified in
* the extension definition.
- *
+ *
* @return this launch configuration type's category, or <code>null</code>
* @since 2.1
*/
public String getCategory();
-
+
/**
* Returns the launch configuration delegate for launch
* configurations of this type, for <code>run</code> 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 <code>getDelegate(String)</code> to specify mode
- */
+ */
+ @Deprecated
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 <code>org.eclipse.debug.core.launchDelegates</code>
- *
+ *
* @param mode launch mode
* @return launch configuration delegate
* @exception CoreException if unable to instantiate the
@@ -129,84 +130,85 @@ public interface ILaunchConfigurationType extends IAdaptable {
* @since 3.0
* @deprecated since 3.3, the method <code>getDelegates(Set)</code> should be used
* instead, as there can be more than one capable delegate per mode or combination
- * of modes
- */
+ * of modes
+ */
+ @Deprecated
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 <code>ILaunchDelegate</code>s capable of launching
* in the specified modes or an empty collection if none
* @throws CoreException if a problem is encountered
* @since 3.3
*/
- public ILaunchDelegate[] getDelegates(Set modes) throws CoreException;
-
+ public ILaunchDelegate[] getDelegates(Set<String> modes) throws CoreException;
+
/**
* Returns the preferred launch delegate for this type in the specified mode combination
* or <code>null</code> if there is no preferred delegate.
- *
+ *
* @param modes the set of modes to support
* @return the preferred delegate or <code>null</code> if none
* @throws CoreException if a problem is encountered
- *
+ *
* @since 3.3
*/
- public ILaunchDelegate getPreferredDelegate(Set modes) throws CoreException;
-
+ public ILaunchDelegate getPreferredDelegate(Set<String> modes) throws CoreException;
+
/**
* Sets the preferred launch delegate for this type in the specified mode combination.
* Specify <code>null</code> 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 <code>null</code>
* @throws CoreException if a problem is encountered
- *
+ *
* @since 3.3
*/
- public void setPreferredDelegate(Set modes, ILaunchDelegate delegate) throws CoreException;
-
+ public void setPreferredDelegate(Set<String> 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);
-
+ public boolean supportsModeCombination(Set<String> 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 <code>null</code> if unspecified.
* A source locator can be specified by a launch configuration type or
- * launch delegate extension's <code>sourceLocatorId</code> attribute.
+ * launch delegate extension's <code>sourceLocatorId</code> attribute.
* <p>
* Only one source locator should be provided per launch configuration type
* and its launch delegates.
@@ -216,7 +218,7 @@ public interface ILaunchConfigurationType extends IAdaptable {
* @since 3.0
*/
public String getSourceLocatorId();
-
+
/**
* Returns the source path computer registered with this launch configuration
* type or <code>null</code> if unspecified. A source path computer can be
@@ -224,52 +226,53 @@ public interface ILaunchConfigurationType extends IAdaptable {
* <code>sourcePathComputerId</code> attribute.
* <p>
* Only one source path computer should be provided per launch configuration type
- * and its launch delegates.
+ * and its launch delegates.
* </p>
* @return the source path computer registered with this launch configuration
* type or <code>null</code> if unspecified
* @since 3.0
*/
- public ISourcePathComputer getSourcePathComputer();
-
+ public ISourcePathComputer getSourcePathComputer();
+
/**
* Returns all of the registered supported modes for this launch configuration type.
* This method does not return null.
- *
+ *
* <p>
* 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
+ * a set of strings of all the modes in some way associated with this type
* </p>
- *
+ *
* @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 <code>getSupportedModeCombinations</code>
* should be used instead to retrieve the complete listing of supported modes and their allowable combinations.
*/
- public Set getSupportedModes();
-
+ @Deprecated
+ public Set<String> getSupportedModes();
+
/**
* Returns a <code>java.util.Set</code> of <code>java.util.Set</code>s 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();
-
+ public Set<Set<String>> 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
+ * accessible in this way, but are still available through the methods on
* <code>ILaunchManager</code>.
- *
+ *
* @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.
@@ -291,11 +294,11 @@ public interface ILaunchConfigurationType extends IAdaptable {
* 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 <code>ILaunchManager</code> - <code>RUN_MODE</code> or
* <code>DEBUG_MODE</code>.
@@ -303,10 +306,10 @@ public interface ILaunchConfigurationType extends IAdaptable {
* 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
*/
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
index a7ffcb85a..b46e3747b 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchConfigurationWorkingCopy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,16 +44,16 @@ import org.eclipse.core.runtime.IAdaptable;
* @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.
@@ -65,19 +65,19 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* effecting the original launch configuration.
* </p>
* @return handle to saved launch configuration
- * @exception CoreException if an exception occurs while
+ * @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.
+ * Sets the integer-valued attribute with the given name.
*
* @param attributeName the name of the attribute, cannot be <code>null</code>
* @param value the value
*/
public void setAttribute(String attributeName, int value);
-
+
/**
* Sets the String-valued attribute with the given name.
* If the value is <code>null</code>, the attribute is removed from
@@ -87,7 +87,7 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* @param value the value, or <code>null</code> if the attribute is to be undefined
*/
public void setAttribute(String attributeName, String value);
-
+
/**
* Sets the <code>java.util.List</code>-valued attribute with the given name.
* The specified List <em>must</em> contain only String-valued entries.
@@ -97,8 +97,8 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* @param attributeName the name of the attribute, cannot be <code>null</code>
* @param value the value, or <code>null</code> if the attribute is to be undefined
*/
- public void setAttribute(String attributeName, List value);
-
+ public void setAttribute(String attributeName, List<String> value);
+
/**
* Sets the <code>java.util.Map</code>-valued attribute with the given name.
* The specified Map <em>must</em> contain only String keys and String values.
@@ -108,8 +108,8 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* @param attributeName the name of the attribute, cannot be <code>null</code>
* @param value the value, or <code>null</code> if the attribute is to be undefined
*/
- public void setAttribute(String attributeName, Map value);
-
+ public void setAttribute(String attributeName, Map<String, String> value);
+
/**
* Sets the <code>java.util.Set</code>-valued attribute with the given name.
* The specified Set <em>must</em> contain only String values.
@@ -120,25 +120,25 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* @param value the value, or <code>null</code> if the attribute is to be undefined
* @since 3.6
*/
- public void setAttribute(String attributeName, Set value);
-
+ public void setAttribute(String attributeName, Set<String> value);
+
/**
- * Sets the boolean-valued attribute with the given name.
+ * Sets the boolean-valued attribute with the given name.
*
* @param attributeName the name of the attribute, cannot be <code>null</code>
* @param value the value
*/
- public void setAttribute(String attributeName, boolean value);
-
+ public void setAttribute(String attributeName, boolean value);
+
/**
* Returns the original launch configuration this working copy
* was created from or <code>null</code> if this is a new
* working copy created from a launch configuration type.
- *
+ *
* @return the original launch configuration, or <code>null</code>
*/
public ILaunchConfiguration getOriginal();
-
+
/**
* Renames this launch configuration to the specified name.
* The new name cannot be <code>null</code>. Has no effect if the name
@@ -146,11 +146,11 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* 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
+ *
+ * @param name the new name for this configuration
*/
- public void rename(String name);
-
+ public void rename(String name);
+
/**
* Sets the container this launch configuration will be stored
* in when saved. When set to <code>null</code>, this configuration
@@ -168,13 +168,13 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* The original file associated with this configuration in
* the workspace will be deleted.
* </p>
- *
+ *
* @param container the container in which to store this
* launch configuration, or <code>null</code> if this
* configuration is to be stored locally
*/
- public void setContainer(IContainer container);
-
+ 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
@@ -188,44 +188,46 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* Attribute names are not allowed to be <code>null</code>
* @since 2.1
*/
- public void setAttributes(Map attributes);
-
+ public void setAttributes(Map<String, ? extends Object> attributes);
+
/**
* Sets the resources associated with this launch configuration, possibly <code>null</code>.
* Clients contributing launch configuration types are responsible for maintaining
* resource mappings.
- *
+ *
* @param resources the resource to map to this launch configuration or <code>null</code>
* @since 3.2
*/
public void setMappedResources(IResource[] resources);
-
+
/**
- * Set the launch modes for this configuration.
- * Over-writes existing launch modes.
+ * Set the launch modes for this configuration. Over-writes existing launch
+ * modes.
* <p>
- * Setting launch modes on a configuration allows the configuration to
- * be launched in a mixed mode - for example, debug and profile.
+ * Setting launch modes on a configuration allows the configuration to be
+ * launched in a mixed mode - for example, <code>debug</code> and
+ * <code>profile</code>.
* </p>
- * @param modes launch mode identifiers to set on this configuration
- * or <code>null</code> to clear mode settings
- *
+ *
+ * @param modes launch mode identifiers to set on this configuration or
+ * <code>null</code> to clear mode settings
+ *
* @since 3.3
*/
- public void setModes(Set modes);
-
+ public void setModes(Set<String> modes);
+
/**
* Set the preferred launch delegates' id for the given mode set. Passing in <code>null</code> 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 <code>null</code> to clear the setting
- *
+ *
* @since 3.3
*/
- public void setPreferredLaunchDelegate(Set modes, String delegateId);
-
+ public void setPreferredLaunchDelegate(Set<String> modes, String delegateId);
+
/**
* Adds the specified launch modes to this configuration's settings.
* <p>
@@ -234,11 +236,11 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* </p>
* @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);
-
+ public void addModes(Set<String> modes);
+
/**
* Removes the specified launch modes from this configuration's settings.
* <p>
@@ -247,11 +249,11 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* </p>
* @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);
-
+ public void removeModes(Set<String> modes);
+
/**
* Removes the specified attribute from the this configuration and returns
* the previous value associated with the specified attribute name, or <tt>null</tt>
@@ -262,15 +264,15 @@ public interface ILaunchConfigurationWorkingCopy extends ILaunchConfiguration, I
* </p>
* @param attributeName the name of the attribute to remove
* @return previous value of the attribute or <code>null</code>
- *
+ *
* @since 3.4
*/
public Object removeAttribute(String attributeName);
-
+
/**
* Returns the parent of this working copy or <code>null</code> if this working
* copy is not a nested copy of another working copy.
- *
+ *
* @return parent or <code>null</code>
* @since 3.3
*/
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
index b9af5cd34..8fda4c5aa 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,7 +19,7 @@ import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
/**
* A proxy to an {@link ILaunchConfigurationDelegate}. Represents a
* launch delegate contributed to the <code>org.eclipse.debug.core.launchDelegates</code>
- * extension point.
+ * 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.
@@ -28,65 +28,65 @@ 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 <code>null</code> if none.
- *
+ *
* @return name or <code>null</code>
*/
public String getName();
-
+
/**
- * Returns a description of this launch delegate, or
+ * Returns a description of this launch delegate, or
* <code>null</code> if none.
- *
+ *
* @return description or <code>null</code>
*/
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();
-
+ public List<Set<String>> 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
+ * 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 <code>null</code> if none provided
*/
- public String getPerspectiveId(Set modes);
-
+ public String getPerspectiveId(Set<String> modes);
+
}
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
index 4796bec88..534abe840 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/ILaunchManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.core;
-
+
import java.util.Map;
import org.eclipse.core.resources.IFile;
@@ -43,43 +43,43 @@ public interface ILaunchManager {
* A launch in a special profile mode (value <code>"profile"</code>).
* @since 3.0
*/
- public static final String PROFILE_MODE= "profile"; //$NON-NLS-1$
+ 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 <code>null</code> which indicates the default environment
- * should be used.
- *
+ * 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 <code>true</code>),
* or if they should replace the environment (i.e. <code>false</code>). The
* default value is <code>true</code>.
- *
- * @since 3.0
+ *
+ * @since 3.0
*/
- public static final String ATTR_APPEND_ENVIRONMENT_VARIABLES = DebugPlugin.getUniqueIdentifier() + ".appendEnvironmentVariables"; //$NON-NLS-1$
-
+ 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
*/
@@ -89,19 +89,19 @@ public interface ILaunchManager {
* 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);
+ 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);
+ 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.
@@ -109,7 +109,7 @@ public interface ILaunchManager {
* @param listener the listener to register
* @since 2.1
*/
- public void addLaunchListener(ILaunchesListener listener);
+ 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.
@@ -120,7 +120,7 @@ public interface ILaunchManager {
/**
* 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 <code>namePrefix</code> as a starting point. If
+ * The name that is returned uses the <code>namePrefix</code> as a starting point. If
* there is no existing launch configuration with this name, then <code>namePrefix</code>
* is returned. Otherwise, the value returned consists of the specified prefix plus
* some suffix that guarantees uniqueness.
@@ -129,20 +129,21 @@ public interface ILaunchManager {
* @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.
+ * will perform validation of the name and correct unsupported name parts.
*/
+ @Deprecated
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 <code>namePrefix</code> as a starting point. If
+ * The name that is returned uses the <code>namePrefix</code> as a starting point. If
* there is no existing launch configuration with this name, then <code>namePrefix</code>
* is returned. Otherwise, the value returned consists of the specified prefix plus
* some suffix that guarantees uniqueness.
* <p>
* 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
+ * during the name generation. Illegal characters will be replaced with '_' and illegal names will be
* replaced with "_reserved_".
* </p>
* @param namePrefix the string that the returned name should begin with
@@ -150,11 +151,11 @@ public interface ILaunchManager {
* @since 3.6
*/
public String generateLaunchConfigurationName(String namePrefix);
-
+
/**
- * Returns if the given name is valid or not. If an invalid name part is located
+ * 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 '/').
@@ -163,7 +164,7 @@ public interface ILaunchManager {
* @since 3.6
*/
public boolean isValidLaunchConfigurationName(String configname) throws IllegalArgumentException;
-
+
/**
* Returns the collection of debug targets currently registered with this
* launch manager.
@@ -171,11 +172,11 @@ public interface ILaunchManager {
* @return an array of debug targets
*/
public IDebugTarget[] getDebugTargets();
- /**
+ /**
* Returns an array of environment variables to be used when
* launching the given configuration or <code>null</code> if unspecified.
* Each entry is of the form "<code>var_name=value</code>".
- *
+ *
* @return an array of environment variables to use when launching the given
* configuration or <code>null</code> if unspecified
* @param configuration launch configuration
@@ -187,9 +188,9 @@ public interface ILaunchManager {
/**
* This method returns the character encoding to use when launching the specified <code>ILaunchConfiguration</code>.
* The returned encoding can be derived from one of three places in the following order:
- * <ol>
+ * <ol>
* <li>An attribute saved on the configuration itself (where no attribute means use the default encoding).</li>
- * <li>The mapped resources for the configuration, in the event one of them has a specific encoding that
+ * <li>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.</li>
* <li>We ask the <code>ResourcesPlugin</code> for the workspace preference (which resolves back to the system
@@ -198,26 +199,26 @@ public interface ILaunchManager {
* @param configuration the <code>ILaunchConfiguration</code> to get the encoding for
* @return the encoding to use when launching the specified <code>ILaunchConfiguration</code>
* @throws CoreException if a problem is encountered
- *
+ *
* @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 <code>IFile</code> is
+ * in the specified file. This method does not check if the specified <code>IFile</code> 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);
+ 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
@@ -229,15 +230,15 @@ public interface ILaunchManager {
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;
+ 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
@@ -245,63 +246,63 @@ public interface ILaunchManager {
* @since 2.0
*/
public ILaunchConfiguration[] getLaunchConfigurations(ILaunchConfigurationType type) throws CoreException;
-
+
/**
* Returns the launch configuration type extension with the specified
* id, or <code>null</code> 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 <code>null</code> 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 <code>null</code> if none.
- *
+ *
* @param mode mode identifier
* @return launch mode or <code>null</code>
* @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 <code>ILaunchConfigurationListener</code>)
@@ -316,7 +317,7 @@ public interface ILaunchManager {
* Renaming a configuration is considered the same as moving a
* configuration.
* </p>
- *
+ *
* @param addedConfiguration a launch configuration for which an add
* notification is being broadcast
* @return the launch configuration that the added launch configuration was
@@ -325,7 +326,7 @@ public interface ILaunchManager {
* @since 2.1
*/
public ILaunchConfiguration getMovedFrom(ILaunchConfiguration addedConfiguration);
-
+
/**
* When a launch configuration is deleted or moved, registered launch
* configuration listeners (see <code>ILaunchConfigurationListener</code>)
@@ -348,8 +349,8 @@ public interface ILaunchManager {
* result of a move
* @since 2.1
*/
- public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration);
-
+ public ILaunchConfiguration getMovedTo(ILaunchConfiguration removedConfiguration);
+
/**
* Returns the native system environment variables as a map of
* variable names and values (Strings).
@@ -357,19 +358,19 @@ public interface ILaunchManager {
* 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
+ * 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.
* </p>
- *
+ *
* @return the native system environment variables; on WIN32, mixed-case
* variable names (keys) have been normalized to upper case
* (key type: <code>String</code>; value type: <code>String</code>)
* @since 3.0
- */
- public Map getNativeEnvironment();
+ */
+ public Map<String, String> getNativeEnvironment();
/**
* Returns the native system environment variables as a map of
@@ -379,18 +380,18 @@ public interface ILaunchManager {
* 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
+ * 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.
* </p>
- *
+ *
* @return the native system environment variables; on WIN32, mixed-case
* variable names (keys) are returned without normalization
* (key type: <code>String</code>; value type: <code>String</code>)
* @since 3.1
- */
- public Map getNativeEnvironmentCasePreserved();
+ */
+ public Map<String, String> getNativeEnvironmentCasePreserved();
/**
* Returns the collection of processes currently registered with this
@@ -399,21 +400,21 @@ public interface ILaunchManager {
* @return an array of processes
*/
public IProcess[] getProcesses();
-
+
/**
* Returns the source container type extension registered with the
* given unique identifier, or <code>null</code> 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 <code>null</code> 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
*/
@@ -424,7 +425,7 @@ public interface ILaunchManager {
* the given launch configuration, or <code>null</code> 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 <code>null</code> if unspecified
@@ -433,43 +434,43 @@ public interface ILaunchManager {
* @since 3.0
*/
public ISourcePathComputer getSourcePathComputer(ILaunchConfiguration configuration) throws CoreException;
-
+
/**
* Returns the source path computer extension registered with the given
* unique identifier, or <code>null</code> if none.
- *
+ *
* @param id source path computer identifier
* @return the source path computer extension registered with the given
* unique identifier, or <code>null</code> if none
* @since 3.0
*/
- public ISourcePathComputer getSourcePathComputer(String id);
-
+ public ISourcePathComputer getSourcePathComputer(String id);
+
/**
- * Return <code>true</code> if there is a launch configuration with the specified name,
+ * Return <code>true</code> if there is a launch configuration with the specified name,
* <code>false</code> 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
+ *
+ * @param identifier the identifier associated with a
* persistable source locator extension
* @return a source locator
* @exception CoreException if an exception occurs creating
@@ -493,7 +494,7 @@ public interface ILaunchManager {
* 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
*/
@@ -508,7 +509,7 @@ public interface ILaunchManager {
* @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.
@@ -517,7 +518,7 @@ public interface ILaunchManager {
* @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.
@@ -525,7 +526,7 @@ public interface ILaunchManager {
* @param listener the listener to unregister
*/
public void removeLaunchListener(ILaunchListener listener);
-
+
}
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
index 802ffc917..d412ca9bb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/IProcessFactory.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -47,7 +47,7 @@ import org.eclipse.debug.core.model.IProcess;
*/
public interface IProcessFactory {
-
+
/**
* Creates and returns a new process representing the given
* <code>java.lang.Process</code>. A streams proxy is created
@@ -62,5 +62,5 @@ public interface IProcessFactory {
* @return the process
* @see IProcess
*/
- public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes);
+ public IProcess newProcess(ILaunch launch, Process process, String label, Map<String, String> attributes);
}
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
index 2ce48cca6..8f54e9cbb 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@ 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;
@@ -38,16 +37,15 @@ import org.eclipse.debug.internal.core.LaunchManager;
* @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();
+ private List<IDebugTarget> fTargets = new ArrayList<IDebugTarget>();
/**
* The configuration that was launched, or null.
@@ -58,7 +56,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
* The system processes associated with
* this launch, or empty if none.
*/
- private List fProcesses= new ArrayList();
+ private List<IProcess> fProcesses = new ArrayList<IProcess>();
/**
* The source locator to use in the debug session
@@ -70,19 +68,19 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
* The mode this launch was launched in.
*/
private String fMode;
-
+
/**
* Table of client defined attributes
*/
- private HashMap fAttributes;
-
+ private HashMap<String, String> fAttributes;
+
/**
* Flag indicating that change notification should
* be suppressed. <code>true</code> until this
* launch has been initialized.
*/
private boolean fSuppressChange = true;
-
+
/**
* Constructs a launch with the specified attributes.
*
@@ -92,7 +90,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
* @param locator the source locator to use for this debug session, or
* <code>null</code> if not supported
*/
- public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
+ public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
fConfiguration = launchConfiguration;
setSourceLocator(locator);
fMode = mode;
@@ -100,35 +98,32 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
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()
*/
+ @Override
public boolean canTerminate() {
- List processes = getProcesses0();
- for (int i = 0; i < processes.size(); i++) {
- IProcess process = (IProcess)processes.get(i);
+ for (IProcess process : getProcesses0()) {
if (process.canTerminate()) {
return true;
}
}
- List targets = getDebugTargets0();
- for (int i = 0; i < targets.size(); i++) {
- IDebugTarget target = (IDebugTarget)targets.get(i);
+ for (IDebugTarget target : getDebugTargets0()) {
if (target.canTerminate() || target.canDisconnect()) {
return true;
}
@@ -139,8 +134,9 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/**
* @see ILaunch#getChildren()
*/
+ @Override
public Object[] getChildren() {
- ArrayList children = new ArrayList(getDebugTargets0());
+ ArrayList<Object> children = new ArrayList<Object>(getDebugTargets0());
children.addAll(getProcesses0());
return children.toArray();
}
@@ -148,77 +144,76 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/**
* @see ILaunch#getDebugTarget()
*/
+ @Override
public IDebugTarget getDebugTarget() {
if (!getDebugTargets0().isEmpty()) {
- return (IDebugTarget)getDebugTargets0().get(0);
+ return getDebugTargets0().get(0);
}
return null;
}
-
+
/**
* @see ILaunch#getProcesses()
*/
+ @Override
public IProcess[] getProcesses() {
- return (IProcess[])getProcesses0().toArray(new IProcess[getProcesses0().size()]);
+ return 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() {
+ protected List<IProcess> getProcesses0() {
return fProcesses;
- }
-
+ }
+
/**
* @see ILaunch#getSourceLocator()
*/
+ @Override
public ISourceLocator getSourceLocator() {
return fLocator;
}
-
+
/**
* @see ILaunch#setSourceLocator(ISourceLocator)
*/
+ @Override
public void setSourceLocator(ISourceLocator sourceLocator) {
fLocator = sourceLocator;
- }
+ }
/**
* @see org.eclipse.debug.core.model.ITerminate#isTerminated()
*/
+ @Override
public boolean isTerminated() {
if (getProcesses0().isEmpty() && getDebugTargets0().isEmpty()) {
return false;
}
-
- Iterator processes = getProcesses0().iterator();
- while (processes.hasNext()) {
- IProcess process = (IProcess)processes.next();
+ for (IProcess process : getProcesses0()) {
if (!process.isTerminated()) {
return false;
}
}
-
- Iterator targets = getDebugTargets0().iterator();
- while (targets.hasNext()) {
- IDebugTarget target = (IDebugTarget)targets.next();
+ for (IDebugTarget target : getDebugTargets0()) {
if (!(target.isTerminated() || target.isDisconnected())) {
return false;
}
}
-
return true;
}
/**
* @see org.eclipse.debug.core.model.ITerminate#terminate()
*/
+ @Override
public void terminate() throws DebugException {
- MultiStatus status=
- new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugCoreMessages.Launch_terminate_failed, null);
+ 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();
@@ -261,20 +256,22 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
IStatus[] children= status.getChildren();
if (children.length == 1) {
throw new DebugException(children[0]);
- }
+ }
throw new DebugException(status);
}
/**
* @see ILaunch#getLaunchMode()
*/
+ @Override
public String getLaunchMode() {
return fMode;
}
-
+
/**
* @see ILaunch#getLaunchConfiguration()
*/
+ @Override
public ILaunchConfiguration getLaunchConfiguration() {
return fConfiguration;
}
@@ -282,43 +279,47 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/**
* @see ILaunch#setAttribute(String, String)
*/
+ @Override
public void setAttribute(String key, String value) {
if (fAttributes == null) {
- fAttributes = new HashMap(5);
+ fAttributes = new HashMap<String, String>(5);
}
- fAttributes.put(key, value);
+ fAttributes.put(key, value);
}
/**
* @see ILaunch#getAttribute(String)
*/
+ @Override
public String getAttribute(String key) {
if (fAttributes == null) {
return null;
}
- return (String)fAttributes.get(key);
+ return fAttributes.get(key);
}
/**
* @see ILaunch#getDebugTargets()
*/
+ @Override
public IDebugTarget[] getDebugTargets() {
- return (IDebugTarget[])fTargets.toArray(new IDebugTarget[fTargets.size()]);
+ return 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() {
+ protected List<IDebugTarget> getDebugTargets0() {
return fTargets;
- }
+ }
/**
* @see ILaunch#addDebugTarget(IDebugTarget)
*/
+ @Override
public void addDebugTarget(IDebugTarget target) {
if (target != null) {
if (!getDebugTargets0().contains(target)) {
@@ -328,21 +329,23 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
}
}
-
+
/**
* @see ILaunch#removeDebugTarget(IDebugTarget)
*/
+ @Override
public void removeDebugTarget(IDebugTarget target) {
if (target != null) {
if (getDebugTargets0().remove(target)) {
fireChanged();
}
}
- }
-
+ }
+
/**
* @see ILaunch#addProcess(IProcess)
*/
+ @Override
public void addProcess(IProcess process) {
if (process != null) {
if (!getProcesses0().contains(process)) {
@@ -352,21 +355,22 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
}
}
-
+
/**
* @see ILaunch#removeProcess(IProcess)
*/
+ @Override
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) {
@@ -377,7 +381,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
}
}
-
+
/**
* Notifies listeners that this launch has changed.
* Has no effect of this launch has not yet been
@@ -402,84 +406,79 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
removeEventListener();
}
-
+
/**
* @see ILaunch#hasChildren()
*/
+ @Override
public boolean hasChildren() {
return getProcesses0().size() > 0 || (getDebugTargets0().size() > 0);
}
-
+
/**
- * Returns whether any processes or targets can be disconnected.
+ * 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()
*/
+ @Override
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;
- }
- }
+ for (IProcess process : getProcesses0()) {
+ if (process instanceof IDisconnect) {
+ if (((IDisconnect) process).canDisconnect()) {
+ return true;
+ }
+ }
+ }
+ for (IDebugTarget target : getDebugTargets0()) {
+ if (target.canDisconnect()) {
+ return true;
+ }
+ }
return false;
}
/**
* @see org.eclipse.debug.core.model.IDisconnect#disconnect()
*/
+ @Override
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
+ for (IProcess process : getProcesses0()) {
+ if (process instanceof IDisconnect) {
+ IDisconnect dis = (IDisconnect) process;
+ if (dis.canDisconnect()) {
+ dis.disconnect();
+ }
+ }
+ }
+ for (IDebugTarget target : getDebugTargets0()) {
+ if (target.canDisconnect()) {
+ target.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()
*/
+ @Override
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;
- }
- }
+ for (IProcess process : getProcesses0()) {
+ if (process instanceof IDisconnect) {
+ if (!((IDisconnect) process).isDisconnected()) {
+ return false;
+ }
+ }
+ }
+ for (IDebugTarget target : getDebugTargets0()) {
+ if (!target.isDisconnected()) {
+ return false;
+ }
+ }
// only return true if there are processes or targets that are disconnected
return hasChildren();
}
@@ -487,6 +486,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchRemoved(ILaunch launch) {
if (this.equals(launch)) {
removeEventListener();
@@ -497,7 +497,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/**
* Returns the launch manager.
- *
+ *
* @return the launch manager.
*/
protected ILaunchManager getLaunchManager() {
@@ -507,22 +507,25 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchAdded(ILaunch launch) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
+ @Override
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)
*/
+ @Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
ILaunchConfiguration from = getLaunchManager().getMovedFrom(configuration);
if (from != null && from.equals(getLaunchConfiguration())) {
@@ -534,15 +537,17 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
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)
*/
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
if (configuration.equals(getLaunchConfiguration())) {
if (getLaunchManager().getMovedTo(configuration) == null) {
@@ -555,6 +560,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
@@ -578,6 +584,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
/* (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter.equals(ILaunch.class)) {
return this;
@@ -588,7 +595,7 @@ public class Launch extends PlatformObject implements ILaunch, IDisconnect, ILau
}
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
index 0a2a2bc44..06913be28 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/RefreshUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 IBM Corporation and others.
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,12 +19,13 @@ 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.IAdaptable;
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.runtime.SubMonitor;
import org.eclipse.core.variables.IStringVariableManager;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.internal.core.DebugCoreMessages;
@@ -37,7 +38,7 @@ 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.
@@ -60,82 +61,84 @@ public class RefreshUtil {
* 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}
+ * or {@link IResource#DEPTH_ZERO}
* @param monitor
* progress monitor which may be <code>null</code>
* @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()) {
+ SubMonitor lmonitor = SubMonitor.convert(monitor, DebugCoreMessages.RefreshingResources, resources.length);
+ if (lmonitor.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());
+ try {
+ for (int i = 0; i < resources.length; i++) {
+ if (lmonitor.isCanceled()) {
+ break;
+ }
+ if (resources[i] != null && resources[i].isAccessible()) {
+ try {
+ resources[i].refreshLocal(depth, null);
+ } catch (CoreException e) {
+ status.merge(e.getStatus());
+ }
}
+ lmonitor.worked(1);
}
- monitor.worked(1);
}
- monitor.done();
+ finally {
+ lmonitor.done();
+ }
if (!status.isOK()) {
throw new CoreException(status);
}
@@ -144,7 +147,7 @@ public class RefreshUtil {
/**
* 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
@@ -160,7 +163,7 @@ public class RefreshUtil {
if (resource == null) {
throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
IStatus.ERROR, MessageFormat.format(DebugCoreMessages.RefreshUtil_1,
- new String[] { pathString }), null));
+ new Object[] { pathString }), null));
}
return new IResource[] { resource };
} else if (memento.startsWith("${working_set:")) { //$NON-NLS-1$
@@ -191,13 +194,13 @@ public class RefreshUtil {
}
}
}
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.RefreshUtil_0, new String[]{memento})));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), MessageFormat.format(DebugCoreMessages.RefreshUtil_0, new Object[] { 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
*/
@@ -219,11 +222,11 @@ public class RefreshUtil {
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
*/
@@ -233,7 +236,7 @@ public class RefreshUtil {
return null;
}
- List resourcesList = new ArrayList();
+ List<IAdaptable> resourcesList = new ArrayList<IAdaptable>();
StringReader reader = new StringReader(wsMemento);
XMLMemento memento = null;
@@ -244,20 +247,19 @@ public class RefreshUtil {
return null;
}
- XMLMemento[] mementos = memento
- .getChildren(IMementoConstants.MEMENTO_ITEM);
+ 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()]);
+ return resourcesList.toArray(new IResource[resourcesList.size()]);
+
+ }
- }
-
/**
* Returns whether the refresh scope specified by the given launch
* configuration is recursive.
- *
+ *
* @param configuration the {@link ILaunchConfiguration}
* @return whether the refresh scope is recursive
* @throws CoreException
@@ -265,12 +267,12 @@ public class RefreshUtil {
*/
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 <code>null</code>
* @throws CoreException
@@ -289,5 +291,5 @@ public class RefreshUtil {
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
index 2d2128b7d..4674482f5 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,25 +33,25 @@ import org.eclipse.debug.internal.core.DebugOptions;
* @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 the {@link IEnabledStateRequest}
*/
UpdateJob(IEnabledStateRequest stateRequest) {
@@ -61,10 +61,11 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
setRule(getEnabledStateSchedulingRule(request));
getJobManager().addJobChangeListener(this);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
run = true;
if (DebugOptions.DEBUG_COMMANDS) {
@@ -116,10 +117,11 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
monitor.done();
return Status.OK_STATUS;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
*/
+ @Override
public boolean belongsTo(Object family) {
Object myFamily = getEnabledStateJobFamily(request);
if (myFamily != null) {
@@ -128,12 +130,15 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
return false;
}
+ @Override
public void aboutToRun(IJobChangeEvent event) {
}
+ @Override
public void awake(IJobChangeEvent event) {
}
+ @Override
public void done(IJobChangeEvent event) {
if (event.getJob() == this) {
if (!run) {
@@ -147,17 +152,20 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
}
}
+ @Override
public void running(IJobChangeEvent event) {
}
+ @Override
public void scheduled(IJobChangeEvent event) {
}
+ @Override
public void sleeping(IJobChangeEvent event) {
}
-
+
}
-
+
/**
* Scheduling rule to serialize commands on an object
*/
@@ -171,18 +179,20 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
*/
+ @Override
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
*/
+ @Override
public boolean isConflicting(ISchedulingRule rule) {
if (rule instanceof SerialPerObjectRule) {
SerialPerObjectRule vup = (SerialPerObjectRule) rule;
@@ -192,12 +202,14 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.IDebugCommandHandler#execute(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
public boolean execute(final IDebugCommandRequest request) {
Job job = new Job(getExecuteTaskName()) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (DebugOptions.DEBUG_COMMANDS) {
DebugOptions.trace("execute: " + AbstractDebugCommand.this); //$NON-NLS-1$
@@ -222,6 +234,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
monitor.done();
return Status.OK_STATUS;
}
+ @Override
public boolean belongsTo(Object family) {
Object jobFamily = getExecuteJobFamily(request);
if (jobFamily != null) {
@@ -234,53 +247,54 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
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)
*/
+ @Override
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.
+ * is called, and sets a cancel status on the progress monitor if the request is canceled.
* <p>
* Handlers must override this method.
* </p>
@@ -296,7 +310,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
* 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 <code>false</code> if the request is canceled.
+ * the request is canceled. Enabled state is set to <code>false</code> if the request is canceled.
* <p>
* Handlers must override this method.
* </p>
@@ -307,7 +321,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
* @throws CoreException if a problem is encountered
*/
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
@@ -317,23 +331,23 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
* <p>
* Clients must override this method.
* </p>
- * @param element element from a {@link IDebugCommandRequest}
+ * @param element element from a {@link IDebugCommandRequest}
* @return associated target object for execution or enabled state update. Cannot return <code>null</code>.
*/
- protected abstract Object getTarget(Object element);
-
+ protected abstract Object getTarget(Object element);
+
/**
* Convenience method to return an adapter of the specified type for the given object or <code>null</code>
* if none.
- *
+ *
* @param element element to retrieve adapter for
* @param type adapter type
* @return adapter or <code>null</code>
*/
- protected Object getAdapter(Object element, Class type) {
- return DebugPlugin.getAdapter(element, type);
- }
-
+ 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 <code>null</code> if none. By default a rule is created to serialize
@@ -347,7 +361,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
protected ISchedulingRule getEnabledStateSchedulingRule(IDebugCommandRequest request) {
return new SerialPerObjectRule(request.getElements()[0]);
}
-
+
/**
* Returns a scheduling rule for this command's {@link IDebugCommandRequest} execute job
* or <code>null</code> if none. By default, execution jobs have no scheduling rule.
@@ -360,7 +374,7 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
protected ISchedulingRule getExecuteSchedulingRule(IDebugCommandRequest request) {
return null;
}
-
+
/**
* Returns the job family for the this command's {@link IEnabledStateRequest} update job
* or <code>null</code> if none. The default implementation returns <code>null</code>.
@@ -372,8 +386,8 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
*/
protected Object getEnabledStateJobFamily(IDebugCommandRequest request) {
return null;
- }
-
+ }
+
/**
* Returns the job family for the this command's {@link IDebugCommandRequest} execute job
* or <code>null</code> if none. The default implementation returns <code>null</code>.
@@ -385,11 +399,11 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
*/
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.
*/
@@ -397,12 +411,12 @@ public abstract class AbstractDebugCommand implements IDebugCommandHandler {
if (objects.length == 1) {
return objects;
} else {
- LinkedHashSet set = new LinkedHashSet(objects.length);
+ LinkedHashSet<Object> set = new LinkedHashSet<Object>(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/model/Breakpoint.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/Breakpoint.java
index 442a331cb..6a6aab9f8 100644
--- 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
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this 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;
@@ -35,7 +35,7 @@ import org.eclipse.debug.internal.core.DebugCoreMessages;
* Abstract implementation of a breakpoint. This class is
* intended to be sub-classed by implementations
* of breakpoints.
- *
+ *
* @see IBreakpoint
* @since 2.0
*/
@@ -44,7 +44,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
/**
* Creates a breakpoint.
- *
+ *
* @since 3.8
*/
public Breakpoint() {
@@ -60,55 +60,62 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
/**
* @see IBreakpoint#setMarker(IMarker)
*/
+ @Override
public void setMarker(IMarker marker) throws CoreException {
fMarker= marker;
}
-
+
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals(Object item) {
if (item instanceof IBreakpoint) {
return getMarker().equals(((IBreakpoint)item).getMarker());
}
return false;
}
-
+
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
return getMarker().hashCode();
}
-
+
/**
* @see IBreakpoint#setEnabled(boolean)
*/
+ @Override
public void setEnabled(boolean enabled) throws CoreException {
if (enabled != isEnabled()) {
setAttribute(ENABLED, enabled);
}
}
-
+
/**
* @see IBreakpoint#isEnabled()
*/
+ @Override
public boolean isEnabled() throws CoreException {
return getMarker().getAttribute(ENABLED, false);
}
-
+
/**
* @see IBreakpoint#isRegistered()
*/
+ @Override
public boolean isRegistered() throws CoreException {
IMarker marker= getMarker();
return marker.exists() && marker.getAttribute(REGISTERED, true);
- }
-
+ }
+
/**
* @see IBreakpoint#setRegistered(boolean)
*/
+ @Override
public void setRegistered(boolean registered) throws CoreException {
if (isRegistered() != registered) {
setAttribute(REGISTERED, registered);
@@ -119,11 +126,12 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
mgr.removeBreakpoint(this, false);
}
}
- }
+ }
/**
* @see IBreakpoint#delete()
*/
+ @Override
public void delete() throws CoreException {
DebugPlugin.getDefault().getBreakpointManager().removeBreakpoint(this, false);
getMarker().delete();
@@ -132,6 +140,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
/**
* @see IBreakpoint#getMarker()
*/
+ @Override
public IMarker getMarker() {
return fMarker;
}
@@ -139,6 +148,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
/**
* @see IBreakpoint#isPersisted()
*/
+ @Override
public boolean isPersisted() throws CoreException {
return getMarker().getAttribute(PERSISTED, true);
}
@@ -146,18 +156,19 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
/**
* @see IBreakpoint#setPersisted(boolean)
*/
+ @Override
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
@@ -166,20 +177,21 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
protected void setAttribute(final String attributeName, final boolean value) throws CoreException {
IWorkspace workspace= ResourcesPlugin.getWorkspace();
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
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
@@ -188,11 +200,12 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
protected void setAttribute(final String attributeName, final int value) throws CoreException {
IWorkspace workspace= ResourcesPlugin.getWorkspace();
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
ensureMarker().setAttribute(attributeName, value);
}
};
-
+
workspace.run(runnable, getMarkerRule(), 0, null);
}
@@ -201,7 +214,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
* 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
@@ -210,11 +223,12 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
protected void setAttribute(final String attributeName, final Object value) throws CoreException {
IWorkspace workspace= ResourcesPlugin.getWorkspace();
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
ensureMarker().setAttribute(attributeName, value);
}
};
-
+
workspace.run(runnable, getMarkerRule(), 0, null);
}
@@ -223,7 +237,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
* 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
@@ -232,11 +246,12 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
protected void setAttributes(final String[] attributeNames, final Object[] values) throws CoreException {
IWorkspace workspace= ResourcesPlugin.getWorkspace();
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
ensureMarker().setAttributes(attributeNames, values);
}
};
-
+
workspace.run(runnable, getMarkerRule(), IWorkspace.AVOID_UPDATE, null);
}
@@ -245,41 +260,42 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
* 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{
+ protected void setAttributes(final Map<String, ? extends Object> attributes) throws CoreException {
IWorkspace workspace= ResourcesPlugin.getWorkspace();
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
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
+ * @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));
+ 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
*/
@@ -291,7 +307,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
/**
* Returns a scheduling rule to use when modifying markers on the given resource,
* possibly <code>null</code>.
- *
+ *
* @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 <code>null</code>
@@ -305,13 +321,13 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
}
return rule;
}
-
+
/**
- * Returns a scheduling rule to use when modifying or deleting this breakpoint's marker,
+ * Returns a scheduling rule to use when modifying or deleting this breakpoint's marker,
* possibly <code>null</code>. This method is only valid when this breakpoint's
* marker has already been created. When creating a marker on a specific resource,
* use <code>getMarkerRule(IResource)</code> instead.
- *
+ *
* @return a scheduling rule to use when modifying or deleting this breakpoint's marker
* @since 3.1
*/
@@ -327,10 +343,10 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
}
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
@@ -341,7 +357,7 @@ public abstract class Breakpoint extends PlatformObject implements IBreakpoint {
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
index bf5a31865..71e606570 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,13 +27,13 @@ import org.eclipse.debug.core.ILaunchConfiguration;
* @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) {
@@ -41,34 +41,38 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
}
/* (non-Javadoc)
- *
+ *
* Debug target implementation should override this method.
- *
+ *
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
- public IDebugTarget getDebugTarget() {
+ @Override
+ public IDebugTarget getDebugTarget() {
return fTarget;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
- public ILaunch getLaunch() {
+ @Override
+ public ILaunch getLaunch() {
return getDebugTarget().getLaunch();
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- public Object getAdapter(Class adapter) {
+ @Override
+ 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)
+ if (getDebugTarget() instanceof IStepFilters) {
return getDebugTarget();
+ }
}
if (adapter == IDebugTarget.class) {
return getDebugTarget();
@@ -88,81 +92,81 @@ public abstract class DebugElement extends PlatformObject implements IDebugEleme
/**
* 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 <code>DebugEvent.STATE</code> or <code>DebugEvent.CONTENT</code>
*/
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
+ *
+ * @param detail detail code for the resume event, such
* as <code>DebugEvent.STEP_OVER</code>
*/
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 <code>DebugEvent.BREAKPOINT</code>
*/
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 <code>TARGET_REQUEST_FAILED</code>.
- *
+ *
* @param message exception message
* @param e underlying exception or <code>null</code>
* @throws DebugException if a problem is encountered
*/
protected void requestFailed(String message, Throwable e) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
DebugException.TARGET_REQUEST_FAILED, message, e));
}
-
+
/**
* Throws a debug exception with a status code of <code>NOT_SUPPORTED</code>.
- *
+ *
* @param message exception message
* @param e underlying exception or <code>null</code>
* @throws DebugException if a problem is encountered
*/
protected void notSupported(String message, Throwable e) throws DebugException {
- throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ 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/IBreakpointImportParticipant.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IBreakpointImportParticipant.java
index cbafd8933..302d19001 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,28 +40,28 @@ import org.eclipse.debug.core.IBreakpointManager;
* <p>
* Clients may implement this interface.
* </p>
- *
+ *
* @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;
-
+ public boolean matches(Map<String, Object> 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
*/
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
index 31c4f25d7..5509a78a9 100644
--- 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
@@ -1,16 +1,16 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this 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
@@ -23,17 +23,17 @@ package org.eclipse.debug.core.model;
* 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).
+ * (i.e. as in a watch list).
* <p>
* Clients are intended to implement this interface.
* </p>
* @since 2.0
*/
public interface IExpression extends IDebugElement {
-
+
/**
* Returns this expression's snippet of code.
- *
+ *
* @return the expression
*/
public abstract String getExpressionText();
@@ -42,21 +42,22 @@ public interface IExpression extends IDebugElement {
* Returns the current value of this expression or
* <code>null</code> if this expression does not
* currently have a value.
- *
+ *
* @return value or <code>null</code>
*/
public abstract IValue getValue();
-
+
/**
* Returns the debug target this expression is associated
* with, or <code>null</code> if this expression is not
* associated with a debug target.
- *
+ *
* @return debug target or <code>null</code>
* @see IDebugElement#getDebugTarget()
*/
+ @Override
public abstract IDebugTarget getDebugTarget();
-
+
/**
* Notifies this expression that it has been removed
* from the expression manager. Any required clean up
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
index 24e375c12..a0854de9b 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -23,6 +23,7 @@ import org.eclipse.debug.core.DebugException;
* @since 2.1
* @deprecated clients should implement <code>IStepFilters</code> instead
*/
+@Deprecated
public interface IFilteredStep extends IStep {
/**
* Returns whether this element can currently perform a filtered step into.
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
index cf91b20cc..d44785dd7 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.debug.core.model;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -26,6 +25,7 @@ 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.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
@@ -41,12 +41,14 @@ import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.internal.core.DebugCoreMessages;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
+import com.ibm.icu.text.MessageFormat;
+
/**
* 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.
+ * if breakpoints are present in the workspace.
* <p>
* Clients implementing launch configuration delegates should subclass
* this class.
@@ -54,66 +56,68 @@ import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
* @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)
*/
+ @Override
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)
*/
+ @Override
public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
if (monitor != null) {
monitor.beginTask("", 1); //$NON-NLS-1$
@@ -122,7 +126,7 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
IProject[] projects = getBuildOrder(configuration, mode);
if (projects == null) {
return true;
- }
+ }
buildProjects(projects, new SubProgressMonitor(monitor, 1));
return false;
} finally {
@@ -131,12 +135,12 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
}
}
}
-
+
/**
* Returns the projects to build before launching the given launch configuration
* or <code>null</code> 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 <code>null</code>
@@ -145,11 +149,11 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
protected IProject[] getBuildOrder(ILaunchConfiguration configuration, String mode) throws CoreException {
return null;
}
-
+
/**
- * Returns the set of projects to use when searching for errors or <code>null</code>
- * if no search is to be done.
- *
+ * Returns the set of projects to use when searching for errors or <code>null</code>
+ * if no search is to be done.
+ *
* @param configuration the configuration being launched
* @param mode launch mode
* @return a list of projects or <code>null</code>
@@ -158,10 +162,11 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
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)
*/
+ @Override
public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
monitor.beginTask("", 1); //$NON-NLS-1$
try {
@@ -170,15 +175,15 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
return true; //continue launch
}
boolean continueLaunch = true;
-
- monitor.subTask(DebugCoreMessages.LaunchConfigurationDelegate_6);
- List errors = new ArrayList();
+
+ monitor.subTask(DebugCoreMessages.LaunchConfigurationDelegate_6);
+ List<IAdaptable> errors = new ArrayList<IAdaptable>();
for (int i = 0; i < projects.length; i++) {
- monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchConfigurationDelegate_7, new String[]{projects[i].getName()}));
+ monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchConfigurationDelegate_7, new Object[] { projects[i].getName() }));
if (existsProblems(projects[i])) {
errors.add(projects[i]);
- }
- }
+ }
+ }
if (!errors.isEmpty()) {
errors.add(0, configuration);
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);
@@ -186,24 +191,25 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
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.
* <p>
* Since 3.2, this check also performs saving of resources before launching.
* </p>
- *
+ *
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
if (!saveBeforeLaunch(configuration, mode, monitor)) {
return false;
@@ -218,19 +224,19 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);
if (prompter != null) {
boolean launchInDebugModeInstead = ((Boolean)prompter.handleStatus(switchToDebugPromptStatus, configuration)).booleanValue();
- if (launchInDebugModeInstead) {
+ 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
@@ -238,7 +244,7 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
* <p>
* Subclasses may override this method if required.
* </p>
- *
+ *
* @param configuration the configuration being launched
* @param mode the launch mode
* @param monitor progress monitor
@@ -256,7 +262,7 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
if(!((Boolean)prompter.handleStatus(saveScopedDirtyEditors, new Object[]{configuration, buildOrder})).booleanValue()) {
return false;
}
- }
+ }
return true;
} finally {
monitor.done();
@@ -266,11 +272,11 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
/**
* 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()) {
@@ -279,12 +285,12 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
}
return breakpointManager.getBreakpoints();
}
-
+
/**
* Returns an array of projects in their suggested build order
* containing all of the projects specified by <code>baseProjects</code>
* 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 <code>baseProjects</code>
@@ -292,26 +298,26 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
* projects
*/
protected IProject[] computeReferencedBuildOrder(IProject[] baseProjects) throws CoreException {
- HashSet unorderedProjects = new HashSet();
+ HashSet<IProject> unorderedProjects = new HashSet<IProject>();
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()]);
+ IProject[] projectSet = unorderedProjects.toArray(new IProject[unorderedProjects.size()]);
return computeBuildOrder(projectSet);
}
-
-
+
+
/**
* Adds all projects referenced by <code>project</code> 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{
+ protected void addReferencedProjects(IProject project, Set<IProject> references) throws CoreException {
if (project.isOpen()) {
IProject[] projects = project.getReferencedProjects();
for (int i = 0; i < projects.length; i++) {
@@ -320,32 +326,32 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
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 <code>projects</code> sorted
* according to their build order.
*/
- protected IProject[] computeBuildOrder(IProject[] projects) {
+ protected IProject[] computeBuildOrder(IProject[] projects) {
String[] orderedNames = ResourcesPlugin.getWorkspace().getDescription().getBuildOrder();
if (orderedNames != null) {
- List orderedProjects = new ArrayList(projects.length);
+ List<IProject> orderedProjects = new ArrayList<IProject>(projects.length);
//Projects may not be in the build order but should be built if selected
- List unorderedProjects = new ArrayList(projects.length);
+ List<IProject> unorderedProjects = new ArrayList<IProject>(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();
+ for (Iterator<IProject> iterator = unorderedProjects.iterator(); iterator.hasNext();) {
+ IProject project = iterator.next();
if (project.getName().equals(projectName)) {
orderedProjects.add(project);
iterator.remove();
@@ -355,18 +361,18 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
}
//Add anything not specified before we return
orderedProjects.addAll(unorderedProjects);
- return (IProject[]) orderedProjects.toArray(new IProject[orderedProjects.size()]);
+ return 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
@@ -384,13 +390,13 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
}
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
@@ -399,20 +405,21 @@ public abstract class LaunchConfigurationDelegate implements ILaunchConfiguratio
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(){
+ @Override
public void run(IProgressMonitor pm) throws CoreException {
SubMonitor localmonitor = SubMonitor.convert(pm, DebugCoreMessages.LaunchConfigurationDelegate_scoped_incremental_build, projects.length);
try {
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
index 94f04baa8..48c278691 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -19,16 +19,17 @@ 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()
*/
+ @Override
public int getLineNumber() throws CoreException {
IMarker m = getMarker();
if (m != null) {
@@ -40,6 +41,7 @@ public abstract class LineBreakpoint extends Breakpoint implements ILineBreakpoi
/**
* @see ILineBreakpoint#getCharStart()
*/
+ @Override
public int getCharStart() throws CoreException {
IMarker m = getMarker();
if (m != null) {
@@ -51,6 +53,7 @@ public abstract class LineBreakpoint extends Breakpoint implements ILineBreakpoi
/**
* @see ILineBreakpoint#getCharEnd()
*/
+ @Override
public int getCharEnd() throws CoreException {
IMarker m = getMarker();
if (m != null) {
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
index 1a8b8fe25..1a27397d2 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,8 +12,8 @@ package org.eclipse.debug.core.model;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.PlatformObject;
@@ -35,7 +35,7 @@ import org.eclipse.debug.internal.core.StreamsProxy;
* Clients may subclass this class. Clients that need to replace the implementation
* of a streams proxy associated with an <code>IProcess</code> should subclass this
* class. Generally clients should not instantiate this class directly, but should
- * instead call <code>DebugPlugin.newProcess(...)</code>, which can delegate to an
+ * instead call <code>DebugPlugin.newProcess(...)</code>, which can delegate to an
* <code>IProcessFactory</code> if one is referenced by the associated launch configuration.
* </p>
* @see org.eclipse.debug.core.model.IProcess
@@ -46,28 +46,28 @@ 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 <code>IProcess</code>
*/
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
*/
@@ -82,12 +82,12 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
* Whether this process has been terminated
*/
private boolean fTerminated;
-
+
/**
* Table of client defined attributes
*/
- private Map fAttributes;
-
+ private Map<String, String> fAttributes;
+
/**
* Whether output from the process should be captured or swallowed
*/
@@ -97,14 +97,14 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
* 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 <code>null</code> if none
*/
- public RuntimeProcess(ILaunch launch, Process process, String name, Map attributes) {
+ public RuntimeProcess(ILaunch launch, Process process, String name, Map<String, String> attributes) {
setLaunch(launch);
initializeAttributes(attributes);
fProcess= process;
@@ -115,7 +115,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
} catch (IllegalThreadStateException e) {
fTerminated= false;
}
-
+
String captureOutput = launch.getAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT);
fCaptureOutput = !("false".equals(captureOutput)); //$NON-NLS-1$
@@ -128,22 +128,21 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* Initialize the attributes of this process to those in the given map.
- *
+ *
* @param attributes attribute map or <code>null</code> if none
*/
- private void initializeAttributes(Map attributes) {
+ private void initializeAttributes(Map<String, String> attributes) {
if (attributes != null) {
- Iterator keys = attributes.keySet().iterator();
- while (keys.hasNext()) {
- String key = (String)keys.next();
- setAttribute(key, (String)attributes.get(key));
- }
+ for (Entry<String, String> entry : attributes.entrySet()) {
+ setAttribute(entry.getKey(), entry.getValue());
+ }
}
}
/**
* @see ITerminate#canTerminate()
*/
+ @Override
public synchronized boolean canTerminate() {
return !fTerminated;
}
@@ -151,13 +150,14 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see IProcess#getLabel()
*/
+ @Override
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) {
@@ -167,13 +167,14 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see IProcess#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
return fLaunch;
}
/**
* Returns the underlying system process associated with this process.
- *
+ *
* @return system process
*/
protected Process getSystemProcess() {
@@ -183,6 +184,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see ITerminate#isTerminated()
*/
+ @Override
public synchronized boolean isTerminated() {
return fTerminated;
}
@@ -190,8 +192,9 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see ITerminate#terminate()
*/
+ @Override
public void terminate() throws DebugException {
- if (!isTerminated()) {
+ if (!isTerminated()) {
if (fStreamsProxy instanceof StreamsProxy) {
((StreamsProxy)fStreamsProxy).kill();
}
@@ -220,7 +223,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
fMonitor.killThread();
fMonitor = null;
}
- IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.RuntimeProcess_terminate_failed, null);
+ IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugException.TARGET_REQUEST_FAILED, DebugCoreMessages.RuntimeProcess_terminate_failed, null);
throw new DebugException(status);
}
}
@@ -234,7 +237,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
((StreamsProxy)fStreamsProxy).close();
}
-
+
// Avoid calling IProcess.exitValue() inside a sync section (Bug 311813).
int exitValue = -1;
boolean running = false;
@@ -243,7 +246,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
} catch (IllegalThreadStateException ie) {
running = true;
}
-
+
synchronized (this) {
fTerminated= true;
if (!running) {
@@ -253,30 +256,31 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
}
fireTerminateEvent();
}
-
+
/**
* @see IProcess#getStreamsProxy()
*/
+ @Override
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);
+ String encoding = getLaunch().getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING);
return new StreamsProxy(getSystemProcess(), encoding);
- }
-
+ }
+
/**
* Fires a creation event.
*/
@@ -286,7 +290,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* Fires the given debug event.
- *
+ *
* @param event debug event to fire
*/
protected void fireEvent(DebugEvent event) {
@@ -305,7 +309,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* Fires a change event.
- */
+ */
protected void fireChangeEvent() {
fireEvent(new DebugEvent(this, DebugEvent.CHANGE));
}
@@ -313,32 +317,35 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see IProcess#setAttribute(String, String)
*/
+ @Override
public void setAttribute(String key, String value) {
if (fAttributes == null) {
- fAttributes = new HashMap(5);
+ fAttributes = new HashMap<String, String>(5);
}
Object origVal = fAttributes.get(key);
if (origVal != null && origVal.equals(value)) {
return; //nothing changed.
}
-
+
fAttributes.put(key, value);
fireChangeEvent();
}
-
+
/**
* @see IProcess#getAttribute(String)
*/
+ @Override
public String getAttribute(String key) {
if (fAttributes == null) {
return null;
}
- return (String)fAttributes.get(key);
+ return fAttributes.get(key);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter.equals(IProcess.class)) {
return this;
@@ -365,19 +372,20 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see IProcess#getExitValue()
*/
+ @Override
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));
+ }
+ 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.
*/
@@ -385,7 +393,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* The underlying <code>java.lang.Process</code> being monitored.
*/
- protected Process fOSProcess;
+ protected Process fOSProcess;
/**
* The <code>IProcess</code> which will be informed when this
* monitor detects that the underlying process has terminated.
@@ -396,7 +404,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
* The <code>Thread</code> which is monitoring the underlying process.
*/
protected Thread fThread;
-
+
/**
* A lock protecting access to <code>fThread</code>.
*/
@@ -405,6 +413,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* @see Thread#run()
*/
+ @Override
public void run() {
synchronized (fThreadLock) {
if (fExit) {
@@ -429,11 +438,11 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* 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);
+ super(DebugCoreMessages.ProcessMonitorJob_0);
setDaemon(true);
fRuntimeProcess= process;
fOSProcess= process.getSystemProcess();
@@ -441,7 +450,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
/**
* 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.
@@ -455,5 +464,5 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
}
}
}
- }
+ }
}
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
index f6918d659..f87794c33 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -14,7 +14,6 @@ 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;
@@ -68,15 +67,15 @@ import com.ibm.icu.text.MessageFormat;
* @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();
+ protected ArrayList<ISourceLookupParticipant> fParticipants = new ArrayList<ISourceLookupParticipant>();
//list of current source containers
protected ISourceContainer[] fSourceContainers = null;
//the launch config associated with this director
- protected ILaunchConfiguration fConfig;
+ protected ILaunchConfiguration fConfig;
//whether duplicates should be searched for or not
protected boolean fDuplicates = false;
// source path computer, or null if default
@@ -85,13 +84,13 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
* Cache of resolved source elements when duplicates exist.
* Keys are the duplicates, values are the source element to use.
*/
- protected Map fResolvedElements = null;
+ protected Map<Object, Object> fResolvedElements = null;
// current participant performing lookup or <code>null</code>
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$
@@ -99,13 +98,13 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
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 List<Object> fSourceElements = new ArrayList<Object>();
private Object fElement = null;
private Throwable fException = null;
-
+
SourceLookupQuery(Object element) {
fElement = element;
}
@@ -113,13 +112,14 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
+ @Override
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() {
@@ -129,6 +129,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
MultiStatus multiStatus = null;
CoreException single = null;
@@ -141,9 +142,11 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
sourceArray = participants[i].findSourceElements(fElement);
if (sourceArray !=null && sourceArray.length > 0) {
if (isFindDuplicates()) {
- for(int j=0; j<sourceArray.length; j++)
- if(!checkDuplicate(sourceArray[j], fSourceElements))
+ for(int j=0; j<sourceArray.length; j++) {
+ if(!checkDuplicate(sourceArray[j], fSourceElements)) {
fSourceElements.add(sourceArray[j]);
+ }
+ }
} else {
fSourceElements.add(sourceArray[0]);
return;
@@ -153,7 +156,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
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 = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, new IStatus[]{single.getStatus()}, SourceLookupMessages.Source_Lookup_Error, null);
multiStatus.add(e.getStatus());
} else {
multiStatus.add(e.getStatus());
@@ -172,8 +175,8 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
}
}
}
-
- public List getSourceElements() {
+
+ public List<Object> getSourceElements() {
return fSourceElements;
}
@@ -182,38 +185,38 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
fSourceElements = null;
fException = null;
}
-
+
}
-
+
/**
* Constructs source lookup director
*/
public AbstractSourceLookupDirector() {
}
-
+
/**
* Sets the type identifier for this source locator's type
- *
+ *
* @param id corresponds to source locator type identifier for a
- * persistable source locator
+ * persistable source locator
*/
public void setId(String id) {
fId = id;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2#dispose()
*/
+ @Override
public synchronized void dispose() {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.removeLaunchConfigurationListener(this);
launchManager.removeLaunchListener(this);
- Iterator iterator = fParticipants.iterator();
- while (iterator.hasNext()) {
- ISourceLookupParticipant participant = (ISourceLookupParticipant) iterator.next();
+ for (ISourceLookupParticipant participant : fParticipants) {
//director may also be a participant
- if(participant != this)
+ if(participant != this) {
participant.dispose();
+ }
}
fParticipants.clear();
if (fSourceContainers != null) {
@@ -224,10 +227,10 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
fSourceContainers = null;
fResolvedElements = null;
}
-
+
/**
* Throws an exception with the given message and underlying exception.
- *
+ *
* @param message error message
* @param exception underlying exception, or <code>null</code>
* @throws CoreException if a problem is encountered
@@ -236,57 +239,59 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
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();
+ private List<ISourceContainer> parseSourceContainers(NodeList list) throws CoreException {
+ List<ISourceContainer> containers = new ArrayList<ISourceContainer>();
for (int i=0; i < list.getLength(); i++) {
- if(!(list.item(i).getNodeType() == Node.ELEMENT_NODE))
- continue;
+ 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);
+ abort(SourceLookupMessages.AbstractSourceLookupDirector_11, null);
}
ISourceContainerType type = DebugPlugin.getDefault().getLaunchManager().getSourceContainerType(typeId);
- if(type != null) {
+ if(type != null) {
String memento = element.getAttribute(CONTAINER_MEMENTO_ATTR);
if (memento == null || memento.equals("")) { //$NON-NLS-1$
- abort(SourceLookupMessages.AbstractSourceLookupDirector_13, null);
+ abort(SourceLookupMessages.AbstractSourceLookupDirector_13, null);
}
ISourceContainer container = type.createSourceContainer(memento);
containers.add(container);
}
else {
- abort(MessageFormat.format(SourceLookupMessages.AbstractSourceLookupDirector_12, new String[]{typeId}), null);
- }
- }
+ abort(MessageFormat.format(SourceLookupMessages.AbstractSourceLookupDirector_12, new Object[] { 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.
- *
+ * 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()
*/
+ @Override
public synchronized ISourceContainer[] getSourceContainers() {
if (fSourceContainers == null) {
return new ISourceContainer[0];
@@ -295,50 +300,54 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
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;
+ @Override
+ public boolean isFindDuplicates() {
+ return fDuplicates;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#setFindDuplicates(boolean)
*/
- public void setFindDuplicates(boolean duplicates) {
- fDuplicates = duplicates;
- }
-
+ @Override
+ 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)
*/
+ @Override
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)
*/
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
if (fConfig == null || configuration.isWorkingCopy()) {
return;
@@ -355,11 +364,12 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
}
}
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
if (configuration.equals(getLaunchConfiguration())) {
if (DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration) == null) {
@@ -367,16 +377,17 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#getMemento()
*/
+ @Override
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);
+
+ Element pathNode = doc.createElement(CONTAINERS_NODE);
if(fDuplicates) {
pathNode.setAttribute(DUPLICATES_ATTR, "true"); //$NON-NLS-1$
} else {
@@ -395,18 +406,19 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
}
return DebugPlugin.serializeDocument(doc);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeFromMemento(java.lang.String)
*/
+ @Override
public void initializeFromMemento(String memento) throws CoreException {
doInitializeFromMemento(memento, true);
}
-
+
/**
* Initializes this source lookup director from the given memento.
* Disposes itself before initialization if specified.
- *
+ *
* @param memento source locator memento
* @param dispose whether to dispose any current source containers and participants
* before initializing
@@ -417,9 +429,9 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
if (dispose) {
dispose();
}
- Element rootElement = DebugPlugin.parseDocument(memento);
- if (!rootElement.getNodeName().equalsIgnoreCase(DIRECTOR_ROOT_NODE)) {
- abort(SourceLookupMessages.AbstractSourceLookupDirector_14, null);
+ Element rootElement = DebugPlugin.parseDocument(memento);
+ if (!rootElement.getNodeName().equalsIgnoreCase(DIRECTOR_ROOT_NODE)) {
+ abort(SourceLookupMessages.AbstractSourceLookupDirector_14, null);
}
NodeList list = rootElement.getChildNodes();
int length = list.getLength();
@@ -431,28 +443,30 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
if(entry.getNodeName().equalsIgnoreCase(CONTAINERS_NODE)){
setFindDuplicates("true".equals(entry.getAttribute(DUPLICATES_ATTR))); //$NON-NLS-1$
NodeList children = entry.getChildNodes();
- List containers = parseSourceContainers(children);
- setSourceContainers((ISourceContainer[]) containers.toArray(new ISourceContainer[containers.size()]));
+ List<ISourceContainer> containers = parseSourceContainers(children);
+ setSourceContainers(containers.toArray(new ISourceContainer[containers.size()]));
}
}
}
initializeParticipants();
- }
-
+ }
+
/**
* Sets the source containers used by this source lookup
* director.
- *
+ *
* @param containers source containers to search
*/
+ @Override
public void setSourceContainers(ISourceContainer[] containers) {
synchronized (this) {
- List list = Arrays.asList( containers );
+ List<ISourceContainer> list = Arrays.asList(containers);
ISourceContainer[] old = getSourceContainers();
for (int i = 0; i < old.length; i++) {
// skip overlapping containers
- if (!list.contains(old[i]))
+ if (!list.contains(old[i])) {
old[i].dispose();
+ }
}
fSourceContainers = containers;
for (int i = 0; i < containers.length; i++) {
@@ -469,26 +483,27 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
participant.sourceContainersChanged(this);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISourceLocator#getSourceElement(org.eclipse.debug.core.model.IStackFrame)
* Would be better to accept Object so this can be used for breakpoints and other objects.
*/
+ @Override
public Object getSourceElement(IStackFrame stackFrame) {
return getSourceElement((Object)stackFrame);
}
-
+
/**
* Performs a source lookup query for the given element
* returning the source elements associated with the element.
- *
+ *
* @param element stack frame
* @return list of associated source elements
*/
- protected List doSourceLookup(Object element) {
+ protected List<Object> doSourceLookup(Object element) {
SourceLookupQuery query = new SourceLookupQuery(element);
SafeRunner.run(query);
- List sources = query.getSourceElements();
+ List<Object> sources = query.getSourceElements();
Throwable exception = query.getException();
if (exception != null) {
if (exception instanceof CoreException) {
@@ -503,7 +518,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
query.dispose();
return sources;
}
-
+
/**
* Returns the source element to associate with the given element.
* This method is called when more than one source element has been found
@@ -517,11 +532,9 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
* @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) {
+ public Object resolveSourceElement(Object element, List<Object> sources) {
// check the duplicates cache first
- Iterator duplicates = sources.iterator();
- while (duplicates.hasNext()) {
- Object dup = duplicates.next();
+ for (Object dup : sources) {
Object resolved = getCachedElement(dup);
if (resolved != null) {
return resolved;
@@ -544,23 +557,26 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/**
* 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 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)
+ private boolean checkDuplicate(Object sourceToAdd, List<Object> sources) {
+ if(sources.size() == 0) {
return false;
- Iterator iterator = sources.iterator();
- while(iterator.hasNext())
- if(iterator.next().equals(sourceToAdd))
+ }
+ for (Object obj : sources) {
+ if (obj.equals(sourceToAdd)) {
return true;
+ }
+ }
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.IPersistableSourceLocator2#initializeFromMemento(java.lang.String, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFromMemento(String memento, ILaunchConfiguration configuration) throws CoreException {
dispose();
setLaunchConfiguration(configuration);
@@ -570,27 +586,29 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IPersistableSourceLocator#initializeDefaults(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
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()
*/
+ @Override
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 <code>null</code> if none
*/
@@ -598,22 +616,25 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
fConfig = configuration;
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.addLaunchConfigurationListener(this);
- launchManager.addLaunchListener(this);
+ launchManager.addLaunchListener(this);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchAdded(ILaunch launch) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchChanged(ILaunch launch) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchRemoved(ILaunch launch) {
if (this.equals(launch.getSourceLocator())) {
dispose();
@@ -622,40 +643,39 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getParticipants()
*/
+ @Override
public synchronized ISourceLookupParticipant[] getParticipants() {
- return (ISourceLookupParticipant[]) fParticipants.toArray(new ISourceLookupParticipant[fParticipants.size()]);
+ return fParticipants.toArray(new ISourceLookupParticipant[fParticipants.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#supportsSourceContainerType(org.eclipse.debug.core.sourcelookup.ISourceContainerType)
*/
+ @Override
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) {
+ protected void cacheResolvedElement(List<Object> duplicates, Object sourceElement) {
if (fResolvedElements == null) {
- fResolvedElements = new HashMap(10);
+ fResolvedElements = new HashMap<Object, Object>(10);
}
- Iterator iterator = duplicates.iterator();
- while (iterator.hasNext()) {
- Object dup = iterator.next();
+ for (Object dup : duplicates) {
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
*/
@@ -665,11 +685,11 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
}
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
*/
@@ -677,23 +697,24 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
if (fResolvedElements != null) {
fResolvedElements.remove(duplicate);
}
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#clearSourceElements(java.lang.Object)
*/
+ @Override
public void clearSourceElements(Object element) {
- List list = doSourceLookup(element);
+ List<Object> list = doSourceLookup(element);
if (list.size() > 0) {
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- clearCachedElement(iterator.next());
+ for (Object obj : list) {
+ clearCachedElement(obj);
}
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#addParticipants(org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant[])
*/
+ @Override
public void addParticipants(ISourceLookupParticipant[] participants) {
for (int i = 0; i < participants.length; i++) {
ISourceLookupParticipant participant = participants[i];
@@ -704,6 +725,7 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#removeParticipants(org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant[])
*/
+ @Override
public void removeParticipants(ISourceLookupParticipant[] participants) {
for (int i = 0; i < participants.length; i++) {
removeSourceLookupParticipant(participants[i]);
@@ -713,12 +735,14 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getId()
*/
+ @Override
public String getId() {
return fId;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourcePathComputer()
*/
+ @Override
public ISourcePathComputer getSourcePathComputer() {
if (fComputer == null && getLaunchConfiguration() != null) {
try {
@@ -731,16 +755,18 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#setSourcePathComputer(org.eclipse.debug.core.sourcelookup.ISourcePathComputer)
*/
+ @Override
public void setSourcePathComputer(ISourcePathComputer computer) {
fComputer = computer;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#findSourceElements(java.lang.Object)
*/
+ @Override
public Object[] findSourceElements(Object object) throws CoreException {
SourceLookupQuery query = new SourceLookupQuery(object);
SafeRunner.run(query);
- List sources = query.getSourceElements();
+ List<Object> sources = query.getSourceElements();
Throwable exception = query.getException();
query.dispose();
if (exception != null && sources.isEmpty()) {
@@ -754,30 +780,31 @@ public abstract class AbstractSourceLookupDirector implements ISourceLookupDirec
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupDirector#getSourceElement(java.lang.Object)
*/
+ @Override
public Object getSourceElement(Object element) {
- List sources = doSourceLookup(element);
+ List<Object> sources = doSourceLookup(element);
if(sources.size() == 1) {
return sources.get(0);
} else if(sources.size() > 1) {
return resolveSourceElement(element, sources);
- } else {
+ } else {
return null;
}
}
-
+
/**
* Sets the current participant or <code>null</code> if none.
- *
+ *
* @param participant active participant or <code>null</code>
*/
private void setCurrentParticipant(ISourceLookupParticipant participant) {
fCurrentParticipant = participant;
}
-
+
/**
* Returns the participant currently looking up source or <code>null</code>
* if none.
- *
+ *
* @return the participant currently looking up source or <code>null</code>
* if none
* @since 3.5
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
index 3640d76e2..be9876582 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -28,14 +28,15 @@ import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
* @since 3.0
*/
public abstract class AbstractSourceLookupParticipant implements ISourceLookupParticipant {
-
+
private ISourceLookupDirector fDirector;
-
- protected static final Object[] EMPTY = new Object[0];
-
+
+ protected static final Object[] EMPTY = new Object[0];
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public void init(ISourceLookupDirector director) {
fDirector = director;
}
@@ -43,19 +44,21 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#dispose()
*/
+ @Override
public void dispose() {
fDirector = null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#findSourceElements(java.lang.Object)
*/
+ @Override
public Object[] findSourceElements(Object object) throws CoreException {
- List results = null;
+ List<Object> results = null;
CoreException single = null;
MultiStatus multiStatus = null;
if (isFindDuplicates()) {
- results = new ArrayList();
+ results = new ArrayList<Object>();
}
String name = getSourceName(object);
if (name != null) {
@@ -75,7 +78,7 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa
} else {
if (objects.length == 1) {
return objects;
- }
+ }
return new Object[]{objects[0]};
}
}
@@ -101,14 +104,14 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa
return EMPTY;
}
return results.toArray();
- }
-
+ }
+
/**
* Returns the source container to search in place of the given source
* container, or <code>null</code> 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 <code>null</code>
* if the source container should not be searched
@@ -116,22 +119,22 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa
protected ISourceContainer getDelegateContainer(ISourceContainer container) {
return container;
}
-
+
/**
* Returns the source lookup director this participant is registered with
* or <code>null</code> if none.
- *
+ *
* @return the source lookup director this participant is registered with
* or <code>null</code> 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
@@ -147,7 +150,7 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa
/**
* 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
*/
@@ -158,10 +161,11 @@ public abstract class AbstractSourceLookupParticipant implements ISourceLookupPa
}
return new ISourceContainer[0];
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant#sourceContainersChanged(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public void sourceContainersChanged(ISourceLookupDirector director) {
}
}
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
index 613d62ca9..924ee5075 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -30,14 +30,14 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant;
* @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 <code>null</code>
* @throws CoreException if a problem is encountered
@@ -46,33 +46,35 @@ public abstract class AbstractSourceContainer extends PlatformObject implements
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 <code>null</code>
* @throws CoreException if a problem is encountered
* @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()
*/
+ @Override
public void dispose() {
fDirector = null;
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getSourceContainers()
*/
+ @Override
public ISourceContainer[] getSourceContainers() throws CoreException {
return new ISourceContainer[0];
}
@@ -80,34 +82,36 @@ public abstract class AbstractSourceContainer extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite()
*/
+ @Override
public boolean isComposite() {
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public void init(ISourceLookupDirector director) {
fDirector = director;
}
-
+
/**
* Returns the source lookup director this source container registered
* in, or <code>null</code> if none.
- *
+ *
* @return the source lookup director this source container registered
* in, or <code>null</code> 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() {
@@ -125,11 +129,11 @@ public abstract class AbstractSourceContainer extends PlatformObject implements
}
return false;
}
-
+
/**
* Returns the source container type identified by the given id,
* or <code>null</code> if none.
- *
+ *
* @param id source container type identifier
* @return source container type or <code>null</code>
*/
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
index 3120a01d5..402e06f61 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,26 +20,26 @@ import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
* Archive source container for an archive in the workspace. Returns instances
* of <code>ZipEntryStorage</code> as source elements.
* <p>
- * Clients may instantiate this class.
+ * Clients may instantiate this class.
* </p>
* @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 boolean fDetectRoot;
private ExternalArchiveSourceContainer fDelegateContainer;
-
+
/**
* Unique identifier for the archive source container type
* (value <code>org.eclipse.debug.core.containerType.archive</code>).
*/
public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.archive"; //$NON-NLS-1$
-
+
/**
- * Creates an archive source container on the given file.
- *
+ * 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
* <code>true</code>, searching is performed relative to a root path
@@ -50,7 +50,7 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
* <code>r/a/b/c.d</code> exists, the root path is set to <code>r</code>.
* From that point on, searching is performed relative to <code>r</code>.
* When <code>false</code>, searching is performed by
- * matching file names as suffixes to the entries in the archive.
+ * matching file names as suffixes to the entries in the archive.
*/
public ArchiveSourceContainer(IFile archive, boolean detectRootPath) {
fFile = archive;
@@ -59,41 +59,45 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
fDelegateContainer = new ExternalArchiveSourceContainer(archive.getLocation().toOSString(), detectRootPath);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
*/
+ @Override
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()
*/
+ @Override
public ISourceContainerType getType() {
return getSourceContainerType(TYPE_ID);
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof ArchiveSourceContainer &&
((ArchiveSourceContainer)obj).getName().equals(getName());
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getName().hashCode();
}
@@ -101,17 +105,18 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String)
*/
- public Object[] findSourceElements(String name) throws CoreException {
+ @Override
+ 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
*/
@@ -121,7 +126,8 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#init(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
*/
- public void init(ISourceLookupDirector director) {
+ @Override
+ public void init(ISourceLookupDirector director) {
super.init(director);
if (fDelegateContainer != null) {
fDelegateContainer.init(director);
@@ -130,22 +136,23 @@ public class ArchiveSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose()
*/
- public void dispose() {
+ @Override
+ 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
index ed442127b..4b79ce6bc 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,23 +29,25 @@ import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
* @since 3.0
*/
public abstract class CompositeSourceContainer extends AbstractSourceContainer {
-
+
private ISourceContainer[] fContainers;
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite()
*/
+ @Override
public boolean isComposite() {
return true;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String)
*/
+ @Override
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.
@@ -65,13 +67,13 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer {
* @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;
+ List<Object> results = null;
CoreException single = null;
MultiStatus multiStatus = null;
if (isFindDuplicates()) {
- results = new ArrayList();
+ results = new ArrayList<Object>();
}
for (int i = 0; i < containers.length; i++) {
ISourceContainer container = containers[i];
@@ -95,7 +97,7 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer {
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 = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, new IStatus[]{single.getStatus()}, SourceLookupMessages.Source_Lookup_Error, null);
multiStatus.add(e.getStatus());
} else {
multiStatus.add(e.getStatus());
@@ -111,27 +113,28 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer {
return EMPTY;
}
return results.toArray();
- }
-
+ }
+
/**
* Creates the source containers in this composite container.
* Subclasses should override this methods.
* @return the array of {@link ISourceContainer}s
- *
+ *
* @throws CoreException if unable to create the containers
*/
protected abstract ISourceContainer[] createSourceContainers() throws CoreException;
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getSourceContainers()
*/
+ @Override
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;
}
@@ -139,6 +142,7 @@ public abstract class CompositeSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if (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
index 00c5ff7f4..97a073951 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,14 +44,14 @@ 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.
- *
+ * 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
@@ -68,29 +68,30 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer
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)
*/
+ @Override
public Object[] findSourceElements(String name) throws CoreException {
- ArrayList sources = new ArrayList();
+ ArrayList<Object> sources = new ArrayList<Object>();
- // An IllegalArgumentException is thrown from the "getFile" method
- // if the path created by appending the file name to the container
+ // 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".
+ // 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()) {
@@ -114,13 +115,13 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer
}
} else if (files.length > 0) {
sources.add(files[0]);
- }
+ }
}
}
}
}
- //check sub-folders
+ //check sub-folders
if ((isFindDuplicates() && fSubfolders) || (sources.isEmpty() && fSubfolders)) {
ISourceContainer[] containers = getSourceContainers();
for (int i=0; i < containers.length; i++) {
@@ -129,41 +130,46 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer
continue;
}
if (isFindDuplicates()) {
- for(int j=0; j < objects.length; j++)
+ for(int j=0; j < objects.length; j++) {
sources.add(objects[j]);
+ }
} else {
sources.add(objects[0]);
break;
}
}
- }
-
- if(sources.isEmpty())
+ }
+
+ 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();
+ @Override
+ public String getName() {
+ return getContainer().getName();
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
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()
*/
+ @Override
public int hashCode() {
return getContainer().hashCode();
}
@@ -171,36 +177,38 @@ public abstract class ContainerSourceContainer extends CompositeSourceContainer
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainer#isComposite()
*/
- public boolean isComposite() {
+ @Override
+ public boolean isComposite() {
return fSubfolders;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
if(fSubfolders) {
IResource[] resources = getContainer().members();
- List list = new ArrayList(resources.length);
+ List<ISourceContainer> list = new ArrayList<ISourceContainer>(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()]);
+ ISourceContainer[] containers = 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.
- *
+ * Validates the given string as a path for a file in this container.
+ *
* @param name path name
* @return <code>true</code> if the path is valid <code>false</code> otherwise
*/
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
index 957655ad0..d97c6afd9 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,13 +24,13 @@ import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
* for a launch configuration on each launch using a launch configuration's
* associated source path computer.
* <p>
- * Clients may instantiate this class.
+ * Clients may instantiate this class.
* </p>
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
*/
-public class DefaultSourceContainer extends CompositeSourceContainer {
-
+public class DefaultSourceContainer extends CompositeSourceContainer {
+
/**
* Unique identifier for the default source container type
* (value <code>org.eclipse.debug.core.containerType.default</code>).
@@ -38,29 +38,31 @@ public class DefaultSourceContainer extends CompositeSourceContainer {
public static final String TYPE_ID = DebugPlugin.getUniqueIdentifier() + ".containerType.default"; //$NON-NLS-1$
/**
- * Constructs a default source container.
+ * Constructs a default source container.
*/
public DefaultSourceContainer() {
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof DefaultSourceContainer;
- }
+ }
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getClass().hashCode();
- }
-
+ }
+
/**
* Returns the launch configuration for which a default source lookup
* path will be computed, or <code>null</code> if none.
- *
+ *
* @return the launch configuration for which a default source lookup
* path will be computed, or <code>null</code>
*/
@@ -71,18 +73,19 @@ public class DefaultSourceContainer extends CompositeSourceContainer {
}
return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
*/
+ @Override
public ISourceContainerType getType() {
return getSourceContainerType(TYPE_ID);
}
-
+
/**
* Returns the source path computer to use, or <code>null</code>
* if none.
- *
+ *
* @return the source path computer to use, or <code>null</code>
* if none
*/
@@ -97,13 +100,15 @@ public class DefaultSourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
*/
+ @Override
public String getName() {
- return SourceLookupMessages.DefaultSourceContainer_0;
+ return SourceLookupMessages.DefaultSourceContainer_0;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
ISourcePathComputer sourcePathComputer = getSourcePathComputer();
if (sourcePathComputer != null) {
@@ -112,7 +117,7 @@ public class DefaultSourceContainer extends CompositeSourceContainer {
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
index 311dba478..3a7689df2 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@ 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;
@@ -24,14 +25,14 @@ import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
* from <code>findSourceElements(...)</code> are instances
* of <code>LocalFileStorage</code>.
* <p>
- * Clients may instantiate this class.
+ * Clients may instantiate this class.
* </p>
* @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
@@ -41,11 +42,11 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
* (value <code>org.eclipse.debug.core.containerType.directory</code>).
*/
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
@@ -53,11 +54,11 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
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
@@ -65,29 +66,31 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
public DirectorySourceContainer(File dir, boolean subfolders) {
fDirectory = dir;
fSubfolders = subfolders;
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
*/
+ @Override
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()
*/
+ @Override
public ISourceContainerType getType() {
return getSourceContainerType(TYPE_ID);
}
@@ -95,15 +98,16 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#findSourceElements(java.lang.String)
*/
+ @Override
public Object[] findSourceElements(String name) throws CoreException {
- ArrayList sources = new ArrayList();
+ ArrayList<Object> sources = new ArrayList<Object>();
File directory = getDirectory();
File file = new File(directory, name);
if (file.exists() && file.isFile()) {
sources.add(new LocalFileStorage(file));
}
-
- //check sub-folders
+
+ //check sub-folders
if ((isFindDuplicates() && fSubfolders) || (sources.isEmpty() && fSubfolders)) {
ISourceContainer[] containers = getSourceContainers();
for (int i=0; i < containers.length; i++) {
@@ -112,23 +116,26 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
continue;
}
if (isFindDuplicates()) {
- for(int j=0; j < objects.length; j++)
+ for(int j=0; j < objects.length; j++) {
sources.add(objects[j]);
+ }
} else {
sources.add(objects[0]);
break;
}
}
- }
-
- if(sources.isEmpty())
+ }
+
+ if(sources.isEmpty()) {
return EMPTY;
+ }
return sources.toArray();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite()
*/
+ @Override
public boolean isComposite() {
return fSubfolders;
}
@@ -136,6 +143,7 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof DirectorySourceContainer) {
DirectorySourceContainer container = (DirectorySourceContainer) obj;
@@ -146,18 +154,20 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getDirectory().hashCode();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
if (isComposite()) {
String[] files = fDirectory.list();
if (files != null) {
- List dirs = new ArrayList();
+ List<ISourceContainer> dirs = new ArrayList<ISourceContainer>();
for (int i = 0; i < files.length; i++) {
String name = files[i];
File file = new File(getDirectory(), name);
@@ -165,11 +175,11 @@ public class DirectorySourceContainer extends CompositeSourceContainer {
dirs.add(new DirectorySourceContainer(file, true));
}
}
- ISourceContainer[] containers = (ISourceContainer[]) dirs.toArray(new ISourceContainer[dirs.size()]);
+ ISourceContainer[] containers = dirs.toArray(new ISourceContainer[dirs.size()]);
for (int i = 0; i < containers.length; i++) {
ISourceContainer container = containers[i];
container.init(getDirector());
- }
+ }
return containers;
}
}
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
index 70241e758..1ff284a11 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ 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;
@@ -30,31 +29,33 @@ import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
import org.eclipse.debug.internal.core.sourcelookup.SourceLookupUtils;
+import com.ibm.icu.text.MessageFormat;
+
/**
* An archive in the local file system. Returns instances
* of <code>ZipEntryStorage</code> as source elements.
* <p>
- * Clients may instantiate this class.
+ * Clients may instantiate this class.
* </p>
* @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 Set<String> fPotentialRoots = null;
+ private List<String> fRoots = new ArrayList<String>();
private String fArchivePath = null;
/**
* Unique identifier for the external archive source container type
* (value <code>org.eclipse.debug.core.containerType.externalArchive</code>).
*/
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.
- *
+ * 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
* <code>true</code>, searching is performed relative to a root path
@@ -66,24 +67,25 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
* When searching for an unqualified file name, root containers are not
* considered.
* When <code>false</code>, searching is performed by
- * matching file names as suffixes to the entries in the archive.
+ * 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)
*/
+ @Override
public Object[] findSourceElements(String name) throws CoreException {
- name = name.replace('\\', '/');
+ String newname = name.replace('\\', '/');
ZipFile file = getArchive();
// NOTE: archive can be closed between get (above) and synchronized block (below)
synchronized (file) {
- boolean isQualfied = name.indexOf('/') > 0;
+ boolean isQualfied = newname.indexOf('/') > 0;
if (fDetectRoots && isQualfied) {
- ZipEntry entry = searchRoots(file, name);
+ ZipEntry entry = searchRoots(file, newname);
if (entry != null) {
return new Object[]{new ZipEntryStorage(file, entry)};
}
@@ -91,10 +93,10 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
// try exact match
ZipEntry entry = null;
try {
- entry = file.getEntry(name);
+ entry = file.getEntry(newname);
} catch (IllegalStateException e) {
// archive was closed between retrieving and locking
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
e.getMessage(), e));
}
if (entry != null) {
@@ -102,16 +104,16 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
return new Object[]{new ZipEntryStorage(file, entry)};
}
// search
- Enumeration entries = file.entries();
- List matches = null;
+ Enumeration<? extends ZipEntry> entries = file.entries();
+ List<ZipEntryStorage> matches = null;
while (entries.hasMoreElements()) {
- entry = (ZipEntry)entries.nextElement();
+ entry = entries.nextElement();
String entryName = entry.getName();
- if (entryName.endsWith(name)) {
- if (isQualfied || entryName.length() == name.length() || entryName.charAt(entryName.length() - name.length() - 1) == '/') {
+ if (entryName.endsWith(newname)) {
+ if (isQualfied || entryName.length() == newname.length() || entryName.charAt(entryName.length() - newname.length() - 1) == '/') {
if (isFindDuplicates()) {
if (matches == null) {
- matches = new ArrayList();
+ matches = new ArrayList<ZipEntryStorage>();
}
matches.add(new ZipEntryStorage(file, entry));
} else {
@@ -127,12 +129,12 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
}
return EMPTY;
}
-
+
/**
* Returns the root path in this archive for the given file name, based
* on its type, or <code>null</code> 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
* @return the {@link ZipEntry} with the given name or <code>null</code>
@@ -140,13 +142,13 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
*/
private ZipEntry searchRoots(ZipFile file, String name) throws CoreException {
if (fPotentialRoots == null) {
- fPotentialRoots = new HashSet();
+ fPotentialRoots = new HashSet<String>();
fPotentialRoots.add(""); //$NON-NLS-1$
// all potential roots are the directories
try {
- Enumeration entries = file.entries();
+ Enumeration<? extends ZipEntry> entries = file.entries();
while (entries.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
+ ZipEntry entry = entries.nextElement();
if (entry.isDirectory()) {
fPotentialRoots.add(entry.getName());
} else {
@@ -164,13 +166,13 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
}
} catch (IllegalStateException e) {
// archive was closed between retrieving and locking
- throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ 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);
+ String root = fRoots.get(i);
ZipEntry entry = file.getEntry(root+name);
if (entry != null) {
return entry;
@@ -178,30 +180,25 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
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);
+ for (String root : fPotentialRoots) {
+ ZipEntry 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();
+ if (root != null) {
+ fRoots.add(root);
+ fPotentialRoots.remove(root);
+ // remove any roots that begin with the new root, as
+ // roots
+ // cannot be nested
+ Iterator<String> rs = fPotentialRoots.iterator();
+ while (rs.hasNext()) {
+ String r = rs.next();
+ if (r.startsWith(root)) {
+ rs.remove();
+ }
}
}
- }
- return entry;
+ return entry;
+ }
}
}
return null;
@@ -210,7 +207,7 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
/**
* Returns the archive to search in.
* @return the {@link ZipFile} to search in
- *
+ *
* @throws CoreException if unable to access the archive
*/
private ZipFile getArchive() throws CoreException {
@@ -219,9 +216,9 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
} catch (IOException e) {
File file = new File(fArchivePath);
if (file.exists()) {
- abort(MessageFormat.format(SourceLookupMessages.ExternalArchiveSourceContainer_2, new String[]{fArchivePath}), e);
+ abort(MessageFormat.format(SourceLookupMessages.ExternalArchiveSourceContainer_2, new Object[] { fArchivePath }), e);
} else {
- warn(MessageFormat.format(SourceLookupMessages.ExternalArchiveSourceContainer_1, new String[]{fArchivePath}), e);
+ warn(MessageFormat.format(SourceLookupMessages.ExternalArchiveSourceContainer_1, new Object[] { fArchivePath }), e);
}
}
return null;
@@ -230,20 +227,22 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
*/
+ @Override
public String getName() {
return fArchivePath;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
*/
+ @Override
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
*/
@@ -253,6 +252,7 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof ExternalArchiveSourceContainer &&
((ExternalArchiveSourceContainer)obj).getName().equals(getName());
@@ -260,19 +260,21 @@ public class ExternalArchiveSourceContainer extends AbstractSourceContainer {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getName().hashCode();
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#dispose()
*/
+ @Override
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
index d43b9e289..90f9ea736 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import org.eclipse.debug.core.sourcelookup.ISourceContainerType;
/**
* A folder in the workspace.
* <p>
- * Clients may instantiate this class.
+ * Clients may instantiate this class.
* </p>
* @since 3.0
* @noextend This class is not intended to be subclassed by clients.
@@ -32,20 +32,21 @@ public class FolderSourceContainer extends ContainerSourceContainer {
/**
- * Constructs a source container on the given folder.
- *
+ * 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()
*/
+ @Override
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
index 454c06a54..261d3bd57 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,35 +36,37 @@ import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
* @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()
*/
+ @Override
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));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, SourceLookupMessages.LocalFileStorage_0, e));
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getFullPath()
*/
+ @Override
public IPath getFullPath() {
try {
return new Path(getFile().getCanonicalPath());
@@ -77,6 +79,7 @@ public class LocalFileStorage extends PlatformObject implements IStorage {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getName()
*/
+ @Override
public String getName() {
return getFile().getName();
}
@@ -84,40 +87,43 @@ public class LocalFileStorage extends PlatformObject implements IStorage {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
return true;
}
-
+
/**
* Sets the file associated with this storage
- *
+ *
* @param file a local file
*/
private void setFile(File file) {
- fFile = 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) {
+ @Override
+ public boolean equals(Object object) {
return object instanceof LocalFileStorage &&
getFile().equals(((LocalFileStorage)object).getFile());
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
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
index be8f9ddb3..5682d216c 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Mikhail Khodjaiants, QNX - Bug 110227: Possible infinite loop in ProjectSourceContainer
+ * Mikhail Khodjaiants, QNX - Bug 110227: Possible infinite loop in ProjectSourceContainer
*******************************************************************************/
package org.eclipse.debug.core.sourcelookup.containers;
@@ -15,6 +15,7 @@ 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;
@@ -37,12 +38,12 @@ public class ProjectSourceContainer extends ContainerSourceContainer {
/**
* Unique identifier for the project source container type
* (value <code>org.eclipse.debug.core.containerType.project</code>).
- */
+ */
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
*/
@@ -50,19 +51,19 @@ public class ProjectSourceContainer extends ContainerSourceContainer {
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() {
@@ -72,6 +73,7 @@ public class ProjectSourceContainer extends ContainerSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
*/
+ @Override
public ISourceContainerType getType() {
return getSourceContainerType(TYPE_ID);
}
@@ -79,6 +81,7 @@ public class ProjectSourceContainer extends ContainerSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#isComposite()
*/
+ @Override
public boolean isComposite() {
return true;
}
@@ -86,13 +89,14 @@ public class ProjectSourceContainer extends ContainerSourceContainer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
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);
+ List<ISourceContainer> all = new ArrayList<ISourceContainer>(folders.length + projects.length);
for (int i = 0; i < folders.length; i++) {
all.add(folders[i]);
}
@@ -103,20 +107,20 @@ public class ProjectSourceContainer extends ContainerSourceContainer {
all.add(container);
}
}
- return (ISourceContainer[]) all.toArray(new ISourceContainer[all.size()]);
- }
+ return all.toArray(new ISourceContainer[all.size()]);
+ }
return super.createSourceContainers();
}
return new ISourceContainer[0];
}
private IProject[] getAllReferencedProjects(IProject project) throws CoreException {
- Set all = new HashSet();
+ Set<IProject> all = new HashSet<IProject>();
getAllReferencedProjects(all, project);
- return (IProject[]) all.toArray(new IProject[all.size()]);
+ return all.toArray(new IProject[all.size()]);
}
- private void getAllReferencedProjects(Set all, IProject project) throws CoreException {
+ private void getAllReferencedProjects(Set<IProject> 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()) {
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
index 9bed84fb7..50c801043 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@ import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
* @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 <code>org.eclipse.debug.core.containerType.workspace</code>).
@@ -35,39 +35,44 @@ public class WorkspaceSourceContainer extends CompositeSourceContainer {
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()
*/
+ @Override
public String getName() {
- return SourceLookupMessages.WorkspaceSourceContainer_0;
+ return SourceLookupMessages.WorkspaceSourceContainer_0;
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return obj instanceof WorkspaceSourceContainer;
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
- */
+ */
+ @Override
public int hashCode() {
return ResourcesPlugin.getWorkspace().hashCode();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
*/
+ @Override
public ISourceContainerType getType() {
return getSourceContainerType(TYPE_ID);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
ISourceContainer[] containers = new ISourceContainer[projects.length];
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
index 205d91566..a133cfe72 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -25,7 +25,7 @@ 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.
* <p>
@@ -36,21 +36,21 @@ import org.eclipse.debug.internal.core.sourcelookup.SourceLookupMessages;
* @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
*/
@@ -62,17 +62,19 @@ public class ZipEntryStorage extends PlatformObject implements IStorage {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getContents()
*/
+ @Override
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));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, SourceLookupMessages.ZipEntryStorage_0, e));
}
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getFullPath()
*/
+ @Override
public IPath getFullPath() {
return new Path(getArchive().getName()).append(getZipEntry().getName());
}
@@ -80,6 +82,7 @@ public class ZipEntryStorage extends PlatformObject implements IStorage {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#getName()
*/
+ @Override
public String getName() {
int index = getZipEntry().getName().lastIndexOf('\\');
if (index == -1) {
@@ -87,65 +90,68 @@ public class ZipEntryStorage extends PlatformObject implements IStorage {
}
if (index == -1) {
return getZipEntry().getName();
- }
+ }
return getZipEntry().getName().substring(index + 1);
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.IStorage#isReadOnly()
*/
+ @Override
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) {
+ @Override
+ 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()
*/
+ @Override
public int hashCode() {
return getZipEntry().getName().hashCode();
}
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
index 18a65651c..73b263535 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -12,10 +12,8 @@ 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;
@@ -62,11 +60,11 @@ import com.ibm.icu.text.MessageFormat;
* will not automatically be initialized. Client code that expects markers and breakpoints to be
* initialized must call {@link #ensureInitialized()}.
* </p>
- *
+ *
* @see IBreakpointManager
*/
public class BreakpointManager implements IBreakpointManager, IResourceChangeListener {
-
+
/**
* Constants for breakpoint add/remove/change updates
*/
@@ -77,75 +75,75 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* A collection of breakpoints registered with this manager.
*/
- private Vector fBreakpoints= null;
-
+ private Vector<IBreakpoint> fBreakpoints = null;
+
/**
* Map of breakpoint import participants.
* Map has the form:
* <pre>Map(String - marker_id, List of {@link IBreakpointImportParticipant})</pre>
*/
- private HashMap fImportParticipants = null;
-
+ private HashMap<String, ArrayList<BreakpointImportParticipantDelegate>> 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();
-
+ private Set<IMarker> fPostChangMarkersChanged = new HashSet<IMarker>();
+
/**
* A collection of breakpoint markers that have received a POST_BUILD notification
* of being added.
*/
- private Set fPostBuildMarkersAdded = new HashSet();
-
+ private Set<IMarker> fPostBuildMarkersAdded = new HashSet<IMarker>();
+
/**
- * Collection of breakpoints being added currently. Used to
+ * Collection of breakpoints being added currently. Used to
* suppress change notification of "REGISTERED" attribute when
* being added.
*/
- private List fSuppressChange = new ArrayList();
-
+ private List<IBreakpoint> fSuppressChange = new ArrayList<IBreakpoint>();
+
/**
* 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;
-
+ private HashMap<String, IConfigurationElement> fBreakpointExtensions;
+
/**
* Collection of markers that associates markers to breakpoints
* key: a marker
* value: the breakpoint which contains that marker
- */
- private HashMap fMarkersToBreakpoints;
+ */
+ private HashMap<IMarker, IBreakpoint> fMarkersToBreakpoints;
/**
* Collection of breakpoint listeners.
*/
private ListenerList fBreakpointListeners= new ListenerList();
-
+
/**
* Collection of (plural) breakpoint listeners.
*/
- private ListenerList fBreakpointsListeners= new ListenerList();
-
+ 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.
@@ -158,12 +156,13 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
* sent.
*/
class PostChangeListener implements IResourceChangeListener {
-
+
private PostChangeVisitor fVisitor = new PostChangeVisitor();
/* (non-Javadoc)
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta= event.getDelta();
if (delta != null) {
@@ -174,17 +173,18 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
}
}
-
+
}
-
+
/**
* Default implementation of a breakpoint import participant
- *
+ *
* @since 3.5
*/
class DefaultImportParticipant implements IBreakpointImportParticipant {
- public boolean matches(Map attributes, IBreakpoint breakpoint) throws CoreException {
+ @Override
+ public boolean matches(Map<String, Object> attributes, IBreakpoint breakpoint) throws CoreException {
//perform legacy comparison
IMarker marker = breakpoint.getMarker();
String type = (String) attributes.get("type"); //$NON-NLS-1$
@@ -201,19 +201,21 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
return false;
}
+ @Override
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)
*/
+ @Override
public boolean visit(IResourceDelta delta) throws CoreException {
if (delta == null) {
return false;
@@ -235,25 +237,27 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
}
break;
+ default:
+ break;
}
}
}
return true;
}
-
+
}
-
+
/**
* Constructs a new breakpoint manager.
*/
public BreakpointManager() {
- fMarkersToBreakpoints= new HashMap(10);
- fBreakpointExtensions= new HashMap(15);
+ fMarkersToBreakpoints = new HashMap<IMarker, IBreakpoint>(10);
+ fBreakpointExtensions = new HashMap<String, IConfigurationElement>(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
* @throws CoreException if a problem is encountered
@@ -261,7 +265,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
private void loadBreakpoints(IResource resource, boolean notify) throws CoreException {
initBreakpointExtensions();
IMarker[] markers= getPersistedMarkers(resource);
- List added = new ArrayList();
+ List<IBreakpoint> added = new ArrayList<IBreakpoint>();
for (int i = 0; i < markers.length; i++) {
IMarker marker= markers[i];
try {
@@ -276,16 +280,16 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
DebugPlugin.log(e);
}
}
- addBreakpoints((IBreakpoint[])added.toArray(new IBreakpoint[added.size()]), notify);
+ addBreakpoints(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 <code>TRANSIENT</code> 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,
@@ -297,8 +301,8 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
*/
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();
+ final List<IMarker> delete = new ArrayList<IMarker>();
+ List<IMarker> persisted = new ArrayList<IMarker>();
for (int i = 0; i < markers.length; i++) {
IMarker marker= markers[i];
// ensure the marker has a valid model identifier attribute
@@ -317,8 +321,9 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
// delete any markers that are not to be restored
if (!delete.isEmpty()) {
- final IMarker[] delMarkers = (IMarker[])delete.toArray(new IMarker[delete.size()]);
+ final IMarker[] delMarkers = delete.toArray(new IMarker[delete.size()]);
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor pm) throws CoreException {
for (int i = 0; i < delMarkers.length; i++) {
IMarker marker = delMarkers[i];
@@ -328,9 +333,9 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
};
new BreakpointManagerJob(wr).schedule();
}
- return (IMarker[])persisted.toArray(new IMarker[persisted.size()]);
+ return persisted.toArray(new IMarker[persisted.size()]);
}
-
+
/**
* Removes this manager as a resource change listener
* and removes all breakpoint listeners.
@@ -366,7 +371,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
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$
+ 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 {
@@ -386,18 +391,20 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* @see IBreakpointManager#getBreakpoint(IMarker)
*/
+ @Override
public IBreakpoint getBreakpoint(IMarker marker) {
// ensure that breakpoints are initialized
getBreakpoints0();
- return (IBreakpoint)fMarkersToBreakpoints.get(marker);
+ return fMarkersToBreakpoints.get(marker);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#getBreakpoints()
*/
+ @Override
public IBreakpoint[] getBreakpoints() {
IBreakpoint[] temp = new IBreakpoint[0];
- Vector breakpoints = getBreakpoints0();
+ Vector<IBreakpoint> breakpoints = getBreakpoints0();
synchronized (breakpoints) {
temp = new IBreakpoint[breakpoints.size()];
breakpoints.copyInto(temp);
@@ -412,7 +419,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
* be initialized. Client code that expects markers and breakpoints to be initialized must call
* this method.
* </p>
- *
+ *
* @since 3.8
*/
public void ensureInitialized() {
@@ -421,33 +428,32 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* The BreakpointManager waits to load the breakpoints
- * of the workspace until a request is made to retrieve the
+ * of the workspace until a request is made to retrieve the
* breakpoints.
* @return the underlying {@link Vector} of breakpoints
*/
- private synchronized Vector getBreakpoints0() {
+ private synchronized Vector<IBreakpoint> getBreakpoints0() {
if (fBreakpoints == null) {
initializeBreakpoints();
}
return fBreakpoints;
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#getBreakpoints(java.lang.String)
*/
+ @Override
public IBreakpoint[] getBreakpoints(String modelIdentifier) {
- Vector allBreakpoints= getBreakpoints0();
+ Vector<IBreakpoint> allBreakpoints = getBreakpoints0();
synchronized (allBreakpoints) {
- ArrayList temp = new ArrayList(allBreakpoints.size());
- Iterator breakpoints= allBreakpoints.iterator();
- while (breakpoints.hasNext()) {
- IBreakpoint breakpoint= (IBreakpoint) breakpoints.next();
+ ArrayList<IBreakpoint> temp = new ArrayList<IBreakpoint>(allBreakpoints.size());
+ for (IBreakpoint breakpoint : allBreakpoints) {
String id= breakpoint.getModelIdentifier();
if (id != null && id.equals(modelIdentifier)) {
temp.add(breakpoint);
}
}
- return (IBreakpoint[]) temp.toArray(new IBreakpoint[temp.size()]);
+ return temp.toArray(new IBreakpoint[temp.size()]);
}
}
@@ -456,56 +462,57 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
* workspace. Start listening to resource deltas.
*/
private void initializeBreakpoints() {
- setBreakpoints(new Vector(10));
+ setBreakpoints(new Vector<IBreakpoint>(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));
- }
+ setBreakpoints(new Vector<IBreakpoint>(0));
+ }
}
-
+
/**
* @see IBreakpointManager#isRegistered(IBreakpoint)
*/
+ @Override
public boolean isRegistered(IBreakpoint breakpoint) {
return getBreakpoints0().contains(breakpoint);
}
-
+
/**
* @see IBreakpointManager#removeBreakpoint(IBreakpoint, boolean)
*/
+ @Override
public void removeBreakpoint(IBreakpoint breakpoint, boolean delete) throws CoreException {
removeBreakpoints(new IBreakpoint[]{breakpoint}, delete);
}
-
+
/**
* @see IBreakpointManager#removeBreakpoints(IBreakpoint[], boolean)
*/
+ @Override
public void removeBreakpoints(IBreakpoint[] breakpoints, final boolean delete) throws CoreException {
- final List remove = new ArrayList(breakpoints.length);
+ final List<IBreakpoint> remove = new ArrayList<IBreakpoint>(breakpoints.length);
+ List<IBreakpoint> bps = getBreakpoints0();
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
- if (getBreakpoints0().contains(breakpoint)) {
+ if (bps.contains(breakpoint)) {
remove.add(breakpoint);
}
}
if (!remove.isEmpty()) {
- Iterator iter = remove.iterator();
- while (iter.hasNext()) {
- IBreakpoint breakpoint = (IBreakpoint)iter.next();
- getBreakpoints0().remove(breakpoint);
+ for (IBreakpoint breakpoint : remove) {
+ bps.remove(breakpoint);
fMarkersToBreakpoints.remove(breakpoint.getMarker());
}
fireUpdate(remove, null, REMOVED);
IWorkspaceRunnable r = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor montitor) throws CoreException {
- Iterator innerIter = remove.iterator();
- while (innerIter.hasNext()) {
- IBreakpoint breakpoint = (IBreakpoint)innerIter.next();
+ for (IBreakpoint breakpoint : remove) {
if (delete) {
breakpoint.delete();
} else {
@@ -521,21 +528,21 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
}
}
- }
+ }
}
};
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
+ * @exception DebugException if breakpoint creation fails. Reasons for
* failure include:
* <ol>
* <li>The breakpoint manager cannot determine what kind of breakpoint
@@ -544,53 +551,55 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
* </ol>
*/
public IBreakpoint createBreakpoint(IMarker marker) throws DebugException {
- IBreakpoint breakpoint= (IBreakpoint) fMarkersToBreakpoints.get(marker);
+ IBreakpoint breakpoint= fMarkersToBreakpoints.get(marker);
if (breakpoint != null) {
return breakpoint;
}
try {
- IConfigurationElement config = (IConfigurationElement)fBreakpointExtensions.get(marker.getType());
+ IConfigurationElement config = 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));
+ throw new DebugException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
+ DebugException.CONFIGURATION_INVALID, MessageFormat.format(DebugCoreMessages.BreakpointManager_Missing_breakpoint_definition, new Object[] { 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$
+ 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;
+ return breakpoint;
} catch (CoreException e) {
throw new DebugException(e.getStatus());
}
- }
+ }
/**
* @see IBreakpointManager#addBreakpoint(IBreakpoint)
*/
+ @Override
public void addBreakpoint(IBreakpoint breakpoint) throws CoreException {
addBreakpoints(new IBreakpoint[]{breakpoint});
}
-
+
/**
* @see IBreakpointManager#addBreakpoints(IBreakpoint[])
*/
+ @Override
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
* @throws CoreException if a problem is encountered
*/
private void addBreakpoints(IBreakpoint[] breakpoints, boolean notify) throws CoreException {
- List added = new ArrayList(breakpoints.length);
- final List update = new ArrayList();
+ List<IBreakpoint> added = new ArrayList<IBreakpoint>(breakpoints.length);
+ final List<IBreakpoint> update = new ArrayList<IBreakpoint>();
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
if (!getBreakpoints0().contains(breakpoint)) {
@@ -604,51 +613,52 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
// 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() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
- Iterator iter = update.iterator();
- while (iter.hasNext()) {
- IBreakpoint breakpoint = (IBreakpoint)iter.next();
- getBreakpoints0().add(breakpoint);
+ List<IBreakpoint> bps = getBreakpoints0();
+ for (IBreakpoint breakpoint : update) {
+ bps.add(breakpoint);
breakpoint.setRegistered(true);
- fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint);
+ fMarkersToBreakpoints.put(breakpoint.getMarker(), breakpoint);
}
}
};
// Need to suppress change notification, since this is really
- // an add notification
+ // 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 the breakpoint
* @return boolean whether change notification is suppressed
*/
protected boolean isChangeSuppressed(IBreakpoint breakpoint) {
return fSuppressChange.contains(breakpoint);
}
-
+
/**
* @see IBreakpointManager#fireBreakpointChanged(IBreakpoint)
*/
+ @Override
public void fireBreakpointChanged(IBreakpoint breakpoint) {
if (getBreakpoints0().contains(breakpoint)) {
- List changed = new ArrayList();
+ List<IBreakpoint> changed = new ArrayList<IBreakpoint>();
changed.add(breakpoint);
fireUpdate(changed, null, CHANGED);
}
@@ -664,8 +674,8 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
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));
+ 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());
@@ -674,9 +684,10 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* A resource has changed. Traverses the delta for breakpoint changes.
- *
+ *
* @param event resource change event
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta= event.getDelta();
if (delta != null) {
@@ -699,24 +710,24 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* Moved markers
*/
- private List fMoved = new ArrayList();
+ private List<IMarker> fMoved = new ArrayList<IMarker>();
/**
* Removed breakpoints
*/
- private List fRemoved = new ArrayList();
-
+ private List<IBreakpoint> fRemoved = new ArrayList<IBreakpoint>();
+
/**
* Added breakpoints.
* @since 3.7
*/
- private List fAdded= new ArrayList();
+ private List<IBreakpoint> fAdded = new ArrayList<IBreakpoint>();
/**
* Changed breakpoints and associated marker deltas
*/
- private List fChanged = new ArrayList();
- private List fChangedDeltas = new ArrayList();
-
+ private List<IBreakpoint> fChanged = new ArrayList<IBreakpoint>();
+ private List<IMarkerDelta> fChangedDeltas = new ArrayList<IMarkerDelta>();
+
/**
* Resets the visitor for a delta traversal - empties
* collections of removed/changed breakpoints.
@@ -728,7 +739,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fChanged.clear();
fChangedDeltas.clear();
}
-
+
/**
* Performs updates on accumulated changes, and fires change notification after
* a traversal. Accumulated updates are reset.
@@ -737,8 +748,9 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
if (!fMoved.isEmpty()) {
// delete moved markers
IWorkspaceRunnable wRunnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
- IMarker[] markers = (IMarker[])fMoved.toArray(new IMarker[fMoved.size()]);
+ IMarker[] markers = fMoved.toArray(new IMarker[fMoved.size()]);
for (int i = 0; i < markers.length; i++) {
markers[i].delete();
}
@@ -751,7 +763,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
if (!fRemoved.isEmpty()) {
try {
- removeBreakpoints((IBreakpoint[])fRemoved.toArray(new IBreakpoint[fRemoved.size()]), false);
+ removeBreakpoints(fRemoved.toArray(new IBreakpoint[fRemoved.size()]), false);
} catch (CoreException e) {
DebugPlugin.log(e);
}
@@ -759,17 +771,16 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
if (!fAdded.isEmpty()) {
try {
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
- Iterator iter= fAdded.iterator();
- while (iter.hasNext()) {
- IBreakpoint breakpoint= (IBreakpoint)iter.next();
+ for (IBreakpoint breakpoint : fAdded) {
breakpoint.getMarker().setAttribute(DebugPlugin.ATTR_BREAKPOINT_IS_DELETED, false);
breakpoint.setRegistered(true);
}
}
};
getWorkspace().run(runnable, null, 0, null);
- addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]), false);
+ addBreakpoints(fAdded.toArray(new IBreakpoint[fAdded.size()]), false);
} catch (CoreException e) {
DebugPlugin.log(e);
}
@@ -778,11 +789,12 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fireUpdate(fChanged, fChangedDeltas, CHANGED);
}
reset();
- }
-
+ }
+
/**
* @see IResourceDeltaVisitor#visit(IResourceDelta)
*/
+ @Override
public boolean visit(IResourceDelta delta) {
if (delta == null) {
return false;
@@ -805,12 +817,14 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
case IResourceDelta.CHANGED :
handleChangeBreakpoint(markerDelta.getMarker(), markerDelta);
break;
+ default:
+ break;
}
}
}
return true;
- }
+ }
/**
* Wrapper for handling adds
@@ -827,7 +841,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fMoved.add(marker);
}
} else {
- // check if the an add & change have be combined into one add notification
+ // check if the an add & change have be combined into one add notification
synchronized (fPostChangMarkersChanged) {
if (fPostChangMarkersChanged.contains(marker)) {
handleChangeBreakpoint(marker, mDelta);
@@ -843,7 +857,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
}
}
}
-
+
/**
* Wrapper for handling removes
* @param marker the {@link IMarker}
@@ -871,36 +885,36 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fChangedDeltas.add(delta);
}
}
-
+
/**
* A project has been opened or closed. Updates the breakpoints for
* that project
* @param project the {@link IProject} that was changed
*/
+ @SuppressWarnings("unchecked")
private void handleProjectResourceOpenStateChange(final IResource project) {
if (!project.isAccessible()) {
//closed
- Enumeration breakpoints= ((Vector)getBreakpoints0().clone()).elements();
- while (breakpoints.hasMoreElements()) {
- IBreakpoint breakpoint= (IBreakpoint) breakpoints.nextElement();
+ for (IBreakpoint breakpoint : (Vector<IBreakpoint>) getBreakpoints0().clone()) {
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)
*/
+ @Override
public void addBreakpointListener(IBreakpointListener listener) {
fBreakpointListeners.add(listener);
}
@@ -908,47 +922,50 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* @see IBreakpointManager#removeBreakpointListener(IBreakpointListener)
*/
+ @Override
public void removeBreakpointListener(IBreakpointListener listener) {
fBreakpointListeners.remove(listener);
}
-
+
/**
* Notifies listeners of the adds/removes/changes
- *
+ *
* @param breakpoints associated breakpoints
* @param deltas or <code>null</code>
* @param update type of change
*/
- private void fireUpdate(List breakpoints, List deltas, int update) {
+ private void fireUpdate(List<IBreakpoint> breakpoints, List<IMarkerDelta> deltas, int update) {
if (breakpoints.isEmpty()) {
- return;
+ return;
}
- IBreakpoint[] bpArray = (IBreakpoint[])breakpoints.toArray(new IBreakpoint[breakpoints.size()]);
+ IBreakpoint[] bpArray = breakpoints.toArray(new IBreakpoint[breakpoints.size()]);
IMarkerDelta[] deltaArray = new IMarkerDelta[bpArray.length];
if (deltas != null) {
- deltaArray = (IMarkerDelta[])deltas.toArray(deltaArray);
+ deltaArray = deltas.toArray(deltaArray);
}
// single listeners
getBreakpointNotifier().notify(bpArray, deltaArray, update);
-
+
// plural listeners
getBreakpointsNotifier().notify(bpArray, deltaArray, update);
- }
+ }
- protected void setBreakpoints(Vector breakpoints) {
+ protected void setBreakpoints(Vector<IBreakpoint> breakpoints) {
fBreakpoints = breakpoints;
}
-
+
/**
* @see IBreakpointManager#hasBreakpoints()
*/
+ @Override
public boolean hasBreakpoints() {
return !getBreakpoints0().isEmpty();
}
-
+
/**
* @see org.eclipse.debug.core.IBreakpointManager#addBreakpointListener(org.eclipse.debug.core.IBreakpointsListener)
*/
+ @Override
public void addBreakpointListener(IBreakpointsListener listener) {
fBreakpointsListeners.add(listener);
}
@@ -956,6 +973,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* @see org.eclipse.debug.core.IBreakpointManager#removeBreakpointListener(org.eclipse.debug.core.IBreakpointsListener)
*/
+ @Override
public void removeBreakpointListener(IBreakpointsListener listener) {
fBreakpointsListeners.remove(listener);
}
@@ -963,21 +981,22 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
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)
*/
+ @Override
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);
@@ -986,6 +1005,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -995,14 +1015,16 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fListener.breakpointRemoved(fBreakpoint, fDelta);
break;
case CHANGED:
- fListener.breakpointChanged(fBreakpoint, fDelta);
+ fListener.breakpointChanged(fBreakpoint, fDelta);
+ break;
+ default:
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
@@ -1015,33 +1037,34 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
for (int j = 0; j < breakpoints.length; j++) {
fBreakpoint = breakpoints[j];
fDelta = deltas[j];
- SafeRunner.run(this);
+ SafeRunner.run(this);
}
}
fListener = null;
fDelta = null;
- fBreakpoint = 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)
*/
+ @Override
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);
@@ -1050,6 +1073,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -1059,14 +1083,16 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fListener.breakpointsRemoved(fNotifierBreakpoints, fDeltas);
break;
case CHANGED:
- fListener.breakpointsChanged(fNotifierBreakpoints, fDeltas);
+ fListener.breakpointsChanged(fNotifierBreakpoints, fDeltas);
break;
- }
+ default:
+ 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
@@ -1089,6 +1115,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#isEnabled()
*/
+ @Override
public boolean isEnabled() {
return Platform.getPreferencesService().getBoolean(DebugPlugin.getUniqueIdentifier(), IInternalDebugCoreConstants.PREF_BREAKPOINT_MANAGER_ENABLED_STATE, true, null);
}
@@ -1096,16 +1123,18 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#setEnabled(boolean)
*/
+ @Override
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 {
+ @Override
+ 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).
+ // the editor ruler will be updated (editors listen to marker changes).
breakpoint.getMarker().setAttribute(IBreakpoint.ENABLED, breakpoint.isEnabled());
}
}
@@ -1122,6 +1151,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#addBreakpointManagerListener(org.eclipse.debug.core.IBreakpointManagerListener)
*/
+ @Override
public void addBreakpointManagerListener(IBreakpointManagerListener listener) {
fBreakpointManagerListeners.add(listener);
}
@@ -1129,22 +1159,24 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#removeBreakpointManagerListener(org.eclipse.debug.core.IBreakpointManagerListener)
*/
+ @Override
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)
*/
+ @Override
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);
@@ -1153,13 +1185,14 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
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) {
@@ -1172,9 +1205,9 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
fListener = null;
}
}
-
+
class BreakpointManagerJob extends Job {
-
+
private final IWorkspaceRunnable fRunnable;
public BreakpointManagerJob (IWorkspaceRunnable wRunnable) {
@@ -1186,6 +1219,7 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
getWorkspace().run(fRunnable, null, 0, null);
@@ -1199,16 +1233,17 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#getTypeName(org.eclipse.debug.core.model.IBreakpoint)
*/
- public String getTypeName(IBreakpoint breakpoint) {
+ @Override
+ public String getTypeName(IBreakpoint breakpoint) {
String typeName= null;
IMarker marker = breakpoint.getMarker();
if (marker != null) {
try {
- IConfigurationElement element = (IConfigurationElement) fBreakpointExtensions.get(marker.getType());
+ IConfigurationElement element = fBreakpointExtensions.get(marker.getType());
if (element != null) {
typeName= element.getAttribute(IConfigurationElementConstants.NAME);
}
- }
+ }
catch (CoreException e) {}
}
return typeName;
@@ -1217,42 +1252,43 @@ public class BreakpointManager implements IBreakpointManager, IResourceChangeLis
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManager#getImportParticipants(java.lang.String)
*/
+ @Override
public IBreakpointImportParticipant[] getImportParticipants(String markertype) throws CoreException {
initializeImportParticipants();
- ArrayList list = (ArrayList) fImportParticipants.get(markertype);
+ ArrayList<BreakpointImportParticipantDelegate> list = 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);
+ delegate = list.get(i);
participants[i] = delegate.getDelegate();
}
if(participants.length == 0) {
return new IBreakpointImportParticipant[] {fDefaultParticipant};
}
- return participants;
+ return participants;
}
-
+
/**
- * Initializes the cache of breakpoint import participants. Does no work if the cache
+ * 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();
+ fImportParticipants = new HashMap<String, ArrayList<BreakpointImportParticipantDelegate>>();
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;
+ ArrayList<BreakpointImportParticipantDelegate> list = null;
for(int i = 0; i < elements.length; i++) {
type = elements[i].getAttribute(IConfigurationElementConstants.TYPE);
if(type != null) {
- list = (ArrayList) fImportParticipants.get(type);
+ list = fImportParticipants.get(type);
if(list == null) {
- list = new ArrayList();
+ list = new ArrayList<BreakpointImportParticipantDelegate>();
fImportParticipants.put(type, list);
}
list.add(new BreakpointImportParticipantDelegate(elements[i]));
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
index f92e8b263..e02b4099c 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,11 +19,11 @@ import org.osgi.framework.BundleContext;
/**
* Access to debug options.
- *
+ *
* @since 3.3
*/
public class DebugOptions implements DebugOptionsListener {
-
+
// debug option flags
public static boolean DEBUG = false;
public static boolean DEBUG_COMMANDS = false;
@@ -32,33 +32,34 @@ public class DebugOptions implements DebugOptionsListener {
static final String DEBUG_FLAG = "org.eclipse.debug.core/debug"; //$NON-NLS-1$
static final String DEBUG_FLAG_COMMANDS = "org.eclipse.debug.core/debug/commands"; //$NON-NLS-1$
static final String DEBUG_FLAG_EVENTS = "org.eclipse.debug.core/debug/events"; //$NON-NLS-1$
-
+
/**
* The {@link DebugTrace} object to print to OSGi tracing
* @since 3.8
*/
private static DebugTrace fgDebugTrace;
-
+
/**
* Constructor
* @param context the bundle context
*/
public DebugOptions(BundleContext context) {
- Hashtable props = new Hashtable(2);
+ Hashtable<String, String> props = new Hashtable<String, String>(2);
props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, DebugPlugin.getUniqueIdentifier());
context.registerService(DebugOptionsListener.class.getName(), this, props);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions)
*/
+ @Override
public void optionsChanged(org.eclipse.osgi.service.debug.DebugOptions options) {
fgDebugTrace = options.newDebugTrace(DebugPlugin.getUniqueIdentifier());
DEBUG = options.getBooleanOption(DEBUG_FLAG, false);
DEBUG_COMMANDS = DEBUG & options.getBooleanOption(DEBUG_FLAG_COMMANDS, false);
DEBUG_EVENTS = DEBUG & options.getBooleanOption(DEBUG_FLAG_EVENTS, false);
}
-
+
/**
* Prints the given message to System.out and to the OSGi tracing (if started)
* @param option the option or <code>null</code>
@@ -72,10 +73,10 @@ public class DebugOptions implements DebugOptionsListener {
fgDebugTrace.trace(option, message, throwable);
}
}
-
+
/**
* Prints the given message to System.out and to the OSGi tracing (if enabled)
- *
+ *
* @param message the message or <code>null</code>
* @since 3.8
*/
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
index c2b7479c5..7f4a0f814 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,7 @@ import org.eclipse.debug.core.DebugPlugin;
/**
* Initializes preferences for debug.core
- *
+ *
* @since 3.3
*/
public class DebugPreferenceInitializer extends AbstractPreferenceInitializer {
@@ -23,6 +23,7 @@ public class DebugPreferenceInitializer extends AbstractPreferenceInitializer {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
// Step filter preferences
Preferences.setDefaultBoolean(DebugPlugin.getUniqueIdentifier(), StepFilterManager.PREF_USE_STEP_FILTERS, false);
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
index b3f1f6c8a..d024f0cd3 100644
--- 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
@@ -1,18 +1,18 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, 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 java.util.Map.Entry;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
@@ -24,30 +24,29 @@ import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.osgi.service.environment.Constants;
/**
- * Resolves the value of environment variables.
+ * 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)
*/
+ @Override
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));
+ 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);
+ Map<String, String> map = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
+ String value = 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();
+ for (Entry<String, String> entry : map.entrySet()) {
+ String key = entry.getKey();
if (key.equalsIgnoreCase(argument)) {
- return (String) entry.getValue();
+ return 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
index 0fc30b27a..8df5726ba 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@ 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;
@@ -53,28 +52,28 @@ import com.ibm.icu.text.MessageFormat;
* @see IExpressionManager
*/
public class ExpressionManager extends PlatformObject implements IExpressionManager {
-
+
/**
* Ordered collection of registered expressions.
*/
- private Vector fExpressions = null;
-
+ private Vector<IExpression> 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();
-
+ private Map<String, IConfigurationElement> fWatchExpressionDelegates = new HashMap<String, IConfigurationElement>();
+
// Constants for add/remove/change/insert/move notification
private static final int ADDED = 1;
private static final int CHANGED = 2;
@@ -92,12 +91,12 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
// 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
@@ -117,16 +116,17 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#newWatchExpressionDelegate(java.lang.String)
*/
+ @Override
public IWatchExpressionDelegate newWatchExpressionDelegate(String debugModel) {
try {
- IConfigurationElement element= (IConfigurationElement) fWatchExpressionDelegates.get(debugModel);
+ IConfigurationElement element= fWatchExpressionDelegates.get(debugModel);
if (element != null) {
return (IWatchExpressionDelegate) element.createExecutableExtension(IConfigurationElementConstants.DELEGATE_CLASS);
- }
+ }
return null;
} catch (CoreException e) {
DebugPlugin.log(e);
@@ -137,11 +137,12 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#hasWatchExpressionDelegate(java.lang.String)
*/
- public boolean hasWatchExpressionDelegate(String id) {
- IConfigurationElement element= (IConfigurationElement) fWatchExpressionDelegates.get(id);
+ @Override
+ public boolean hasWatchExpressionDelegate(String id) {
+ IConfigurationElement element= 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
@@ -170,7 +171,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
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$
+ DebugPlugin.logMessage(MessageFormat.format("Invalid XML element encountered while loading watch expressions: {0}", new Object[] { node.getNodeName() }), null); //$NON-NLS-1$
continue;
}
String expressionText= element.getAttribute(TEXT_TAG);
@@ -178,7 +179,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
boolean enabled= TRUE_VALUE.equals(element.getAttribute(ENABLED_TAG));
IWatchExpression expression= newWatchExpression(expressionText, enabled);
if (fExpressions == null) {
- fExpressions= new Vector(list.getLength());
+ fExpressions = new Vector<IExpression>(list.getLength());
}
fExpressions.add(expression);
} else {
@@ -187,11 +188,11 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
}
}
}
-
+
/**
* 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
@@ -203,13 +204,14 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#newWatchExpression(java.lang.String)
*/
+ @Override
public IWatchExpression newWatchExpression(String expressionText) {
return new WatchExpression(expressionText);
}
-
+
/**
* Persists this manager's watch expressions as XML in the
- * preference store.
+ * preference store.
*/
public void storeWatchExpressions() {
String expressionString = IInternalDebugCoreConstants.EMPTY_STRING;
@@ -243,7 +245,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
for (int i = 0; i < expressions.length; i++) {
IExpression expression= expressions[i];
if (expression instanceof IWatchExpression) {
- Element element= document.createElement(EXPRESSION_TAG);
+ 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);
@@ -255,40 +257,42 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#addExpression(org.eclipse.debug.core.model.IExpression)
*/
+ @Override
public void addExpression(IExpression expression) {
addExpressions(new IExpression[]{expression});
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#addExpressions(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void addExpressions(IExpression[] expressions) {
- List added = doAdd(expressions);
+ List<IExpression> added = doAdd(expressions);
if (!added.isEmpty()) {
- fireUpdate((IExpression[])added.toArray(new IExpression[added.size()]), ADDED);
+ fireUpdate(added.toArray(new IExpression[added.size()]), ADDED);
}
}
-
+
/**
* Adds the given expressions to the list of managed expressions, and returns a list
* of expressions that were actually added. Expressions that already exist in the
* managed list are not added.
- *
+ *
* @param expressions expressions to add
* @return list of expressions that were actually added.
*/
- private List doAdd(IExpression[] expressions) {
- List added = new ArrayList(expressions.length);
+ private List<IExpression> doAdd(IExpression[] expressions) {
+ List<IExpression> added = new ArrayList<IExpression>(expressions.length);
synchronized (this) {
if (fExpressions == null) {
- fExpressions = new Vector(expressions.length);
+ fExpressions = new Vector<IExpression>(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);
- }
+ }
}
}
return added;
@@ -297,6 +301,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#getExpressions()
*/
+ @Override
public synchronized IExpression[] getExpressions() {
if (fExpressions == null) {
return new IExpression[0];
@@ -309,22 +314,21 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#getExpressions(java.lang.String)
*/
+ @Override
public synchronized 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();
+ ArrayList<IExpression> temp = new ArrayList<IExpression>(fExpressions.size());
+ for (IExpression expression : fExpressions) {
+ String id = expression.getModelIdentifier();
if (id != null && id.equals(modelIdentifier)) {
temp.add(expression);
}
}
- return (IExpression[]) temp.toArray(new IExpression[temp.size()]);
+ return 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
@@ -339,8 +343,8 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
* @since 3.4
*/
public void insertExpressions(IExpression[] expressions, IExpression insertionLocation, boolean insertBefore){
- List added = null;
- List inserted = null;
+ List<IExpression> added = null;
+ List<IExpression> inserted = null;
int insertionIndex = -1;
synchronized (this) {
if (fExpressions == null || ((insertionIndex = fExpressions.indexOf(insertionLocation)) < 0)) {
@@ -349,44 +353,44 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
if (!insertBefore){
insertionIndex++;
}
- inserted = new ArrayList(expressions.length);
+ inserted = new ArrayList<IExpression>(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+inserted.size(), expression);
inserted.add(expression);
- }
+ }
}
}
}
if (added != null) {
if (!added.isEmpty()) {
- fireUpdate((IExpression[])added.toArray(new IExpression[added.size()]), ADDED);
+ fireUpdate(added.toArray(new IExpression[added.size()]), ADDED);
}
return;
}
if (inserted != null) {
if (!inserted.isEmpty()) {
- fireUpdate((IExpression[])inserted.toArray(new IExpression[inserted.size()]), INSERTED, insertionIndex);
+ fireUpdate(inserted.toArray(new IExpression[inserted.size()]), INSERTED, insertionIndex);
}
}
}
-
+
/**
* 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
+ * 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){
- List movedExpressions = new ArrayList(expressions.length);
+ List<IExpression> movedExpressions = new ArrayList<IExpression>(expressions.length);
int insertionIndex = -1;
IExpression[] movedExpressionsArray = null;
synchronized (this) {
@@ -400,7 +404,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
if (!insertBefore){
insertionIndex++;
}
-
+
for (int i = 0; i < expressions.length; i++) {
int removeIndex = fExpressions.indexOf(expressions[i]);
if (removeIndex >= 0){
@@ -411,21 +415,22 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fExpressions.remove(removeIndex);
}
}
- movedExpressionsArray = (IExpression[])movedExpressions.toArray(new IExpression[movedExpressions.size()]);
+ movedExpressionsArray = 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);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#removeExpression(org.eclipse.debug.core.model.IExpression)
*/
+ @Override
public void removeExpression(IExpression expression) {
removeExpressions(new IExpression[] {expression});
}
@@ -433,8 +438,9 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#removeExpressions(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void removeExpressions(IExpression[] expressions) {
- List removed = new ArrayList(expressions.length);
+ List<IExpression> removed = new ArrayList<IExpression>(expressions.length);
synchronized (this) {
if (fExpressions == null) {
return;
@@ -443,22 +449,22 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
IExpression expression = expressions[i];
if (fExpressions.remove(expression)) {
removed.add(expression);
- }
- }
+ }
+ }
}
// dispose outside of the synchronized block
- Iterator iterator = removed.iterator();
- while (iterator.hasNext()) {
- ((IExpression) iterator.next()).dispose();
- }
if (!removed.isEmpty()) {
- fireUpdate((IExpression[])removed.toArray(new IExpression[removed.size()]), REMOVED);
+ for (IExpression expression : removed) {
+ expression.dispose();
+ }
+ fireUpdate(removed.toArray(new IExpression[removed.size()]), REMOVED);
}
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#addExpressionListener(org.eclipse.debug.core.IExpressionListener)
*/
+ @Override
public void addExpressionListener(IExpressionListener listener) {
if (fListeners == null) {
fListeners = new ListenerList();
@@ -469,17 +475,18 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#removeExpressionListener(org.eclipse.debug.core.IExpressionListener)
*/
+ @Override
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
*/
protected void watchExpressionChanged(IWatchExpression expression) {
@@ -496,17 +503,17 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/**
* 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 <code>-1</code>
@@ -514,14 +521,15 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
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()
*/
+ @Override
public synchronized boolean hasExpressions() {
return fExpressions != null && !fExpressions.isEmpty();
}
@@ -529,6 +537,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#addExpressionListener(org.eclipse.debug.core.IExpressionsListener)
*/
+ @Override
public void addExpressionListener(IExpressionsListener listener) {
if (fExpressionsListeners == null) {
fExpressionsListeners = new ListenerList();
@@ -539,23 +548,24 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionManager#removeExpressionListener(org.eclipse.debug.core.IExpressionsListener)
*/
+ @Override
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;
@@ -563,6 +573,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
*/
+ @Override
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);
@@ -571,6 +582,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -581,14 +593,16 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fListener.expressionRemoved(fExpression);
break;
case CHANGED:
- fListener.expressionChanged(fExpression);
+ fListener.expressionChanged(fExpression);
+ break;
+ default:
break;
- }
+ }
}
/**
* Notifies listeners of the add/change/remove
- *
+ *
* @param expressions the expressions that have changed
* @param update the type of change
*/
@@ -602,13 +616,13 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fExpression = expressions[j];
SafeRunner.run(this);
}
- }
+ }
}
fListener = null;
fExpression = null;
}
}
-
+
/**
* Returns the expressions notifier
* @return the expressions notifier
@@ -616,21 +630,22 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
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)
*/
+ @Override
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);
@@ -639,6 +654,7 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
/* (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case MOVED:
@@ -662,14 +678,16 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fListener.expressionsRemoved(fNotifierExpressions);
break;
case CHANGED:
- fListener.expressionsChanged(fNotifierExpressions);
+ fListener.expressionsChanged(fNotifierExpressions);
+ break;
+ default:
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
@@ -684,9 +702,9 @@ public class ExpressionManager extends PlatformObject implements IExpressionMana
fListener = (IExpressionsListener)copiedListeners[i];
SafeRunner.run(this);
}
- }
+ }
fNotifierExpressions = null;
- fListener = null;
+ fListener = null;
}
}
}
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
index 933dabf8d..3196df3ea 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,12 +20,12 @@ 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).
*/
@@ -33,7 +33,7 @@ public class InputStreamMonitor {
/**
* The queue of output.
*/
- private Vector fQueue;
+ private Vector<String> fQueue;
/**
* The thread which writes to the stream.
*/
@@ -42,7 +42,7 @@ public class InputStreamMonitor {
* A lock for ensuring that writes to the queue are contiguous
*/
private Object fLock;
-
+
/**
* Whether the underlying output stream has been closed
*/
@@ -52,34 +52,34 @@ public class InputStreamMonitor {
* 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 <code>null</code> for system default
*/
public InputStreamMonitor(OutputStream stream, String encoding) {
fStream= stream;
- fQueue= new Vector();
+ fQueue = new Vector<String>();
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) {
@@ -95,6 +95,7 @@ public class InputStreamMonitor {
public void startMonitoring() {
if (fThread == null) {
fThread= new Thread(new Runnable() {
+ @Override
public void run() {
write();
}
@@ -103,7 +104,7 @@ public class InputStreamMonitor {
fThread.start();
}
}
-
+
/**
* Close all communications between this
* monitor and the underlying stream.
@@ -115,7 +116,7 @@ public class InputStreamMonitor {
thread.interrupt();
}
}
-
+
/**
* Continuously writes to the stream.
*/
@@ -131,19 +132,20 @@ public class InputStreamMonitor {
}
}
}
-
+
/**
* Write the text in the queue to the stream.
*/
protected void writeNext() {
while (!fQueue.isEmpty() && !fClosed) {
- String text = (String)fQueue.firstElement();
+ String text = fQueue.firstElement();
fQueue.removeElementAt(0);
try {
- if (fEncoding != null)
+ if (fEncoding != null) {
fStream.write(text.getBytes(fEncoding));
- else
+ } else {
fStream.write(text.getBytes());
+ }
fStream.flush();
} catch (IOException e) {
DebugPlugin.log(e);
@@ -160,7 +162,7 @@ public class InputStreamMonitor {
/**
* 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 {
@@ -170,7 +172,7 @@ public class InputStreamMonitor {
} 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
index ff886fa04..b021f6b85 100644
--- 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
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.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;
@@ -39,10 +39,10 @@ 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.SubMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@@ -67,73 +67,73 @@ 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 <code>null</code>
* 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 <code>null</code> 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
+ * 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 <code>ILaunchDelegate</code>
- *
+ *
* @since 3.3
*/
- public static final String ATTR_PREFERRED_LAUNCHERS = DebugPlugin.getUniqueIdentifier() + ".preferred_launchers"; //$NON-NLS-1$
-
+ 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 <code>null</code> if stored locally
* with workspace metadata.
@@ -145,7 +145,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
* 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 <code>null</code>.
- *
+ *
* @param name launch configuration name
* @param container parent container or <code>null</code>
* @since 3.5
@@ -160,22 +160,22 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
* Initialize any state variables - called first in the constructor.
* Subclasses must override as appropriate.
*/
- protected void initialize() {
+ 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 the name to parse
* @return simple name
* @since 3.5
@@ -187,11 +187,11 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
}
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
@@ -205,21 +205,21 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
StringReader reader = new StringReader(memento);
InputSource source = new InputSource(reader);
root = parser.parse(source).getDocumentElement();
-
- String localString = root.getAttribute(IConfigurationElementConstants.LOCAL);
+
+ String localString = root.getAttribute(IConfigurationElementConstants.LOCAL);
String path = root.getAttribute(IConfigurationElementConstants.PATH);
- String message = null;
+ String message = null;
if (path == null || IInternalDebugCoreConstants.EMPTY_STRING.equals(path)) {
- message = DebugCoreMessages.LaunchConfiguration_18;
+ message = DebugCoreMessages.LaunchConfiguration_18;
} else if (localString == null || IInternalDebugCoreConstants.EMPTY_STRING.equals(localString)) {
- message = DebugCoreMessages.LaunchConfiguration_19;
+ 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());
@@ -231,19 +231,20 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
setContainer(container);
return;
} catch (ParserConfigurationException e) {
- ex = e;
+ ex = e;
} catch (SAXException e) {
ex = e;
} catch (IOException e) {
ex = e;
}
- IStatus s = newStatus(DebugCoreMessages.LaunchConfiguration_17, DebugException.INTERNAL_ERROR, ex);
+ 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)
*/
+ @Override
public boolean contentsEqual(ILaunchConfiguration object) {
try {
if (object instanceof LaunchConfiguration) {
@@ -262,14 +263,16 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#copy(java.lang.String)
*/
+ @Override
public ILaunchConfigurationWorkingCopy copy(String name) throws CoreException {
ILaunchConfigurationWorkingCopy copy = new LaunchConfigurationWorkingCopy(this, name);
return copy;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#delete()
*/
+ @Override
public void delete() throws CoreException {
if (exists()) {
IFile file = getFile();
@@ -280,7 +283,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
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)
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfiguration_Failed_to_delete_launch_configuration__1, null)
);
}
}
@@ -306,16 +309,17 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
* 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)
*/
+ @Override
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()) &&
@@ -324,10 +328,10 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
}
return false;
}
-
+
/**
* Returns whether the given objects are equal or both <code>null</code>.
- *
+ *
* @param o1 the object
* @param o2 the object to be compared to o1
* @return whether the given objects are equal or both <code>null</code>
@@ -345,6 +349,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#exists()
*/
+ @Override
public boolean exists() {
IFile file = getFile();
if (file != null) {
@@ -363,6 +368,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, boolean)
*/
+ @Override
public boolean getAttribute(String attributeName, boolean defaultValue) throws CoreException {
return getInfo().getBooleanAttribute(attributeName, defaultValue);
}
@@ -370,6 +376,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, int)
*/
+ @Override
public int getAttribute(String attributeName, int defaultValue) throws CoreException {
return getInfo().getIntAttribute(attributeName, defaultValue);
}
@@ -377,27 +384,34 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.List)
*/
- public List getAttribute(String attributeName, List defaultValue) throws CoreException {
+ @Override
+ public List<String> getAttribute(String attributeName, List<String> defaultValue) throws CoreException {
return getInfo().getListAttribute(attributeName, defaultValue);
}
- /**
- * @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.util.Set)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String
+ * , java.util.Set)
*/
- public Set getAttribute(String attributeName, Set defaultValue) throws CoreException {
+ @Override
+ public Set<String> getAttribute(String attributeName, Set<String> 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 {
+ @Override
+ public Map<String, String> getAttribute(String attributeName, Map<String, String> defaultValue) throws CoreException {
return getInfo().getMapAttribute(attributeName, defaultValue);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getAttribute(java.lang.String, java.lang.String)
*/
+ @Override
public String getAttribute(String attributeName, String defaultValue) throws CoreException {
return getInfo().getStringAttribute(attributeName, defaultValue);
}
@@ -405,7 +419,8 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getAttributes()
*/
- public Map getAttributes() throws CoreException {
+ @Override
+ public Map<String, Object> getAttributes() throws CoreException {
LaunchConfigurationInfo info = getInfo();
return info.getAttributes();
}
@@ -413,6 +428,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getCategory()
*/
+ @Override
public String getCategory() throws CoreException {
return getType().getCategory();
}
@@ -420,6 +436,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getFile()
*/
+ @Override
public IFile getFile() {
IContainer container = getContainer();
if (container != null) {
@@ -427,10 +444,10 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
}
return null;
}
-
+
/**
* Returns the simple file name of this launch configuration.
- *
+ *
* @return the simple file name of this launch configuration - for example
* "Abc.launch"
*/
@@ -444,7 +461,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/**
* Returns the info object containing the attributes
* of this configuration
- *
+ *
* @return info for this handle
* @exception CoreException if unable to retrieve the
* info object
@@ -452,19 +469,20 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
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()
*/
+ @Override
public IPath getLocation() {
try {
IFileStore store = getFileStore();
@@ -478,12 +496,12 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
}
return null;
}
-
+
/**
* Returns the file store this configuration is persisted in or <code>null</code> 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, <code>null</code> is returned.
- *
+ *
* @return file store this configuration is persisted in or <code>null</code>
* @throws CoreException if a problem is encountered
* @since 3.5
@@ -503,25 +521,26 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getResource()
*/
+ @Override
public IResource[] getMappedResources() throws CoreException {
- List paths = getAttribute(ATTR_MAPPED_RESOURCE_PATHS, (List)null);
+ List<String> paths = getAttribute(ATTR_MAPPED_RESOURCE_PATHS, (List<String>) null);
if (paths == null || paths.size() == 0) {
return null;
}
- List types = getAttribute(ATTR_MAPPED_RESOURCE_TYPES, (List)null);
+ List<String> types = getAttribute(ATTR_MAPPED_RESOURCE_TYPES, (List<String>) null);
if (types == null || types.size() != paths.size()) {
- throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, null));
+ throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, null));
}
- ArrayList list = new ArrayList();
+ ArrayList<IResource> list = new ArrayList<IResource>();
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);
+ String pathStr = paths.get(i);
+ String typeStr= 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));
+ throw new CoreException(newStatus(DebugCoreMessages.LaunchConfiguration_0, DebugPlugin.ERROR, e));
}
IPath path = Path.fromPortableString(pathStr);
IResource res = null;
@@ -551,12 +570,13 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
if (list.isEmpty()) {
return null;
}
- return (IResource[])list.toArray(new IResource[list.size()]);
+ return list.toArray(new IResource[list.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getMemento()
*/
+ @Override
public String getMemento() throws CoreException {
IPath relativePath = null;
IFile file = getFile();
@@ -582,37 +602,40 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
} catch (TransformerException te) {
e= te;
}
- IStatus status = newStatus(DebugCoreMessages.LaunchConfiguration_16, DebugException.INTERNAL_ERROR, e);
+ IStatus status = newStatus(DebugCoreMessages.LaunchConfiguration_16, DebugException.INTERNAL_ERROR, e);
throw new CoreException(status);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getName()
*/
+ @Override
public String getName() {
return fName;
}
-
+
/**
* Returns the container this configuration is stored in, or <code>null</code>
* if this configuration is local.
- *
+ *
* @return the container this configuration is stored in, or <code>null</code>
* 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));
+ @Override
+ public Set<String> getModes() throws CoreException {
+ Set<String> options = getAttribute(ATTR_LAUNCH_MODES, (Set<String>) null);
+ return (options != null ? new HashSet<String>(options) : new HashSet<String>(0));
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getType()
*/
+ @Override
public ILaunchConfigurationType getType() throws CoreException {
return getInfo().getType();
}
@@ -620,6 +643,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#getWorkingCopy()
*/
+ @Override
public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException {
return new LaunchConfigurationWorkingCopy(this);
}
@@ -627,6 +651,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
IContainer container = getContainer();
if (container == null) {
@@ -635,18 +660,19 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
return getName().hashCode() + container.hashCode();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#hasAttribute(java.lang.String)
*/
+ @Override
public boolean hasAttribute(String attributeName) throws CoreException {
return getInfo().hasAttribute(attributeName);
}
-
+
/**
- * Set the source locator to use with the launch, if specified
+ * 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
* @throws CoreException if a problem is encountered
*/
@@ -662,10 +688,11 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
if (memento == null) {
locator.initializeDefaults(this);
} else {
- if(locator instanceof IPersistableSourceLocator2)
+ if(locator instanceof IPersistableSourceLocator2) {
((IPersistableSourceLocator2)locator).initializeFromMemento(memento, this);
- else
+ } else {
locator.initializeFromMemento(memento);
+ }
}
launch.setSourceLocator(locator);
}
@@ -675,13 +702,15 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#isLocal()
*/
+ @Override
public boolean isLocal() {
return getContainer() == null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#isMigrationCandidate()
*/
+ @Override
public boolean isMigrationCandidate() throws CoreException {
return ((LaunchConfigurationType)getType()).isMigrationCandidate(this);
}
@@ -689,6 +718,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#isWorkingCopy()
*/
+ @Override
public boolean isWorkingCopy() {
return false;
}
@@ -696,6 +726,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException {
return launch(mode, monitor, false);
}
@@ -703,6 +734,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#launch(java.lang.String, org.eclipse.core.runtime.IProgressMonitor, boolean)
*/
+ @Override
public ILaunch launch(String mode, IProgressMonitor monitor, boolean build) throws CoreException {
return launch(mode, monitor, build, true);
}
@@ -710,10 +742,8 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (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();
- }
+ @Override
+ public ILaunch launch(String mode, IProgressMonitor monitor, boolean build, boolean register) throws CoreException {
/* Setup progress monitor
* - Prepare delegate (0)
* - Pre-launch check (1)
@@ -722,16 +752,10 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
* - 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);
+ SubMonitor lmonitor = SubMonitor.convert(monitor, DebugCoreMessages.LaunchConfiguration_9, build ? 23 : 13);
try {
// bug 28245 - force the delegate to load in case it is interested in launch notifications
- Set modes = getModes();
+ Set<String> modes = getModes();
modes.add(mode);
ILaunchDelegate[] delegates = getType().getDelegates(modes);
ILaunchConfigurationDelegate delegate = null;
@@ -742,7 +766,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
if (handler != null) {
handler.handleStatus(delegateNotAvailable, new Object[] {this, mode});
}
- IStatus status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_11, null);
+ IStatus status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_11, null);
throw new CoreException(status);
} else {
ILaunchDelegate del = getPreferredDelegate(modes);
@@ -764,12 +788,12 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
delegate = del.getDelegate();
}
else {
- status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_13, null);
+ 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);
+ status = new Status(IStatus.CANCEL, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, DebugCoreMessages.LaunchConfiguration_13, null);
throw new CoreException(status);
}
}
@@ -777,7 +801,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
delegate = del.getDelegate();
}
}
-
+
ILaunchConfigurationDelegate2 delegate2 = null;
if (delegate instanceof ILaunchConfigurationDelegate2) {
delegate2 = (ILaunchConfigurationDelegate2) delegate;
@@ -792,8 +816,9 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
} 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);
+ IStatus status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR,
+ MessageFormat.format(DebugCoreMessages.LaunchConfiguration_14, new Object[] {
+ mode, launch.getLaunchMode() }), null);
throw new CoreException(status);
}
}
@@ -805,57 +830,58 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
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);
-
+ lmonitor.subTask(DebugCoreMessages.LaunchConfiguration_8);
+
if (delegate2 != null) {
- if (!(delegate2.preLaunchCheck(this, mode, new SubProgressMonitor(monitor, 1)))) {
+ if (!(delegate2.preLaunchCheck(this, mode, new SubProgressMonitor(lmonitor, 1)))) {
return launch;
}
}
else {
- monitor.worked(1); /* No pre-launch-check */
+ lmonitor.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);
+ IProgressMonitor buildMonitor = new SubProgressMonitor(lmonitor, 10, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+ buildMonitor.beginTask(DebugCoreMessages.LaunchConfiguration_7, 10);
buildMonitor.subTask(DebugCoreMessages.LaunchConfiguration_6);
+ boolean tempbuild = build;
if (delegate2 != null) {
- build = delegate2.buildForLaunch(this, mode, new SubProgressMonitor(buildMonitor, 7));
+ tempbuild = delegate2.buildForLaunch(this, mode, new SubProgressMonitor(buildMonitor, 7));
}
- if (build) {
+ if (tempbuild) {
buildMonitor.subTask(DebugCoreMessages.LaunchConfiguration_5);
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(buildMonitor, 3));
+ 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);
+ lmonitor.subTask(DebugCoreMessages.LaunchConfiguration_4);
if (delegate2 != null) {
- if (!(delegate2.finalLaunchCheck(this, mode, new SubProgressMonitor(monitor, 1)))) {
+ if (!(delegate2.finalLaunchCheck(this, mode, new SubProgressMonitor(lmonitor, 1)))) {
return launch;
}
}
else {
- monitor.worked(1); /* No validation */
+ lmonitor.worked(1); /* No validation */
}
if (register) {
getLaunchManager().addLaunch(launch);
}
-
+
try {
//initialize the source locator
- monitor.subTask(DebugCoreMessages.LaunchConfiguration_3);
+ lmonitor.subTask(DebugCoreMessages.LaunchConfiguration_3);
initializeSourceLocator(launch);
- monitor.worked(1);
+ lmonitor.worked(1);
/* Launch the delegate */
- monitor.subTask(DebugCoreMessages.LaunchConfiguration_2);
- delegate.launch(this, mode, launch, new SubProgressMonitor(monitor, 10));
+ lmonitor.subTask(DebugCoreMessages.LaunchConfiguration_2);
+ delegate.launch(this, mode, launch, new SubProgressMonitor(lmonitor, 10));
} catch (CoreException e) {
// if there was an exception, and the launch is empty, remove it
if (!launch.hasChildren()) {
@@ -869,27 +895,28 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
}
throw e;
}
- if (monitor.isCanceled()) {
+ if (lmonitor.isCanceled()) {
getLaunchManager().removeLaunch(launch);
}
return launch;
}
finally {
- monitor.done();
+ lmonitor.done();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#migrate()
*/
- public void migrate() throws CoreException {
+ @Override
+ public void migrate() throws CoreException {
((LaunchConfigurationType)getType()).migrate(this);
}
/**
- * Creates and returns a new error status based on
+ * 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 <code>null</code>
@@ -901,28 +928,29 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/**
* 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 <code>null</code> if stored in the
* local metadata.
- *
+ *
* @param container or <code>null</code>
* @since 3.5
*/
protected void setContainer(IContainer container) {
fContainer = container;
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#supportsMode(java.lang.String)
*/
+ @Override
public boolean supportsMode(String mode) throws CoreException {
return getType().supportsMode(mode);
}
@@ -930,6 +958,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfiguration#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
try {
IFileStore fileStore = getFileStore();
@@ -944,23 +973,25 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
/**
* @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);
+ @Override
+ public ILaunchDelegate getPreferredDelegate(Set<String> modes) throws CoreException {
+ Map<String, String> delegates = getAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, (Map<String, String>) null);
if(delegates != null) {
- String id = (String) delegates.get(modes.toString());
+ String id = delegates.get(modes.toString());
if(id != null) {
return getLaunchManager().getLaunchDelegate(id);
}
}
return null;
}
-
+
/**
* @see java.lang.Object#toString()
*/
+ @Override
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
index 3b2751197..6e633e9b8 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.internal.core;
-
+
import java.util.Comparator;
import org.eclipse.core.runtime.CoreException;
@@ -19,44 +19,46 @@ import org.eclipse.debug.core.DebugPlugin;
/**
* Proxy to a runtime classpath entry resolver extension.
- *
+ *
* @see IConfigurationElementConstants
*/
-public class LaunchConfigurationComparator implements Comparator {
+public class LaunchConfigurationComparator implements Comparator<Object> {
private IConfigurationElement fConfigurationElement;
-
- private Comparator fDelegate;
-
+
+ private Comparator<Object> fDelegate;
+
/**
* Constructs a new resolver on the given configuration element
- *
+ *
* @param element configuration element
*/
public LaunchConfigurationComparator(IConfigurationElement element) {
fConfigurationElement = element;
}
-
+
/**
* Returns the {@link Comparator} delegate
- *
+ *
* @return the {@link Comparator}
*/
- protected Comparator getComparator() {
+ @SuppressWarnings("unchecked")
+ protected Comparator<Object> getComparator() {
if (fDelegate == null) {
try {
- fDelegate = (Comparator)fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
+ fDelegate = (Comparator<Object>) fConfigurationElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
} catch (CoreException e) {
DebugPlugin.log(e);
}
}
return fDelegate;
}
-
+
/**
* @see Comparator#compare(Object, Object)
*/
+ @Override
public int compare(Object o1, Object o2) {
return getComparator().compare(o1, o2);
}
@@ -64,8 +66,13 @@ public class LaunchConfigurationComparator implements Comparator {
/**
* @see Object#equals(Object)
*/
+ @Override
public boolean equals(Object obj) {
return getComparator().equals(obj);
}
+ @Override
+ public int hashCode() {
+ return getComparator().hashCode();
+ }
}
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
index e62171c5f..be5564629 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.internal.core;
-
+
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
@@ -38,12 +38,12 @@ 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
*/
@@ -60,24 +60,26 @@ public class LaunchConfigurationInfo {
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 <code>String</code>s and
- * values are one of <code>String</code>, <code>Integer</code>, or
- * <code>Boolean</code>.
+ * values are one of <code>String</code>, <code>Integer</code>,
+ * <code>Boolean</code>, <code>Set&lt;String&gt;</code>,
+ * <code>List&lt;String&gt;</code>, or
+ * <code>Map&lt;String, String&gt;</code>
*/
- private TreeMap fAttributes;
-
+ private TreeMap<String, Object> 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$
@@ -87,52 +89,52 @@ public class LaunchConfigurationInfo {
}
}
}
-
+
/**
* Constructs a new empty info
*/
protected LaunchConfigurationInfo() {
- setAttributeTable(new TreeMap());
+ setAttributeTable(new TreeMap<String, Object>());
}
-
+
/**
* Returns this configuration's attribute table.
- *
+ *
* @return attribute table
*/
- private TreeMap getAttributeTable() {
+ private TreeMap<String, Object> getAttributeTable() {
return fAttributes;
}
/**
* Sets this configuration's attribute table.
- *
+ *
* @param table
* attribute table
- */
- private void setAttributeTable(TreeMap table) {
+ */
+ private void setAttributeTable(TreeMap<String, Object> table) {
fAttributes = table;
}
-
+
/**
* Sets the attributes in this info to those in the given map.
- *
+ *
* @param map the {@link Map} of attributes to set
*/
- protected void setAttributes(Map map) {
+ protected void setAttributes(Map<String, ?> map) {
if (map == null) {
- setAttributeTable(new TreeMap());
+ setAttributeTable(new TreeMap<String, Object>());
return;
}
- setAttributeTable(new TreeMap(map));
+ setAttributeTable(new TreeMap<String, Object>(map));
}
-
+
/**
* Returns the <code>String</code> attribute with the given key or the
* given default value if undefined.
* @param key the attribute name
* @param defaultValue the value to be returned if the given key does not exist in the attribute table
- *
+ *
* @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
@@ -143,23 +145,23 @@ public class LaunchConfigurationInfo {
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
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_lang_String__1, new Object[] { key }), null
)
);
}
return defaultValue;
}
-
+
/**
* Returns the <code>int</code> attribute with the given key or the given
* default value if undefined.
* @param key the name of the attribute
* @param defaultValue the default value to return if the key does not appear in the attribute table
- *
+ *
* @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
@@ -170,23 +172,23 @@ public class LaunchConfigurationInfo {
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
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_int__2, new Object[] { key }), null
)
);
}
return defaultValue;
}
-
+
/**
* Returns the <code>boolean</code> attribute with the given key or the
* given default value if undefined.
* @param key the name of the attribute
* @param defaultValue the default value to return if the key does not appear in the attribute table
- *
+ *
* @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
@@ -197,123 +199,127 @@ public class LaunchConfigurationInfo {
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
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_boolean__3, new Object[] { key }), null
)
);
}
return defaultValue;
}
-
+
/**
* Returns the <code>java.util.List</code> attribute with the given key or
* the given default value if undefined.
* @param key the name of the attribute
* @param defaultValue the default value to return if the key does not appear in the attribute table
- *
+ *
* @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
* <code>java.util.List</code>
*/
- protected List getListAttribute(String key, List defaultValue) throws CoreException {
+ @SuppressWarnings("unchecked")
+ protected List<String> getListAttribute(String key, List<String> defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
if (attr != null) {
if (attr instanceof List) {
- return (List)attr;
- }
+ return (List<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_util_List__1, new String[] {key}), null
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_List__1, new Object[] { key }), null
)
);
}
return defaultValue;
}
-
+
/**
* Returns the <code>java.util.Set</code> attribute with the given key or
* the given default value if undefined.
+ *
* @param key the name of the attribute
- * @param defaultValue the default value to return if the key does not xist in the attribute table
- *
+ * @param defaultValue the default value to return if the key does not exist
+ * in the attribute table
+ *
* @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
- * <code>java.util.Set</code>
- *
+ * @throws CoreException if the attribute with the given key exists but is
+ * not a <code>java.util.Set</code>
+ *
* @since 3.3
*/
- protected Set getSetAttribute(String key, Set defaultValue) throws CoreException {
+ @SuppressWarnings("unchecked")
+ protected Set<String> getSetAttribute(String key, Set<String> defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
if (attr != null) {
if (attr instanceof Set) {
- return (Set)attr;
- }
+ return (Set<String>) attr;
+ }
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, new String[] {key}), null
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_35, new Object[] { key }), null
)
);
}
return defaultValue;
}
-
+
/**
* Returns the <code>java.util.Map</code> attribute with the given key or
* the given default value if undefined.
* @param key the name of the attribute
* @param defaultValue the default value to return if the key does not exist in the attribute table
- *
+ *
* @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
* <code>java.util.Map</code>
*/
- protected Map getMapAttribute(String key, Map defaultValue) throws CoreException {
+ @SuppressWarnings("unchecked")
+ protected Map<String, String> getMapAttribute(String key, Map<String, String> defaultValue) throws CoreException {
Object attr = getAttributeTable().get(key);
if (attr != null) {
if (attr instanceof Map) {
- return (Map)attr;
- }
+ return (Map<String, 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_util_Map__1, new String[] {key}), null
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_Attribute__0__is_not_of_type_java_util_Map__1, new Object[] { 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() {
@@ -322,20 +328,20 @@ public class LaunchConfigurationInfo {
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();
+ protected TreeMap<String, Object> getAttributes() {
+ return new TreeMap<String, Object>(getAttributeTable());
}
-
+
/**
* Sets the given attribute to the given value. Only working copy's should
* use this API.
- *
+ *
* @param key
* attribute key
* @param value
@@ -348,10 +354,10 @@ public class LaunchConfigurationInfo {
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
@@ -362,22 +368,20 @@ public class LaunchConfigurationInfo {
* @throws TransformerException
* if an exception occurs creating the XML
*/
+ @SuppressWarnings("unchecked")
protected String getAsXML() throws CoreException, IOException, ParserConfigurationException, TransformerException {
-
Document doc = LaunchManager.getDocument();
- Element configRootElement = doc.createElement(LAUNCH_CONFIGURATION);
+ 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();
+
+ configRootElement.setAttribute(TYPE, getType().getIdentifier());
+
+ for (String key : getAttributeTable().keySet()) {
if (key == null) {
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationInfo_36, null
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationInfo_36, null
)
);
}
@@ -389,26 +393,25 @@ public class LaunchConfigurationInfo {
String valueString = null;
if (value instanceof String) {
valueString = (String)value;
- element = createKeyValueElement(doc, STRING_ATTRIBUTE, key, valueString);
+ element = createKeyValueElement(doc, STRING_ATTRIBUTE, key, valueString);
} else if (value instanceof Integer) {
valueString = ((Integer)value).toString();
- element = createKeyValueElement(doc, INT_ATTRIBUTE, key, valueString);
+ 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);
+ element = createKeyValueElement(doc, BOOLEAN_ATTRIBUTE, key, valueString);
+ } else if (value instanceof List) {
+ element = createListElement(doc, LIST_ATTRIBUTE, key, (List<String>) value);
+ } else if (value instanceof Map) {
+ element = createMapElement(doc, MAP_ATTRIBUTE, key, (Map<String, String>) value);
} else if(value instanceof Set) {
- element = createSetElement(doc, SET_ATTRIBUTE, key, (Set)value);
+ element = createSetElement(doc, SET_ATTRIBUTE, key, (Set<String>) 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.
@@ -420,109 +423,105 @@ public class LaunchConfigurationInfo {
*/
protected Element createKeyValueElement(Document doc, String elementType, String key, String value) {
Element element = doc.createElement(elementType);
- element.setAttribute(KEY, key);
+ element.setAttribute(KEY, key);
element.setAttribute(VALUE, value);
return element;
}
-
+
/**
* Creates a new <code>Element</code> for the specified
* <code>java.util.List</code>
- *
+ *
* @param doc the doc to add the element to
* @param elementType the type of the element
* @param listKey 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) {
+ protected Element createListElement(Document doc, String elementType, String listKey, List<String> 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);
+ listElement.setAttribute(KEY, listKey);
+ for (String value : list) {
+ Element element = doc.createElement(LIST_ENTRY);
element.setAttribute(VALUE, value);
listElement.appendChild(element);
- }
+ }
return listElement;
}
-
+
/**
* Creates a new <code>Element</code> for the specified
* <code>java.util.Set</code>
- *
+ *
* @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) {
+ protected Element createSetElement(Document doc, String elementType, String setKey, Set<String> set) {
Element setElement = doc.createElement(elementType);
setElement.setAttribute(KEY, setKey);
// persist in sorted order
- List list = new ArrayList(set);
+ List<String> list = new ArrayList<String>(set);
Collections.sort(list);
Element element = null;
- for(Iterator iter = list.iterator(); iter.hasNext();) {
+ for (String str : list) {
element = doc.createElement(SET_ENTRY);
- element.setAttribute(VALUE, (String) iter.next());
+ element.setAttribute(VALUE, str);
setElement.appendChild(element);
}
return setElement;
}
-
+
/**
* Creates a new <code>Element</code> for the specified
* <code>java.util.Map</code>
- *
+ *
* @param doc the doc to add the element to
* @param elementType the type of the element
* @param mapKey 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) {
+ protected Element createMapElement(Document doc, String elementType, String mapKey, Map<String, String> map) {
Element mapElement = doc.createElement(elementType);
mapElement.setAttribute(KEY, mapKey);
// persist in sorted order based on keys
- List keys = new ArrayList(map.keySet());
+ List<String> keys = new ArrayList<String>(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);
+ for (String key : keys) {
+ String value = map.get(key);
+ Element element = doc.createElement(MAP_ENTRY);
+ element.setAttribute(KEY, key);
+ element.setAttribute(VALUE, value);
mapElement.appendChild(element);
- }
- return mapElement;
+ }
+ return mapElement;
}
-
+
/**
* Initializes the mapping of attributes from the XML file
* @param root the root node from the XML document
* @throws CoreException if a problem is encountered
*/
protected void initializeFromXML(Element root) throws CoreException {
- if (!root.getNodeName().equalsIgnoreCase(LAUNCH_CONFIGURATION)) {
+ if (!root.getNodeName().equalsIgnoreCase(LAUNCH_CONFIGURATION)) {
throw getInvalidFormatDebugException();
}
-
+
// read type
- String id = root.getAttribute(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});
+ String message= MessageFormat.format(DebugCoreMessages.LaunchConfigurationInfo_missing_type, new Object[]{id});
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
@@ -530,7 +529,7 @@ public class LaunchConfigurationInfo {
);
}
setType(type);
-
+
NodeList list = root.getChildNodes();
Node node = null;
Element element = null;
@@ -541,23 +540,23 @@ public class LaunchConfigurationInfo {
if (nodeType == Node.ELEMENT_NODE) {
element = (Element) node;
nodeName = element.getNodeName();
- if (nodeName.equalsIgnoreCase(STRING_ATTRIBUTE)) {
+ if (nodeName.equalsIgnoreCase(STRING_ATTRIBUTE)) {
setStringAttribute(element);
- } else if (nodeName.equalsIgnoreCase(INT_ATTRIBUTE)) {
+ } else if (nodeName.equalsIgnoreCase(INT_ATTRIBUTE)) {
setIntegerAttribute(element);
- } else if (nodeName.equalsIgnoreCase(BOOLEAN_ATTRIBUTE)) {
+ } 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)) {
+ } 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 <code>String</code> from the specified element into the local attribute mapping
* @param element the element to load from
@@ -566,7 +565,7 @@ public class LaunchConfigurationInfo {
protected void setStringAttribute(Element element) throws CoreException {
setAttribute(getKeyAttribute(element), getValueAttribute(element));
}
-
+
/**
* Loads an <code>Integer</code> from the specified element into the local attribute mapping
* @param element the element to load from
@@ -575,7 +574,7 @@ public class LaunchConfigurationInfo {
protected void setIntegerAttribute(Element element) throws CoreException {
setAttribute(getKeyAttribute(element), new Integer(getValueAttribute(element)));
}
-
+
/**
* Loads a <code>Boolean</code> from the specified element into the local attribute mapping
* @param element the element to load from
@@ -584,26 +583,26 @@ public class LaunchConfigurationInfo {
protected void setBooleanAttribute(Element element) throws CoreException {
setAttribute(getKeyAttribute(element), Boolean.valueOf(getValueAttribute(element)));
}
-
+
/**
* Reads a <code>List</code> 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);
+ String listKey = element.getAttribute(KEY);
NodeList nodeList = element.getChildNodes();
int entryCount = nodeList.getLength();
- List list = new ArrayList(entryCount);
+ List<String> list = new ArrayList<String>(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)) {
+ selement = (Element) node;
+ if (!selement.getNodeName().equalsIgnoreCase(LIST_ENTRY)) {
throw getInvalidFormatDebugException();
}
list.add(getValueAttribute(selement));
@@ -611,28 +610,28 @@ public class LaunchConfigurationInfo {
}
setAttribute(listKey, list);
}
-
+
/**
* Reads a <code>Set</code> 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);
+ Set<String> set = new HashSet<String>(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)) {
+ if(!selement.getNodeName().equalsIgnoreCase(SET_ENTRY)) {
throw getInvalidFormatDebugException();
}
set.add(getValueAttribute(selement));
@@ -640,26 +639,26 @@ public class LaunchConfigurationInfo {
}
setAttribute(setKey, set);
}
-
+
/**
* Reads a <code>Map</code> 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);
+ String mapKey = element.getAttribute(KEY);
NodeList nodeList = element.getChildNodes();
int entryCount = nodeList.getLength();
- Map map = new HashMap(entryCount);
+ Map<String, String> map = new HashMap<String, String>(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)) {
+ selement = (Element) node;
+ if (!selement.getNodeName().equalsIgnoreCase(MAP_ENTRY)) {
throw getInvalidFormatDebugException();
}
map.put(getKeyAttribute(selement), getValueAttribute(selement));
@@ -667,7 +666,7 @@ public class LaunchConfigurationInfo {
}
setAttribute(mapKey, map);
}
-
+
/**
* Returns the <code>String</code> representation of the 'key' attribute from the specified element
* @param element the element to read from
@@ -681,7 +680,7 @@ public class LaunchConfigurationInfo {
}
return key;
}
-
+
/**
* Returns the <code>String</code> representation of the 'value' attribute from the specified element
* @param element the element to read from
@@ -689,71 +688,72 @@ public class LaunchConfigurationInfo {
* @throws CoreException if a problem is encountered
*/
protected String getValueAttribute(Element element) throws CoreException {
- String value = element.getAttribute(VALUE);
+ 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
+ return
new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationInfo_Invalid_launch_configuration_XML__10, null
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationInfo_Invalid_launch_configuration_XML__10, null
)
);
}
-
+
/**
* Two <code>LaunchConfigurationInfo</code> 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)
*/
+ @Override
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) {
+ protected boolean compareAttributes(TreeMap<String, Object> map1, TreeMap<String, Object> map2) {
LaunchManager manager = (LaunchManager)DebugPlugin.getDefault().getLaunchManager();
if (map1.size() == map2.size()) {
- Iterator attributes = map1.keySet().iterator();
+ Iterator<String> attributes = map1.keySet().iterator();
while (attributes.hasNext()) {
- String key = (String)attributes.next();
+ String key = attributes.next();
Object attr1 = map1.get(key);
Object attr2 = map2.get(key);
if (attr2 == null) {
return false;
}
- Comparator comp = manager.getComparator(key);
+ Comparator<Object> comp = manager.getComparator(key);
if (comp == null) {
if (fgIsSun14x) {
if(attr2 instanceof String & attr1 instanceof String) {
@@ -776,14 +776,15 @@ public class LaunchConfigurationInfo {
}
}
}
- return true;
+ return true;
}
return false;
}
-
+
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fType.hashCode() + fAttributes.size();
}
@@ -792,20 +793,20 @@ public class LaunchConfigurationInfo {
* Returns if the attribute map contains the specified key
* @param attributeName the name of the attribute to check for
* @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 <code>null</code> if none. Does nothing
* if the attribute name is <code>null</code>
* @param attributeName the name of the attribute to remove
* @return attribute value or <code>null</code>
- *
+ *
* @since 3.4.0
*/
protected Object removeAttribute(String attributeName) {
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
index 39890ae86..8848883ed 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,12 +10,11 @@
*******************************************************************************/
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;
@@ -47,79 +46,80 @@ import com.ibm.icu.text.MessageFormat;
* 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;
-
+ private Set<String> fModes = null;
+
/**
* A set of sets containing all of the supported mode combinations of this type
- *
+ *
* @since 3.3
*/
- private Set fModeCombinations = null;
-
+ private Set<Set<String>> 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;
-
+ private Map<Set<String>, Set<ILaunchDelegate>> 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;
-
+ private Map<Set<String>, ILaunchDelegate> 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)
*/
+ @Override
public String getAttribute(String attributeName) {
return fElement.getAttribute(attributeName);
}
@@ -127,6 +127,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getCategory()
*/
+ @Override
public String getCategory() {
return fElement.getAttribute(IConfigurationElementConstants.CATEGORY);
}
@@ -134,6 +135,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate()
*/
+ @Override
public ILaunchConfigurationDelegate getDelegate() throws CoreException {
return getDelegate(ILaunchManager.RUN_MODE);
}
@@ -141,8 +143,9 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getDelegate(java.lang.String)
*/
+ @Override
public ILaunchConfigurationDelegate getDelegate(String mode) throws CoreException {
- Set modes = new HashSet();
+ Set<String> modes = new HashSet<String>();
modes.add(mode);
ILaunchDelegate[] delegates = getDelegates(modes);
if (delegates.length > 0) {
@@ -153,33 +156,35 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
if (launchMode == null) {
status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7,
- new String[]{mode}));
+ new Object[] { mode }));
} else {
status = new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
MessageFormat.format(DebugCoreMessages.LaunchConfigurationType_7,
- new String[]{((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).getLaunchModeName(mode)}));
+ new Object[] { ((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 {
+ @Override
+ public ILaunchDelegate[] getDelegates(Set<String> modes) throws CoreException {
initializeDelegates();
- Set delegates = (Set) fDelegates.get(modes);
+ Set<ILaunchDelegate> delegates = fDelegates.get(modes);
if (delegates == null) {
delegates = Collections.EMPTY_SET;
}
- return (ILaunchDelegate[]) delegates.toArray(new ILaunchDelegate[delegates.size()]);
+ return 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) {
+ @Override
+ public void setPreferredDelegate(Set<String> modes, ILaunchDelegate delegate) {
if(fPreferredDelegates == null) {
- fPreferredDelegates = new HashMap();
+ fPreferredDelegates = new HashMap<Set<String>, ILaunchDelegate>();
}
if (delegate == null) {
fPreferredDelegates.remove(modes);
@@ -188,15 +193,16 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
}
((LaunchManager)DebugPlugin.getDefault().getLaunchManager()).persistPreferredLaunchDelegate(this);
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchConfigurationType#getPreferredDelegate(java.util.Set)
*/
- public ILaunchDelegate getPreferredDelegate(Set modes) {
+ @Override
+ public ILaunchDelegate getPreferredDelegate(Set<String> modes) {
initializePreferredDelegates();
- return (ILaunchDelegate) fPreferredDelegates.get(modes);
+ return 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.
* <p>
@@ -206,33 +212,31 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* </pre>
* </p>
* @return the <code>java.util.Map</code> of preferred delegates or an empty <code>java.util.Map</code> if no preferred delegates are specified, never <code>null</code>
- *
+ *
* @since 3.3
*/
- public Map getPreferredDelegates() {
+ public Map<Set<String>, ILaunchDelegate> getPreferredDelegates() {
initializePreferredDelegates();
return fPreferredDelegates;
}
-
+
/**
* This method is used to initialize the listing of preferred launch delegates for this type
- *
+ *
* <p>
- * 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.
+ * 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...
* </p>
* @since 3.3
*/
private synchronized void initializePreferredDelegates() {
if(fPreferredDelegates == null) {
- fPreferredDelegates = new HashMap();
+ fPreferredDelegates = new HashMap<Set<String>, ILaunchDelegate>();
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();
+ for (Set<String> modes : fDelegates.keySet()) {
delegate = lm.getPreferredDelegate(getIdentifier(), modes);
if(delegate != null) {
fPreferredDelegates.put(modes, delegate);
@@ -240,27 +244,25 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
}
}
}
-
+
/**
* Initializes the listing of launch delegates for this type
*/
private synchronized void initializeDelegates() {
if (fDelegates == null) {
// initialize delegate
- fDelegates = new Hashtable();
+ fDelegates = new Hashtable<Set<String>, Set<ILaunchDelegate>>();
LaunchDelegate[] launchDelegates = getLaunchDelegateExtensions();
LaunchDelegate delegate = null;
- List modelist = null;
- Set modes = null, tmp = null;
+ List<Set<String>> modelist = null;
+ Set<ILaunchDelegate> 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);
+ for (Set<String> modes : modelist) {
+ tmp = fDelegates.get(modes);
if (tmp == null) {
- tmp = new HashSet();
+ tmp = new HashSet<ILaunchDelegate>();
fDelegates.put(modes, tmp);
}
tmp.add(delegate);
@@ -268,10 +270,10 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
}
}
}
-
+
/**
* Returns all launch delegate extensions registered for this configuration type.
- *
+ *
* @return all launch delegate extensions
*/
private LaunchDelegate[] getLaunchDelegateExtensions() {
@@ -281,6 +283,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getIdentifier()
*/
+ @Override
public String getIdentifier() {
return fElement.getAttribute(IConfigurationElementConstants.ID);
}
@@ -288,6 +291,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getName()
*/
+ @Override
public String getName() {
return fElement.getAttribute(IConfigurationElementConstants.NAME);
}
@@ -295,13 +299,15 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getPluginId()
*/
+ @Override
public String getPluginIdentifier() {
return fElement.getContributor().getName();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSourceLocatorId()
*/
+ @Override
public String getSourceLocatorId() {
if(fSourceLocator == null) {
fSourceLocator = getAttribute(IConfigurationElementConstants.SOURCE_LOCATOR);
@@ -324,11 +330,12 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
}
}
return fSourceLocator;
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSourcePathComputer()
*/
+ @Override
public ISourcePathComputer getSourcePathComputer() {
if(fSourcePathComputer == null) {
//get the id
@@ -340,7 +347,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
if(id != null) {
fSourcePathComputer = DebugPlugin.getDefault().getLaunchManager().getSourcePathComputer(id);
}
- else {
+ 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();
@@ -356,7 +363,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
}
fSourceProvider = null;
}
-
+
}
return fSourcePathComputer;
}
@@ -364,45 +371,41 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModes()
*/
- public Set getSupportedModes() {
+ @Override
+ public Set<String> getSupportedModes() {
if(fModes == null) {
- fModes = new HashSet();
+ fModes = new HashSet<String>();
LaunchDelegate[] delegates = getLaunchDelegateExtensions();
- List modesets = null;
+ List<Set<String>> 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());
+ for (Set<String> modes : modesets) {
+ fModes.addAll(modes);
}
}
}
return fModes;
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchConfigurationType#getSupportedModeCombinations()
*/
- public Set getSupportedModeCombinations() {
+ @Override
+ public Set<Set<String>> 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;
+ return Collections.unmodifiableSet(fModeCombinations);
}
-
+
/**
* 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 if a problem is encountered
- *
+ *
* @since 3.2
*/
public boolean isMigrationCandidate(ILaunchConfiguration candidate) throws CoreException {
@@ -412,7 +415,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
}
return false;
}
-
+
/**
* This method initializes the migration delegate
* @throws CoreException if a problem is encountered
@@ -422,17 +425,18 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
fMigrationDelegate = (ILaunchConfigurationMigrationDelegate) fElement.createExecutableExtension(IConfigurationElementConstants.MIGRATION_DELEGATE);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#isPublic()
*/
+ @Override
public boolean isPublic() {
String publicString = fElement.getAttribute(IConfigurationElementConstants.PUBLIC);
if (publicString != null) {
if (publicString.equalsIgnoreCase("false")) { //$NON-NLS-1$
return false;
}
- }
+ }
return true;
}
@@ -441,7 +445,7 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
* In the event the migration delegate has not been provided do nothing.
* @param candidate the candidate launch configuration to migrate
* @throws CoreException if a problem is encountered
- *
+ *
* @since 3.2
*/
public void migrate(ILaunchConfiguration candidate) throws CoreException {
@@ -450,13 +454,14 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
fMigrationDelegate.migrate(candidate);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#newInstance(org.eclipse.core.resources.IContainer, java.lang.String)
*/
+ @Override
public ILaunchConfigurationWorkingCopy newInstance(IContainer container, String name) throws CoreException {
// validate the configuration name - see bug 275741
- IPath path = new Path(name);
+ IPath path = new Path(name);
if (container == null) {
// not allowed to nest in sub directory when local
if (path.segmentCount() > 1) {
@@ -475,23 +480,23 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/**
* @see org.eclipse.debug.core.ILaunchConfigurationType#supportsMode(java.lang.String)
*/
+ @Override
public boolean supportsMode(String mode) {
if(fModeCombinations == null) {
getSupportedModeCombinations();
}
- Set modes = null;
- for(Iterator iter = fModeCombinations.iterator(); iter.hasNext();) {
- modes = (Set) iter.next();
+ for (Set<String> modes : fModeCombinations) {
if(modes.size() == 1 && modes.contains(mode)) {
return true;
}
}
return false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#getContributorName()
*/
+ @Override
public String getContributorName() {
return fElement.getContributor().getName();
}
@@ -499,14 +504,15 @@ public class LaunchConfigurationType extends PlatformObject implements ILaunchCo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationType#supportsModeCombination(java.util.Set)
*/
- public boolean supportsModeCombination(Set modes) {
+ @Override
+ public boolean supportsModeCombination(Set<String> modes) {
if(fModeCombinations == null) {
getSupportedModeCombinations();
}
return fModeCombinations.contains(modes);
}
- /**
+ /**
* Called on preference import to reset preferred delegates.
*/
void resetPreferredDelegates() {
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
index da3db4b35..372f57c09 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.internal.core;
-
+
import java.io.BufferedOutputStream;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -47,44 +47,44 @@ 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
+ * 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
@@ -96,20 +96,21 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
setOriginal(original);
fSuppressChange = false;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.LaunchConfiguration#initialize()
*/
+ @Override
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
@@ -121,12 +122,12 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
setOriginal((LaunchConfiguration) parent.getOriginal());
fParent = parent;
fSuppressChange = false;
- }
-
+ }
+
/**
- * Constructs a copy of the specified launch
+ * 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
@@ -139,11 +140,11 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
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 <code>null</code> if to be local
* @param name the name of the new launch configuration
@@ -159,6 +160,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfigurationWorkingCopy#isDirty()
*/
+ @Override
public boolean isDirty() {
return fDirty;
}
@@ -166,17 +168,18 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfigurationWorkingCopy#doSave()
*/
+ @Override
public synchronized ILaunchConfiguration doSave() throws CoreException {
return doSave(new NullProgressMonitor());
}
/**
* Saves with progress.
- *
+ *
* @param monitor the {@link IProgressMonitor}
* @return the saved <code>ILaunchConfiguration</code>
* @throws CoreException if a problem is encountered
- *
+ *
* @since 3.3
*/
public synchronized ILaunchConfiguration doSave(IProgressMonitor monitor) throws CoreException {
@@ -206,6 +209,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
if (useRunnable) {
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor pm) throws CoreException {
doSave0(pm);
}
@@ -225,14 +229,14 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
return new LaunchConfiguration(getName(), getContainer());
}
-
+
/**
* Performs the actual saving of the launch configuration.
* @param monitor the {@link IProgressMonitor}
* @throws CoreException if a problem is encountered
*/
private void doSave0(IProgressMonitor monitor) throws CoreException {
- SubMonitor lmonitor = SubMonitor.convert(monitor, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_0, new String[] {getName()}), 2);
+ SubMonitor lmonitor = SubMonitor.convert(monitor, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_0, new Object[] { getName() }), 2);
try {
// set up from/to information if this is a move
boolean moved = (!isNew() && isMoved());
@@ -257,11 +261,11 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
}
}
-
+
/**
* Writes the new configuration information to a file.
* @param monitor the {@link IProgressMonitor}
- *
+ *
* @exception CoreException if writing the file fails
*/
protected void writeNewFile(IProgressMonitor monitor) throws CoreException {
@@ -272,9 +276,9 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
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
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1, new Object[] { e.toString() }), null
)
- );
+ );
}
SubMonitor lmonitor = SubMonitor.convert(monitor, IInternalDebugCoreConstants.EMPTY_STRING, 5);
try {
@@ -288,7 +292,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_4, null
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_4, null
)
);
}
@@ -315,9 +319,9 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
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
+ DebugException.REQUEST_FAILED, MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy__0__occurred_generating_launch_configuration_XML__1, new Object[] { ie.toString() }), null
)
- );
+ );
}
} else {
// use resource API to update configuration file
@@ -327,7 +331,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_5, null
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_5, null
));
}
IContainer dir = file.getParent();
@@ -336,9 +340,9 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2, null
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_Specified_container_for_launch_configuration_does_not_exist_2, null
)
- );
+ );
}
ByteArrayInputStream stream = null;
try {
@@ -348,7 +352,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
throw new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_5, ue
+ DebugException.REQUEST_FAILED, DebugCoreMessages.LaunchConfigurationWorkingCopy_5, ue
));
}
SubMonitor smonitor = null;
@@ -356,7 +360,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
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()}));
+ smonitor.setTaskName(MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_2, new Object[] { getName() }));
file.create(stream, false, smonitor);
} else {
// validate edit
@@ -366,14 +370,14 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
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()}));
+ smonitor.setTaskName(MessageFormat.format(DebugCoreMessages.LaunchConfigurationWorkingCopy_3, new Object[] { getName() }));
file.setContents(stream, true, false, smonitor);
}
}
- // notify of add/change for both local and shared configurations - see bug 288368
+ // notify of add/change for both local and shared configurations - see bug 288368
if (added) {
getLaunchManager().launchConfigurationAdded(new LaunchConfiguration(getName(), getContainer()));
} else {
@@ -402,10 +406,11 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
}
}
-
+
/**
* @see ILaunchConfigurationWorkingCopy#setAttribute(String, int)
*/
+ @Override
public void setAttribute(String attributeName, int value) {
getInfo().setAttribute(attributeName, new Integer(value));
setDirty();
@@ -414,6 +419,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfigurationWorkingCopy#setAttribute(String, String)
*/
+ @Override
public void setAttribute(String attributeName, String value) {
getInfo().setAttribute(attributeName, value);
setDirty();
@@ -422,15 +428,17 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfigurationWorkingCopy#setAttribute(String, boolean)
*/
+ @Override
public void setAttribute(String attributeName, boolean value) {
getInfo().setAttribute(attributeName, Boolean.valueOf(value));
- setDirty();
+ setDirty();
}
/**
* @see ILaunchConfigurationWorkingCopy#setAttribute(String, List)
*/
- public void setAttribute(String attributeName, List value) {
+ @Override
+ public void setAttribute(String attributeName, List<String> value) {
getInfo().setAttribute(attributeName, value);
setDirty();
}
@@ -438,15 +446,17 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfigurationWorkingCopy#setAttribute(String, Map)
*/
- public void setAttribute(String attributeName, Map value) {
+ @Override
+ public void setAttribute(String attributeName, Map<String, String> 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) {
+ @Override
+ public void setAttribute(String attributeName, Set<String> value) {
getInfo().setAttribute(attributeName, value);
setDirty();
}
@@ -454,6 +464,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfigurationWorkingCopy#getOriginal()
*/
+ @Override
public ILaunchConfiguration getOriginal() {
ILaunchConfiguration config = fOriginal;
ILaunchConfigurationWorkingCopy parent = fParent;
@@ -463,20 +474,21 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
return config;
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#getParent()
*/
+ @Override
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
@@ -488,21 +500,21 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
setInfo(info.getCopy());
fDirty = false;
}
-
+
/**
* Sets the launch configuration this working copy
* is based on.
- *
- * @param original the launch configuration this working
+ *
+ * @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
*/
@@ -513,20 +525,22 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see ILaunchConfiguration#isWorkingCopy()
*/
+ @Override
public boolean isWorkingCopy() {
return true;
}
-
+
/**
* A working copy keeps a local info object that is not
* cached with the launch manager.
- *
+ *
* @see LaunchConfiguration#getInfo()
*/
+ @Override
protected LaunchConfigurationInfo getInfo() {
return fInfo;
}
-
+
/**
* Sets this working copy's state to dirty.
* Notifies listeners that this working copy has
@@ -536,13 +550,14 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
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) {
+ @Override
+ public void setModes(Set<String> modes) {
getInfo().setAttribute(ATTR_LAUNCH_MODES, (modes.size() > 0 ? modes : null));
setDirty();
}
@@ -550,70 +565,74 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#addModes(java.util.Set)
*/
- public void addModes(Set modes) {
+ @Override
+ public void addModes(Set<String> modes) {
try {
- Set opts = getModes();
+ Set<String> 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) {
+ @Override
+ public void removeModes(Set<String> options) {
try {
- Set opts = getModes();
+ Set<String> 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)
*/
+ @Override
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
*/
+ @Override
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
*/
@@ -628,19 +647,20 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
}
if (newContainer == null) {
return !originalContainer.equals(newContainer);
- }
+ }
return !newContainer.equals(originalContainer);
- }
-
+ }
+
/**
* A working copy cannot generate a memento.
- *
+ *
* @see ILaunchConfiguration#getMemento()
*/
+ @Override
public String getMemento() {
return null;
- }
-
+ }
+
/**
* Returns whether change notification should be
* suppressed
@@ -649,10 +669,11 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
protected boolean suppressChangeNotification() {
return fSuppressChange;
}
-
+
/**
* @see ILaunchConfigurationWorkingCopy#setContainer(IContainer)
*/
+ @Override
public void setContainer(IContainer container) {
if (equalOrNull(getContainer(), container)) {
return;
@@ -660,11 +681,15 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
super.setContainer(container);
setDirty();
}
-
- /**
- * @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setAttributes(java.util.Map)
- */
- public void setAttributes(Map attributes) {
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setAttributes(
+ * java.util.Map)
+ */
+ @Override
+ public void setAttributes(Map<String, ? extends Object> attributes) {
getInfo().setAttributes(attributes);
setDirty();
}
@@ -672,12 +697,13 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setResource(org.eclipse.core.resources.IResource)
*/
+ @Override
public void setMappedResources(IResource[] resources) {
- ArrayList paths = null;
- ArrayList types = null;
+ ArrayList<String> paths = null;
+ ArrayList<String> types = null;
if(resources != null && resources.length > 0) {
- paths = new ArrayList(resources.length);
- types = new ArrayList(resources.length);
+ paths = new ArrayList<String>(resources.length);
+ types = new ArrayList<String>(resources.length);
for (int i = 0; i < resources.length; i++) {
IResource resource = resources[i];
if(resource != null) {
@@ -693,31 +719,31 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/**
* @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#setPreferredLaunchDelegate(java.util.Set, java.lang.String)
*/
- public void setPreferredLaunchDelegate(Set modes, String delegateId) {
+ @Override
+ public void setPreferredLaunchDelegate(Set<String> modes, String delegateId) {
if(modes != null) {
try {
- Map delegates = getAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, (Map)null);
+ Map<String, String> delegates = getAttribute(LaunchConfiguration.ATTR_PREFERRED_LAUNCHERS, (Map<String, String>) 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);
+ Map<String, String> map = new HashMap<String, String>();
+ 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
*/
+ @Override
public ILaunchConfigurationWorkingCopy getWorkingCopy() throws CoreException {
return new LaunchConfigurationWorkingCopy(this);
}
@@ -725,6 +751,7 @@ public class LaunchConfigurationWorkingCopy extends LaunchConfiguration implemen
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeAttribute(java.lang.String)
*/
+ @Override
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
index 8ec2e22b9..e6dddf937 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@ import com.ibm.icu.text.MessageFormat;
/**
* Proxy to a launch delegate extension
* Clients can contribute launch delegates through the <code>launchDelegates</code> extension point
- *
+ *
* Example contribution of the local java launch delegate
* <pre>
* <extension point="org.eclipse.debug.core.launchDelegates">
@@ -39,36 +39,36 @@ import com.ibm.icu.text.MessageFormat;
modes="run, debug"
name="%localJavaApplication"
type="org.eclipse.jdt.launching.localJavaApplication">
- <modeCombination
+ <modeCombination
modes="run, profile">
perspective="com.example.Perspective">
</modeCombination>
</launchDelegate>
* </pre>
- *
+ *
* 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;
+
+ //a listing of sets of
+ private List<Set<String>> fLaunchModes = null;
private String fType = null;
- private HashMap fPerspectiveIds = null;
-
+ private HashMap<Set<String>, String> fPerspectiveIds = null;
+
/**
* Constructor
* @param element the configuration element to associate with this launch delegate
@@ -76,17 +76,18 @@ public final class LaunchDelegate implements ILaunchDelegate {
public LaunchDelegate(IConfigurationElement element) {
fElement = element;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchDelegateProxy#getDelegate()
*/
+ @Override
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));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, MessageFormat.format(DebugCoreMessages.LaunchDelegate_3, new Object[] { getId() }), null));
}
}
return fDelegate;
@@ -95,6 +96,7 @@ public final class LaunchDelegate implements ILaunchDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchDelegateProxy#getId()
*/
+ @Override
public String getId() {
return fElement.getAttribute(IConfigurationElementConstants.ID);
}
@@ -114,16 +116,16 @@ public final class LaunchDelegate implements ILaunchDelegate {
}
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);
+ private Set<String> parseModes(IConfigurationElement element) {
+ HashSet<String> set = new HashSet<String>();
+ String modes = element.getAttribute(IConfigurationElementConstants.MODES);
if (modes != null) {
String[] strings = modes.split(","); //$NON-NLS-1$
for (int i = 0; i < strings.length; i++) {
@@ -132,16 +134,17 @@ public final class LaunchDelegate implements ILaunchDelegate {
}
return set;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchDelegateProxy#getModes()
*/
- public List getModes() {
+ @Override
+ public List<Set<String>> getModes() {
if(fLaunchModes == null) {
- fLaunchModes = new ArrayList();
- fPerspectiveIds = new HashMap();
+ fLaunchModes = new ArrayList<Set<String>>();
+ fPerspectiveIds = new HashMap<Set<String>, String>();
IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.MODE_COMBINATION);
- Set modeset = null;
+ Set<String> modeset = null;
for (int i = 0; i < children.length; i++) {
modeset = parseModes(children[i]);
fLaunchModes.add(modeset);
@@ -150,11 +153,11 @@ public final class LaunchDelegate implements ILaunchDelegate {
//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);
+ 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 = new HashSet<String>();
modeset.add(strings[i].trim());
fLaunchModes.add(modeset);
}
@@ -162,11 +165,12 @@ public final class LaunchDelegate implements ILaunchDelegate {
}
return fLaunchModes;
}
-
+
/**
* Returns the human readable name for this launch delegate
* @return the human readable name for this launch delegate, or <code>null</code> if none
*/
+ @Override
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);
@@ -177,23 +181,24 @@ public final class LaunchDelegate implements ILaunchDelegate {
}
name = name.trim();
if (Character.isUpperCase(name.charAt(0))) {
- name = MessageFormat.format(DebugCoreMessages.LaunchDelegate_1, new String[]{name});
+ name = MessageFormat.format(DebugCoreMessages.LaunchDelegate_1, new Object[] { name });
} else {
- name = MessageFormat.format(DebugCoreMessages.LaunchDelegate_2, new String[]{name});
+ name = MessageFormat.format(DebugCoreMessages.LaunchDelegate_2, new Object[] { name });
}
}
return name;
}
-
+
/**
* Returns the contributor name of this delegate (plug-in name).
- *
+ *
* @return contributor name
*/
+ @Override
public String getContributorName() {
return fElement.getContributor().getName();
}
-
+
/**
* Returns the associated source locator id or <code>null</code>
* @return the associated source locator id or <code>null</code> if not provided
@@ -209,10 +214,11 @@ public final class LaunchDelegate implements ILaunchDelegate {
public String getSourcePathComputerId() {
return fElement.getAttribute(IConfigurationElementConstants.SOURCE_PATH_COMPUTER);
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchDelegate#getDescription()
*/
+ @Override
public String getDescription() {
String desc = fElement.getAttribute(IConfigurationElementConstants.DELEGATE_DESCRIPTION);
if(desc == null) {
@@ -220,10 +226,11 @@ public final class LaunchDelegate implements ILaunchDelegate {
}
return desc;
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchDelegate#getPluginIdentifier()
*/
+ @Override
public String getPluginIdentifier() {
return fElement.getContributor().getName();
}
@@ -231,6 +238,7 @@ public final class LaunchDelegate implements ILaunchDelegate {
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if(obj == null) {
return false;
@@ -238,13 +246,20 @@ public final class LaunchDelegate implements ILaunchDelegate {
return obj instanceof ILaunchDelegate && getId() != null && getId().equals(((ILaunchDelegate)obj).getId());
}
+ @Override
+ public int hashCode() {
+ String id = getId();
+ return id == null ? 0 : id.hashCode();
+ }
+
/**
* @see org.eclipse.debug.core.ILaunchDelegate#getPerspectiveId(java.util.Set)
*/
- public String getPerspectiveId(Set modes) {
+ @Override
+ public String getPerspectiveId(Set<String> modes) {
if(fPerspectiveIds == null) {
getModes();
}
- return (String) fPerspectiveIds.get(modes);
+ return 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
index 6352f866d..0d77b6204 100644
--- 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
@@ -4,14 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.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
+ * Marc Khouzam - Bug 313143: Preferred Launch Delegate not recovered from preferences
*******************************************************************************/
package org.eclipse.debug.internal.core;
@@ -30,17 +30,16 @@ import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
+import java.util.Collections;
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.Map.Entry;
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;
@@ -74,12 +73,12 @@ 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.runtime.SubMonitor;
import org.eclipse.core.variables.VariablesPlugin;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
@@ -119,75 +118,76 @@ import com.ibm.icu.text.MessageFormat;
* @see ILaunchManager
*/
public class LaunchManager extends PlatformObject implements ILaunchManager, IResourceChangeListener {
-
+
/**
- * Preferred launch delegate preference name.
+ * Preferred launch delegate preference name.
* <p>
- * Prior to 3.5 this preferred launch delegates for all launch
+ * 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.
+ * and stored in this preference.
* </p>
* <p>
- * 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
+ * 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$
-
+
/**
* 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$
+ 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)
*/
+ @Override
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);
@@ -195,7 +195,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Notifies the given listener of the add/change/remove
- *
+ *
* @param configuration the configuration that has changed
* @param update the type of change
*/
@@ -210,12 +210,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
fConfiguration = null;
- fListener = null;
+ fListener = null;
}
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -227,24 +228,27 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
case CHANGED:
fListener.launchConfigurationChanged(fConfiguration);
break;
- }
+ default:
+ 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)
*/
+ @Override
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);
@@ -252,7 +256,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Notifies the given listener of the adds/changes/removes
- *
+ *
* @param launches the launches that changed
* @param update the type of change
*/
@@ -264,15 +268,16 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
for (int i= 0; i < copiedListeners.length; i++) {
fListener = (ILaunchesListener)copiedListeners[i];
SafeRunner.run(this);
- }
+ }
fNotifierLaunches = null;
fRegistered = null;
- fListener = null;
+ fListener = null;
}
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -284,15 +289,15 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
case CHANGED:
case TERMINATE:
if (fRegistered == null) {
- List registered = null;
+ List<ILaunch> 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);
+ registered = new ArrayList<ILaunch>(fNotifierLaunches.length);
for (int k = 0; k < j; k++) {
registered.add(fNotifierLaunches[k]);
}
@@ -302,7 +307,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (registered == null) {
fRegistered = fNotifierLaunches;
} else {
- fRegistered = (ILaunch[])registered.toArray(new ILaunch[registered.size()]);
+ fRegistered = registered.toArray(new ILaunch[registered.size()]);
}
}
if (fRegistered.length > 0) {
@@ -314,33 +319,34 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
break;
+ default:
+ 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)
*/
+ @Override
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());
- }
+ ArrayList<ILaunchConfiguration> configs = collectAssociatedLaunches(delta.getResource());
+ for (ILaunchConfiguration config : configs) {
+ try {
+ config.delete();
+ } catch (CoreException e) {
+ DebugPlugin.log(e.getStatus());
}
}
return false;
@@ -348,15 +354,16 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
return true;
}
}
-
+
/**
* Visitor for handling resource deltas.
*/
class LaunchManagerVisitor implements IResourceDeltaVisitor {
-
+
/**
* @see IResourceDeltaVisitor#visit(IResourceDelta)
*/
+ @Override
public boolean visit(IResourceDelta delta) {
if (delta == null) {
return false;
@@ -366,7 +373,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
IProject project = (IProject)delta.getResource();
if (project.isOpen()) {
LaunchManager.this.projectOpened(project);
- } else {
+ } else {
LaunchManager.this.projectClosed(project);
}
}
@@ -377,7 +384,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
IFile file = (IFile)resource;
if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equals(file.getFileExtension())) {
ILaunchConfiguration handle = new LaunchConfiguration(file);
- switch (delta.getKind()) {
+ switch (delta.getKind()) {
case IResourceDelta.ADDED :
LaunchManager.this.launchConfigurationAdded(handle);
break;
@@ -387,6 +394,8 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
case IResourceDelta.CHANGED :
LaunchManager.this.launchConfigurationChanged(handle);
break;
+ default:
+ break;
}
}
return false;
@@ -394,20 +403,21 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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)
*/
+ @Override
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);
@@ -415,7 +425,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Notifies listeners of the add/change/remove
- *
+ *
* @param launch the launch that has changed
* @param update the type of change
*/
@@ -426,14 +436,15 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
for (int i= 0; i < copiedListeners.length; i++) {
fListener = (ILaunchListener)copiedListeners[i];
SafeRunner.run(this);
- }
+ }
fLaunch = null;
- fListener = null;
+ fListener = null;
}
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -447,24 +458,27 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fListener.launchChanged(fLaunch);
}
break;
- }
+ default:
+ break;
+ }
}
}
-
+
/**
* Collects files whose extension matches the launch configuration file
* extension.
*/
class ResourceProxyVisitor implements IResourceProxyVisitor {
-
- private List fList;
-
- protected ResourceProxyVisitor(List list) {
+
+ private List<IResource> fList;
+
+ protected ResourceProxyVisitor(List<IResource> list) {
fList= list;
}
/**
* @see org.eclipse.core.resources.IResourceProxyVisitor#visit(org.eclipse.core.resources.IResourceProxy)
*/
+ @Override
public boolean visit(IResourceProxy proxy) {
if (proxy.getType() == IResource.FILE) {
if (ILaunchConfiguration.LAUNCH_CONFIGURATION_FILE_EXTENSION.equalsIgnoreCase(proxy.requestFullPath().getFileExtension())) {
@@ -475,36 +489,36 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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) {
+ private Set<String> fModes = null;
+
+ public PreferredDelegate(ILaunchDelegate delegate, String typeid, Set<String> modes) {
fDelegate = delegate;
fTypeid = typeid;
fModes = modes;
}
-
+
public String getTypeId() {
return fTypeid;
}
-
- public Set getModes() {
+
+ public Set<String> getModes() {
return fModes;
}
-
+
public ILaunchDelegate getDelegate() {
return fDelegate;
}
}
-
+
/**
* Types of notifications
*/
@@ -512,14 +526,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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;
-
+ private static HashMap<String, String> fgNativeEnv = null;
+ private static HashMap<String, String> fgNativeEnvCasePreserved = null;
+
/**
* Path to the local directory where local launch configurations
* are stored with the workspace.
@@ -542,7 +556,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* 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
@@ -557,179 +571,189 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
DOMSource source = new DOMSource(doc);
StreamResult outputTarget = new StreamResult(s);
transformer.transform(source, outputTarget);
- return s.toString("UTF8"); //$NON-NLS-1$
+ return s.toString("UTF8"); //$NON-NLS-1$
}
-
+
/**
* Collection of defined launch configuration type
* extensions.
*/
- private List fLaunchConfigurationTypes = null;
+ private List<ILaunchConfigurationType> fLaunchConfigurationTypes = null;
/**
* Launch configuration cache. Keys are <code>LaunchConfiguration</code>,
* values are <code>LaunchConfigurationInfo</code>.
*/
- private Map fLaunchConfigurations = new HashMap(10);
-
+ private Map<ILaunchConfiguration, LaunchConfigurationInfo> fLaunchConfigurations = new HashMap<ILaunchConfiguration, LaunchConfigurationInfo>(10);
+
/**
* A cache of launch configuration names currently in the workspace.
*/
private String[] fSortedConfigNames = null;
-
+
/**
* Collection of all launch configurations in the workspace.
* <code>List</code> of <code>ILaunchConfiguration</code>.
*/
- private List fLaunchConfigurationIndex = null;
-
+ private List<ILaunchConfiguration> fLaunchConfigurationIndex = null;
+
/**
* Launch configuration comparator extensions,
* keyed by attribute name.
*/
- private Map fComparators = null;
-
+ private Map<String, LaunchConfigurationComparator> fComparators = null;
+
/**
* Registered launch modes, or <code>null</code> if not initialized.
* Keys are mode identifiers, values are <code>ILaunchMode</code>s.
*/
- private Map fLaunchModes = null;
-
+ private Map<String, ILaunchMode> fLaunchModes = null;
+
/**
* A map of LaunchDelegate objects stored by id of delegate, or launch config type
*/
- private HashMap fLaunchDelegates = null;
-
+ private HashMap<String, LaunchDelegate> fLaunchDelegates = null;
+
/**
* Initial startup cache of preferred delegate so that the debug preferences are only parsed once
- *
+ *
* @since 3.3
*/
- private Set fPreferredDelegates = null;
-
+ private Set<PreferredDelegate> fPreferredDelegates = null;
+
/**
* Collection of launches
*/
- private List fLaunches= new ArrayList(10);
+ private List<ILaunch> fLaunches = new ArrayList<ILaunch>(10);
/**
- * Set of launches for efficient 'isRegistered()' check
+ * Set of launches for efficient 'isRegistered()' check TODO remove this -
+ * Launches don't implement hashCode() or equals() - so its no more
+ * efficient than walking the other collection
*/
- private Set fLaunchSet = new HashSet(10);
-
+ private Set<ILaunch> fLaunchSet = new HashSet<ILaunch>(10);
+
/**
* Collection of listeners
*/
private ListenerList fListeners = new ListenerList();
-
+
/**
* Collection of "plural" listeners.
* @since 2.1
*/
- private ListenerList fLaunchesListeners = new ListenerList();
-
+ 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;
+ private Map<String, IConfigurationElement> fSourceLocators = null;
/**
* The handles of launch configurations being moved, or <code>null</code>
*/
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;
-
+ private Map<String, ISourceContainerType> sourceContainerTypes;
+
/**
* Map of source path computer extensions. Keys are extension ids
* and values are associated configuration elements.
*/
- private Map sourcePathComputers;
-
- private Set fActiveModes;
+ private Map<String, ISourcePathComputer> sourcePathComputers;
+
+ /**
+ * TODO, we can probably remove this too
+ */
+ private Set<String> fActiveModes;
/**
* @see ILaunchManager#addLaunch(ILaunch)
*/
+ @Override
public void addLaunch(ILaunch launch) {
if (internalAddLaunch(launch)) {
fireUpdate(launch, ADDED);
fireUpdate(new ILaunch[] {launch}, ADDED);
}
}
-
+
/**
* @see ILaunchManager#addLaunchConfigurationListener(ILaunchConfigurationListener)
*/
+ @Override
public void addLaunchConfigurationListener(ILaunchConfigurationListener listener) {
fLaunchConfigurationListeners.add(listener);
- }
-
+ }
+
/**
* @see org.eclipse.debug.core.ILaunchManager#addLaunches(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void addLaunches(ILaunch[] launches) {
- List added = new ArrayList(launches.length);
+ List<ILaunch> added = new ArrayList<ILaunch>(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()]);
+ ILaunch[] addedLaunches = 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)
*/
+ @Override
public void addLaunchListener(ILaunchesListener listener) {
fLaunchesListeners.add(listener);
- }
-
+ }
+
/**
* @see ILaunchManager#addLaunchListener(ILaunchListener)
*/
+ @Override
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.
@@ -738,13 +762,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* 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
+ * method preserves mixed-case keys using the variable names
* recorded by the OS.
* </p>
* @param cache the map
* @since 3.1
- */
- private void cacheNativeEnvironment(Map cache) {
+ */
+ private void cacheNativeEnvironment(Map<String, String> cache) {
try {
String nativeCommand= null;
boolean isWin9xME= false; //see bug 50567
@@ -779,13 +803,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (!file.delete()) {
file.deleteOnExit(); // if delete() fails try again on VM close
}
- for (Enumeration enumeration = p.keys(); enumeration.hasMoreElements();) {
+ for (Entry<Object, Object> entry : p.entrySet()) {
// 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();
+ String key = (String) entry.getKey();
//no need to cast value
- cache.put(key, p.get(key));
+ cache.put(key, (String) p.get(key));
}
} else {
//read process directly on other platforms
@@ -860,10 +884,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fLaunchConfigurationIndex.clear();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getEncoding(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public String getEncoding(ILaunchConfiguration configuration) throws CoreException {
String encoding = configuration.getAttribute(DebugPlugin.ATTR_CONSOLE_ENCODING, (String)null);
if(encoding == null) {
@@ -873,7 +898,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if(res instanceof IFile) {
return ((IFile)res).getCharset();
}
- else if(res instanceof IContainer) {
+ else if(res instanceof IContainer) {
return ((IContainer)res).getDefaultCharset();
}
}
@@ -883,7 +908,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
return encoding;
}
-
+
/**
* The launch config name cache is cleared when a config is added, deleted or changed.
*/
@@ -901,17 +926,17 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
return new DebugException(
new Status(
IStatus.ERROR, DebugPlugin.getUniqueIdentifier(),
- DebugException.REQUEST_FAILED, message, throwable
+ 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.
- *
+ *
* @param stream the {@link InputStream} to read from
* @return the new {@link LaunchConfigurationInfo}
* @throws CoreException if a problem is encountered
@@ -930,38 +955,36 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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
* @return all launch configurations in the given container
*/
- protected List findLaunchConfigurations(IContainer container) {
- List list = new ArrayList(10);
+ protected List<ILaunchConfiguration> findLaunchConfigurations(IContainer container) {
if (container instanceof IProject && !((IProject)container).isOpen()) {
- return list;
+ return Collections.EMPTY_LIST;
}
+ List<IResource> list = new ArrayList<IResource>(10);
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());
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(list.size());
+ for (IResource resource : list) {
+ ILaunchConfiguration config = getLaunchConfiguration((IFile) resource);
if(config != null && config.exists()) {
configs.add(config);
}
}
return configs;
}
-
+
/**
* Searches for the {@link ILaunchConfiguration} with the given name
* @param name the name to search for
@@ -979,37 +1002,41 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
return null;
}
-
+
/**
* Finds and returns all local launch configurations.
*
* @return all local launch configurations
*/
- protected List findLocalLaunchConfigurations() {
+ protected List<ILaunchConfiguration> 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() {
+ @Override
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);
+ if (files.length > 0) {
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(10);
+ 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;
}
}
- return configs;
+ return Collections.EMPTY_LIST;
}
-
+
/**
* Fires notification to (single) listeners that a launch has been
* added/changed/removed.
- *
+ *
* @param launch launch that has changed
* @param update type of change
*/
@@ -1020,7 +1047,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Fires notification to (plural) listeners that a launch has been
* added/changed/removed.
- *
+ *
* @param launches launches that have changed
* @param update type of change
*/
@@ -1031,47 +1058,50 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#generateUniqueLaunchConfigurationNameFrom(java.lang.String)
*/
+ @Override
public String generateUniqueLaunchConfigurationNameFrom(String baseName) {
int index = 1;
- int length= baseName.length();
+ int length = baseName.length();
int copyIndex = baseName.lastIndexOf(" ("); //$NON-NLS-1$
+ String base = baseName;
if (copyIndex > -1 && length > copyIndex + 2 && baseName.charAt(length - 1) == ')') {
- String trailer = baseName.substring(copyIndex + 2, length -1);
+ String trailer = baseName.substring(copyIndex + 2, length - 1);
if (isNumber(trailer)) {
try {
index = Integer.parseInt(trailer);
- baseName = baseName.substring(0, copyIndex);
- }
+ base = baseName.substring(0, copyIndex);
+ }
catch (NumberFormatException nfe) {}
}
- }
- String newName = baseName;
+ }
+ String newName = base;
while (isExistingLaunchConfigurationName(newName)) {
- newName = MessageFormat.format(DebugCoreMessages.LaunchManager_31, new String[] {baseName, Integer.toString(index)});
+ newName = MessageFormat.format(DebugCoreMessages.LaunchManager_31, new Object[] {
+ base, 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 <code>basename</code> as a starting point. If
+ * The name that is returned uses the <code>basename</code> as a starting point. If
* there is no existing launch configuration with this name, then <code>basename</code>
* is returned. Otherwise, the value returned consists of the specified base plus
* some suffix that guarantees uniqueness. Passing <code>null</code> as the set of reserved names will cause this
* method to return <code>generateUniqueLaunchConfigurationNameFrom(String baseName)</code>.
- *
+ *
* 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) {
+ public String generateUniqueLaunchConfigurationNameFrom(String basename, Set<String> reservednames) {
if(reservednames == null) {
return generateUniqueLaunchConfigurationNameFrom(basename);
}
@@ -1085,46 +1115,46 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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++;
+ index++;
buffer.append(')');
newname = buffer.toString();
- }
+ }
return newname;
}
-
+
/**
- * Returns a collection of all launch configuration handles in
+ * 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() {
+ private synchronized List<ILaunchConfiguration> getAllLaunchConfigurations() {
if (fLaunchConfigurationIndex == null) {
- try {
- fLaunchConfigurationIndex = new ArrayList(20);
- List configs = findLocalLaunchConfigurations();
+ try {
+ fLaunchConfigurationIndex = new ArrayList<ILaunchConfiguration>(20);
+ List<ILaunchConfiguration> configs = findLocalLaunchConfigurations();
verifyConfigurations(configs, fLaunchConfigurationIndex);
configs = findLaunchConfigurations(ResourcesPlugin.getWorkspace().getRoot());
verifyConfigurations(configs, fLaunchConfigurationIndex);
} finally {
- hookResourceChangeListener();
+ hookResourceChangeListener();
}
}
return fLaunchConfigurationIndex;
}
-
+
/**
- * Return a sorted array of the names of all <code>ILaunchConfiguration</code>s in
+ * Return a sorted array of the names of all <code>ILaunchConfiguration</code>s in
* the workspace. These are cached, and cache is cleared when a new config is added,
* deleted or changed.
* @return the sorted array of {@link ILaunchConfiguration} names
@@ -1140,51 +1170,51 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
return fSortedConfigNames;
}
-
+
/**
* Returns the comparator registered for the given attribute, or
* <code>null</code> if none.
- *
+ *
* @param attributeName attribute for which a comparator is required
* @return comparator, or <code>null</code> if none
*/
- protected Comparator getComparator(String attributeName) {
- Map map = getComparators();
- return (Comparator)map.get(attributeName);
+ protected Comparator<Object> getComparator(String attributeName) {
+ Map<String, LaunchConfigurationComparator> map = getComparators();
+ return map.get(attributeName);
}
-
+
/**
* Returns comparators, loading if required
* @return the complete map of {@link ILaunchConfiguration} {@link Comparator}s
*/
- protected Map getComparators() {
+ protected Map<String, LaunchConfigurationComparator> getComparators() {
initializeComparators();
return fComparators;
- }
-
+ }
+
/**
* Returns the launch configurations specified by the given
* XML document.
- *
+ *
* @param root XML document
* @return list of launch configurations
* @throws CoreException if a problem is encountered
- */
- protected List getConfigsFromXML(Element root) throws CoreException {
- DebugException invalidFormat =
+ */
+ protected List<ILaunchConfiguration> 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
+ 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);
+
+ // read each launch configuration
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(4);
NodeList list = root.getChildNodes();
int length = list.getLength();
Node node = null;
@@ -1207,34 +1237,32 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
return configs;
}
-
+
protected ConfigurationNotifier getConfigurationNotifier() {
return new ConfigurationNotifier();
- }
-
+ }
+
/**
* @see ILaunchManager#getDebugTargets()
*/
+ @Override
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]);
- }
+ List<IDebugTarget> allTargets = new ArrayList<IDebugTarget>(fLaunches.size());
+ IDebugTarget[] targets = null;
+ for (ILaunch launch : fLaunches) {
+ targets = launch.getDebugTargets();
+ for (int i = 0; i < targets.length; i++) {
+ allTargets.add(targets[i]);
}
}
- return (IDebugTarget[])allTargets.toArray(new IDebugTarget[allTargets.size()]);
+ return 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() {
@@ -1243,11 +1271,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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() {
@@ -1260,32 +1288,28 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getEnvironment(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public String[] getEnvironment(ILaunchConfiguration configuration) throws CoreException {
- Map configEnv = configuration.getAttribute(ATTR_ENVIRONMENT_VARIABLES, (Map) null);
+ Map<String, String> configEnv = configuration.getAttribute(ATTR_ENVIRONMENT_VARIABLES, (Map<String, String>) null);
if (configEnv == null) {
return null;
}
- Map env = new HashMap();
+ Map<String, String> env = new HashMap<String, String>();
// 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();
+ for (Entry<String, String> entry : configEnv.entrySet()) {
+ key = entry.getKey();
+ value = entry.getValue();
// translate any string substitution variables
if (value != null) {
value = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(value);
@@ -1301,10 +1325,8 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
// 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();
+ for (Entry<String, String> nativeEntry : env.entrySet()) {
+ nativeKey = (nativeEntry).getKey();
if (nativeKey.equalsIgnoreCase(key)) {
nativeEntry.setValue(value);
added = true;
@@ -1316,34 +1338,31 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (!added) {
env.put(key, value);
}
- }
-
- iter = env.entrySet().iterator();
- List strings = new ArrayList(env.size());
+ }
+ List<String> strings = new ArrayList<String>(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());
+ for (Entry<String, String> entry : env.entrySet()) {
+ buffer = new StringBuffer(entry.getKey());
+ buffer.append('=').append(entry.getValue());
strings.add(buffer.toString());
}
- return (String[]) strings.toArray(new String[strings.size()]);
+ return 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.
* @param config the {@link ILaunchConfiguration} to get the info object from
* @return the {@link LaunchConfigurationInfo} object from the given {@link ILaunchConfiguration}
- *
+ *
* @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);
+ LaunchConfigurationInfo info = fLaunchConfigurations.get(config);
if (info == null) {
IFileStore store = config.getFileStore();
if (config.exists()) {
@@ -1355,100 +1374,99 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fLaunchConfigurations.put(config, info);
}
} catch (FileNotFoundException e) {
- throwException(config, e);
+ throwException(config, e);
} catch (SAXException e) {
- throwException(config, e);
+ throwException(config, e);
} catch (ParserConfigurationException e) {
- throwException(config, e);
+ throwException(config, e);
} catch (IOException e) {
- throwException(config, e);
+ throwException(config, e);
} finally {
if (stream != null) {
try {
stream.close();
} catch (IOException e) {
- throwException(config, 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);
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager_does_not_exist, new Object[] {
+ config.getName(), store.toURI().toString() }), null);
} else {
- throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager_does_not_exist_no_store_found, new String[]{config.getName()}), null);
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager_does_not_exist_no_store_found, new Object[] { config.getName() }), null);
}
}
}
return info;
}
-
+
/**
* @see ILaunchManager#getLaunchConfiguration(IFile)
*/
+ @Override
public ILaunchConfiguration getLaunchConfiguration(IFile file) {
hookResourceChangeListener();
return new LaunchConfiguration(file);
}
-
+
/**
* @see ILaunchManager#getLaunchConfiguration(String)
*/
+ @Override
public ILaunchConfiguration getLaunchConfiguration(String memento) throws CoreException {
hookResourceChangeListener();
return new LaunchConfiguration(memento);
}
-
+
/**
* @see ILaunchManager#getLaunchConfigurations()
*/
+ @Override
public synchronized ILaunchConfiguration[] getLaunchConfigurations() {
- List allConfigs = getAllLaunchConfigurations();
- return (ILaunchConfiguration[])allConfigs.toArray(new ILaunchConfiguration[allConfigs.size()]);
- }
-
+ List<ILaunchConfiguration> allConfigs = getAllLaunchConfigurations();
+ return allConfigs.toArray(new ILaunchConfiguration[allConfigs.size()]);
+ }
+
/**
* @see ILaunchManager#getLaunchConfigurations(ILaunchConfigurationType)
*/
+ @Override
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();
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
if (config.getType().equals(type)) {
configs.add(config);
}
}
- return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
+ return 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();
+ protected synchronized List<ILaunchConfiguration> getLaunchConfigurations(IProject project) {
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
+ IFile file = config.getFile();
if (file != null && file.getProject().equals(project)) {
configs.add(config);
}
}
return configs;
}
-
+
/**
* @see ILaunchManager#getLaunchConfigurationType(String)
*/
+ @Override
public ILaunchConfigurationType getLaunchConfigurationType(String id) {
ILaunchConfigurationType[] types = getLaunchConfigurationTypes();
for(int i = 0; i < types.length; i++) {
@@ -1462,79 +1480,82 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* @see ILaunchManager#getLaunchConfigurationTypes()
*/
+ @Override
public ILaunchConfigurationType[] getLaunchConfigurationTypes() {
initializeLaunchConfigurationTypes();
- return (ILaunchConfigurationType[])fLaunchConfigurationTypes.toArray(new ILaunchConfigurationType[fLaunchConfigurationTypes.size()]);
+ return fLaunchConfigurationTypes.toArray(new ILaunchConfigurationType[fLaunchConfigurationTypes.size()]);
}
-
+
/**
* @see ILaunchManager#getLaunches()
*/
+ @Override
public ILaunch[] getLaunches() {
synchronized (fLaunches) {
- return (ILaunch[])fLaunches.toArray(new ILaunch[fLaunches.size()]);
+ return fLaunches.toArray(new ILaunch[fLaunches.size()]);
}
}
-
+
/**)
* @see org.eclipse.debug.core.ILaunchManager#getLaunchMode(java.lang.String)
*/
+ @Override
public ILaunchMode getLaunchMode(String mode) {
initializeLaunchModes();
- return (ILaunchMode) fLaunchModes.get(mode);
+ return fLaunchModes.get(mode);
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchManager#getLaunchModes()
*/
+ @Override
public ILaunchMode[] getLaunchModes() {
initializeLaunchModes();
- Collection collection = fLaunchModes.values();
- return (ILaunchMode[]) collection.toArray(new ILaunchMode[collection.size()]);
+ Collection<ILaunchMode> collection = fLaunchModes.values();
+ return 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 <code>IlaunchDelegate.getDelegate</code> 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()]);
+ Collection<LaunchDelegate> col = fLaunchDelegates.values();
+ return col.toArray(new ILaunchDelegate[col.size()]);
}
-
+
/**
- * Returns the listing of launch delegates that apply to the specified
+ * Returns the listing of launch delegates that apply to the specified
* <code>ILaunchConfigurationType</code> id
- * @param typeid the id of the launch configuration type to get delegates for
+ * @param typeid the id of the launch configuration type to get delegates for
* @return An array of <code>LaunchDelegate</code>s that apply to the specified launch configuration
* type, or an empty array, never <code>null</code>
- *
+ *
* @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)) {
+ ArrayList<LaunchDelegate> list = new ArrayList<LaunchDelegate>();
+ for (Entry<String, LaunchDelegate> entry : fLaunchDelegates.entrySet()) {
+ LaunchDelegate ld = entry.getValue();
+ if (ld.getLaunchConfigurationTypeId().equals(typeid)) {
list.add(ld);
}
}
- return (LaunchDelegate[]) list.toArray(new LaunchDelegate[list.size()]);
+ return list.toArray(new LaunchDelegate[list.size()]);
}
-
+
/**
- * This method returns the <code>ILaunchDelegate</code> instance corresponding to the id
+ * This method returns the <code>ILaunchDelegate</code> instance corresponding to the id
* of the launch delegate specified
- * @param id the id of the <code>ILaunchDelegate</code> to find
+ * @param id the id of the <code>ILaunchDelegate</code> to find
* @return the <code>ILaunchDelegate</code> or <code>null</code> if not found
- *
+ *
* @since 3.3
*/
public ILaunchDelegate getLaunchDelegate(String id) {
@@ -1548,15 +1569,15 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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();
+ fLaunchDelegates = new HashMap<String, LaunchDelegate>();
//get all launch delegate contributions
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_DELEGATES);
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
@@ -1577,11 +1598,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
}
-
+
/**
* This method is used to initialize a simple listing of all preferred delegates, which is then used by each
* <code>ILaunchConfigurationType</code> to find if they have preferred delegates. Once an <code>ILaunchConfigurationType</code>
- * has used this listing to initialize its preferred delegates it will maintain changes to its preferred delegate, which are
+ * 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.
* <p>
* This cache is not synchronized with the runtime preferred delegates stored in launch configuration types.
@@ -1590,7 +1611,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
*/
private synchronized void initializePreferredDelegates() {
if(fPreferredDelegates == null) {
- fPreferredDelegates = new HashSet();
+ fPreferredDelegates = new HashSet<PreferredDelegate>();
String preferred = Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), LaunchManager.PREF_PREFERRED_DELEGATES, IInternalDebugCoreConstants.EMPTY_STRING, null);
if(!IInternalDebugCoreConstants.EMPTY_STRING.equals(preferred)) {
try {
@@ -1598,13 +1619,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
NodeList nodes = root.getElementsByTagName(IConfigurationElementConstants.DELEGATE);
Element element = null;
String typeid = null;
- Set modeset = null;
+ Set<String> modeset = null;
for(int i = 0; i < nodes.getLength(); i++) {
element = (Element) nodes.item(i);
- String delegateid = element.getAttribute(IConfigurationElementConstants.ID);
+ 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));
+ modeset = new HashSet<String>(Arrays.asList(modes));
LaunchDelegate delegate = getLaunchDelegateExtension(typeid, delegateid, modeset);
if (delegate != null) {
//take type id, modeset, delegate and create entry
@@ -1614,51 +1635,49 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
}
- catch (CoreException e) {DebugPlugin.log(e);}
+ catch (CoreException e) {DebugPlugin.log(e);}
}
}
}
-
+
/**
- * Allows internal access to reset preferred delegates when re-importing
- * preferences.
- *
+ * 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 <code>ILaunchConfigurationType</code> 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 <code>null</code> if none
- *
+ *
* @since 3.3
*/
- protected ILaunchDelegate getPreferredDelegate(String typeid, Set modes) {
- // Retrieve preferred delegates using legacy mechanism for backward
+ protected ILaunchDelegate getPreferredDelegate(String typeid, Set<String> 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();
+ for (PreferredDelegate pd : fPreferredDelegates) {
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.
+ // 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();
+ HashSet<String> modeset = new HashSet<String>();
while(tokenizer2.hasMoreTokens()) {
modeset.add(tokenizer2.nextToken());
}
@@ -1667,28 +1686,28 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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
+ * @param modeset Set of modes that the launch delegate applies to.
+ * @return The launch delegate matching the specified parameters, or
* <code>null</code> if not found.
- *
+ *
* @since 3.5
*/
- private LaunchDelegate getLaunchDelegateExtension(String typeId, String id, Set modeset) {
+ private LaunchDelegate getLaunchDelegateExtension(String typeId, String id, Set<String> 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(id.equals(extensions[j].getId())) {
+ List<Set<String>> modesets = extensions[j].getModes();
if(modesets.contains(modeset)) {
return extensions[j];
}
@@ -1696,25 +1715,22 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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();
+ protected synchronized List<ILaunchConfiguration> getLocalLaunchConfigurations() {
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
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
@@ -1722,138 +1738,140 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @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();
+ List<ILaunchConfiguration> configurations = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
+ try {
+ IResource[] resources = config.getMappedResources();
if(resources != null) {
for(int j = 0; j < resources.length; j++) {
if(resources[j].equals(resource)) {
- configurations.add(configs[i]);
+ configurations.add(config);
+ break;
}
}
}
+ } catch (CoreException ce) {
+ DebugPlugin.log(ce);
}
}
- catch(CoreException e) {DebugPlugin.log(e);}
- return (ILaunchConfiguration[])configurations.toArray(new ILaunchConfiguration[configurations.size()]);
+ return configurations.toArray(new ILaunchConfiguration[configurations.size()]);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getMigrationCandidates()
*/
+ @Override
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]);
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
+ if (!config.isReadOnly() && config.isMigrationCandidate()) {
+ configs.add(config);
}
}
- return (ILaunchConfiguration[])configs.toArray(new ILaunchConfiguration[configs.size()]);
+ return configs.toArray(new ILaunchConfiguration[configs.size()]);
}
-
+
/**
* @see org.eclipse.debug.core.ILaunchManager#getMovedFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
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)
*/
+ @Override
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() {
+ @Override
+ public synchronized Map<String, String> getNativeEnvironment() {
if (fgNativeEnv == null) {
- Map casePreserved = getNativeEnvironmentCasePreserved();
+ Map<String, String> 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());
+ fgNativeEnv = new HashMap<String, String>();
+ for (Entry<String, String> entry : casePreserved.entrySet()) {
+ fgNativeEnv.put(entry.getKey().toUpperCase(), entry.getValue());
}
} else {
- fgNativeEnv = new HashMap(casePreserved);
+ fgNativeEnv = new HashMap<String, String>(casePreserved);
}
}
- return new HashMap(fgNativeEnv);
- }
-
+ return new HashMap<String, String>(fgNativeEnv);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getNativeEnvironmentCasePreserved()
*/
- public synchronized Map getNativeEnvironmentCasePreserved() {
+ @Override
+ public synchronized Map<String, String> getNativeEnvironmentCasePreserved() {
if (fgNativeEnvCasePreserved == null) {
- fgNativeEnvCasePreserved= new HashMap();
+ fgNativeEnvCasePreserved = new HashMap<String, String>();
cacheNativeEnvironment(fgNativeEnvCasePreserved);
}
- return new HashMap(fgNativeEnvCasePreserved);
+ return new HashMap<String, String>(fgNativeEnvCasePreserved);
}
-
+
/**
* @see ILaunchManager#getProcesses()
*/
+ @Override
public IProcess[] getProcesses() {
synchronized (fLaunches) {
- List allProcesses = new ArrayList(fLaunches.size());
- Iterator e = fLaunches.iterator();
+ List<IProcess> allProcesses = new ArrayList<IProcess>(fLaunches.size());
IProcess[] processes = null;
- while (e.hasNext()) {
- processes = ((ILaunch) e.next()).getProcesses();
+ for (ILaunch launch : fLaunches) {
+ processes = launch.getProcesses();
for (int i= 0; i < processes.length; i++) {
allProcesses.add(processes[i]);
}
}
- return (IProcess[])allProcesses.toArray(new IProcess[allProcesses.size()]);
+ return allProcesses.toArray(new IProcess[allProcesses.size()]);
}
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getSourceContainerType(java.lang.String)
*/
+ @Override
public ISourceContainerType getSourceContainerType(String id) {
initializeSourceContainerTypes();
- return (ISourceContainerType) sourceContainerTypes.get(id);
+ return sourceContainerTypes.get(id);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getSourceContainerTypes()
*/
+ @Override
public ISourceContainerType[] getSourceContainerTypes() {
initializeSourceContainerTypes();
- Collection containers = sourceContainerTypes.values();
- return (ISourceContainerType[]) containers.toArray(new ISourceContainerType[containers.size()]);
+ Collection<ISourceContainerType> containers = sourceContainerTypes.values();
+ return containers.toArray(new ISourceContainerType[containers.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#newSourcePathComputer(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
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();
+ //use default computer for configuration type, if any
+ return configuration.getType().getSourcePathComputer();
}
return getSourcePathComputer(id);
}
@@ -1861,9 +1879,10 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#getSourcePathComputer(java.lang.String)
*/
+ @Override
public ISourcePathComputer getSourcePathComputer(String id) {
initializeSourceContainerTypes();
- return (ISourcePathComputer) sourcePathComputers.get(id);
+ return sourcePathComputers.get(id);
}
/**
@@ -1875,7 +1894,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fListening = true;
}
}
-
+
/**
* Load comparator extensions.
*/
@@ -1883,18 +1902,18 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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);
+ fComparators = new HashMap<String, LaunchConfigurationComparator>(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$
+ 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$
+ MessageFormat.format("Invalid launch configuration comparator extension defined by plug-in {0} - attribute not specified.", new Object[] { configurationElement.getContributor().getName() }), null); //$NON-NLS-1$
DebugPlugin.log(s);
}
}
@@ -1909,13 +1928,13 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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 = new ArrayList<ILaunchConfigurationType>(infos.length);
+ for (int i= 0; i < infos.length; i++) {
fLaunchConfigurationTypes.add(new LaunchConfigurationType(infos[i]));
}
}
}
-
+
/**
* Load comparator extensions.
*/
@@ -1924,17 +1943,17 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
try {
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_LAUNCH_MODES);
IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fLaunchModes = new HashMap();
+ fLaunchModes = new HashMap<String, ILaunchMode>();
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.
*/
@@ -1942,7 +1961,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (sourceContainerTypes == null) {
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_CONTAINER_TYPES);
IConfigurationElement[] extensions = extensionPoint.getConfigurationElements();
- sourceContainerTypes = new HashMap();
+ sourceContainerTypes = new HashMap<String, ISourceContainerType>();
for (int i = 0; i < extensions.length; i++) {
sourceContainerTypes.put(
extensions[i].getAttribute(IConfigurationElementConstants.ID),
@@ -1950,7 +1969,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_PATH_COMPUTERS);
extensions = extensionPoint.getConfigurationElements();
- sourcePathComputers = new HashMap();
+ sourcePathComputers = new HashMap<String, ISourcePathComputer>();
for (int i = 0; i < extensions.length; i++) {
sourcePathComputers.put(
extensions[i].getAttribute(IConfigurationElementConstants.ID),
@@ -1966,18 +1985,18 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (fSourceLocators == null) {
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugPlugin.getUniqueIdentifier(), DebugPlugin.EXTENSION_POINT_SOURCE_LOCATORS);
IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
- fSourceLocators= new HashMap(infos.length);
+ fSourceLocators = new HashMap<String, IConfigurationElement>(infos.length);
IConfigurationElement configurationElement = null;
String id = null;
for (int i= 0; i < infos.length; i++) {
configurationElement = infos[i];
- id = configurationElement.getAttribute(IConfigurationElementConstants.ID);
+ 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$
+ MessageFormat.format("Invalid source locator extension defined by plug-in \"{0}\": \"id\" not specified.", new Object[] { configurationElement.getContributor().getName() }), null); //$NON-NLS-1$
DebugPlugin.log(s);
}
}
@@ -1987,7 +2006,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* 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
*/
@@ -2007,7 +2026,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* 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
*/
@@ -2023,15 +2042,16 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* @see ILaunchManager#isExistingLaunchConfigurationName(String)
*/
+ @Override
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
* @param string the {@link String} to check
@@ -2049,20 +2069,21 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true, null);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchManager#isRegistered(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public boolean isRegistered(ILaunch launch) {
synchronized (fLaunches) {
return fLaunchSet.contains(launch);
@@ -2072,7 +2093,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* 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
*/
@@ -2089,26 +2110,26 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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)) {
+ if (isValid(config)) {
boolean added = false;
synchronized (this) {
- List allConfigs = getAllLaunchConfigurations();
+ List<ILaunchConfiguration> allConfigs = getAllLaunchConfigurations();
if (!allConfigs.contains(config)) {
allConfigs.add(config);
added = true;
- }
+ }
}
if (added) {
getConfigurationNotifier().notify(config, ADDED);
@@ -2118,14 +2139,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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) {
@@ -2141,15 +2162,15 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
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) {
@@ -2157,120 +2178,119 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
synchronized (this) {
Object key = fLaunchConfigurations.remove(config);
removed = key != null;
- getAllLaunchConfigurations().remove(config);
+ getAllLaunchConfigurations().remove(config);
}
if (removed) {
getConfigurationNotifier().notify(config, REMOVED);
clearConfigNameCache();
}
}
-
+
/**
* @see ILaunchManager#newSourceLocator(String)
*/
+ @Override
public IPersistableSourceLocator newSourceLocator(String identifier) throws CoreException {
initializeSourceLocators();
- IConfigurationElement config = (IConfigurationElement)fSourceLocators.get(identifier);
+ IConfigurationElement config = 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));
- }
+ MessageFormat.format(DebugCoreMessages.LaunchManager_Source_locator_does_not_exist___0__13, new Object[] { 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
*/
protected void projectClosed(IProject project) {
- List configs = getLaunchConfigurations(project);
- if (!configs.isEmpty()) {
- Iterator iterator = configs.iterator();
- while (iterator.hasNext()) {
- launchConfigurationDeleted((ILaunchConfiguration)iterator.next());
- }
+ for (ILaunchConfiguration config : getLaunchConfigurations(project)) {
+ launchConfigurationDeleted(config);
}
//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
*/
protected void projectOpened(IProject project) {
- List configs = findLaunchConfigurations(project);
- if (!configs.isEmpty()) {
- Iterator iterator = configs.iterator();
- while (iterator.hasNext()) {
- launchConfigurationAdded((ILaunchConfiguration) iterator.next());
- }
+ for (ILaunchConfiguration config : findLaunchConfigurations(project)) {
+ launchConfigurationAdded(config);
}
}
-
+
/**
* @see ILaunchManager#removeLaunch(ILaunch)
*/
+ @Override
public void removeLaunch(final ILaunch launch) {
if (internalRemoveLaunch(launch)) {
fireUpdate(launch, REMOVED);
fireUpdate(new ILaunch[] {launch}, REMOVED);
}
}
-
+
/**
* @see ILaunchManager#removeLaunchConfigurationListener(ILaunchConfigurationListener)
*/
+ @Override
public void removeLaunchConfigurationListener(ILaunchConfigurationListener listener) {
fLaunchConfigurationListeners.remove(listener);
}
-
- /**
+
+ /**
* @see org.eclipse.debug.core.ILaunchManager#removeLaunches(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void removeLaunches(ILaunch[] launches) {
- List removed = new ArrayList(launches.length);
+ List<ILaunch> removed = new ArrayList<ILaunch>(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()]);
+ ILaunch[] removedLaunches = 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)
*/
+ @Override
public void removeLaunchListener(ILaunchesListener listener) {
fLaunchesListeners.remove(listener);
}
-
+
/**
* @see ILaunchManager#removeLaunchListener(ILaunchListener)
*/
+ @Override
public void removeLaunchListener(ILaunchListener listener) {
fListeners.remove(listener);
}
-
+
/**
* Traverses the delta looking for added/removed/changed launch
* configuration files.
- *
+ *
* @see IResourceChangeListener#resourceChanged(IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
IResourceDelta delta = event.getDelta();
if (delta != null) {
@@ -2289,18 +2309,18 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
}
-
+
/**
* Gets the launch configuration associated with the specified <code>IResource</code>.
- * This method relies on the resource mapping existing, if no such mapping
+ * 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 {
+ private ArrayList<ILaunchConfiguration> collectAssociatedLaunches(IResource resource) {
+ ArrayList<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
+ try {
ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurations();
IResource[] resources = null;
for(int i = 0; i < configs.length; i++) {
@@ -2308,7 +2328,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
resources = configs[i].getMappedResources();
if(resources != null) {
for(int j = 0; j < resources.length; j++){
- if(resource.equals(resources[j]) ||
+ if(resource.equals(resources[j]) ||
resource.getFullPath().isPrefixOf(resources[j].getFullPath())) {
list.add(configs[i]);
break;
@@ -2322,11 +2342,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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
* <code>null</code>
* @param to the location a launch configuration is being moved to,
@@ -2364,7 +2384,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
}
-
+
persistPreferredLaunchDelegates();
clearAllLaunchConfigurations();
fStepFilterManager = null;
@@ -2373,7 +2393,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* Saves the listings of preferred launch delegates from all of the launch configuration types
- *
+ *
* @since 3.3
*/
public void persistPreferredLaunchDelegates() {
@@ -2384,31 +2404,26 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
/**
- * Persists the given launch configuration delegate.
+ * 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();
+ Map<Set<String>, ILaunchDelegate> 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) {
+ for (Entry<Set<String>, ILaunchDelegate> entry : preferred.entrySet()) {
+ Set<String> modes = entry.getKey();
+ ILaunchDelegate delegate = entry.getValue();
+ 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(';');
+ for (String mode : modes) {
+ str.append(mode).append(',');
}
+ str.append(';');
}
}
Preferences.setString(DebugPlugin.getUniqueIdentifier(), preferenceName, str.toString(), null);
@@ -2439,7 +2454,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
catch(CoreException e) {DebugPlugin.log(e);}
}
-
+
/**
* Throws a debug exception with the given throwable that occurred
* while processing the given configuration.
@@ -2457,32 +2472,30 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
} catch (CoreException ce) {
}
- throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager__0__occurred_while_reading_launch_configuration_file__1___1, new String[]{e.toString(), uri}), e);
+ throw createDebugException(MessageFormat.format(DebugCoreMessages.LaunchManager__0__occurred_while_reading_launch_configuration_file__1___1, new Object[] {
+ 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();
+ protected void verifyConfigurations(List<ILaunchConfiguration> verify, List<ILaunchConfiguration> valid) {
+ for (ILaunchConfiguration config : verify) {
if (!valid.contains(config) && isValid(config)) {
valid.add(config);
}
- }
+ }
}
-
+
/**
* Returns the name of the given launch mode with accelerators removed,
* or <code>null</code> if none.
- *
+ *
* @param id launch mode identifier
* @return launch mode name with accelerators removed or <code>null</code>
*/
@@ -2495,7 +2508,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
/**
* Returns the label with any accelerators removed.
- *
+ *
* @param label label to process
* @return label without accelerators
*/
@@ -2520,11 +2533,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
}
return title;
- }
-
+ }
+
/**
* Returns the singleton step filter manager.
- *
+ *
* @return the step filter manager
*/
public synchronized StepFilterManager getStepFilterManager() {
@@ -2532,8 +2545,8 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
fStepFilterManager = new StepFilterManager();
}
return fStepFilterManager;
- }
-
+ }
+
/**
* Imports launch configurations represented by the given local files, overwriting
* any existing configurations. Sends launch configuration change notification
@@ -2548,14 +2561,8 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
* @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();
+ Map<String, ILaunchConfiguration> sharedConfigs = new HashMap<String, ILaunchConfiguration>();
+ for (ILaunchConfiguration config : getAllLaunchConfigurations()) {
if (!config.isLocal()) {
StringBuffer buf = new StringBuffer(config.getName());
buf.append('.');
@@ -2563,13 +2570,14 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
sharedConfigs.put(buf.toString(), config);
}
}
- monitor.beginTask(DebugCoreMessages.LaunchManager_29, files.length);
+ List<Status> stati = null;
+ SubMonitor lmonitor = SubMonitor.convert(monitor, DebugCoreMessages.LaunchManager_29, files.length);
for (int i = 0; i < files.length; i++) {
- if (monitor.isCanceled()) {
+ if (lmonitor.isCanceled()) {
break;
}
File source = files[i];
- monitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchManager_28, new String[]{source.getName()}));
+ lmonitor.subTask(MessageFormat.format(DebugCoreMessages.LaunchManager_28, new Object[] { source.getName() }));
IPath location = new Path(LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.toOSString()).append(source.getName());
File target = location.toFile();
IPath locationdir = location.removeLastSegments(1);
@@ -2580,7 +2588,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
try {
copyFile(source, target);
ILaunchConfiguration configuration = new LaunchConfiguration(LaunchConfiguration.getSimpleName(source.getName()), null);
- ILaunchConfiguration shared = (ILaunchConfiguration) sharedConfigs.get(target.getName());
+ ILaunchConfiguration shared = sharedConfigs.get(target.getName());
if (shared != null) {
setMovedFromTo(shared, configuration);
shared.delete();
@@ -2592,33 +2600,32 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
} catch (IOException e) {
if (stati == null) {
- stati = new ArrayList();
+ stati = new ArrayList<Status>();
}
stati.add(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR,
- MessageFormat.format(DebugCoreMessages.LaunchManager_27, new String[]{source.getPath()}), e));
+ MessageFormat.format(DebugCoreMessages.LaunchManager_27, new Object[] { source.getPath() }), e));
}
- monitor.worked(1);
+ lmonitor.worked(1);
}
- if (!monitor.isCanceled()) {
- monitor.done();
+ if (!lmonitor.isCanceled()) {
+ lmonitor.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());
+ for (Status status : stati) {
+ multi.add(status);
}
throw new CoreException(multi);
} else {
- throw new CoreException((IStatus) stati.get(0));
+ throw new CoreException(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 if the file read fails
@@ -2634,11 +2641,11 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
}
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
*/
@@ -2646,7 +2653,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
if (fActiveModes == null) {
ILaunchConfigurationType[] types = getLaunchConfigurationTypes();
ILaunchMode[] modes = getLaunchModes();
- fActiveModes = new HashSet(3);
+ fActiveModes = new HashSet<String>(3);
for (int i = 0; i < types.length; i++) {
for (int j = 0; j < modes.length; j++) {
if (types[i].supportsMode(modes[j].getIdentifier())) {
@@ -2661,6 +2668,7 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* @see org.eclipse.debug.core.ILaunchManager#generateLaunchConfigurationName(java.lang.String)
*/
+ @Override
public String generateLaunchConfigurationName(String namePrefix) {
String name = generateUniqueLaunchConfigurationNameFrom(namePrefix);
try {
@@ -2688,20 +2696,21 @@ public class LaunchManager extends PlatformObject implements ILaunchManager, IRe
/**
* @see org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(java.lang.String)
*/
+ @Override
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}));
+ throw new IllegalArgumentException(MessageFormat.format(DebugCoreMessages.LaunchManager_invalid_config_name, new Object[] { 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])}));
+ throw new IllegalArgumentException(MessageFormat.format(DebugCoreMessages.LaunchManager_invalid_config_name_char, new Object[] { 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
index d596460ca..d06a264d5 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,6 @@
*******************************************************************************/
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;
@@ -18,18 +17,20 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchMode;
+import com.ibm.icu.text.MessageFormat;
+
/**
* 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
*/
@@ -40,18 +41,18 @@ public class LaunchMode implements ILaunchMode {
/**
* 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
* @param name the attribute name to check
- *
+ *
* @exception CoreException if attribute does not exist
*/
private void verifyAttributeExists(String name) throws CoreException {
@@ -62,23 +63,25 @@ public class LaunchMode implements ILaunchMode {
/**
* This method is used to create a new internal error describing that the specified attribute
- * is missing
+ * is missing
* @param attrName the name of the attribute that is missing
* @throws CoreException if a problem is encountered
*/
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));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, MessageFormat.format(DebugCoreMessages.LaunchMode_1, new Object[] { attrName }), null));
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchMode#getIdentifier()
*/
+ @Override
public String getIdentifier() {
return fConfigurationElement.getAttribute(IConfigurationElementConstants.MODE);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchMode#getLabel()
*/
+ @Override
public String getLabel() {
return fConfigurationElement.getAttribute(IConfigurationElementConstants.LABEL);
}
@@ -86,10 +89,11 @@ public class LaunchMode implements ILaunchMode {
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchMode#getLaunchAsLabel()
*/
+ @Override
public String getLaunchAsLabel() {
String label = fConfigurationElement.getAttribute(IConfigurationElementConstants.LAUNCH_AS_LABEL);
if (label == null) {
- return MessageFormat.format(DebugCoreMessages.LaunchMode_0, new String[]{getLabel()});
+ return MessageFormat.format(DebugCoreMessages.LaunchMode_0, new Object[] { 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
index 70175ead8..ffa3853fa 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,6 +22,7 @@ public class LaunchablePropertyTester extends PropertyTester {
/**
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if ("launchable".equals(property)) { //$NON-NLS-1$
if (((LaunchManager)(DebugPlugin.getDefault().getLaunchManager())).launchModeAvailable((String)expectedValue)) {
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
index abe87bd1c..6368d709b 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,11 +12,10 @@ 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 java.util.StringTokenizer;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -28,14 +27,14 @@ 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;
+ private List<LogicalStructureType> fTypes = null;
+ private List<LogicalStructureProvider> fTypeProviders;
/**
* Map containing the user's selection for each combination of logical
@@ -45,15 +44,15 @@ public class LogicalStructureManager {
* 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;
+ private Map<String, Integer> 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;
-
+ private List<String> 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:
@@ -68,14 +67,14 @@ public class LogicalStructureManager {
* 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
@@ -84,29 +83,27 @@ public class LogicalStructureManager {
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();
+ List<ILogicalStructureType> select = new ArrayList<ILogicalStructureType>();
+ for (ILogicalStructureType type : fTypes) {
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]);
+ for (LogicalStructureProvider provider : fTypeProviders) {
+ ILogicalStructureType[] types = provider.getLogicalStructures(value);
+ for (int i = 0; i < types.length; i++) {
+ select.add(types[i]);
}
}
- return (ILogicalStructureType[]) select.toArray(new ILogicalStructureType[select.size()]);
+ return select.toArray(new ILogicalStructureType[select.size()]);
}
-
+
/**
* Loads the map of structure selections from the preference store.
*/
private void loadStructureTypeSelections() {
- fStructureTypeSelections= new HashMap();
+ fStructureTypeSelections = new HashMap<String, Integer>();
String selections= Platform.getPreferencesService().getString(DebugPlugin.getUniqueIdentifier(), PREF_STRUCTURE_SELECTIONS, IInternalDebugCoreConstants.EMPTY_STRING, null);
// selections are stored in the form:
// selection|selection|...selection|
@@ -123,27 +120,25 @@ public class LogicalStructureManager {
}
}
}
-
+
/**
* 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());
+ for (Entry<String, Integer> entry : fStructureTypeSelections.entrySet()) {
+ 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();
+ fStructureTypeIds = new ArrayList<String>();
// 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$
@@ -154,19 +149,18 @@ public class LogicalStructureManager {
}
}
}
-
+
/**
* 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(',');
+ for (String id : fStructureTypeIds) {
+ buffer.append(id).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 <code>null</code> if the user has chosen
@@ -181,7 +175,7 @@ public class LogicalStructureManager {
}
String combo= getComboString(structureTypes);
// Lookup the combo
- Integer index = (Integer) fStructureTypeSelections.get(combo);
+ Integer index = fStructureTypeSelections.get(combo);
if (index == null) {
// If the user hasn't explicitly chosen anything for this
// combo yet, just return the first type.
@@ -191,7 +185,7 @@ public class LogicalStructureManager {
return null;
}
// If an index is stored for this combo, retrieve the id at the index
- String id= (String) fStructureTypeIds.get(index.intValue());
+ String id= fStructureTypeIds.get(index.intValue());
for (int i = 0; i < structureTypes.length; i++) {
// Return the type with the retrieved id
ILogicalStructureType type = structureTypes[i];
@@ -201,9 +195,9 @@ public class LogicalStructureManager {
}
return structureTypes[0];
}
-
+
/**
- *
+ *
* @param types the array of types
* @param selected the type that is selected for the given combo or <code>null</code>
* if the user has de-selected any structure for the given combo
@@ -219,7 +213,7 @@ public class LogicalStructureManager {
storeStructureTypeSelections();
storeStructureTypeIds();
}
-
+
/**
* Returns the string representing the given combination of logical
* structure types. This string will be a series of comma-separated
@@ -243,13 +237,13 @@ public class LogicalStructureManager {
}
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);
+ fTypes = new ArrayList<LogicalStructureType>(extensions.length);
for (int i = 0; i < extensions.length; i++) {
IConfigurationElement extension = extensions[i];
LogicalStructureType type;
@@ -263,7 +257,7 @@ public class LogicalStructureManager {
// 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);
+ fTypeProviders = new ArrayList<LogicalStructureProvider>(extensions.length);
for (int i= 0; i < extensions.length; i++) {
try {
fTypeProviders.add(new LogicalStructureProvider(extensions[i]));
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
index 029a15c85..d133c2e22 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,18 +10,21 @@
*******************************************************************************/
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.*;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILogicalStructureType;
+import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate;
+import org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2;
+import org.eclipse.debug.core.model.IValue;
+
+import com.ibm.icu.text.MessageFormat;
/**
* Proxy to a logical structure type extension.
- *
+ *
* @see IConfigurationElementConstants
*/
public class LogicalStructureType implements ILogicalStructureType {
@@ -31,11 +34,11 @@ public class LogicalStructureType implements ILogicalStructureType {
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;
-
+ 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
*/
@@ -46,22 +49,22 @@ public class LogicalStructureType implements ILogicalStructureType {
/**
* 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);
+ fModelId = fConfigurationElement.getAttribute(IConfigurationElementConstants.MODEL_IDENTIFIER);
if (fModelId == null) {
missingAttribute(IConfigurationElementConstants.MODEL_IDENTIFIER);
}
}
-
+
/**
* Verifies the given attribute exists
* @param name the name to verify
- *
+ *
* @exception CoreException if attribute does not exist
*/
private void verifyAttributeExists(String name) throws CoreException {
@@ -76,26 +79,29 @@ public class LogicalStructureType implements ILogicalStructureType {
* @throws CoreException if a problem is encountered
*/
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));
+ throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.ERROR, MessageFormat.format(DebugCoreMessages.LogicalStructureType_1, new Object[] { attrName }), null));
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.ILogicalStructureType#getDescription()
*/
+ @Override
public String getDescription() {
return fConfigurationElement.getAttribute(IConfigurationElementConstants.DESCRIPTION);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.ILogicalStructureType#getId()
*/
+ @Override
public String getId() {
return fConfigurationElement.getAttribute(IConfigurationElementConstants.ID);
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.ILogicalStructureType#getLogicalStructure(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public IValue getLogicalStructure(IValue value) throws CoreException {
return getDelegate().getLogicalStructure(value);
}
@@ -103,6 +109,7 @@ public class LogicalStructureType implements ILogicalStructureType {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.ILogicalStructureType#providesLogicalStructure(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public boolean providesLogicalStructure(IValue value) {
if (value.getModelIdentifier().equals(fModelId)) {
return getDelegate().providesLogicalStructure(value);
@@ -128,6 +135,7 @@ public class LogicalStructureType implements ILogicalStructureType {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate2#getDescription(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public String getDescription(IValue value) {
ILogicalStructureTypeDelegate delegate = getDelegate();
if (delegate instanceof ILogicalStructureTypeDelegate2) {
@@ -144,7 +152,7 @@ public class LogicalStructureType implements ILogicalStructureType {
}
String description = getDescription();
if (description == null) {
- return DebugCoreMessages.LogicalStructureType_0;
+ 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
index a42f94845..c72eb51af 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,7 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * WindRiver - Bug 192028 [Memory View] Memory view does not
+ * WindRiver - Bug 192028 [Memory View] Memory view does not
* display memory blocks that do not reference IDebugTarget
*******************************************************************************/
@@ -32,15 +32,14 @@ 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 ArrayList<IMemoryBlockListener> listeners = new ArrayList<IMemoryBlockListener>();
+ private ArrayList<IMemoryBlock> memoryBlocks = new ArrayList<IMemoryBlock>();
+
private static final int ADDED = 0;
private static final int REMOVED = 1;
/**
@@ -48,14 +47,15 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
* 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)
*/
+ @Override
public void handleException(Throwable exception) {
DebugPlugin.log(exception);
}
@@ -63,6 +63,7 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -71,12 +72,14 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
case REMOVED:
fListener.memoryBlocksRemoved(fMemoryBlocks);
break;
- }
+ default:
+ break;
+ }
}
/**
* Notify listeners of added/removed memory block events
- *
+ *
* @param memBlocks blocks that have changed
* @param update type of change
*/
@@ -88,38 +91,39 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
fListener = (IMemoryBlockListener)copiedListeners[i];
fMemoryBlocks = memBlocks;
SafeRunner.run(this);
- }
+ }
}
fListener = null;
fMemoryBlocks = null;
}
}
-
+
/**
* Returns the <code>MemoryBlockNotifier</code>
* @return the <code>MemoryBlockNotifier</code>
- *
- * TODO consider using only one of these, and sync where needed,
+ *
+ * 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)
*/
+ @Override
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;
+ return;
}
-
+
if(mem.length > 0) {
- ArrayList newMemoryBlocks = new ArrayList();
+ ArrayList<IMemoryBlock> newMemoryBlocks = new ArrayList<IMemoryBlock>();
for (int i=0; i<mem.length; i++) {
// do not allow duplicates
if (!memoryBlocks.contains(mem[i])) {
@@ -131,22 +135,23 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
}
}
}
- notifyListeners((IMemoryBlock[])newMemoryBlocks.toArray(new IMemoryBlock[newMemoryBlocks.size()]), ADDED);
+ notifyListeners(newMemoryBlocks.toArray(new IMemoryBlock[newMemoryBlocks.size()]), ADDED);
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IMemoryBlockManager#removeMemoryBlock(org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
public void removeMemoryBlocks(IMemoryBlock[] memBlocks) {
if (memoryBlocks == null) {
return;
}
if (memBlocks == null){
DebugPlugin.logMessage("Null argument passed into IMemoryBlockManager.removeMemoryBlock", null); //$NON-NLS-1$
- return;
- }
-
+ return;
+ }
+
if(memBlocks.length > 0) {
for (int i=0; i<memBlocks.length; i++) {
memoryBlocks.remove(memBlocks[i]);
@@ -154,7 +159,7 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
if (memoryBlocks.size() == 0) {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
- if (memBlocks[i] instanceof IMemoryBlockExtension) {
+ if (memBlocks[i] instanceof IMemoryBlockExtension) {
try {
((IMemoryBlockExtension)memBlocks[i]).dispose();
} catch (DebugException e) {
@@ -169,8 +174,9 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IMemoryBlockManager#addListener(org.eclipse.debug.ui.IMemoryBlockListener)
*/
+ @Override
public void addListener(IMemoryBlockListener listener) {
-
+
if(listeners == null) {
return;
}
@@ -186,8 +192,9 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IMemoryBlockManager#removeListener(org.eclipse.debug.ui.IMemoryBlockListener)
*/
+ @Override
public void removeListener(IMemoryBlockListener listener) {
-
+
if(listeners == null) {
return;
}
@@ -203,51 +210,51 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
/* (non-Javadoc)
* @see org.eclipse.debug.core.IMemoryBlockManager#getMemoryBlocks()
*/
+ @Override
public IMemoryBlock[] getMemoryBlocks() {
- return (IMemoryBlock[])memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]);
+ return memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IMemoryBlockManager#getMemoryBlocks(org.eclipse.debug.core.model.IDebugTarget)
*/
+ @Override
public IMemoryBlock[] getMemoryBlocks(IDebugTarget debugTarget) {
- IMemoryBlock[] blocks = (IMemoryBlock[])memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]);
- ArrayList memoryBlocksList = new ArrayList();
- for (int i=0; i<blocks.length; i++) {
- if (blocks[i].getDebugTarget() == debugTarget) {
- memoryBlocksList.add(blocks[i]);
+ ArrayList<IMemoryBlock> memoryBlocksList = new ArrayList<IMemoryBlock>();
+ for (IMemoryBlock block : memoryBlocks) {
+ if (block.getDebugTarget() == debugTarget) {
+ memoryBlocksList.add(block);
}
}
- return (IMemoryBlock[])memoryBlocksList.toArray(new IMemoryBlock[memoryBlocksList.size()]);
+ return memoryBlocksList.toArray(new IMemoryBlock[memoryBlocksList.size()]);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IMemoryBlockManager#getMemoryBlocks(org.eclipse.debug.core.model.IMemoryBlockRetrieval)
*/
+ @Override
public IMemoryBlock[] getMemoryBlocks(IMemoryBlockRetrieval retrieve) {
- IMemoryBlock[] blocks = (IMemoryBlock[])memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]);
- ArrayList memoryBlocksList = new ArrayList(blocks.length);
- for (int i=0; i<blocks.length; i++) {
- if (blocks[i] instanceof IMemoryBlockExtension) {
- if (((IMemoryBlockExtension)blocks[i]).getMemoryBlockRetrieval() == retrieve) {
- memoryBlocksList.add(blocks[i]);
+ ArrayList<IMemoryBlock> memoryBlocksList = new ArrayList<IMemoryBlock>();
+ for (IMemoryBlock block : memoryBlocks) {
+ if (block instanceof IMemoryBlockExtension) {
+ if (((IMemoryBlockExtension) block).getMemoryBlockRetrieval() == retrieve) {
+ memoryBlocksList.add(block);
}
}
- else {
- IMemoryBlockRetrieval mbRetrieval = (IMemoryBlockRetrieval)blocks[i].getAdapter(IMemoryBlockRetrieval.class);
-
+ else {
+ IMemoryBlockRetrieval mbRetrieval = (IMemoryBlockRetrieval) block.getAdapter(IMemoryBlockRetrieval.class);
// standard memory block always uses the debug target as the memory block retrieval
- if (mbRetrieval == null)
- mbRetrieval = blocks[i].getDebugTarget();
-
+ if (mbRetrieval == null) {
+ mbRetrieval = block.getDebugTarget();
+ }
if (mbRetrieval == retrieve) {
- memoryBlocksList.add(blocks[i]);
+ memoryBlocksList.add(block);
}
}
}
- return (IMemoryBlock[])memoryBlocksList.toArray(new IMemoryBlock[memoryBlocksList.size()]);
+ return memoryBlocksList.toArray(new IMemoryBlock[memoryBlocksList.size()]);
}
-
+
/**
* Notifies the listeners about the given memory blocks and the event to be sent
* @param memBlocks the array of memory blocks
@@ -260,12 +267,13 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i=0; i < events.length; i++) {
handleDebugEvent(events[i]);
}
}
-
+
/**
* Handles a debug event
* @param event the {@link DebugEvent}
@@ -273,20 +281,20 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
public void handleDebugEvent(DebugEvent event) {
Object obj = event.getSource();
IDebugTarget dt = null;
-
+
if (event.getKind() == DebugEvent.TERMINATE) {
// a terminate event could happen from an IThread or IDebugTarget
// only handle a debug event from the debug target
if (obj instanceof IDebugTarget) {
dt = ((IDebugTarget)obj);
-
+
// getMemoryBlocks will return an empty array if it is null
IMemoryBlock[] deletedMemoryBlocks = getMemoryBlocks(dt);
removeMemoryBlocks(deletedMemoryBlocks);
}
}
}
-
+
/**
* Clean up when the plugin is shut down
*/
@@ -295,11 +303,11 @@ public class MemoryBlockManager implements IMemoryBlockManager, IDebugEventSetLi
listeners.clear();
listeners = null;
}
-
+
if (memoryBlocks != null) {
memoryBlocks.clear();
memoryBlocks = null;
}
}
-
+
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
index 5d0dab378..4e4ae7064 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/NullStreamsProxy.java
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -20,7 +20,7 @@ import org.eclipse.debug.core.model.IStreamsProxy2;
public class NullStreamsProxy implements IStreamsProxy2 {
private NullStreamMonitor outputStreamMonitor;
private NullStreamMonitor errorStreamMonitor;
-
+
public NullStreamsProxy(Process process) {
outputStreamMonitor = new NullStreamMonitor(process.getInputStream());
errorStreamMonitor = new NullStreamMonitor(process.getErrorStream());
@@ -29,27 +29,31 @@ public class NullStreamsProxy implements IStreamsProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamsProxy2#closeInputStream()
*/
- public void closeInputStream() throws IOException {
+ @Override
+ public void closeInputStream() throws IOException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamsProxy#getErrorStreamMonitor()
*/
- public IStreamMonitor getErrorStreamMonitor() {
+ @Override
+ public IStreamMonitor getErrorStreamMonitor() {
return errorStreamMonitor;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamsProxy#getOutputStreamMonitor()
*/
- public IStreamMonitor getOutputStreamMonitor() {
+ @Override
+ public IStreamMonitor getOutputStreamMonitor() {
return outputStreamMonitor;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamsProxy#write(java.lang.String)
*/
- public void write(String input) throws IOException {
+ @Override
+ public void write(String input) throws IOException {
}
private class NullStreamMonitor implements IStreamMonitor {
@@ -62,7 +66,8 @@ public class NullStreamsProxy implements IStreamsProxy2 {
private void startReaderThread() {
Thread thread = new Thread(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
byte[] bytes = new byte[1024];
try {
while(fStream.read(bytes) >= 0) {
@@ -71,29 +76,32 @@ public class NullStreamsProxy implements IStreamsProxy2 {
} catch (IOException e) {
}
}
- }, DebugCoreMessages.NullStreamsProxy_0);
+ }, 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) {
+ @Override
+ public void addListener(IStreamListener listener) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamMonitor#getContents()
*/
- public String getContents() {
+ @Override
+ 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) {
+ @Override
+ 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
index 7dd37305c..b16235d43 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -23,9 +23,9 @@ import org.eclipse.debug.core.IStreamListener;
import org.eclipse.debug.core.model.IFlushableStreamMonitor;
/**
- * Monitors the output stream of a system process and notifies
+ * 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.
*/
@@ -39,7 +39,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
* A collection of listeners
*/
private ListenerList fListeners= new ListenerList();
-
+
/**
* Whether content is being buffered
*/
@@ -66,15 +66,15 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
* 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 <code>null</code> for system default
*/
@@ -87,6 +87,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamMonitor#addListener(org.eclipse.debug.core.IStreamListener)
*/
+ @Override
public synchronized void addListener(IStreamListener listener) {
fListeners.add(listener);
}
@@ -120,6 +121,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamMonitor#getContents()
*/
+ @Override
public synchronized String getContents() {
return fContents.toString();
}
@@ -170,14 +172,14 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
}
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 {
@@ -186,7 +188,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
DebugPlugin.log(e);
}
}
-
+
protected void kill() {
fKilled= true;
}
@@ -194,6 +196,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamMonitor#removeListener(org.eclipse.debug.core.IStreamListener)
*/
+ @Override
public synchronized void removeListener(IStreamListener listener) {
fListeners.remove(listener);
}
@@ -204,19 +207,21 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
protected void startMonitoring() {
if (fThread == null) {
fThread= new Thread(new Runnable() {
+ @Override
public void run() {
read();
}
- }, DebugCoreMessages.OutputStreamMonitor_label);
+ }, DebugCoreMessages.OutputStreamMonitor_label);
fThread.setDaemon(true);
fThread.setPriority(Thread.MIN_PRIORITY);
fThread.start();
}
}
-
+
/**
* @see org.eclipse.debug.core.model.IFlushableStreamMonitor#setBuffered(boolean)
*/
+ @Override
public synchronized void setBuffered(boolean buffer) {
fBuffered = buffer;
}
@@ -224,13 +229,15 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/**
* @see org.eclipse.debug.core.model.IFlushableStreamMonitor#flushContents()
*/
+ @Override
public synchronized void flushContents() {
fContents.setLength(0);
}
-
+
/**
* @see IFlushableStreamMonitor#isBuffered()
*/
+ @Override
public synchronized boolean isBuffered() {
return fBuffered;
}
@@ -238,15 +245,16 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
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)
*/
+ @Override
public void handleException(Throwable exception) {
DebugPlugin.log(exception);
}
@@ -254,13 +262,15 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
/**
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
fListener.streamAppended(fText, OutputStreamMonitor.this);
}
public void notifyAppend(String text) {
- if (text == null)
+ if (text == null) {
return;
+ }
fText = text;
Object[] copiedListeners= fListeners.getListeners();
for (int i= 0; i < copiedListeners.length; i++) {
@@ -268,7 +278,7 @@ public class OutputStreamMonitor implements IFlushableStreamMonitor {
SafeRunner.run(this);
}
fListener = null;
- fText = null;
+ fText = null;
}
}
}
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
index b75ced816..3a9fe1ba0 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 IBM Corporation and others.
+ * Copyright (c) 2010, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,14 +18,15 @@ 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.
+ * Used to listen for preference imports that include changes to preferred
+ * launch delegates.
*
- * @since 3.6
+ * @since 3.6 TODO can we roll this into general preference listening?
*/
public class PreferredDelegateModifyListener extends PreferenceModifyListener {
class Visitor implements IPreferenceNodeVisitor {
+ @Override
public boolean visit(IEclipsePreferences node) throws BackingStoreException {
if (node.name().equals(DebugPlugin.getUniqueIdentifier())) {
// reset preferred delegates, so they are re-initialized from the preferences
@@ -39,9 +40,10 @@ public class PreferredDelegateModifyListener extends PreferenceModifyListener {
}
return true;
}
-
+
}
+ @Override
public IEclipsePreferences preApply(IEclipsePreferences node) {
try {
// force VMs to be initialized before we import the new VMs
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
index 4a3ef6a51..f976847ce 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,14 +20,15 @@ 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 class RefreshScopeComparator implements Comparator<String> {
- public int compare(Object o1, Object o2) {
- String m1 = (String) o1;
- String m2 = (String) o2;
+ @Override
+ public int compare(String o1, String o2) {
+ String m1 = o1;
+ String m2 = o2;
try {
IResource[] r1 = RefreshUtil.toResources(m1);
IResource[] r2 = RefreshUtil.toResources(m2);
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
index 1ceb5bfc4..37f05ced6 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,13 +20,13 @@ 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 <code>DebugUIPlugin</code> class.
@@ -34,42 +34,44 @@ public class StepFilterManager implements ILaunchListener {
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)
*/
+ @Override
public void launchAdded(ILaunch launch) {
launchChanged(launch);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
+ @Override
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) {
@@ -80,9 +82,10 @@ public class StepFilterManager implements ILaunchListener {
launchChanged(launch);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
*/
+ @Override
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
index 0bae93602..437d1dc16 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.internal.core;
-
+
import java.io.IOException;
import org.eclipse.debug.core.model.IStreamMonitor;
@@ -36,14 +36,14 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
private InputStreamMonitor fInputMonitor;
/**
* Records the open/closed state of communications with
- * the underlying streams. Note: fClosed is initialized to
+ * the underlying streams. Note: fClosed is initialized to
* <code>false</code> by default.
*/
private boolean fClosed;
/**
* Creates a <code>StreamsProxy</code> 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 <code>null</code> if default
*/
@@ -74,9 +74,9 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
}
/**
- * Returns whether the proxy is currently closed. This method
- * synchronizes access to the <code>fClosed</code> flag.
- *
+ * Returns whether the proxy is currently closed. This method
+ * synchronizes access to the <code>fClosed</code> flag.
+ *
* @param setClosed If <code>true</code> this method will also set the
* <code>fClosed</code> flag to true. Otherwise, the <code>fClosed</code>
* flag is not modified.
@@ -89,7 +89,7 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
}
return closed;
}
-
+
/**
* Causes the proxy to close all
* communications between it and the
@@ -108,6 +108,7 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
/**
* @see IStreamsProxy#getErrorStreamMonitor()
*/
+ @Override
public IStreamMonitor getErrorStreamMonitor() {
return fErrorMonitor;
}
@@ -115,6 +116,7 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
/**
* @see IStreamsProxy#getOutputStreamMonitor()
*/
+ @Override
public IStreamMonitor getOutputStreamMonitor() {
return fOutputMonitor;
}
@@ -122,6 +124,7 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
/**
* @see IStreamsProxy#write(String)
*/
+ @Override
public void write(String input) throws IOException {
if (!isClosed(false)) {
fInputMonitor.write(input);
@@ -133,13 +136,14 @@ public class StreamsProxy implements IStreamsProxy, IStreamsProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStreamsProxy2#closeInputStream()
*/
- public void closeInputStream() throws IOException {
+ @Override
+ 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
index 01c5d19d5..ebb2cf6b5 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -19,16 +19,17 @@ import org.eclipse.core.variables.IDynamicVariableResolver;
import org.eclipse.debug.core.DebugPlugin;
/**
- * Resolves the value of system properties from the Eclipse SDK runtime.
+ * 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)
*/
+ @Override
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));
+ 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
index da4d5e543..361090a80 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -35,6 +35,7 @@ public class SystemVariableResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
if ("ARCH".equals(argument)) { //$NON-NLS-1$
return Platform.getOSArch();
@@ -51,14 +52,15 @@ public class SystemVariableResolver implements IDynamicVariableResolver {
}
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 == '/')
+ if (i == 0 && c == '/') {
continue;
+ }
}
// Some VMs may return %20 instead of a space
if (c == '%' && i + 2 < path.length()) {
@@ -73,5 +75,5 @@ public class SystemVariableResolver implements IDynamicVariableResolver {
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
index 82fa104b4..b257db3cc 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -26,17 +26,17 @@ 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.
@@ -49,7 +49,7 @@ public class WatchExpression implements IWatchExpression {
/**
* 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
*/
@@ -57,20 +57,22 @@ public class WatchExpression implements IWatchExpression {
this(expressionText);
fEnabled= enabled;
}
-
+
/**
* @see org.eclipse.debug.core.model.IWatchExpression#evaluate()
*/
+ @Override
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)
*/
+ @Override
public void watchEvaluationFinished(IWatchExpressionResult result) {
setResult(result);
}
@@ -82,18 +84,23 @@ public class WatchExpression implements IWatchExpression {
} else {
// No delegate provided
listener.watchEvaluationFinished(new IWatchExpressionResult() {
+ @Override
public IValue getValue() {
return null;
}
+ @Override
public boolean hasErrors() {
return true;
}
+ @Override
public String[] getErrorMessages() {
- return new String[] { DebugCoreMessages.WatchExpression_0 };
+ return new String[] { DebugCoreMessages.WatchExpression_0 };
}
+ @Override
public String getExpressionText() {
return WatchExpression.this.getExpressionText();
}
+ @Override
public DebugException getException() {
return null;
}
@@ -104,6 +111,7 @@ public class WatchExpression implements IWatchExpression {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IWatchExpression#setExpressionContext(org.eclipse.debug.core.model.IDebugElement)
*/
+ @Override
public void setExpressionContext(IDebugElement context) {
synchronized (this) {
fCurrentContext= context;
@@ -115,14 +123,14 @@ public class WatchExpression implements IWatchExpression {
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) {
@@ -141,7 +149,7 @@ public class WatchExpression implements IWatchExpression {
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
@@ -154,6 +162,7 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IExpression#getExpressionText()
*/
+ @Override
public String getExpressionText() {
return fExpressionText;
}
@@ -161,6 +170,7 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IExpression#getValue()
*/
+ @Override
public synchronized IValue getValue() {
if (fResult == null) {
return null;
@@ -171,6 +181,7 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
+ @Override
public IDebugTarget getDebugTarget() {
IDebugElement element = fCurrentContext;
if (element != null) {
@@ -182,12 +193,14 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IExpression#dispose()
*/
+ @Override
public void dispose() {
}
/**
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
+ @Override
public String getModelIdentifier() {
synchronized (this) {
IValue value = getValue();
@@ -196,7 +209,7 @@ public class WatchExpression implements IWatchExpression {
}
if (fCurrentContext != null) {
return fCurrentContext.getModelIdentifier();
- }
+ }
}
return DebugPlugin.getUniqueIdentifier();
}
@@ -204,17 +217,19 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
IDebugTarget debugTarget = getDebugTarget();
if (debugTarget != null) {
return debugTarget.getLaunch();
}
- return null;
+ return null;
}
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
//CONTEXTLAUNCHING
if(adapter.equals(ILaunchConfiguration.class)) {
@@ -228,9 +243,10 @@ public class WatchExpression implements IWatchExpression {
/**
* Set the enabled state of the {@link WatchExpression}
- *
+ *
* @param enabled the new enabled state
*/
+ @Override
public void setEnabled(boolean enabled) {
fEnabled= enabled;
watchExpressionChanged();
@@ -241,6 +257,7 @@ public class WatchExpression implements IWatchExpression {
* Set the text of the expression
* @param expression the new expression text
*/
+ @Override
public void setExpressionText(String expression) {
fExpressionText= expression;
watchExpressionChanged();
@@ -252,6 +269,7 @@ public class WatchExpression implements IWatchExpression {
* Enabled watch expressions will continue to update their value
* automatically. Disabled expressions require a manual update.
*/
+ @Override
public boolean isEnabled() {
return fEnabled;
}
@@ -259,13 +277,14 @@ public class WatchExpression implements IWatchExpression {
/**
* @see org.eclipse.debug.core.model.IWatchExpression#isPending()
*/
+ @Override
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
*/
@@ -279,13 +298,15 @@ public class WatchExpression implements IWatchExpression {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IErrorReportingExpression#hasErrors()
*/
+ @Override
public boolean hasErrors() {
return fResult != null && fResult.hasErrors();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IErrorReportingExpression#getErrorMessages()
*/
+ @Override
public String[] getErrorMessages() {
if (fResult == null) {
return new String[0];
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
index f8c67a243..9b98e0b20 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,7 +47,7 @@ public final class XMLMemento {
* <p>
* Same as calling createReadRoot(reader, null)
* </p>
- *
+ *
* @param reader the <code>Reader</code> used to create the memento's document
* @return a memento on the first <code>Element</code> for reading the document
* @throws Exception if IO problems, invalid format, or no element.
@@ -61,7 +61,7 @@ public final class XMLMemento {
* Creates a <code>Document</code> from the <code>Reader</code>
* and returns a memento on the first <code>Element</code> for reading
* the document.
- *
+ *
* @param reader the <code>Reader</code> 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
@@ -97,10 +97,10 @@ public final class XMLMemento {
// errorMessage = WorkbenchMessages.XMLMemento_parserConfigError;
} catch (IOException e) {
exception = e;
- // errorMessage = WorkbenchMessages.XMLMemento_ioError;
+ // errorMessage = WorkbenchMessages.XMLMemento_ioError;
} catch (SAXException e) {
exception = e;
- // errorMessage = WorkbenchMessages.XMLMemento_formatError;
+ // errorMessage = WorkbenchMessages.XMLMemento_formatError;
}
String problemText = null;
@@ -110,13 +110,13 @@ public final class XMLMemento {
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
*/
@@ -141,7 +141,7 @@ public final class XMLMemento {
* <code>createWriteRoot</code> to create the initial
* memento on a document.
* </p>
- *
+ *
* @param document the document for the memento
* @param element the element node for the memento
*/
@@ -220,7 +220,7 @@ public final class XMLMemento {
}
// Extract each node with given type.
- ArrayList list = new ArrayList(size);
+ ArrayList<Element> list = new ArrayList<Element>(size);
for (int nX = 0; nX < size; nX++) {
Node node = nodes.item(nX);
if (node instanceof Element) {
@@ -235,7 +235,7 @@ public final class XMLMemento {
size = list.size();
XMLMemento[] results = new XMLMemento[size];
for (int x = 0; x < size; x++) {
- results[x] = new XMLMemento(factory, (Element) list.get(x));
+ results[x] = new XMLMemento(factory, list.get(x));
}
return results;
}
@@ -330,9 +330,9 @@ public final class XMLMemento {
}
/**
- * Returns the Text node of the memento. Each memento is allowed only
+ * Returns the Text node of the memento. Each memento is allowed only
* one Text node.
- *
+ *
* @return the Text node of the memento, or <code>null</code> if
* the memento has no Text node.
*/
@@ -432,7 +432,7 @@ public final class XMLMemento {
Text textNode = getTextNode();
if (textNode == null) {
textNode = factory.createTextNode(data);
- // Always add the text node as the first child (fixes bug 93718)
+ // Always add the text node as the first child (fixes bug 93718)
element.insertBefore(textNode, element.getFirstChild());
} else {
textNode.setData(data);
@@ -441,8 +441,8 @@ public final class XMLMemento {
/**
* Saves this memento's document current values to the
- * specified writer.
- *
+ * 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.
*/
@@ -457,10 +457,10 @@ public final class XMLMemento {
/**
* A simple XML writer. Using this instead of the javax.xml.transform classes allows
- * compilation against JCL Foundation (bug 80053).
+ * compilation against JCL Foundation (bug 80053).
*/
private static final class DOMWriter extends PrintWriter {
-
+
// private int tab;
/* constants */
@@ -468,7 +468,7 @@ public final class XMLMemento {
/**
* Creates a new DOM writer on the given output writer.
- *
+ *
* @param output the output writer
*/
public DOMWriter(Writer output) {
@@ -479,7 +479,7 @@ public final class XMLMemento {
/**
* Prints the given element.
- *
+ *
* @param element the element to print
*/
public void print(Element element) {
@@ -521,7 +521,7 @@ public final class XMLMemento {
// 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$
}
@@ -550,7 +550,7 @@ public final class XMLMemento {
sb.append(">"); //$NON-NLS-1$
print(sb.toString());
}
-
+
private static void appendEscapedChar(StringBuffer buffer, char c) {
String replacement = getReplacement(c);
if (replacement != null) {
@@ -593,6 +593,8 @@ public final class XMLMemento {
return "#x0A"; //$NON-NLS-1$
case '\u0009':
return "#x09"; //$NON-NLS-1$
+ default:
+ break;
}
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
index 5d47e7b30..ce7a82c2c 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,13 +31,13 @@ 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();
@@ -51,15 +51,16 @@ public class CommandAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (IStepFiltersHandler.class.equals(adapterType)) {
if (adaptableObject instanceof IDebugElement ||
- adaptableObject instanceof ILaunch ||
+ adaptableObject instanceof ILaunch ||
adaptableObject instanceof IProcess) {
return fgStepFiltersCommand;
}
}
-
+
if (ITerminateHandler.class.equals(adapterType)) {
if (adaptableObject instanceof ITerminate) {
return fgTerminateCommand;
@@ -106,6 +107,7 @@ public class CommandAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
+ @Override
public Class[] getAdapterList() {
return new Class[]{
ITerminateHandler.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
index 5d447e5df..066edbc66 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,9 +16,9 @@ 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;
}
@@ -26,9 +26,10 @@ public class DebugCommandRequest extends Request implements IDebugCommandRequest
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.IDebugCommandRequest#getElements()
*/
+ @Override
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
index 956c4df47..4076df356 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,11 +17,12 @@ 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 {
+ @Override
protected Object getTarget(Object element) {
return getAdapter(element, IDisconnect.class);
}
@@ -29,6 +30,7 @@ public class DisconnectCommand extends ForEachCommand implements IDisconnectHand
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.ForEachCommand#execute(java.lang.Object)
*/
+ @Override
protected void execute(Object target) throws CoreException {
((IDisconnect)target).disconnect();
}
@@ -36,6 +38,7 @@ public class DisconnectCommand extends ForEachCommand implements IDisconnectHand
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.ForEachCommand#isExecutable(java.lang.Object)
*/
+ @Override
protected boolean isExecutable(Object target) {
return ((IDisconnect)target).canDisconnect();
}
@@ -43,6 +46,7 @@ public class DisconnectCommand extends ForEachCommand implements IDisconnectHand
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index a0d712de0..bc4ed7e13 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,11 +17,12 @@ 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 {
+ @Override
protected Object getTarget(Object element) {
return getAdapter(element, IDropToFrame.class);
}
@@ -29,6 +30,7 @@ public class DropToFrameCommand extends StepCommand implements IDropToFrameHandl
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.StepCommand#isSteppable(java.lang.Object)
*/
+ @Override
protected boolean isSteppable(Object target) throws CoreException {
return ((IDropToFrame)target).canDropToFrame();
}
@@ -36,6 +38,7 @@ public class DropToFrameCommand extends StepCommand implements IDropToFrameHandl
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.StepCommand#step(java.lang.Object)
*/
+ @Override
protected void step(Object target) throws CoreException {
((IDropToFrame)target).dropToFrame();
}
@@ -43,6 +46,7 @@ public class DropToFrameCommand extends StepCommand implements IDropToFrameHandl
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index a92772e35..61bbda896 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@ import org.eclipse.debug.core.commands.IEnabledStateRequest;
/**
* A command that operates on each element individually.
- *
+ *
* @since 3.3
*/
public abstract class ForEachCommand extends AbstractDebugCommand {
@@ -26,18 +26,20 @@ 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)
*/
+ @Override
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)
*/
+ @Override
protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request) throws CoreException {
for (int i = 0; i < targets.length; i++) {
if (!isExecutable(targets[i])) {
@@ -47,7 +49,7 @@ public abstract class ForEachCommand extends AbstractDebugCommand {
}
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
index 4de8e2136..feac8029d 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,19 +18,21 @@ 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()
*/
+ @Override
public void done() {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.IRequest#getStatus()
*/
+ @Override
public IStatus getStatus() {
return fStatus;
}
@@ -38,6 +40,7 @@ public class Request implements IRequest {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IRequest#setStatus(org.eclipse.core.runtime.IStatus)
*/
+ @Override
public void setStatus(IStatus status) {
fStatus = status;
}
@@ -45,6 +48,7 @@ public class Request implements IRequest {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IRequest#cancel()
*/
+ @Override
public synchronized void cancel() {
fCanceled = true;
}
@@ -52,6 +56,7 @@ public class Request implements IRequest {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IRequest#isCanceled()
*/
+ @Override
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
index 91475b019..26b9ceb32 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,22 +17,25 @@ 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 {
+ @Override
protected void execute(Object target) throws CoreException {
((ISuspendResume)target).resume();
}
+ @Override
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)
*/
+ @Override
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
index 9fd08ae4d..147ec25b3 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,14 +21,16 @@ 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;
+import org.eclipse.debug.core.model.IThread;
/**
* Common function for step commands.
- *
+ *
* @since 3.3
*/
public abstract class StepCommand extends AbstractDebugCommand {
+ @Override
protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException {
for (int i = 0; i < targets.length; i++) {
step(targets[i]);
@@ -36,7 +38,8 @@ public abstract class StepCommand extends AbstractDebugCommand {
}
protected abstract void step(Object target) throws CoreException ;
-
+
+ @Override
protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest collector) throws CoreException {
if (isThreadCompatible(targets)) {
for (int i = 0; i < targets.length; i++) {
@@ -49,15 +52,15 @@ public abstract class StepCommand extends AbstractDebugCommand {
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);
+ Set<IThread> threads = new HashSet<IThread>(targets.length);
for (int i = 0; i < targets.length; i++) {
Object object = targets[i];
IStackFrame frame = null;
@@ -67,14 +70,15 @@ public abstract class StepCommand extends AbstractDebugCommand {
frame = (IStackFrame)((IAdaptable)object).getAdapter(IStackFrame.class);
}
if (frame != null) {
- if (!threads.add(frame.getThread())) {
+ if (!threads.add(frame.getThread())) {
return false;
}
}
}
return true;
}
-
+
+ @Override
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
index e5bfdc959..afefb9532 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,11 +22,12 @@ 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 {
+ @Override
protected Object getTarget(Object element) {
IDebugTarget[] targets = getDebugTargets(element);
if (targets.length > 0) {
@@ -46,7 +47,7 @@ public class StepFiltersCommand extends ForEachCommand implements IStepFiltersHa
}
return null;
}
-
+
private IDebugTarget[] getDebugTargets(Object element) {
if (element instanceof IDebugElement) {
IDebugElement debugElement = (IDebugElement) element;
@@ -65,6 +66,7 @@ public class StepFiltersCommand extends ForEachCommand implements IStepFiltersHa
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.ForEachCommand#execute(java.lang.Object)
*/
+ @Override
protected void execute(Object target) throws CoreException {
if (target == null) {
return;
@@ -75,10 +77,11 @@ public class StepFiltersCommand extends ForEachCommand implements IStepFiltersHa
filter.setStepFiltersEnabled(DebugPlugin.isUseStepFilters());
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.ForEachCommand#isExecutable(java.lang.Object)
*/
+ @Override
protected boolean isExecutable(Object target) {
IStepFilters[] filters = (IStepFilters[]) target;
for (int i = 0; i < filters.length; i++) {
@@ -89,11 +92,12 @@ public class StepFiltersCommand extends ForEachCommand implements IStepFiltersHa
}
return true;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index 998c15319..0d99f55ef 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,15 +17,17 @@ 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 {
+ @Override
protected boolean isSteppable(Object target) {
return ((IStep)target).canStepInto();
}
+ @Override
protected void step(Object target) throws CoreException {
((IStep)target).stepInto();
}
@@ -33,6 +35,7 @@ public class StepIntoCommand extends StepCommand implements IStepIntoHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index bf8d2d8e3..ba9961d9e 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,12 +17,13 @@ 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 {
+ @Override
protected void step(Object target) throws CoreException {
((IStep)target).stepOver();
}
@@ -30,6 +31,7 @@ public class StepOverCommand extends StepCommand implements IStepOverHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.StepCommand#isSteppable(java.lang.Object)
*/
+ @Override
protected boolean isSteppable(Object target) {
return ((IStep)target).canStepOver();
}
@@ -37,6 +39,7 @@ public class StepOverCommand extends StepCommand implements IStepOverHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index f44a89663..5982c8e8c 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,15 +17,17 @@ 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 {
+ @Override
protected boolean isSteppable(Object target) {
return ((IStep)target).canStepReturn();
}
+ @Override
protected void step(Object target) throws CoreException {
((IStep)target).stepReturn();
}
@@ -34,6 +36,7 @@ public class StepReturnCommand extends StepCommand implements IStepReturnHandler
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index 3db9b9be9..180d60b5a 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,19 +17,22 @@ 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 {
+ @Override
protected Object getTarget(Object element) {
return getAdapter(element, ISuspendResume.class);
}
+ @Override
protected void execute(Object target) throws CoreException {
((ISuspendResume)target).suspend();
}
-
+
+ @Override
protected boolean isExecutable(Object target) {
return ((ISuspendResume)target).canSuspend();
}
@@ -37,6 +40,7 @@ public class SuspendCommand extends ForEachCommand implements ISuspendHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index 35962d892..636f246cb 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,19 +17,22 @@ 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 {
+ @Override
protected Object getTarget(Object element) {
return getAdapter(element, ITerminate.class);
}
+ @Override
protected void execute(Object target) throws CoreException {
((ITerminate)target).terminate();
}
+ @Override
protected boolean isExecutable(Object target) {
return ((ITerminate)target).canTerminate();
}
@@ -37,6 +40,7 @@ public class TerminateCommand extends ForEachCommand implements ITerminateHandle
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.AbstractDebugCommand#getEnabledStateJobFamily(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
index 7bd6f4331..c58313671 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -22,57 +22,61 @@ 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)
*/
+ @Override
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)
*/
+ @Override
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);
+ 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()
*/
+ @Override
public String getName() {
return fElement.getAttribute(IConfigurationElementConstants.NAME);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getId()
*/
+ @Override
public String getId() {
return fElement.getAttribute(IConfigurationElementConstants.ID);
}
-
+
/**
* Lazily instantiates and returns the underlying source container type.
* @return the {@link ISourceContainerTypeDelegate}
@@ -87,6 +91,7 @@ public class SourceContainerType implements ISourceContainerType {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getDescription()
*/
+ @Override
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
index 159b81698..3e366e2f3 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -13,17 +13,16 @@ package org.eclipse.debug.internal.core.sourcelookup;
import java.util.Comparator;
/**
- * Comparator for source locator mementors. Ignores whitespace differences.
+ * Comparator for source locator mementos. 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;
+public class SourceLocatorMementoComparator implements Comparator<String> {
+
+ @Override
+ public int compare(String o1, String o2) {
+ String m1 = o1;
+ String m2 = o2;
int i1 = 0, i2 = 0;
while (i1 < m1.length()) {
i1 = skipWhitespace(m1, i1);
@@ -37,17 +36,18 @@ public class SourceLocatorMementoComparator implements Comparator {
} 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++;
+ int off = offset;
+ while (off < string.length() && Character.isWhitespace(string.charAt(off))) {
+ off++;
}
- return offset;
+ return off;
}
}
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
index 67b2bb831..1bc135f12 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ 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;
@@ -31,19 +30,19 @@ import org.eclipse.debug.core.ILaunchesListener2;
* @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.
+ * removed, and when a debug target or process terminates.
*/
- private static HashMap fgZipFileCache = new HashMap(5);
+ private static HashMap<String, ZipFile> fgZipFileCache = new HashMap<String, ZipFile>(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
@@ -56,7 +55,7 @@ public class SourceLookupUtils {
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(fgCleaner);
ResourcesPlugin.getWorkspace().addResourceChangeListener(fgCleaner, IResourceChangeEvent.PRE_DELETE | IResourceChangeEvent.PRE_CLOSE);
}
- ZipFile zip = (ZipFile)fgZipFileCache.get(name);
+ ZipFile zip = fgZipFileCache.get(name);
if (zip == null) {
zip = new ZipFile(name);
fgZipFileCache.put(name, zip);
@@ -64,7 +63,7 @@ public class SourceLookupUtils {
return zip;
}
}
-
+
/**
* Closes all zip files that have been opened,
* and removes them from the zip file cache.
@@ -73,9 +72,7 @@ public class SourceLookupUtils {
*/
public static void closeArchives() {
synchronized (fgZipFileCache) {
- Iterator iter = fgZipFileCache.values().iterator();
- while (iter.hasNext()) {
- ZipFile file = (ZipFile)iter.next();
+ for (ZipFile file : fgZipFileCache.values()) {
synchronized (file) {
try {
file.close();
@@ -86,8 +83,8 @@ public class SourceLookupUtils {
}
fgZipFileCache.clear();
}
- }
-
+ }
+
/**
* Called when the debug plug-in shuts down.
*/
@@ -95,10 +92,10 @@ public class SourceLookupUtils {
closeArchives();
if (fgCleaner != null) {
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(fgCleaner);
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(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.
@@ -108,10 +105,11 @@ public class SourceLookupUtils {
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
ILaunch launch = launches[i];
- if (!launch.isTerminated()) {
+ if (!launch.isTerminated()) {
SourceLookupUtils.closeArchives();
return;
}
@@ -121,18 +119,21 @@ public class SourceLookupUtils {
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
- public void launchesAdded(ILaunch[] launches) {
+ @Override
+ public void launchesAdded(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
*/
+ @Override
public void resourceChanged(IResourceChangeEvent event) {
SourceLookupUtils.closeArchives();
}
@@ -140,9 +141,10 @@ public class SourceLookupUtils {
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
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
index fa06e2aaf..996d14287 100644
--- 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
@@ -45,6 +45,7 @@ public class SourcePathComputer implements ISourcePathComputer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourcePathComputer#getId()
*/
+ @Override
public String getId() {
return fElement.getAttribute(IConfigurationElementConstants.ID);
}
@@ -64,6 +65,7 @@ public class SourcePathComputer implements ISourcePathComputer {
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) {
try {
return getDelegate().computeSourceContainers(configuration, monitor);
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
index 27c6d768f..04d26f2f4 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,7 +24,7 @@ import org.w3c.dom.Node;
/**
* Archive source container type for archives in the workspace.
- *
+ *
* @since 3.0
*/
public class ArchiveSourceContainerType extends AbstractSourceContainerTypeDelegate {
@@ -32,6 +32,7 @@ public class ArchiveSourceContainerType extends AbstractSourceContainerTypeDeleg
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento) throws CoreException {
Node node = parseDocument(memento);
if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -39,21 +40,22 @@ public class ArchiveSourceContainerType extends AbstractSourceContainerTypeDeleg
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);
+ 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_11, null);
}
- abort(SourceLookupMessages.ExternalArchiveSourceContainerType_12, 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)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
ArchiveSourceContainer archive = (ArchiveSourceContainer) container;
Document document = newDocument();
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
index bea44536c..b75031552 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -22,14 +22,15 @@ 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)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
Document document = newDocument();
Element element = document.createElement("default"); //$NON-NLS-1$
@@ -40,6 +41,7 @@ public class DefaultSourceContainerType extends AbstractSourceContainerTypeDeleg
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento)throws CoreException {
Node node = parseDocument(memento);
if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -47,10 +49,10 @@ public class DefaultSourceContainerType extends AbstractSourceContainerTypeDeleg
if ("default".equals(element.getNodeName())) { //$NON-NLS-1$
return new DefaultSourceContainer();
}
- abort(SourceLookupMessages.DefaultSourceContainerType_6, null);
+ abort(SourceLookupMessages.DefaultSourceContainerType_6, null);
}
- abort(SourceLookupMessages.DefaultSourceContainerType_7, null);
- return 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
index d25a0ff66..3ce10cf66 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -22,7 +22,7 @@ import org.w3c.dom.Node;
/**
* A folder in the local file system.
- *
+ *
* @since 3.0
*/
public class DirectorySourceContainerType extends AbstractSourceContainerTypeDelegate {
@@ -30,6 +30,7 @@ public class DirectorySourceContainerType extends AbstractSourceContainerTypeDel
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento) throws CoreException {
Node node = parseDocument(memento);
if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -37,21 +38,22 @@ public class DirectorySourceContainerType extends AbstractSourceContainerTypeDel
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);
+ 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_11, null);
}
- abort(SourceLookupMessages.DirectorySourceContainerType_12, 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)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
DirectorySourceContainer folder = (DirectorySourceContainer) container;
Document document = newDocument();
@@ -65,5 +67,5 @@ public class DirectorySourceContainerType extends AbstractSourceContainerTypeDel
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
index 43f295ac5..1ad26bb61 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -21,7 +21,7 @@ import org.w3c.dom.Node;
/**
* External archive source container type.
- *
+ *
* @since 3.0
*/
public class ExternalArchiveSourceContainerType extends AbstractSourceContainerTypeDelegate {
@@ -29,6 +29,7 @@ public class ExternalArchiveSourceContainerType extends AbstractSourceContainerT
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento) throws CoreException {
Node node = parseDocument(memento);
if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -36,20 +37,21 @@ public class ExternalArchiveSourceContainerType extends AbstractSourceContainerT
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);
+ 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_11, null);
}
- abort(SourceLookupMessages.ExternalArchiveSourceContainerType_12, 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)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
ExternalArchiveSourceContainer archive = (ExternalArchiveSourceContainer) container;
Document document = newDocument();
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
index ce9ea0899..5c83b61c8 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -25,7 +25,7 @@ import org.w3c.dom.Node;
/**
* A folder in the workspace.
- *
+ *
* @since 3.0
*/
public class FolderSourceContainerType extends AbstractSourceContainerTypeDelegate {
@@ -33,6 +33,7 @@ public class FolderSourceContainerType extends AbstractSourceContainerTypeDelega
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
FolderSourceContainer folderSourceContainer = (FolderSourceContainer)container;
Document document = newDocument();
@@ -50,6 +51,7 @@ public class FolderSourceContainerType extends AbstractSourceContainerTypeDelega
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento) throws CoreException {
Node node = parseDocument(memento);
if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -57,17 +59,17 @@ public class FolderSourceContainerType extends AbstractSourceContainerTypeDelega
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);
+ 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_11, null);
}
- abort(SourceLookupMessages.FolderSourceContainerType_12, 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
index 7dfbb6c40..4d1e397c0 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,7 +24,7 @@ import org.w3c.dom.Node;
/**
* The type for creating/restoring a project source container.
- *
+ *
* @since 3.0
*/
public class ProjectSourceContainerType extends AbstractSourceContainerTypeDelegate {
@@ -32,6 +32,7 @@ public class ProjectSourceContainerType extends AbstractSourceContainerTypeDeleg
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
ProjectSourceContainer project = (ProjectSourceContainer) container;
Document document = newDocument();
@@ -49,6 +50,7 @@ public class ProjectSourceContainerType extends AbstractSourceContainerTypeDeleg
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento) throws CoreException {
Node node = parseDocument(memento);
if (node.getNodeType() == Node.ELEMENT_NODE) {
@@ -56,17 +58,17 @@ public class ProjectSourceContainerType extends AbstractSourceContainerTypeDeleg
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);
+ 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_11, null);
}
- abort(SourceLookupMessages.ProjectSourceContainerType_12, 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
index 460fadd1f..ba43a28c3 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -21,7 +21,7 @@ import org.w3c.dom.Node;
/**
* The type for creating/restoring workspace source containers.
- *
+ *
* @since 3.0
*/
public class WorkspaceSourceContainerType extends AbstractSourceContainerTypeDelegate {
@@ -29,21 +29,23 @@ public class WorkspaceSourceContainerType extends AbstractSourceContainerTypeDel
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#createSourceContainer(java.lang.String)
*/
+ @Override
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_3, null);
}
- abort(SourceLookupMessages.WorkspaceSourceContainerType_4, 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)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
Document document = newDocument();
Element element = document.createElement("workspace"); //$NON-NLS-1$
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
index b01601c03..c5c5c9cfd 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -14,17 +14,18 @@ import org.eclipse.core.resources.IResource;
/**
* Resolver for the <code>${container_*}</code> variables. Accepts an optional
- * argument that is interpretted as a full path to a container in the workspace.
+ * argument that is interpretted as a full path to a container in the workspace.
* <p>
* Moved to debug core in 3.5, existed in debug.iu since 3.0.
* </p>
* @since 3.5
*/
public class ContainerResolver extends ResourceResolver {
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.stringsubstitution.ResourceResolver#translateSelectedResource(org.eclipse.core.resources.IResource)
*/
+ @Override
protected IResource translateSelectedResource(IResource resource) {
return resource.getParent();
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/DateTimeResolver.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/DateTimeResolver.java
index c95bf3fce..9cfb6f425 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/DateTimeResolver.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/variables/DateTimeResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 EclipseSource Inc. and others.
+ * Copyright (c) 2012, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,7 +24,7 @@ import org.eclipse.osgi.util.NLS;
/**
* Resolver for the <code>current_date</code> dynamic variable for launch configurations. The optional argument
* must be a string pattern for {@link SimpleDateFormat}. Default pattern is <code>yyyyMMdd_HHmm</code>.
- *
+ *
* @since 3.8
*/
public class DateTimeResolver implements IDynamicVariableResolver {
@@ -32,6 +32,7 @@ public class DateTimeResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
SimpleDateFormat format = null;
if (argument != null && argument.trim().length() > 0){
@@ -41,11 +42,11 @@ public class DateTimeResolver implements IDynamicVariableResolver {
DebugPlugin.log(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), NLS.bind(Messages.DateTimeResolver_ProblemWithDateArgument, argument), e));
}
}
-
+
if (format == null){
format = new SimpleDateFormat("yyyyMMdd_HHmm"); //$NON-NLS-1$
}
-
+
return format.format(new Date());
}
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
index ad7b0a8a0..1b25f7664 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -14,7 +14,7 @@ import org.eclipse.core.resources.IResource;
/**
* Resolver for the <code>${project_*}</code> variables. Accepts an optional argument
- * that is interpretted as the name of a project.
+ * that is interpretted as the name of a project.
* <p>
* Moved to debug core in 3.5, existed in debug.iu since 3.0.
* </p>
@@ -24,6 +24,7 @@ public class ProjectResolver extends ResourceResolver {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.stringsubstitution.ResourceResolver#translateSelectedResource(org.eclipse.core.resources.IResource)
*/
+ @Override
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
index 4a5d9b9d5..cdbf25e8c 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,7 +33,7 @@ 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 {
@@ -41,6 +41,7 @@ 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)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
IResource resource = null;
if (argument == null) {
@@ -54,26 +55,26 @@ public class ResourceResolver implements IDynamicVariableResolver {
return translateToValue(resource, variable);
}
}
- abort(MessageFormat.format(Messages.ResourceResolver_0, new String[]{getReferenceExpression(variable, argument)}), null);
+ abort(MessageFormat.format(Messages.ResourceResolver_0, new Object[] { 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() {
@@ -83,7 +84,7 @@ public class ResourceResolver implements IDynamicVariableResolver {
/**
* Returns an expression used to reference the given variable and optional argument.
* For example, <code>${var_name:arg}</code>.
- *
+ *
* @param variable referenced variable
* @param argument referenced argument or <code>null</code>
* @return variable reference expression
@@ -99,24 +100,24 @@ public class ResourceResolver implements IDynamicVariableResolver {
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 <code>null</code>
+ * @param exception underlying exception or <code>null</code>
* @throws CoreException if a problem occurs
*/
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
@@ -129,13 +130,13 @@ public class ResourceResolver implements IDynamicVariableResolver {
} catch (CoreException e) {
// unable to resolve a selection
}
- abort(MessageFormat.format(Messages.ResourceResolver_1, new String[]{getReferenceExpression(variable, null)}), null);
- return null;
+ abort(MessageFormat.format(Messages.ResourceResolver_1, new Object[] { 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
@@ -161,7 +162,7 @@ public class ResourceResolver implements IDynamicVariableResolver {
} else if (name.endsWith("_name")) { //$NON-NLS-1$
return resource.getName();
}
- abort(MessageFormat.format(Messages.ResourceResolver_2, new String[]{getReferenceExpression(variable, null)}), null);
+ abort(MessageFormat.format(Messages.ResourceResolver_2, new Object[] { 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
index 86abb50f1..7bd8c2d5e 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,10 +12,19 @@ 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.core.resources.IResource;
+import org.eclipse.core.resources.IResourceStatus;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+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.core.variables.VariablesPlugin;
import org.eclipse.osgi.util.NLS;
/**
@@ -28,6 +37,7 @@ public final class WorkspaceResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource resource;
diff --git a/org.eclipse.debug.core/pom.xml b/org.eclipse.debug.core/pom.xml
index 1653f6816..c8407ff48 100644
--- a/org.eclipse.debug.core/pom.xml
+++ b/org.eclipse.debug.core/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.debug</groupId>
<artifactId>org.eclipse.debug.core</artifactId>
- <version>3.8.100-SNAPSHOT</version>
+ <version>3.9.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.debug.examples.core/.classpath b/org.eclipse.debug.examples.core/.classpath
index 9f8cf0e63..d97c2f508 100644
--- a/org.eclipse.debug.examples.core/.classpath
+++ b/org.eclipse.debug.examples.core/.classpath
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src_ant"/>
<classpathentry kind="src" path="pdavm/src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
<classpathentry kind="output" path="bin"/>
</classpath>
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
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.examples.core/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
index d6aa25d24..8445dae1c 100644
--- a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF
@@ -6,9 +6,9 @@ Bundle-Version: 1.3.300.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
+ org.eclipse.core.variables;bundle-version="3.2.800",
+ org.eclipse.debug.core;bundle-version="3.9.0",
+ org.apache.ant;bundle-version="1.9.2";resolution:=optional
Eclipse-LazyStart: true
Export-Package: org.eclipse.debug.examples.ant.tasks;x-friends:="org.eclipse.debug.examples.ui",
org.eclipse.debug.examples.core.midi.launcher;x-friends:="org.eclipse.debug.examples.ui",
@@ -19,5 +19,5 @@ Export-Package: org.eclipse.debug.examples.ant.tasks;x-friends:="org.eclipse.deb
org.eclipse.debug.examples.core.pda.protocol;x-friends:="org.eclipse.debug.examples.ui",
org.eclipse.debug.examples.core.pda.sourcelookup;x-friends:="org.eclipse.debug.examples.ui",
org.eclipse.debug.examples.pdavm;x-friends:="org.eclipse.debug.examples.ui"
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
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
index 06e9d2f36..195d902bd 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms 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)
@@ -28,6 +28,7 @@ import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.StringTokenizer;
import java.util.TreeSet;
import java.util.regex.Matcher;
@@ -35,46 +36,48 @@ import java.util.regex.Pattern;
/**
* Push Down Automata interpreter.
- *
+ *
* @since 3.5
*/
public class PDAVirtualMachine {
- static class Stack extends LinkedList {
+ static class Stack extends LinkedList<Object> {
private static final long serialVersionUID = 1L;
- public Object pop() {
+ @Override
+ public Object pop() {
return isEmpty() ? new Integer(0) : remove(size() - 1);
}
- public void push(Object value) {
+ @Override
+ public void push(Object value) {
add(value);
}
}
-
+
static class Register {
- Register(String name) {
- fName = name;
+ Register(String name) {
+ fName = name;
}
String fName;
String fGroup = "<no_group>"; //$NON-NLS-1$
boolean fIsWriteable = true;
- Map fBitFields = new LinkedHashMap(0);
+ Map<String, BitField> fBitFields = new LinkedHashMap<String, BitField>(0);
int fValue;
}
static class BitField {
- BitField(String name) {
- fName = name;
+ BitField(String name) {
+ fName = name;
}
String fName;
int fBitOffset;
int fBitCount;
- Map fMnemonics = new LinkedHashMap(0);
+ Map<String, Integer> fMnemonics = new LinkedHashMap<String, Integer>(0);
}
- Map fRegisters = new LinkedHashMap(0);
-
+ Map<String, Register> fRegisters = new LinkedHashMap<String, Register>(0);
+
class Args {
final String[] fArgs;
@@ -87,7 +90,7 @@ public class PDAVirtualMachine {
boolean hasNextArg() {
return fArgs.length > next;
}
-
+
String getNextStringArg() {
if (fArgs.length > next) {
return fArgs[next++];
@@ -124,7 +127,7 @@ public class PDAVirtualMachine {
PDAThread getThreadArg() {
int id = getNextIntArg();
- return (PDAThread)fThreads.get( new Integer(id) );
+ return fThreads.get( new Integer(id) );
}
}
@@ -141,10 +144,10 @@ public class PDAVirtualMachine {
String[] fThreadCode;
/** PDAThread copy of the labels. */
- Map fThreadLabels;
+ Map<String, Integer> fThreadLabels;
/** The stack of stack frames (the control stack) */
- final List fFrames = new LinkedList();
+ final List<Frame> fFrames = new LinkedList<Frame>();
/** Current stack frame (not includced in fFrames) */
Frame fCurrentFrame;
@@ -160,11 +163,11 @@ public class PDAVirtualMachine {
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);
@@ -173,7 +176,7 @@ public class PDAVirtualMachine {
}
}
- final Map fThreads = new LinkedHashMap();
+ final Map<Integer, PDAThread> fThreads = new LinkedHashMap<Integer, PDAThread>();
int fNextThreadId = 1;
@@ -185,12 +188,12 @@ public class PDAVirtualMachine {
final String[] fCode;
/** A mapping of labels to indicies in the code array */
- final Map fLabels;
+ final Map<String, Integer> fLabels;
/** Each stack frame is a mapping of variable names to values. */
class Frame {
- final Map fLocalVariables = new LinkedHashMap();
-
+ final Map<String, Object> fLocalVariables = new LinkedHashMap<String, Object>();
+
/**
* The name of the function in this frame
*/
@@ -206,7 +209,7 @@ public class PDAVirtualMachine {
fFunction = function;
fPC = pc;
}
-
+
void set(String name, Object value) {
if (name.startsWith("$")) { //$NON-NLS-1$
setRegisterValue(name, value);
@@ -214,31 +217,35 @@ public class PDAVirtualMachine {
fLocalVariables.put(name, value);
}
}
-
+
Object get(String name) {
if (name.startsWith("$")) { //$NON-NLS-1$
return getRegisterValue(name);
- } else {
+ } else {
return fLocalVariables.get(name);
}
}
}
void setRegisterValue(String name, Object value) {
- Register reg = (Register)fRegisters.get(getRegisterPartOfName(name));
- if (reg == null) return;
+ Register reg = 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;
+ 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);
+ intValue = bitField.fMnemonics.get(value);
}
if (intValue != null) {
- int bitFieldMask = 2^(bitField.fBitCount - 1);
+ int bitFieldMask = 2^(bitField.fBitCount - 1);
int registerMask = ~(bitFieldMask << bitField.fBitOffset);
int bitFieldValue = intValue.intValue() & bitFieldMask;
reg.fValue = (reg.fValue & registerMask) | (bitFieldValue << bitField.fBitOffset);
@@ -249,25 +256,29 @@ public class PDAVirtualMachine {
}
Object getRegisterValue(String name) {
- Register reg = (Register)fRegisters.get(getRegisterPartOfName(name));
- if (reg == null) return null;
+ Register reg = 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);
+ 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();
+ final Map<Integer, Boolean> fBreakpoints = new HashMap<Integer, Boolean>();
/**
* The suspend flag is true if the VM should suspend running the program and
@@ -280,7 +291,7 @@ public class PDAVirtualMachine {
/** Flag indicating whether the debugger is performing a step return */
boolean fStepReturnVM = false;
-
+
int fSteppingThread = 0;
/** Name of the pda program being debugged */
@@ -313,7 +324,7 @@ public class PDAVirtualMachine {
OutputStream fEventStream;
/** The eventstops table holds which events cause suspends and which do not. */
- final Map fEventStops = new HashMap();
+ final Map<String, Boolean> fEventStops = new HashMap<String, Boolean>();
{
fEventStops.put("unimpinstr", Boolean.FALSE); //$NON-NLS-1$
fEventStops.put("nosuchlabel", Boolean.FALSE); //$NON-NLS-1$
@@ -323,13 +334,13 @@ public class PDAVirtualMachine {
* The watchpoints table holds watchpoint information.
* <p/>
* variablename_stackframedepth => N
- * <ul>
- * <li>N = 0 is no watch</li>
+ * <ul>
+ * <li>N = 0 is no watch</li>
* <li>N = 1 is read watch</li>
* <li>N = 2 is write watch</li>
* <li>N = 3 is both, etc.</li>
*/
- final Map fWatchpoints = new HashMap();
+ final Map<String, Integer> fWatchpoints = new HashMap<String, Integer>();
public static void main(String[] args) {
String programFile = args.length >= 1 ? args[0] : null;
@@ -378,7 +389,7 @@ public class PDAVirtualMachine {
// Load all the code into memory
FileReader fileReader = new FileReader(inputFile);
StringWriter stringWriter = new StringWriter();
- List code = new LinkedList();
+ List<String> code = new LinkedList<String>();
try {
int c = fileReader.read();
while (c != -1) {
@@ -395,7 +406,7 @@ public class PDAVirtualMachine {
fileReader.close();
}
code.add(stringWriter.toString().trim());
- fCode = (String[])code.toArray(new String[code.size()]);
+ fCode = code.toArray(new String[code.size()]);
fLabels = mapLabels(fCode);
@@ -407,8 +418,8 @@ public class PDAVirtualMachine {
/**
* Initializes the labels map
*/
- Map mapLabels(String[] code) {
- Map labels = new HashMap();
+ Map<String, Integer> mapLabels(String[] code) {
+ Map<String, Integer> labels = new HashMap<String, Integer>();
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));
@@ -460,7 +471,7 @@ public class PDAVirtualMachine {
fSuspendVM = "client"; //$NON-NLS-1$
}
-
+
void run() {
int id = fNextThreadId++;
sendDebugEvent("vmstarted", false); //$NON-NLS-1$
@@ -472,7 +483,7 @@ public class PDAVirtualMachine {
boolean allThreadsSuspended = false;
while (!fThreads.isEmpty()) {
checkForBreakpoint();
-
+
if (fSuspendVM != null) {
debugUI();
} else {
@@ -483,13 +494,13 @@ public class PDAVirtualMachine {
}
}
- PDAThread[] threadsCopy = (PDAThread[])fThreads.values().toArray(new PDAThread[fThreads.size()]);
+ PDAThread[] threadsCopy = 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);
@@ -498,10 +509,10 @@ public class PDAVirtualMachine {
thread.fRun = false;
} else if (thread.fStepReturn) {
// If this thread is in a step-return operation, check
- // if we've returned from a call.
+ // if we've returned from a call.
instruction = thread.fThreadCode[thread.fCurrentFrame.fPC];
if ("return".equals(instruction)) { //$NON-NLS-1$
- // Note: this will only be triggered if the current
+ // Note: this will only be triggered if the current
// thread also has the fStepReturn flag set.
if (fStepReturnVM) {
fSuspendVM = thread.fID + " step"; //$NON-NLS-1$
@@ -517,14 +528,14 @@ public class PDAVirtualMachine {
sendDebugEvent("suspended " + thread.fID + " " + thread.fSuspend, false); //$NON-NLS-1$ //$NON-NLS-2$
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); //$NON-NLS-1$
if (fDebug) {
try {
@@ -543,28 +554,42 @@ public class PDAVirtualMachine {
void doOneInstruction(PDAThread thread, String instr) {
StringTokenizer tokenizer = new StringTokenizer(instr);
String op = tokenizer.nextToken();
- List tokens = new LinkedList();
+ List<String> tokens = new LinkedList<String>();
while (tokenizer.hasMoreTokens()) {
tokens.add(tokenizer.nextToken());
}
- Args args = new Args( (String[])tokens.toArray(new String[tokens.size()]) );
+ Args args = new Args( tokens.toArray(new String[tokens.size()]) );
boolean opValid = true;
- if (op.equals("add")) iAdd(thread, args); //$NON-NLS-1$
- else if (op.equals("branch_not_zero")) iBranchNotZero(thread, args); //$NON-NLS-1$
- else if (op.equals("call")) iCall(thread, args); //$NON-NLS-1$
- else if (op.equals("dec")) iDec(thread, args); //$NON-NLS-1$
- else if (op.equals("def")) iDef(thread, args); //$NON-NLS-1$
- else if (op.equals("dup")) iDup(thread, args); //$NON-NLS-1$
- else if (op.equals("exec")) iExec(thread, args); //$NON-NLS-1$
- else if (op.equals("halt")) iHalt(thread, args); //$NON-NLS-1$
- else if (op.equals("output")) iOutput(thread, args); //$NON-NLS-1$
- else if (op.equals("pop")) iPop(thread, args); //$NON-NLS-1$
- else if (op.equals("push")) iPush(thread, args); //$NON-NLS-1$
- else if (op.equals("return")) iReturn(thread, args); //$NON-NLS-1$
- else if (op.equals("var")) iVar(thread, args); //$NON-NLS-1$
- else if (op.equals("xyzzy")) iInternalEndEval(thread, args); //$NON-NLS-1$
- else if (op.startsWith(":")) {} // label //$NON-NLS-1$
+ if (op.equals("add")) { //$NON-NLS-1$
+ iAdd(thread, args);
+ } else if (op.equals("branch_not_zero")) { //$NON-NLS-1$
+ iBranchNotZero(thread, args);
+ } else if (op.equals("call")) { //$NON-NLS-1$
+ iCall(thread, args);
+ } else if (op.equals("dec")) { //$NON-NLS-1$
+ iDec(thread, args);
+ } else if (op.equals("def")) { //$NON-NLS-1$
+ iDef(thread, args);
+ } else if (op.equals("dup")) { //$NON-NLS-1$
+ iDup(thread, args);
+ } else if (op.equals("exec")) { //$NON-NLS-1$
+ iExec(thread, args);
+ } else if (op.equals("halt")) { //$NON-NLS-1$
+ iHalt(thread, args);
+ } else if (op.equals("output")) { //$NON-NLS-1$
+ iOutput(thread, args);
+ } else if (op.equals("pop")) { //$NON-NLS-1$
+ iPop(thread, args);
+ } else if (op.equals("push")) { //$NON-NLS-1$
+ iPush(thread, args);
+ } else if (op.equals("return")) { //$NON-NLS-1$
+ iReturn(thread, args);
+ } else if (op.equals("var")) { //$NON-NLS-1$
+ iVar(thread, args);
+ } else if (op.equals("xyzzy")) { //$NON-NLS-1$
+ iInternalEndEval(thread, args);
+ } else if (op.startsWith(":")) {} // label //$NON-NLS-1$
else if (op.startsWith("#")) {} // comment //$NON-NLS-1$
else {
opValid = false;
@@ -572,7 +597,7 @@ public class PDAVirtualMachine {
if (!opValid) {
sendDebugEvent("unimplemented instruction " + op, true); //$NON-NLS-1$
- if ( ((Boolean)fEventStops.get("unimpinstr")).booleanValue() ) { //$NON-NLS-1$
+ if ( fEventStops.get("unimpinstr").booleanValue() ) { //$NON-NLS-1$
fSuspendVM = thread.fID + " event unimpinstr"; //$NON-NLS-1$
thread.fCurrentFrame.fPC--;
}
@@ -589,18 +614,18 @@ public class PDAVirtualMachine {
void checkForBreakpoint() {
if (fDebug) {
- for (Iterator itr = fThreads.values().iterator(); itr.hasNext();) {
- PDAThread thread = (PDAThread)itr.next();
+ for (Iterator<PDAThread> itr = fThreads.values().iterator(); itr.hasNext();) {
+ PDAThread thread = 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 (fSuspendVM == null &&
+ thread.fSuspend == null && !thread.fPerformingEval &&
+ fBreakpoints.containsKey(pc))
{
- if ( ((Boolean)fBreakpoints.get(pc)).booleanValue() ) {
+ if ( fBreakpoints.get(pc).booleanValue() ) {
fSuspendVM = thread.fID + " breakpoint " + pc; //$NON-NLS-1$
} else {
thread.fSuspend = "breakpoint " + pc; //$NON-NLS-1$
@@ -644,12 +669,12 @@ public class PDAVirtualMachine {
// 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();
+ for (Iterator<PDAThread> itr = fThreads.values().iterator(); itr.hasNext();) {
+ PDAThread thread = itr.next();
thread.fSuspend = null;
thread.fStep = thread.fStepReturn = thread.fPerformingEval = false;
}
-
+
while (fSuspendVM != null) {
String line = ""; //$NON-NLS-1$
try {
@@ -676,41 +701,69 @@ public class PDAVirtualMachine {
}
String command = tokenizer.nextToken();
- List tokens = new LinkedList();
+ List<String> tokens = new LinkedList<String>();
while (tokenizer.hasMoreTokens()) {
tokens.add(tokenizer.nextToken());
}
- Args args = new Args( (String[])tokens.toArray(new String[tokens.size()]));
-
- if ("children".equals(command)) debugChildren(args); //$NON-NLS-1$
- else if ("clear".equals(command)) debugClearBreakpoint(args); //$NON-NLS-1$
- else if ("data".equals(command)) debugData(args); //$NON-NLS-1$
- else if ("drop".equals(command)) debugDropFrame(args); //$NON-NLS-1$
- else if ("eval".equals(command)) debugEval(args); //$NON-NLS-1$
- else if ("eventstop".equals(command)) debugEventStop(args); //$NON-NLS-1$
- else if ("frame".equals(command)) debugFrame(args); //$NON-NLS-1$
- else if ("groups".equals(command)) debugGroups(args); //$NON-NLS-1$
- else if ("popdata".equals(command)) debugPopData(args); //$NON-NLS-1$
- else if ("pushdata".equals(command)) debugPushData(args); //$NON-NLS-1$
- else if ("registers".equals(command)) debugRegisters(args); //$NON-NLS-1$
- else if ("restart".equals(command)) debugRestart(args); //$NON-NLS-1$
- else if ("resume".equals(command)) debugResume(args); //$NON-NLS-1$
- else if ("set".equals(command)) debugSetBreakpoint(args); //$NON-NLS-1$
- else if ("setdata".equals(command)) debugSetData(args); //$NON-NLS-1$
- else if ("setvar".equals(command)) debugSetVariable(args); //$NON-NLS-1$
- else if ("stack".equals(command)) debugStack(args); //$NON-NLS-1$
- else if ("stackdepth".equals(command)) debugStackDepth(args); //$NON-NLS-1$
- else if ("state".equals(command)) debugState(args); //$NON-NLS-1$
- else if ("step".equals(command)) debugStep(args); //$NON-NLS-1$
- else if ("stepreturn".equals(command)) debugStepReturn(args); //$NON-NLS-1$
- else if ("suspend".equals(command)) debugSuspend(args); //$NON-NLS-1$
- else if ("terminate".equals(command)) debugTerminate(); //$NON-NLS-1$
- else if ("threads".equals(command)) debugThreads(); //$NON-NLS-1$
- else if ("var".equals(command)) debugVar(args); //$NON-NLS-1$
- else if ("vmresume".equals(command)) debugVMResume(); //$NON-NLS-1$
- else if ("vmsuspend".equals(command)) debugVMSuspend(); //$NON-NLS-1$
- else if ("watch".equals(command)) debugWatch(args); //$NON-NLS-1$
- else {
+ Args args = new Args( tokens.toArray(new String[tokens.size()]));
+
+ if ("children".equals(command)) { //$NON-NLS-1$
+ debugChildren(args);
+ } else if ("clear".equals(command)) { //$NON-NLS-1$
+ debugClearBreakpoint(args);
+ } else if ("data".equals(command)) { //$NON-NLS-1$
+ debugData(args);
+ } else if ("drop".equals(command)) { //$NON-NLS-1$
+ debugDropFrame(args);
+ } else if ("eval".equals(command)) { //$NON-NLS-1$
+ debugEval(args);
+ } else if ("eventstop".equals(command)) { //$NON-NLS-1$
+ debugEventStop(args);
+ } else if ("frame".equals(command)) { //$NON-NLS-1$
+ debugFrame(args);
+ } else if ("groups".equals(command)) { //$NON-NLS-1$
+ debugGroups(args);
+ } else if ("popdata".equals(command)) { //$NON-NLS-1$
+ debugPopData(args);
+ } else if ("pushdata".equals(command)) { //$NON-NLS-1$
+ debugPushData(args);
+ } else if ("registers".equals(command)) { //$NON-NLS-1$
+ debugRegisters(args);
+ } else if ("restart".equals(command)) { //$NON-NLS-1$
+ debugRestart(args);
+ } else if ("resume".equals(command)) { //$NON-NLS-1$
+ debugResume(args);
+ } else if ("set".equals(command)) { //$NON-NLS-1$
+ debugSetBreakpoint(args);
+ } else if ("setdata".equals(command)) { //$NON-NLS-1$
+ debugSetData(args);
+ } else if ("setvar".equals(command)) { //$NON-NLS-1$
+ debugSetVariable(args);
+ } else if ("stack".equals(command)) { //$NON-NLS-1$
+ debugStack(args);
+ } else if ("stackdepth".equals(command)) { //$NON-NLS-1$
+ debugStackDepth(args);
+ } else if ("state".equals(command)) { //$NON-NLS-1$
+ debugState(args);
+ } else if ("step".equals(command)) { //$NON-NLS-1$
+ debugStep(args);
+ } else if ("stepreturn".equals(command)) { //$NON-NLS-1$
+ debugStepReturn(args);
+ } else if ("suspend".equals(command)) { //$NON-NLS-1$
+ debugSuspend(args);
+ } else if ("terminate".equals(command)) { //$NON-NLS-1$
+ debugTerminate();
+ } else if ("threads".equals(command)) { //$NON-NLS-1$
+ debugThreads();
+ } else if ("var".equals(command)) { //$NON-NLS-1$
+ debugVar(args);
+ } else if ("vmresume".equals(command)) { //$NON-NLS-1$
+ debugVMResume();
+ } else if ("vmsuspend".equals(command)) { //$NON-NLS-1$
+ debugVMSuspend();
+ } else if ("watch".equals(command)) { //$NON-NLS-1$
+ debugWatch(args);
+ } else {
sendCommandResponse("error: invalid command\n"); //$NON-NLS-1$
}
}
@@ -724,21 +777,21 @@ public class PDAVirtualMachine {
int sfnumber = args.getNextIntArg();
String var = args.getNextStringArg();
-
- Frame frame = sfnumber >= thread.fFrames.size()
+
+ Frame frame = sfnumber >= thread.fFrames.size()
? thread.fCurrentFrame : (Frame)thread.fFrames.get(sfnumber);
String varDot = var + "."; //$NON-NLS-1$
- List children = new ArrayList();
- for (Iterator itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
- String localVar = (String)itr.next();
+ List<String> children = new ArrayList<String>();
+ for (Iterator<String> itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
+ String localVar = 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();) {
+ for (Iterator<String> itr = children.iterator(); itr.hasNext();) {
result.append(itr.next());
result.append('|');
}
@@ -746,7 +799,7 @@ public class PDAVirtualMachine {
sendCommandResponse(result.toString());
}
-
+
void debugClearBreakpoint(Args args) {
int line = args.getNextIntArg();
@@ -764,7 +817,7 @@ public class PDAVirtualMachine {
}
StringBuffer result = new StringBuffer();
- for (Iterator itr = thread.fStack.iterator(); itr.hasNext();) {
+ for (Iterator<?> itr = thread.fStack.iterator(); itr.hasNext();) {
result.append(itr.next());
result.append('|');
}
@@ -780,7 +833,7 @@ public class PDAVirtualMachine {
}
if (!thread.fFrames.isEmpty()) {
- thread.fCurrentFrame = (Frame)thread.fFrames.remove(thread.fFrames.size() - 1);
+ thread.fCurrentFrame = thread.fFrames.remove(thread.fFrames.size() - 1);
}
thread.fCurrentFrame.fPC--;
sendCommandResponse("ok\n"); //$NON-NLS-1$
@@ -798,18 +851,18 @@ public class PDAVirtualMachine {
sendCommandResponse("error: cannot evaluate while vm is suspended\n"); //$NON-NLS-1$
return;
}
-
+
PDAThread thread = args.getThreadArg();
if (thread == null) {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
return;
}
-
+
if (thread.fSuspend == null) {
sendCommandResponse("error: thread running\n"); //$NON-NLS-1$
return;
}
-
+
StringTokenizer tokenizer = new StringTokenizer(args.getNextStringArg(), "|"); //$NON-NLS-1$
tokenizer.countTokens();
@@ -841,9 +894,9 @@ public class PDAVirtualMachine {
thread.fSavedPC = thread.fCurrentFrame.fPC;
thread.fCurrentFrame.fPC = fCode.length;
thread.fPerformingEval = true;
-
+
thread.fSuspend = null;
-
+
sendCommandResponse("ok\n"); //$NON-NLS-1$
sendDebugEvent("resumed " + thread.fID + " eval", false); //$NON-NLS-1$ //$NON-NLS-2$
@@ -874,7 +927,7 @@ public class PDAVirtualMachine {
if (sfnumber >= thread.fFrames.size()) {
frame = thread.fCurrentFrame;
} else {
- frame = (Frame)thread.fFrames.get(sfnumber);
+ frame = thread.fFrames.get(sfnumber);
}
sendCommandResponse(printFrame(frame) + "\n"); //$NON-NLS-1$
}
@@ -883,13 +936,13 @@ public class PDAVirtualMachine {
* @param args
*/
void debugGroups(Args args) {
- TreeSet groups = new TreeSet();
- for (Iterator itr = fRegisters.values().iterator(); itr.hasNext();) {
- Register reg = (Register)itr.next();
+ TreeSet<String> groups = new TreeSet<String>();
+ for (Iterator<Register> itr = fRegisters.values().iterator(); itr.hasNext();) {
+ Register reg = itr.next();
groups.add(reg.fGroup);
}
StringBuffer response = new StringBuffer();
- for (Iterator itr = groups.iterator(); itr.hasNext();) {
+ for (Iterator<String> itr = groups.iterator(); itr.hasNext();) {
response.append(itr.next());
response.append('|');
}
@@ -914,7 +967,7 @@ public class PDAVirtualMachine {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
return;
}
-
+
Object val = args.getNextIntOrStringArg();
thread.fStack.push(val);
sendCommandResponse("ok\n"); //$NON-NLS-1$
@@ -922,16 +975,16 @@ public class PDAVirtualMachine {
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();
+ for (Iterator<Register> itr = fRegisters.values().iterator(); itr.hasNext();) {
+ Register reg = 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();
+ for (Iterator<BitField> itr2 = reg.fBitFields.values().iterator(); itr2.hasNext();) {
+ BitField bitField = itr2.next();
response.append('|');
response.append(bitField.fName);
response.append(' ');
@@ -939,15 +992,15 @@ public class PDAVirtualMachine {
response.append(' ');
response.append(bitField.fBitCount);
response.append(' ');
- for (Iterator itr3 = bitField.fMnemonics.entrySet().iterator(); itr3.hasNext();) {
- Map.Entry mnemonicEntry = (Map.Entry)itr3.next();
+ for (Iterator<Entry<String, Integer>> itr3 = bitField.fMnemonics.entrySet().iterator(); itr3.hasNext();) {
+ Entry<String, Integer> mnemonicEntry = itr3.next();
response.append(mnemonicEntry.getKey());
response.append(' ');
response.append(mnemonicEntry.getValue());
response.append(' ');
}
}
-
+
response.append('#');
}
}
@@ -961,8 +1014,8 @@ public class PDAVirtualMachine {
void debugRestart(Args args) {
fSuspendVM = "restart"; //$NON-NLS-1$
- for (Iterator itr = fThreads.keySet().iterator(); itr.hasNext();) {
- Integer id = (Integer)itr.next();
+ for (Iterator<Integer> itr = fThreads.keySet().iterator(); itr.hasNext();) {
+ Integer id = itr.next();
sendDebugEvent("exited " + id, false); //$NON-NLS-1$
}
fThreads.clear();
@@ -970,9 +1023,9 @@ public class PDAVirtualMachine {
int id = fNextThreadId++;
fThreads.put(new Integer(id), new PDAThread(id, "main", 0)); //$NON-NLS-1$
sendDebugEvent("started " + id, false); //$NON-NLS-1$
-
+
fRegisters.clear();
-
+
sendCommandResponse("ok\n"); //$NON-NLS-1$
}
@@ -981,26 +1034,26 @@ public class PDAVirtualMachine {
if (thread == null) {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
return;
- }
+ }
if (fSuspendVM != null) {
sendCommandResponse("error: cannot resume thread when vm is suspended\n"); //$NON-NLS-1$
return;
- }
+ }
if (thread.fSuspend == null) {
sendCommandResponse("error: thread already running\n"); //$NON-NLS-1$
return;
- }
-
+ }
+
thread.fSuspend = null;
sendDebugEvent("resumed " + thread.fID + " client", false); //$NON-NLS-1$ //$NON-NLS-2$
-
+
sendCommandResponse("ok\n"); //$NON-NLS-1$
}
void debugSetBreakpoint(Args args) {
int line = args.getNextIntArg();
int stopVM = args.getNextIntArg();
-
+
fBreakpoints.put(new Integer(line), new Boolean(stopVM != 0));
sendCommandResponse("ok\n"); //$NON-NLS-1$
}
@@ -1011,7 +1064,7 @@ public class PDAVirtualMachine {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
return;
}
-
+
int offset = args.getNextIntArg();
Object val = args.getNextIntOrStringArg();
@@ -1036,11 +1089,11 @@ public class PDAVirtualMachine {
while (args.hasNextArg()) {
val = val.toString() + " " + args.getNextStringArg(); //$NON-NLS-1$
}
-
+
if (sfnumber >= thread.fFrames.size()) {
thread.fCurrentFrame.set(var, val);
} else {
- ((Frame)thread.fFrames.get(sfnumber)).set(var, val);
+ thread.fFrames.get(sfnumber).set(var, val);
}
sendCommandResponse("ok\n"); //$NON-NLS-1$
}
@@ -1053,9 +1106,9 @@ public class PDAVirtualMachine {
}
StringBuffer result = new StringBuffer();
-
- for (Iterator itr = thread.fFrames.iterator(); itr.hasNext();) {
- Frame frame = (Frame)itr.next();
+
+ for (Iterator<Frame> itr = thread.fFrames.iterator(); itr.hasNext();) {
+ Frame frame = itr.next();
result.append(printFrame(frame));
result.append('#');
}
@@ -1085,8 +1138,8 @@ public class PDAVirtualMachine {
buf.append(frame.fPC);
buf.append('|');
buf.append(frame.fFunction);
- for (Iterator itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
- String var = (String)itr.next();
+ for (Iterator<String> itr = frame.fLocalVariables.keySet().iterator(); itr.hasNext();) {
+ String var = itr.next();
if (var.indexOf('.') == -1) {
buf.append('|');
buf.append(var);
@@ -1107,21 +1160,21 @@ public class PDAVirtualMachine {
}
sendCommandResponse(response + "\n"); //$NON-NLS-1$
}
-
+
void debugStep(Args args) {
PDAThread thread = args.getThreadArg();
if (thread == null) {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
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
+ // 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
+ // All threads are suspended, so suspend all threads again when
// step completes.
fSuspendVM = null;
fStepVM = true;
@@ -1145,8 +1198,8 @@ public class PDAVirtualMachine {
if (thread == null) {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
return;
- }
-
+ }
+
if (fSuspendVM != null) {
fSuspendVM = null;
fStepReturnVM = true;
@@ -1168,7 +1221,7 @@ public class PDAVirtualMachine {
if (thread == null) {
sendCommandResponse("error: invalid thread\n"); //$NON-NLS-1$
return;
- }
+ }
if (fSuspendVM != null) {
sendCommandResponse("error: vm already suspended\n"); //$NON-NLS-1$
return;
@@ -1176,8 +1229,8 @@ public class PDAVirtualMachine {
if (thread.fSuspend != null) {
sendCommandResponse("error: thread already suspended\n"); //$NON-NLS-1$
return;
- }
-
+ }
+
thread.fSuspend = "client"; //$NON-NLS-1$
sendDebugEvent("suspended " + thread.fID + " client", false); //$NON-NLS-1$ //$NON-NLS-2$
sendCommandResponse("ok\n"); //$NON-NLS-1$
@@ -1185,7 +1238,7 @@ public class PDAVirtualMachine {
void debugThreads() {
StringBuffer response = new StringBuffer();
- for (Iterator itr = fThreads.keySet().iterator(); itr.hasNext();) {
+ for (Iterator<Integer> itr = fThreads.keySet().iterator(); itr.hasNext();) {
response.append(itr.next());
response.append(' ');
}
@@ -1202,9 +1255,9 @@ public class PDAVirtualMachine {
int sfnumber = args.getNextIntArg();
String var = args.getNextStringArg();
- Frame frame = sfnumber >= thread.fFrames.size()
+ 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"); //$NON-NLS-1$
@@ -1217,7 +1270,7 @@ public class PDAVirtualMachine {
if (fSuspendVM == null) {
sendCommandResponse("error: vm already running\n"); //$NON-NLS-1$
return;
- }
+ }
fSuspendVM = null;
sendCommandResponse("ok\n"); //$NON-NLS-1$
@@ -1261,10 +1314,10 @@ public class PDAVirtualMachine {
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();
+ thread.fCurrentFrame.fPC = thread.fThreadLabels.get(label).intValue();
} else {
sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
- if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) { //$NON-NLS-1$
+ if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
fSuspendVM = thread.fID + " event nosuchlabel"; //$NON-NLS-1$
thread.fStack.push(val);
thread.fCurrentFrame.fPC--;
@@ -1277,10 +1330,10 @@ public class PDAVirtualMachine {
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());
+ thread.fCurrentFrame = new Frame(label, thread.fThreadLabels.get(label).intValue());
} else {
sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
- if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) { //$NON-NLS-1$
+ if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
fSuspendVM = thread.fID + " event nosuchlabel"; //$NON-NLS-1$
thread.fCurrentFrame.fPC--;
}
@@ -1311,22 +1364,28 @@ public class PDAVirtualMachine {
String bitFieldName = getBitFieldPartOfName(name);
if ("register".equals(type)) { //$NON-NLS-1$
- Register reg = new Register(regName);
+ Register reg = new Register(regName);
reg.fGroup = args.getNextStringArg();
fRegisters.put(regName, reg);
reg.fIsWriteable = args.getNextBooleanArg();
} else if ("bitfield".equals(type)) { //$NON-NLS-1$
- Register reg = (Register)fRegisters.get(regName);
- if (reg == null) return;
+ Register reg = 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)) { //$NON-NLS-1$
- Register reg = (Register)fRegisters.get(regName);
- if (reg == null) return;
- BitField bitField = (BitField)reg.fBitFields.get(bitFieldName);
- if (bitField == null) return;
+ Register reg = fRegisters.get(regName);
+ if (reg == null) {
+ return;
+ }
+ BitField bitField = reg.fBitFields.get(bitFieldName);
+ if (bitField == null) {
+ return;
+ }
bitField.fMnemonics.put(args.getNextStringArg(), new Integer(args.getNextIntArg()));
}
sendDebugEvent("registers", false); //$NON-NLS-1$
@@ -1346,7 +1405,7 @@ public class PDAVirtualMachine {
if (name.startsWith("$") && start != -1) { //$NON-NLS-1$
return name.substring(start + 1, name.length());
}
- return null;
+ return null;
}
/**
@@ -1358,16 +1417,16 @@ public class PDAVirtualMachine {
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()) );
+ fThreads.put( new Integer(id), new PDAThread(id, label, fLabels.get(label).intValue()) );
sendDebugEvent("started " + id, false); //$NON-NLS-1$
} else {
sendDebugEvent("no such label " + label, true); //$NON-NLS-1$
- if ( ((Boolean)fEventStops.get("nosuchlabel")).booleanValue() ) { //$NON-NLS-1$
+ if ( fEventStops.get("nosuchlabel").booleanValue() ) { //$NON-NLS-1$
thread.fSuspend = "event nosuchlabel"; //$NON-NLS-1$
thread.fCurrentFrame.fPC--;
}
@@ -1396,7 +1455,7 @@ public class PDAVirtualMachine {
String var = arg.substring(1);
thread.fCurrentFrame.set(var, thread.fStack.pop());
String key = thread.fCurrentFrame.fFunction + "::" + var; //$NON-NLS-1$
- if ( fWatchpoints.containsKey(key) && (((Integer)fWatchpoints.get(key)).intValue() & 2) != 0 ) {
+ if ( fWatchpoints.containsKey(key) && (fWatchpoints.get(key).intValue() & 2) != 0 ) {
fSuspendVM = thread.fID + " watch write " + key; //$NON-NLS-1$
}
} else {
@@ -1410,10 +1469,13 @@ public class PDAVirtualMachine {
if (arg.startsWith("$")) { //$NON-NLS-1$
String var = arg.substring(1);
Object val = thread.fCurrentFrame.get(var);
- if (val == null) val = "<undefined>"; //$NON-NLS-1$
+ if (val == null)
+ {
+ val = "<undefined>"; //$NON-NLS-1$
+ }
thread.fStack.push(val);
String key = thread.fCurrentFrame.fFunction + "::" + var; //$NON-NLS-1$
- if (fWatchpoints.containsKey(key) && (((Integer)fWatchpoints.get(key)).intValue() & 1) != 0) {
+ if (fWatchpoints.containsKey(key) && (fWatchpoints.get(key).intValue() & 1) != 0) {
fSuspendVM = thread.fID + " watch read " + key; //$NON-NLS-1$
}
} else {
@@ -1430,7 +1492,7 @@ public class PDAVirtualMachine {
}
thread.fStack.push(val);
}
-
+
arg = args.getNextStringArg();
}
}
@@ -1441,7 +1503,7 @@ public class PDAVirtualMachine {
*/
void iReturn(PDAThread thread, Args args) {
if (!thread.fFrames.isEmpty()) {
- thread.fCurrentFrame = (Frame)thread.fFrames.remove(thread.fFrames.size() - 1);
+ thread.fCurrentFrame = thread.fFrames.remove(thread.fFrames.size() - 1);
} else {
// Execution returned from the top frame, which means this thread
// should exit.
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
index f972867d8..242236705 100644
--- 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
@@ -33,6 +33,7 @@ public class ClockControl extends TimeControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.TimeControl#getTimeValue()
*/
+ @Override
protected long getTimeValue() {
return getSequencer().getMicrosecondPosition();
}
@@ -40,6 +41,7 @@ public class ClockControl extends TimeControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable()
*/
+ @Override
public boolean isEditable() {
return true;
}
@@ -47,6 +49,7 @@ public class ClockControl extends TimeControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String)
*/
+ @Override
public IStatus setValue(String newValue) {
try {
long value = getLong(newValue);
@@ -61,6 +64,7 @@ public class ClockControl extends TimeControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String)
*/
+ @Override
public IStatus validateValue(String value) {
try {
getLong(value);
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
index 01e63a6b9..3ab8d18c4 100644
--- 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
@@ -28,6 +28,7 @@ public class LengthControl extends TimeControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.TimeControl#getTimeValue()
*/
+ @Override
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
index 75801ecea..674e2fc49 100644
--- 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
@@ -85,6 +85,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.Launch#canTerminate()
*/
+ @Override
public boolean canTerminate() {
return getSequencer().isOpen();
}
@@ -92,6 +93,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.Launch#isTerminated()
*/
+ @Override
public boolean isTerminated() {
if (fSequencer != null) {
return !fSequencer.isOpen();
@@ -102,6 +104,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.Launch#terminate()
*/
+ @Override
public void terminate() throws DebugException {
getSequencer().stop();
getSequencer().close();
@@ -112,6 +115,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canResume()
*/
+ @Override
public boolean canResume() {
return isSuspended();
}
@@ -119,6 +123,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
*/
+ @Override
public boolean canSuspend() {
if (fSequencer != null) {
return fSequencer.isRunning();
@@ -129,6 +134,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
+ @Override
public boolean isSuspended() {
if (fSequencer != null) {
return fSequencer.isOpen() & !fSequencer.isRunning();
@@ -139,6 +145,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
+ @Override
public void resume() throws DebugException {
getSequencer().start();
fireChanged();
@@ -148,6 +155,7 @@ public class MidiLaunch extends Launch implements ISuspendResume {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
+ @Override
public void suspend() throws DebugException {
getSequencer().stop();
fireChanged();
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
index fbd531236..65123a55c 100644
--- 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
@@ -67,6 +67,7 @@ public class MidiLaunchDelegate 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)
*/
+ @Override
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
String excep = configuration.getAttribute(ATTR_THROW_EXCEPTION, (String)null);
if (excep != null) {
@@ -135,6 +136,7 @@ public class MidiLaunchDelegate extends LaunchConfigurationDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
*/
+ @Override
public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
return new MidiLaunch(configuration, mode);
}
@@ -142,6 +144,7 @@ public class MidiLaunchDelegate extends LaunchConfigurationDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#buildForLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
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
index 3274582cc..c5b51ea6a 100644
--- 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
@@ -113,6 +113,7 @@ public abstract class SequencerControl {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj != null) {
if (getClass().equals(obj.getClass())) {
@@ -126,6 +127,7 @@ public abstract class SequencerControl {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
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
index 28def4594..2980adc83 100644
--- 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
@@ -33,6 +33,7 @@ public class TempoControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#getValue()
*/
+ @Override
public String getValue() {
float bpm = getSequencer().getTempoInBPM();
return Float.toString(bpm);
@@ -41,6 +42,7 @@ public class TempoControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable()
*/
+ @Override
public boolean isEditable() {
return getSequencer().isOpen();
}
@@ -48,6 +50,7 @@ public class TempoControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String)
*/
+ @Override
public IStatus setValue(String newValue) {
try {
float value = getFloat(newValue);
@@ -62,6 +65,7 @@ public class TempoControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String)
*/
+ @Override
public IStatus validateValue(String value) {
try {
getFloat(value);
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
index 93aa54df4..4bcb85ac6 100644
--- 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
@@ -33,6 +33,7 @@ public abstract class TimeControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#getValue()
*/
+ @Override
public String getValue() {
long position = getTimeValue();
int milli = (int) (position & 0x3F);
@@ -67,6 +68,7 @@ public abstract class TimeControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#isEditable()
*/
+ @Override
public boolean isEditable() {
return false;
}
@@ -74,6 +76,7 @@ public abstract class TimeControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#setValue(java.lang.String)
*/
+ @Override
public IStatus setValue(String newValue) {
return null;
}
@@ -81,6 +84,7 @@ public abstract class TimeControl extends SequencerControl {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.midi.launcher.SequencerControl#validateValue(java.lang.String)
*/
+ @Override
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
index dbdb1fc85..759f1088a 100644
--- 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
@@ -71,6 +71,7 @@ public class DebugCorePlugin extends Plugin {
/**
* This method is called upon plug-in activation
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
}
@@ -78,6 +79,7 @@ public class DebugCorePlugin extends Plugin {
/**
* This method is called when the plug-in is stopped
*/
+ @Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = 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
index 41d3a9074..325402c7f 100644
--- 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
@@ -60,6 +60,7 @@ public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListen
*/
public PDALineBreakpoint(final IResource resource, final int lineNumber) throws CoreException {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.lineBreakpoint"); //$NON-NLS-1$
setMarker(marker);
@@ -75,6 +76,7 @@ public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListen
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier()
*/
+ @Override
public String getModelIdentifier() {
return DebugCorePlugin.ID_PDA_DEBUG_MODEL;
}
@@ -174,6 +176,7 @@ public class PDALineBreakpoint extends LineBreakpoint implements IPDAEventListen
*
* @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
*/
+ @Override
public void handleEvent(PDAEvent event) {
if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
PDARunControlEvent rcEvent = (PDARunControlEvent)event;
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
index 42705dd62..2d406d9d2 100644
--- 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
@@ -36,6 +36,7 @@ public class PDARunToLineBreakpoint extends PDALineBreakpoint {
*/
public PDARunToLineBreakpoint(final IFile resource, final int lineNumber) throws DebugException {
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ @Override
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"); //$NON-NLS-1$
@@ -55,6 +56,7 @@ public class PDARunToLineBreakpoint extends PDALineBreakpoint {
*
* @return whether this breakpoint is a run-to-line breakpoint
*/
+ @Override
public boolean isRunToLineBreakpoint() {
return true;
}
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
index d3f7dc593..ce7c15226 100644
--- 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
@@ -65,6 +65,7 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
*/
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() {
+ @Override
public void run(IProgressMonitor monitor) throws CoreException {
IMarker marker = resource.createMarker("org.eclipse.debug.examples.core.pda.markerType.watchpoint"); //$NON-NLS-1$
setMarker(marker);
@@ -83,42 +84,48 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IWatchpoint#isAccess()
*/
- public boolean isAccess() throws CoreException {
+ @Override
+ 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 {
+ @Override
+ 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 {
+ @Override
+ 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 {
+ @Override
+ public void setModification(boolean modification) throws CoreException {
setAttribute(MODIFICATION, modification);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IWatchpoint#supportsAccess()
*/
- public boolean supportsAccess() {
+ @Override
+ public boolean supportsAccess() {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IWatchpoint#supportsModification()
*/
- public boolean supportsModification() {
+ @Override
+ public boolean supportsModification() {
return true;
}
@@ -175,6 +182,7 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint#createRequest(org.eclipse.debug.examples.core.pda.model.PDADebugTarget)
*/
+ @Override
protected void createRequest(PDADebugTarget target) throws CoreException {
int flag = 0;
if (isAccess()) {
@@ -189,6 +197,7 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.pda.breakpoints.PDALineBreakpoint#clearRequest(org.eclipse.debug.examples.core.pda.model.PDADebugTarget)
*/
+ @Override
protected void clearRequest(PDADebugTarget target) throws CoreException {
target.sendCommand(new PDAWatchCommand(getFunctionName(), getVariableName(), 0));
}
@@ -196,6 +205,7 @@ public class PDAWatchpoint extends PDALineBreakpoint implements IWatchpoint {
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
*/
+ @Override
public void handleEvent(PDAEvent event) {
if (event instanceof PDASuspendedEvent || event instanceof PDAVMSuspendedEvent) {
PDARunControlEvent rcEvent = (PDARunControlEvent)event;
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
index 95c4c34d6..b4a2ecf73 100644
--- 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
@@ -44,22 +44,23 @@ 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)
*/
+ @Override
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();
-
+ //#else
+
+ List<String> commandList = new ArrayList<String>();
+
// Get Java VM path
String javaVMHome = System.getProperty("java.home"); //$NON-NLS-1$
String javaVMExec = javaVMHome + File.separatorChar + "bin" + File.separatorChar + "java"; //$NON-NLS-1$ //$NON-NLS-2$
if (File.separatorChar == '\\') {
javaVMExec += ".exe"; //$NON-NLS-1$
- }
+ }
File exe = new File(javaVMExec);
if (!exe.exists()) {
abort(MessageFormat.format("Specified java VM executable {0} does not exist.", new Object[]{javaVMExec}), null); //$NON-NLS-1$
@@ -68,7 +69,7 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
commandList.add("-cp"); //$NON-NLS-1$
commandList.add(File.pathSeparator + DebugCorePlugin.getFileInPlugin(new Path("bin"))); //$NON-NLS-1$
-
+
commandList.add("org.eclipse.debug.examples.pdavm.PDAVirtualMachine"); //$NON-NLS-1$
// program name
@@ -76,14 +77,14 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
if (program == null) {
abort("Perl program unspecified.", null); //$NON-NLS-1$
}
-
+
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); //$NON-NLS-1$
+ abort(MessageFormat.format("Perl program {0} does not exist.", new Object[] { file.getFullPath().toString() }), null); //$NON-NLS-1$
}
-
+
commandList.add(file.getLocation().toOSString());
-
+
// if in debug mode, add debug arguments - i.e. '-debug requestPort eventPort'
int requestPort = -1;
int eventPort = -1;
@@ -97,22 +98,22 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
commandList.add("" + requestPort); //$NON-NLS-1$
commandList.add("" + eventPort); //$NON-NLS-1$
}
-
- String[] commandLine = (String[]) commandList.toArray(new String[commandList.size()]);
+
+ String[] commandLine = 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 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
@@ -120,10 +121,10 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
private void abort(String message, Throwable e) throws CoreException {
throw new CoreException(new Status(IStatus.ERROR, DebugCorePlugin.PLUGIN_ID, 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() {
@@ -131,7 +132,7 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
try {
socket= new ServerSocket(0);
return socket.getLocalPort();
- } catch (IOException e) {
+ } catch (IOException e) {
} finally {
if (socket != null) {
try {
@@ -140,13 +141,14 @@ public class PDALaunchDelegate extends LaunchConfigurationDelegate {
}
}
}
- return -1;
- }
-
+ 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)
*/
+ @Override
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/PDAArray.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAArray.java
index 5107b2695..effe377c2 100644
--- 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
@@ -30,6 +30,7 @@ public class PDAArray extends PDAValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
+ @Override
public boolean hasVariables() throws DebugException {
return true;
}
@@ -37,6 +38,7 @@ public class PDAArray extends PDAValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
+ @Override
public IVariable[] getVariables() throws DebugException {
String string = getValueString();
String[] words = string.split("\\W+"); //$NON-NLS-1$
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
index 834198ebe..2c9dd55cb 100644
--- 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
@@ -37,6 +37,7 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getValue()
*/
+ @Override
public IValue getValue() throws DebugException {
return fValue;
}
@@ -44,6 +45,7 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getName()
*/
+ @Override
public String getName() throws DebugException {
return "[" + fIndex + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -51,6 +53,7 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
return "String"; //$NON-NLS-1$
}
@@ -58,6 +61,7 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
*/
+ @Override
public boolean hasValueChanged() throws DebugException {
return false;
}
@@ -65,18 +69,21 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
*/
+ @Override
public void setValue(String expression) throws DebugException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public void setValue(IValue value) throws DebugException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
*/
+ @Override
public boolean supportsValueModification() {
return false;
}
@@ -84,6 +91,7 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
*/
+ @Override
public boolean verifyValue(String expression) throws DebugException {
return false;
}
@@ -91,6 +99,7 @@ public class PDAArrayEntry extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
*/
+ @Override
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
index fb854ba15..f07fac187 100644
--- 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
@@ -39,6 +39,7 @@ public class PDADebugElement extends DebugElement {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
+ @Override
public String getModelIdentifier() {
return DebugCorePlugin.ID_PDA_DEBUG_MODEL;
}
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
index b5e4a0607..e024badf6 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2005, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -67,41 +67,41 @@ 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());
-
+ private Map<Integer, PDAThread> fThreads = Collections.synchronizedMap(new LinkedHashMap<Integer, PDAThread>());
+
// event dispatch job
private EventDispatchJob fEventDispatch;
-
+
// event listeners
- private List fEventListeners = Collections.synchronizedList(new ArrayList());
-
+ private List<IPDAEventListener> fEventListeners = Collections.synchronizedList(new ArrayList<IPDAEventListener>());
+
/**
- * Listens to events from the PDA VM and fires corresponding
+ * Listens to events from the PDA VM and fires corresponding
* debug events.
*/
class EventDispatchJob extends Job {
-
+
public EventDispatchJob() {
super("PDA Event Dispatch"); //$NON-NLS-1$
setSystem(true);
@@ -110,6 +110,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
String message = ""; //$NON-NLS-1$
while (!isTerminated() && message != null) {
@@ -127,7 +128,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
}
Object[] listeners = fEventListeners.toArray();
for (int i = 0; i < listeners.length; i++) {
- ((IPDAEventListener)listeners[i]).handleEvent(event);
+ ((IPDAEventListener)listeners[i]).handleEvent(event);
}
}
} catch (IOException e) {
@@ -136,14 +137,14 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
}
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) {
@@ -153,21 +154,21 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
}
}
}
-
+
/**
* 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
+ * 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
@@ -214,32 +215,37 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugTarget#getProcess()
*/
+ @Override
public IProcess getProcess() {
return fProcess;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugTarget#getThreads()
*/
+ @Override
public IThread[] getThreads() throws DebugException {
synchronized (fThreads) {
- return (IThread[])fThreads.values().toArray(new IThread[fThreads.size()]);
+ return fThreads.values().toArray(new IThread[fThreads.size()]);
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugTarget#hasThreads()
*/
+ @Override
public boolean hasThreads() throws DebugException {
return fThreads.size() > 0;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugTarget#getName()
*/
+ @Override
public String getName() throws DebugException {
return "PDA"; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugTarget#supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint)
*/
+ @Override
public boolean supportsBreakpoint(IBreakpoint breakpoint) {
if (!isTerminated() && breakpoint.getModelIdentifier().equals(getModelIdentifier())) {
try {
@@ -261,40 +267,45 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
}
}
} catch (CoreException e) {
- }
+ }
}
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
+ @Override
public IDebugTarget getDebugTarget() {
return this;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
return fLaunch;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
+ @Override
public boolean canTerminate() {
return getProcess().canTerminate();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#isTerminated()
*/
+ @Override
public synchronized boolean isTerminated() {
return fTerminated || getProcess().isTerminated();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#terminate()
*/
+ @Override
public void terminate() throws DebugException {
//#ifdef ex2
-//# // TODO: Exercise 2 - send termination request to interpreter
+//# // TODO: Exercise 2 - send termination request to interpreter
//#else
sendCommand(new PDATerminateCommand());
//#endif
@@ -302,39 +313,45 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canResume()
*/
+ @Override
public boolean canResume() {
return !isTerminated() && isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
*/
+ @Override
public boolean canSuspend() {
return !isTerminated() && !isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
+ @Override
public synchronized boolean isSuspended() {
return !isTerminated() && fVMSuspended;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
+ @Override
public void resume() throws DebugException {
sendCommand(new PDAVMResumeCommand());
- }
-
+ }
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
+ @Override
public void suspend() throws DebugException {
sendCommand(new PDAVMSuspendCommand());
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointListener#breakpointAdded(org.eclipse.debug.core.model.IBreakpoint)
*/
+ @Override
public void breakpointAdded(IBreakpoint breakpoint) {
if (supportsBreakpoint(breakpoint)) {
try {
@@ -349,6 +366,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointListener#breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
*/
+ @Override
public void breakpointRemoved(IBreakpoint breakpoint, IMarkerDelta delta) {
if (supportsBreakpoint(breakpoint)) {
try {
@@ -361,6 +379,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointListener#breakpointChanged(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.resources.IMarkerDelta)
*/
+ @Override
public void breakpointChanged(IBreakpoint breakpoint, IMarkerDelta delta) {
if (supportsBreakpoint(breakpoint)) {
try {
@@ -376,29 +395,34 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDisconnect#canDisconnect()
*/
+ @Override
public boolean canDisconnect() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDisconnect#disconnect()
*/
+ @Override
public void disconnect() throws DebugException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDisconnect#isDisconnected()
*/
+ @Override
public boolean isDisconnected() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval()
*/
+ @Override
public boolean supportsStorageRetrieval() {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long)
*/
+ @Override
public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException {
return new PDAMemoryBlock(this, startAddress, length);
}
@@ -416,7 +440,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
} catch (DebugException e) {
}
}
-
+
/**
* Install breakpoints that are already registered with the breakpoint
* manager.
@@ -427,7 +451,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
breakpointAdded(breakpoints[i]);
}
}
-
+
/**
* Called when this debug target terminates.
*/
@@ -440,17 +464,17 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
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")) { //$NON-NLS-1$ //$NON-NLS-2$
return DebugEvent.BREAKPOINT;
@@ -464,30 +488,30 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
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));
+ PDAThread thread = 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)
*/
@@ -508,8 +532,9 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
}
// Should never reach this satement.
return null;
- }
-
+ }
+
+ @Override
public PDACommandResult sendCommand(PDACommand command) throws DebugException {
String response = sendRequest(command.getRequest());
return command.createResult(response);
@@ -519,6 +544,7 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
* When the breakpoint manager disables, remove all registered breakpoints
* requests from the VM. When it enables, reinstall them.
*/
+ @Override
public void breakpointManagerEnablementChanged(boolean enabled) {
IBreakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getModelIdentifier());
for (int i = 0; i < breakpoints.length; i++) {
@@ -528,11 +554,12 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
breakpointRemoved(breakpoints[i], null);
}
}
- }
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
*/
+ @Override
public void handleEvent(PDAEvent event) {
if (event instanceof PDAStartedEvent) {
started((PDAStartedEvent)event);
@@ -546,13 +573,13 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
vmSuspended((PDAVMSuspendedEvent)event);
} else if (event instanceof PDAVMResumedEvent) {
vmResumed((PDAVMResumedEvent)event);
- }
+ }
}
-
+
/**
* Returns this debug target's single thread, or <code>null</code>
* if terminated.
- *
+ *
* @param threadId ID of the thread to return, or <code>0</code>
* to return the first available thread
* @return this debug target's single thread, or <code>null</code>
@@ -560,24 +587,24 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr
*/
public PDAThread getThread(int threadId) {
if (threadId > 0) {
- return (PDAThread)fThreads.get(new Integer(threadId));
+ return fThreads.get(new Integer(threadId));
} else {
synchronized(fThreads) {
if (fThreads.size() > 0) {
- return (PDAThread)fThreads.values().iterator().next();
+ return 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/PDAMemoryBlock.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java
index 616578131..394c7c1da 100644
--- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java
+++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java
@@ -42,6 +42,7 @@ public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlock#getStartAddress()
*/
+ @Override
public long getStartAddress() {
return fStart;
}
@@ -49,6 +50,7 @@ public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlock#getLength()
*/
+ @Override
public long getLength() {
return fLength;
}
@@ -56,6 +58,7 @@ public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlock#getBytes()
*/
+ @Override
public byte[] getBytes() throws DebugException {
return fBytes;
}
@@ -63,6 +66,7 @@ public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlock#supportsValueModification()
*/
+ @Override
public boolean supportsValueModification() {
return true;
}
@@ -70,6 +74,7 @@ public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[])
*/
+ @Override
public void setValue(long offset, byte[] bytes) throws DebugException {
int i = 0;
long off = offset;
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
index b235690f3..24dfefcd2 100644
--- 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
@@ -65,30 +65,35 @@ public class PDAStackFrame extends PDADebugElement implements IStackFrame {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getThread()
*/
+ @Override
public IThread getThread() {
return fThread;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getVariables()
*/
+ @Override
public IVariable[] getVariables() throws DebugException {
return fThread.getVariables(this);
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#hasVariables()
*/
+ @Override
public boolean hasVariables() throws DebugException {
return getVariables().length > 0;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getLineNumber()
*/
+ @Override
public int getLineNumber() throws DebugException {
return fPC;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getCharStart()
*/
+ @Override
public int getCharStart() throws DebugException {
return -1;
}
@@ -96,114 +101,133 @@ public class PDAStackFrame extends PDADebugElement implements IStackFrame {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getCharEnd()
*/
+ @Override
public int getCharEnd() throws DebugException {
return -1;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getName()
*/
+ @Override
public String getName() throws DebugException {
return fName;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#getRegisterGroups()
*/
+ @Override
public IRegisterGroup[] getRegisterGroups() throws DebugException {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStackFrame#hasRegisterGroups()
*/
+ @Override
public boolean hasRegisterGroups() throws DebugException {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#canStepInto()
*/
+ @Override
public boolean canStepInto() {
return getThread().canStepInto();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#canStepOver()
*/
+ @Override
public boolean canStepOver() {
return getThread().canStepOver();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#canStepReturn()
*/
+ @Override
public boolean canStepReturn() {
return getThread().canStepReturn();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#isStepping()
*/
+ @Override
public boolean isStepping() {
return getThread().isStepping();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepInto()
*/
+ @Override
public void stepInto() throws DebugException {
getThread().stepInto();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepOver()
*/
+ @Override
public void stepOver() throws DebugException {
getThread().stepOver();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepReturn()
*/
+ @Override
public void stepReturn() throws DebugException {
getThread().stepReturn();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canResume()
*/
+ @Override
public boolean canResume() {
return getThread().canResume();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
*/
+ @Override
public boolean canSuspend() {
return getThread().canSuspend();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
+ @Override
public boolean isSuspended() {
return getThread().isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
+ @Override
public void resume() throws DebugException {
getThread().resume();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
+ @Override
public void suspend() throws DebugException {
getThread().suspend();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
+ @Override
public boolean canTerminate() {
return getThread().canTerminate();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#isTerminated()
*/
+ @Override
public boolean isTerminated() {
return getThread().isTerminated();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#terminate()
*/
+ @Override
public void terminate() throws DebugException {
getThread().terminate();
}
@@ -221,6 +245,7 @@ public class PDAStackFrame extends PDADebugElement implements IStackFrame {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof PDAStackFrame) {
PDAStackFrame sf = (PDAStackFrame)obj;
@@ -233,6 +258,7 @@ public class PDAStackFrame extends PDADebugElement implements IStackFrame {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getSourceName().hashCode() + fId;
}
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
index a7909d485..4fc8e5289 100644
--- 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
@@ -46,38 +46,44 @@ public class PDAStackValue extends PDADebugElement implements IValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
- public String getValueString() throws DebugException {
+ @Override
+ public String getValueString() throws DebugException {
return fValue;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#isAllocated()
*/
- public boolean isAllocated() throws DebugException {
+ @Override
+ public boolean isAllocated() throws DebugException {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
- public IVariable[] getVariables() throws DebugException {
+ @Override
+ public IVariable[] getVariables() throws DebugException {
return new IVariable[0];
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
- public boolean hasVariables() throws DebugException {
+ @Override
+ public boolean hasVariables() throws DebugException {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
*/
- public String getReferenceTypeName() throws DebugException {
+ @Override
+ public String getReferenceTypeName() throws DebugException {
return null;
}
/*
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
return obj instanceof PDAStackValue &&
((PDAStackValue)obj).fValue.equals(fValue) &&
((PDAStackValue)obj).fIndex == fIndex;
@@ -86,7 +92,8 @@ public class PDAStackValue extends PDADebugElement implements IValue {
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ @Override
+ 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
index 409746bc3..c0798215d 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2005, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -46,23 +46,23 @@ 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 <code>null</code>
* if none.
*/
private IBreakpoint fBreakpoint;
-
+
/**
* Whether this thread is stepping
*/
private boolean fStepping = false;
-
+
/**
* Whether this thread is suspended
*/
@@ -72,45 +72,46 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
* Most recent error event or <code>null</code>
*/
private String fErrorEvent;
-
+
/**
* Table mapping stack frames to current variables
*/
- private Map fVariables = Collections.synchronizedMap(new HashMap());
-
+ private Map<IStackFrame, IVariable[]> fVariables = Collections.synchronizedMap(new HashMap<IStackFrame, IVariable[]>());
+
/**
* 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()
*/
+ @Override
public IStackFrame[] getStackFrames() throws DebugException {
if (isSuspended()) {
PDAStackCommandResult result = (PDAStackCommandResult)sendCommand(new PDAStackCommand(fThreadId));
@@ -122,22 +123,25 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
}
return new IStackFrame[0];
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IThread#hasStackFrames()
*/
+ @Override
public boolean hasStackFrames() throws DebugException {
return isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IThread#getPriority()
*/
+ @Override
public int getPriority() throws DebugException {
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IThread#getTopStackFrame()
*/
+ @Override
public IStackFrame getTopStackFrame() throws DebugException {
IStackFrame[] frames = getStackFrames();
if (frames.length > 0) {
@@ -148,45 +152,50 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IThread#getName()
*/
+ @Override
public String getName() {
return "Main thread"; //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IThread#getBreakpoints()
*/
+ @Override
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()
*/
+ @Override
public boolean canResume() {
return isSuspended() && !getDebugTarget().isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#canSuspend()
*/
+ @Override
public boolean canSuspend() {
return !isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#isSuspended()
*/
+ @Override
public boolean isSuspended() {
if (getDebugTarget().isTerminated()) {
return false;
@@ -201,9 +210,10 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#resume()
*/
+ @Override
public void resume() throws DebugException {
//#ifdef ex2
-//# // TODO: Exercise 2 - send resume request to interpreter
+//# // TODO: Exercise 2 - send resume request to interpreter
//#else
sendCommand(new PDAResumeCommand(fThreadId));
//#endif
@@ -211,9 +221,10 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ISuspendResume#suspend()
*/
+ @Override
public void suspend() throws DebugException {
//#ifdef ex2
-//# // TODO: Exercise 2 - send suspend request to interpreter
+//# // TODO: Exercise 2 - send suspend request to interpreter
//#else
sendCommand(new PDASuspendCommand(fThreadId));
//#endif
@@ -221,74 +232,84 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#canStepInto()
*/
+ @Override
public boolean canStepInto() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#canStepOver()
*/
+ @Override
public boolean canStepOver() {
return isSuspended();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#canStepReturn()
*/
+ @Override
public boolean canStepReturn() {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#isStepping()
*/
+ @Override
public boolean isStepping() {
return fStepping;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepInto()
*/
+ @Override
public void stepInto() throws DebugException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepOver()
*/
+ @Override
public void stepOver() throws DebugException {
sendCommand(new PDAStepCommand(fThreadId));
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IStep#stepReturn()
*/
+ @Override
public void stepReturn() throws DebugException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
+ @Override
public boolean canTerminate() {
return !isTerminated();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#isTerminated()
*/
+ @Override
public boolean isTerminated() {
return getDebugTarget().isTerminated();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ITerminate#terminate()
*/
+ @Override
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) {
@@ -298,7 +319,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/**
* Sets the most recent error event encountered, or <code>null</code>
* to clear the most recent error
- *
+ *
* @param event one of 'unimpinstr' or 'nosuchlabel' or <code>null</code>
*/
private synchronized void setError(String event) {
@@ -308,7 +329,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/**
* Returns the most recent error event encountered since the last
* suspend, or <code>null</code> if none.
- *
+ *
* @return the most recent error event encountered since the last
* suspend, or <code>null</code> if none
*/
@@ -319,13 +340,14 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/* (non-Javadoc)
* @see org.eclipse.debug.examples.core.pda.model.IPDAEventListener#handleEvent(java.lang.String)
*/
+ @Override
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);
@@ -335,7 +357,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
//#ifdef ex2
//# }
//# // TODO: Exercise 2 - handle/fire "client" resume event
- //#else
+ //#else
} else if ("client".equals(event.fReason)) { //$NON-NLS-1$
resumed(DebugEvent.CLIENT_REQUEST);
}
@@ -363,7 +385,7 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
suspended(DebugEvent.STEP_END);
} else if ("event".equals(event.fReason) && getError() != null) { //$NON-NLS-1$
exceptionHit();
- }
+ }
//#endif
//#ifdef ex5
//# // TODO: Exercise 5 - handle end of drop event
@@ -373,19 +395,19 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
}
//#endif
} else if (_event instanceof PDANoSuchLabelEvent ||
- _event instanceof PDAUnimplementedInstructionEvent)
+ _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) {
@@ -393,10 +415,10 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
fVariables.clear();
fireResumeEvent(detail);
}
-
+
/**
* Notification the target has suspended for the given reason
- *
+ *
* @param detail reason for the suspend
*/
private void suspended(int detail) {
@@ -409,12 +431,12 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
*/
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
*/
@@ -423,49 +445,49 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
fVariables.put(frame, variables);
}
}
-
+
/**
* Returns the current variables for the given stack frame, or
* <code>null</code> if none.
- *
+ *
* @param frame stack frame
* @return variables or <code>null</code>
*/
protected IVariable[] getVariables(IStackFrame frame) {
synchronized (fVariables) {
- IVariable[] variables = (IVariable[]) fVariables.get(frame);
+ IVariable[] variables = 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
+//# // 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
+//# // TODO: Exercise 5 - allow pop if there is more than 1 frame on the stack
//#else
try {
return getStackFrames().length > 1;
@@ -474,12 +496,12 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
//#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 {
@@ -491,14 +513,14 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
}
return values;
}
- return new IValue[0];
+ 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() {
@@ -508,13 +530,13 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
}
return false;
}
-
+
/**
* Pops and returns the top of the data stack
- *
- * @return the top value on the 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 {
@@ -526,24 +548,24 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
requestFailed("Empty stack", null); //$NON-NLS-1$
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 {
@@ -552,9 +574,9 @@ public class PDAThread extends PDADebugElement implements IThread, IPDAEventList
/**
* Returns this thread's unique identifier
- *
+ *
* @return this thread's unique identifier
- *
+ *
* @since 3.5
*/
public int getIdentifier() {
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
index 81a92db29..620f7ac83 100644
--- 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
@@ -35,6 +35,7 @@ public class PDAValue extends PDADebugElement implements IValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
try {
Integer.parseInt(fValue);
@@ -46,18 +47,21 @@ public class PDAValue extends PDADebugElement implements IValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
+ @Override
public String getValueString() throws DebugException {
return fValue;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#isAllocated()
*/
+ @Override
public boolean isAllocated() throws DebugException {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
+ @Override
public IVariable[] getVariables() throws DebugException {
PDAStackFrame frame = fVariable.getStackFrame();
PDAListResult result = (PDAListResult) sendCommand(
@@ -72,6 +76,7 @@ public class PDAValue extends PDADebugElement implements IValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
+ @Override
public boolean hasVariables() throws DebugException {
if (getVariables().length != 0) {
return true;
@@ -85,14 +90,16 @@ public class PDAValue extends PDADebugElement implements IValue {
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
return obj instanceof PDAValue && ((PDAValue)obj).fValue.equals(fValue);
}
/*
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fValue.hashCode();
}
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
index 08ca276be..3745028e1 100644
--- 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
@@ -46,6 +46,7 @@ public class PDAVariable extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getValue()
*/
+ @Override
public IValue getValue() throws DebugException {
PDACommandResult result = sendCommand(new PDAVarCommand(
fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName()));
@@ -55,24 +56,28 @@ public class PDAVariable extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getName()
*/
+ @Override
public String getName() throws DebugException {
return fName;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
return "Thing"; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
*/
+ @Override
public boolean hasValueChanged() throws DebugException {
return false;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
*/
+ @Override
public void setValue(String expression) throws DebugException {
sendCommand(new PDASetVarCommand(
fFrame.getThreadIdentifier(), getStackFrame().getIdentifier(), getName(), expression));
@@ -81,23 +86,27 @@ public class PDAVariable extends PDADebugElement implements IVariable {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public void setValue(IValue value) throws DebugException {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
*/
+ @Override
public boolean supportsValueModification() {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
*/
+ @Override
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)
*/
+ @Override
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/WordStructureDelegate.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/WordStructureDelegate.java
index ccc6b2647..2d218e08f 100644
--- 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
@@ -24,6 +24,7 @@ public class WordStructureDelegate implements ILogicalStructureTypeDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#providesLogicalStructure(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public boolean providesLogicalStructure(IValue value) {
//#ifdef ex6
//# // TODO: Exercise 6 - provide logical structures if the value has multiple words
@@ -41,6 +42,7 @@ public class WordStructureDelegate implements ILogicalStructureTypeDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.ILogicalStructureTypeDelegate#getLogicalStructure(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public IValue getLogicalStructure(IValue value) throws CoreException {
//#ifdef ex6
//# // TODO: Exercise 6 - create an array from the given value
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
index 6a8caaa19..b36e3dbcf 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -17,24 +17,24 @@ import java.util.StringTokenizer;
/**
* Object representing a bit field in the stack command results.
- *
- * @see PDARegistersCommand
+ *
+ * @see PDARegistersCommand
*/
public class PDABitFieldData {
final public String fName;
final public int fOffset;
final public int fCount;
- final public Map fMnemonics;
-
+ final public Map<String, String> fMnemonics;
+
PDABitFieldData(String bitFieldString) {
StringTokenizer st = new StringTokenizer(bitFieldString, " "); //$NON-NLS-1$
-
+
fName = st.nextToken();
fOffset = Integer.parseInt(st.nextToken());
fCount = Integer.parseInt(st.nextToken());
-
- fMnemonics = new LinkedHashMap(0);
+
+ fMnemonics = new LinkedHashMap<String, String>(0);
while (st.hasMoreTokens()) {
fMnemonics.put(st.nextToken(), st.nextToken());
}
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
index 9886a920a..9d9339b75 100644
--- 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
@@ -29,7 +29,8 @@ public class PDAChildrenCommand extends PDACommand {
super("children " + threadId + " " + frameId + " " + name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 76f688bf4..20eba643f 100644
--- 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
@@ -26,7 +26,8 @@ public class PDAClearBreakpointCommand extends PDACommand {
super("clear " + line); //$NON-NLS-1$
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDADataCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDADataCommand.java
index 61cc412e1..e82630f1a 100644
--- 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
@@ -30,7 +30,8 @@ public class PDADataCommand extends PDACommand {
super("data " + threadId); //$NON-NLS-1$
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 1d77bbe79..9777ff94c 100644
--- 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
@@ -39,7 +39,8 @@ public class PDADropFrameCommand extends PDACommand {
super("drop " + threadId); //$NON-NLS-1$
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 50f79cf26..499a9dd0a 100644
--- 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
@@ -38,7 +38,8 @@ public class PDAEvalCommand extends PDACommand {
super("eval " + threadId + " " + operation); //$NON-NLS-1$ //$NON-NLS-2$
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAEventStopCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAEventStopCommand.java
index 713723eea..b96060fda 100644
--- 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
@@ -43,7 +43,8 @@ public class PDAEventStopCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAFrameCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameCommand.java
index 3c30b3bfb..92fb11de8 100644
--- 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
@@ -31,7 +31,8 @@ public class PDAFrameCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAFrameData.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAFrameData.java
index 01cfbf4cd..d3c5ab8d7 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -20,8 +20,8 @@ import org.eclipse.core.runtime.Path;
/**
* Object representing a frame in the stack command results.
- *
- * @see PDAStackCommand
+ *
+ * @see PDAStackCommand
*/
public class PDAFrameData {
@@ -30,18 +30,18 @@ public class PDAFrameData {
final public int fPC;
final public String fFunction;
final public String[] fVariables;
-
+
PDAFrameData(String frameString) {
StringTokenizer st = new StringTokenizer(frameString, "|"); //$NON-NLS-1$
-
+
fFilePath = new Path(st.nextToken());
fPC = Integer.parseInt(st.nextToken());
fFunction = st.nextToken();
-
- List variablesList = new ArrayList();
+
+ List<String> variablesList = new ArrayList<String>();
while (st.hasMoreTokens()) {
variablesList.add(st.nextToken());
}
- fVariables = (String[])variablesList.toArray(new String[variablesList.size()]);
+ fVariables = 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
index bf503d461..fb405b32c 100644
--- 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
@@ -28,7 +28,8 @@ public class PDAGroupsCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 99199a5e9..e2b9a38ae 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -21,24 +21,24 @@ import java.util.StringTokenizer;
*/
public class PDAListResult extends PDACommandResult {
-
+
final public String[] fValues;
-
+
PDAListResult(String response) {
super(response);
StringTokenizer st = new StringTokenizer(response, "|"); //$NON-NLS-1$
- List valuesList = new ArrayList();
-
+ List<String> valuesList = new ArrayList<String>();
+
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);
+ fValues[i] = 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
index c90b0b600..d96681c5a 100644
--- 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
@@ -32,7 +32,8 @@ public class PDANoSuchLabelEvent extends PDAEvent {
return message.startsWith("no such label"); //$NON-NLS-1$
}
- protected String getName(String message) {
+ @Override
+ protected String getName(String message) {
if (isEventMessage(message)) {
return "no such label"; //$NON-NLS-1$
}
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
index c181a2971..1e3726c25 100644
--- 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
@@ -29,7 +29,8 @@ public class PDAPopDataCommand extends PDACommand {
super("popdata " + threadId); //$NON-NLS-1$
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index c6ff895c6..fd3ccd8d1 100644
--- 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
@@ -31,7 +31,8 @@ public class PDAPushDataCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 05a12cd5e..27c1874d2 100644
--- 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
@@ -4,9 +4,10 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.examples.core.pda.protocol;
@@ -16,8 +17,8 @@ import java.util.StringTokenizer;
/**
* Object representing a register in the registers command results.
- *
- * @see PDARCommand
+ *
+ * @see PDARCommand
*/
public class PDARegisterData {
@@ -25,19 +26,19 @@ public class PDARegisterData {
final public String fName;
final public boolean fWritable;
final public PDABitFieldData[] fBitFields;
-
+
PDARegisterData(String regString) {
StringTokenizer st = new StringTokenizer(regString, "|"); //$NON-NLS-1$
-
+
String regInfo = st.nextToken();
StringTokenizer regSt = new StringTokenizer(regInfo, " "); //$NON-NLS-1$
fName = regSt.nextToken();
fWritable = Boolean.getBoolean(regSt.nextToken());
-
- List bitFieldsList = new ArrayList();
+
+ List<PDABitFieldData> bitFieldsList = new ArrayList<PDABitFieldData>();
while (st.hasMoreTokens()) {
bitFieldsList.add(new PDABitFieldData(st.nextToken()));
}
- fBitFields = (PDABitFieldData[])bitFieldsList.toArray(new PDABitFieldData[bitFieldsList.size()]);
+ fBitFields = 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
index 0592d6b56..045df225d 100644
--- 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
@@ -28,7 +28,8 @@ public class PDARegistersCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index a53bac5e2..7eabe8af4 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -21,20 +21,20 @@ import java.util.StringTokenizer;
*/
public class PDARegistersCommandResult extends PDACommandResult {
-
+
/**
- * Array of registers returned by the registers commands.
+ * Array of registers returned by the registers commands.
*/
final public PDARegisterData[] fRegisters;
-
+
PDARegistersCommandResult(String response) {
super(response);
StringTokenizer st = new StringTokenizer(response, "#"); //$NON-NLS-1$
- List regList = new ArrayList();
-
+ List<PDARegisterData> regList = new ArrayList<PDARegisterData>();
+
while (st.hasMoreTokens()) {
regList.add(new PDARegisterData(st.nextToken()));
}
- fRegisters = (PDARegisterData[])regList.toArray(new PDARegisterData[regList.size()]);
+ fRegisters = regList.toArray(new PDARegisterData[regList.size()]);
}
}
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
index 6f518e9fe..29bfc78f3 100644
--- 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
@@ -30,7 +30,8 @@ public class PDARestartCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 657860137..64bac76a2 100644
--- 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
@@ -35,7 +35,8 @@ public class PDAResumeCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDARunControlEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDARunControlEvent.java
index 3f507d1e4..c9e10a762 100644
--- 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
@@ -58,7 +58,8 @@ public class PDARunControlEvent extends PDAEvent {
return message.substring(idx, endIdx);
}
- protected String getName(String message) {
+ @Override
+ protected String getName(String message) {
int nameEnd = message.indexOf(' ');
nameEnd = nameEnd == -1 ? message.length() : nameEnd;
return message.substring(0, nameEnd);
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
index a5223a916..4459ebc2f 100644
--- 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
@@ -41,7 +41,8 @@ public class PDASetBreakpointCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 85ed35ae4..c6f5278bc 100644
--- 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
@@ -31,7 +31,8 @@ public class PDASetDataCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index ac7dde342..c32570a6a 100644
--- 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
@@ -33,7 +33,8 @@ public class PDASetVarCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 92cd55bbc..836f5d6a9 100644
--- 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
@@ -34,7 +34,8 @@ public class PDAStackCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index b98bcba70..dfc583266 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -21,21 +21,21 @@ import java.util.StringTokenizer;
*/
public class PDAStackCommandResult extends PDACommandResult {
-
+
/**
- * Array of frames return by the stack commands. The frames are ordered
+ * 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, "#"); //$NON-NLS-1$
- List framesList = new ArrayList();
-
+ List<PDAFrameData> framesList = new ArrayList<PDAFrameData>();
+
while (st.hasMoreTokens()) {
framesList.add(new PDAFrameData(st.nextToken()));
}
- fFrames = (PDAFrameData[])framesList.toArray(new PDAFrameData[framesList.size()]);
+ fFrames = 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
index 3b6abfa82..f30db3c68 100644
--- 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
@@ -31,7 +31,8 @@ public class PDAStackDepthCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAStepCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAStepCommand.java
index 5a5124ef1..f767ba746 100644
--- 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
@@ -40,7 +40,8 @@ public class PDAStepCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index 973c93e53..443513878 100644
--- 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
@@ -41,7 +41,8 @@ public class PDAStepReturnCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index cba45439d..2100c4b11 100644
--- 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
@@ -35,7 +35,8 @@ public class PDASuspendCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDATerminateCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDATerminateCommand.java
index 55db441ec..4f4ad3932 100644
--- 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
@@ -29,7 +29,8 @@ public class PDATerminateCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAUnimplementedInstructionEvent.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAUnimplementedInstructionEvent.java
index c6a593322..90e0103e9 100644
--- 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
@@ -33,7 +33,8 @@ public class PDAUnimplementedInstructionEvent extends PDAEvent {
return message.startsWith("unimplemented instruction"); //$NON-NLS-1$
}
- protected String getName(String message) {
+ @Override
+ protected String getName(String message) {
if (isEventMessage(message)) {
return "unimplemented instruction"; //$NON-NLS-1$
}
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
index 83bb95d6e..43c726ed0 100644
--- 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
@@ -32,7 +32,8 @@ public class PDAVMResumeCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAVMSuspendCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVMSuspendCommand.java
index 88f7d5dd8..d65d07dd0 100644
--- 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
@@ -32,7 +32,8 @@ public class PDAVMSuspendCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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/PDAVarCommand.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/protocol/PDAVarCommand.java
index b81302b79..cab160251 100644
--- 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
@@ -34,7 +34,8 @@ public class PDAVarCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ 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
index c3b88cf64..1440049ff 100644
--- 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
@@ -38,7 +38,8 @@ public class PDAWatchCommand extends PDACommand {
}
- public PDACommandResult createResult(String resultText) {
+ @Override
+ public PDACommandResult createResult(String resultText) {
return new PDACommandResult(resultText);
}
}
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
index f975cf7c3..83b1bc57a 100644
--- 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
@@ -22,6 +22,7 @@ public class PDASourceLookupDirector extends AbstractSourceLookupDirector {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector#initializeParticipants()
*/
+ @Override
public void initializeParticipants() {
//#ifdef ex4
//# // TODO: Exercise 4 - add our participant to this director
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
index 0d07ce78d..7326ad37c 100644
--- 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
@@ -24,6 +24,7 @@ public class PDASourceLookupParticipant extends AbstractSourceLookupParticipant
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceLookupParticipant#getSourceName(java.lang.Object)
*/
+ @Override
public String getSourceName(Object object) throws CoreException {
//#ifdef ex4
//# // TODO: Exercise 4 - return the name of the source file for the given stack frame
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
index d91b3f245..208a5a4b4 100644
--- 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
@@ -39,6 +39,7 @@ public class PDASourcePathComputerDelegate implements ISourcePathComputerDelegat
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourcePathComputerDelegate#computeSourceContainers(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException {
String path = configuration.getAttribute(DebugCorePlugin.ATTR_PDA_PROGRAM, (String)null);
ISourceContainer sourceContainer = null;
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
index dc19387ac..d51bba239 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2005, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -17,7 +17,6 @@ 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;
@@ -31,7 +30,7 @@ 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
+ * example plug-ins with parts of code missing/inserted etc., for
* various exercises.
* <p>
* The preprocessor looks for #ifdef statements in java comments, and is
@@ -46,52 +45,52 @@ import org.apache.tools.ant.util.FileUtils;
* </p>
*/
public class PreProcessor extends Task {
-
- private Vector fFileSets = new Vector();
+
+ private Vector<FileSet> fFileSets = new Vector<FileSet>();
private File fDestDir = null;
- private Set fSymbols = new HashSet();
+ private Set<String> fSymbols = new HashSet<String>();
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(""); //$NON-NLS-1$ //$NON-NLS-2$
private Matcher ELSE_IF_MATCHER = Pattern.compile("#elseif\\s+\\w+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
private Matcher ELSE_MATCHER = Pattern.compile("#else$|#else\\W+").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
private Matcher END_MATCHER = Pattern.compile("#endif").matcher(""); //$NON-NLS-1$ //$NON-NLS-2$
-
+
/**
* 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) {
@@ -104,6 +103,7 @@ public class PreProcessor extends Task {
}
}
+ @Override
public void execute() throws BuildException {
if (fSymbols.size() == 0) {
throw new BuildException("No symbols specified for preprocessor"); //$NON-NLS-1$
@@ -115,7 +115,7 @@ public class PreProcessor extends Task {
throw new BuildException("destdir does not exist: " + fDestDir.getAbsolutePath()); //$NON-NLS-1$
}
StringBuffer buf = new StringBuffer("Symbols: "); //$NON-NLS-1$
- String[] symbols = (String[]) fSymbols.toArray(new String[fSymbols.size()]);
+ String[] symbols = fSymbols.toArray(new String[fSymbols.size()]);
for (int i = 0; i < symbols.length; i++) {
String symbol = symbols[i];
buf.append(symbol);
@@ -124,10 +124,8 @@ public class PreProcessor extends Task {
}
}
log(buf.toString());
-
- Iterator fileSets = fFileSets.iterator();
- while (fileSets.hasNext()) {
- FileSet fileSet = (FileSet) fileSets.next();
+
+ for (FileSet fileSet : fFileSets) {
DirectoryScanner scanner = fileSet.getDirectoryScanner(getProject());
String[] includedFiles = scanner.getIncludedFiles();
File baseDir = fileSet.getDir(getProject());
@@ -136,14 +134,13 @@ public class PreProcessor extends Task {
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
+ * @param destDir root destination directory
*/
private void processFile(File baseDir, String fileName, File destDir) throws BuildException {
File destFile = new File(destDir, fileName);
@@ -167,21 +164,27 @@ public class PreProcessor extends Task {
}
} else {
// write new file
- FileWriter writer;
+ FileWriter writer = null;
try {
writer = new FileWriter(destFile);
writer.write(contents);
- writer.close();
} catch (IOException e) {
throw new BuildException(e);
+ } finally {
+ try {
+ if (writer != null) {
+ writer.close();
+ }
+ } catch (IOException e) {
+ throw new BuildException(e);
+ }
}
-
}
}
/**
* Pre-processes a file
- *
+ *
* @param srcFile the file to process
* @param strip chars to strip off lines in a true condition, or <code>null</code>
* @return
@@ -213,7 +216,7 @@ public class PreProcessor extends Task {
state = STATE_TRUE_CONDITION;
} else {
state = STATE_FALSE_CONDITION;
- }
+ }
} else if (elseif) {
throw new BuildException("#elseif encountered without corresponding #ifdef"); //$NON-NLS-1$
} else if (elze) {
@@ -261,6 +264,8 @@ public class PreProcessor extends Task {
throw new BuildException("illegal nested #ifdef"); //$NON-NLS-1$
}
break;
+ default:
+ break;
}
if (!commandLine) {
if (state == STATE_OUTSIDE_CONDITION || state == STATE_TRUE_CONDITION) {
@@ -273,8 +278,8 @@ public class PreProcessor extends Task {
buffer.append("\n"); //$NON-NLS-1$
written = true;
}
- }
- changed = changed || !written;
+ }
+ changed = changed || !written;
line = reader.readLine();
}
}
diff --git a/org.eclipse.debug.examples.ui/.classpath b/org.eclipse.debug.examples.ui/.classpath
index b7464f3ca..ad32c83a7 100644
--- a/org.eclipse.debug.examples.ui/.classpath
+++ b/org.eclipse.debug.examples.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
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
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.examples.ui/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
index cdbdcd9bc..91cdcd845 100644
--- a/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.examples.ui/META-INF/MANIFEST.MF
@@ -6,14 +6,14 @@ Bundle-Version: 1.4.200.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.debug.core;bundle-version="3.9.0",
org.eclipse.ui,
- org.eclipse.debug.ui,
+ org.eclipse.debug.ui;bundle-version="3.10.0",
org.eclipse.jface.text,
org.eclipse.ui.editors,
org.eclipse.ui.workbench.texteditor,
org.eclipse.ui.ide,
- org.eclipse.debug.examples.core,
+ org.eclipse.debug.examples.core;bundle-version="1.3.300",
org.eclipse.core.expressions
Eclipse-LazyStart: true
Export-Package: org.eclipse.debug.examples.ui.midi.adapters;x-internal:=true,
@@ -26,5 +26,5 @@ Export-Package: org.eclipse.debug.examples.ui.midi.adapters;x-internal:=true,
org.eclipse.debug.examples.ui.pda.launcher;x-internal:=true,
org.eclipse.debug.examples.ui.pda.presentation;x-internal:=true,
org.eclipse.debug.examples.ui.pda.views;x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
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
index 31d375ab8..ff95f9fc1 100644
--- 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
@@ -24,6 +24,7 @@ public class CheckboxModelProxyFactory 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)
*/
+ @Override
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
if (CheckboxView.ID.equals(context.getId())) {
if (element instanceof Track) {
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
index 100f20e5a..214aba225 100644
--- 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
@@ -25,6 +25,7 @@ public class ControlCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean canModify(Object element, String property) {
if (SequencerColumnPresentation.COL_VALUE.equals(property)) {
if (element instanceof SequencerControl) {
@@ -37,6 +38,7 @@ public class ControlCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
*/
+ @Override
public Object getValue(Object element, String property) {
if (SequencerColumnPresentation.COL_VALUE.equals(property)) {
if (element instanceof SequencerControl) {
@@ -50,6 +52,7 @@ public class ControlCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
*/
+ @Override
public void modify(Object element, String property, Object value) {
Object oldValue = getValue(element, property);
if (!value.equals(oldValue)) {
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
index ecb05ae8b..a76fc406e 100644
--- 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
@@ -27,6 +27,7 @@ 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)
*/
+ @Override
public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
return new TextCellEditor(parent);
}
@@ -34,6 +35,7 @@ public class ControlEditor implements IElementEditor {
/* (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)
*/
+ @Override
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
index a09df84d3..0d5d262de 100644
--- 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
@@ -55,6 +55,7 @@ public class ControlEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean handlesEvent(DebugEvent event) {
return true;
}
@@ -62,6 +63,7 @@ public class ControlEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#dispose()
*/
+ @Override
public synchronized void dispose() {
super.dispose();
if (fTimer != null) {
@@ -72,6 +74,7 @@ public class ControlEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#refreshRoot(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void refreshRoot(DebugEvent event) {
ModelDelta delta = new ModelDelta(fLaunch, IModelDelta.CONTENT);
fireDelta(delta);
@@ -80,6 +83,7 @@ public class ControlEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handleResume(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void handleResume(DebugEvent event) {
super.handleResume(event);
startTimer();
@@ -91,6 +95,7 @@ public class ControlEventHandler extends DebugEventHandler {
private void startTimer() {
fTimer = new Timer(true);
fTimer.schedule(new TimerTask() {
+ @Override
public void run() {
ModelDelta delta = new ModelDelta(fLaunch, IModelDelta.NO_CHANGE);
delta = delta.addNode(new ClockControl(fLaunch), IModelDelta.STATE | IModelDelta.CONTENT);
@@ -102,6 +107,7 @@ public class ControlEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handleSuspend(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void handleSuspend(DebugEvent event) {
super.handleSuspend(event);
if (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
index febdf3e42..7daab2a8b 100644
--- 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
@@ -26,6 +26,7 @@ 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)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
SequencerControl control = (SequencerControl) elementPath.getLastSegment();
if (SequencerColumnPresentation.COL_NAME.equals(columnId)) {
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
index 1e3988ad1..6197cda6f 100644
--- 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
@@ -26,6 +26,7 @@ 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)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof MidiLaunch) {
return "SEQUENCER"; //$NON-NLS-1$
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
index 9ddbf24df..b3dfbbead 100644
--- 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
@@ -50,6 +50,7 @@ public class MidiAdapterFactory implements IAdapterFactory {
private static IModelProxyFactory fgCheckboxModelProxyFactory = new CheckboxModelProxyFactory();
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (IElementContentProvider.class.equals(adapterType)) {
if (adaptableObject instanceof MidiLaunch) {
@@ -104,6 +105,7 @@ public class MidiAdapterFactory implements IAdapterFactory {
return null;
}
+ @Override
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
index 13406acda..39f3a4a8f 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.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)
@@ -22,7 +22,7 @@ import org.eclipse.jface.viewers.TreePath;
/**
* Provides labels for MIDI tracks.
- *
+ *
* @since 1.0
*/
public class MidiEventLabelProvider extends ElementLabelProvider {
@@ -30,6 +30,7 @@ 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)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
MidiEvent event = (MidiEvent) elementPath.getLastSegment();
MidiMessage message = event.getMessage();
@@ -57,24 +58,25 @@ public class MidiEventLabelProvider extends ElementLabelProvider {
}
return ""; //$NON-NLS-1$
}
-
-
+
+
/*
* (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)
*/
+ @Override
public boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException {
- Boolean result = (Boolean) MidiEventModelProxy.gChecked.get(path);
- return result == null ? false : result.booleanValue();
+ Boolean result = 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) {
+ 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');
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
index 884062f09..26d89d818 100644
--- 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
@@ -20,12 +20,13 @@ 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();
-
-
+ static Map<TreePath, Boolean> gChecked = new HashMap<TreePath, Boolean>();
+
+
/* (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)
*/
+ @Override
public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) {
System.out.println("TrackCheckListener.setChecked() element = " + path.getLastSegment() + " checked = " + checked); //$NON-NLS-1$ //$NON-NLS-2$
gChecked.put(path, Boolean.valueOf(checked));
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
index 440b79e46..30d11b260 100644
--- 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
@@ -26,6 +26,7 @@ public class MidiStepOverHandler implements IStepOverHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.IDebugCommandHandler#canExecute(org.eclipse.debug.core.commands.IEnabledStateRequest)
*/
+ @Override
public void canExecute(IEnabledStateRequest request) {
// We could create a job here, schedule it, then return to be asynchronous
request.setEnabled(request.getElements().length > 0);
@@ -35,6 +36,7 @@ public class MidiStepOverHandler implements IStepOverHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.commands.IDebugCommandHandler#execute(org.eclipse.debug.core.commands.IDebugCommandRequest)
*/
+ @Override
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
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
index 5a9fc55b1..3fdde0f0f 100644
--- 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
@@ -27,6 +27,7 @@ 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)
*/
+ @Override
public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) {
return new SequencerColumnPresentation();
@@ -37,6 +38,7 @@ public class SequencerColumnFactory implements IColumnPresentationFactory {
/* (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)
*/
+ @Override
public String getColumnPresentationId(IPresentationContext context, Object element) {
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) {
return SequencerColumnPresentation.ID;
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
index 5be898b41..3672fcb46 100644
--- 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
@@ -38,6 +38,7 @@ public class SequencerColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getAvailableColumns()
*/
+ @Override
public String[] getAvailableColumns() {
return COLUMN_IDS;
}
@@ -45,6 +46,7 @@ public class SequencerColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getHeader(java.lang.String)
*/
+ @Override
public String getHeader(String id) {
if (COL_NAME.equals(id)) {
return "Control"; //$NON-NLS-1$
@@ -58,6 +60,7 @@ public class SequencerColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getId()
*/
+ @Override
public String getId() {
return ID;
}
@@ -65,6 +68,7 @@ public class SequencerColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getInitialColumns()
*/
+ @Override
public String[] getInitialColumns() {
return COLUMN_IDS;
}
@@ -72,6 +76,7 @@ public class SequencerColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#isOptional()
*/
+ @Override
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
index 348e854e2..149ec9df6 100644
--- 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
@@ -34,6 +34,7 @@ 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)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
return getTracks((MidiLaunch) element).length;
@@ -49,6 +50,7 @@ public class SequencerContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
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);
@@ -89,6 +91,7 @@ public class SequencerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
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
index 3faf1c4f0..a6b0338a9 100644
--- 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
@@ -51,6 +51,7 @@ public class SequencerControlsModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
super.installed(viewer);
fHandler.init();
@@ -68,6 +69,7 @@ public class SequencerControlsModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
*/
+ @Override
protected DebugEventHandler[] createEventHandlers() {
fHandler = new ControlEventHandler(this);
return new DebugEventHandler[]{fHandler};
@@ -76,6 +78,7 @@ public class SequencerControlsModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean containsEvent(DebugEvent event) {
if (event.getSource() instanceof SequencerControl) {
return ((SequencerControl)event.getSource()).getLaunch().equals(fLaunch);
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
index 52e48c1e7..5955b8aa6 100644
--- 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
@@ -29,6 +29,7 @@ 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)
*/
+ @Override
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId())) {
if (element instanceof MidiLaunch) {
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
index 66b9063e1..cc7727735 100644
--- 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
@@ -27,6 +27,7 @@ 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)
*/
+ @Override
public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) {
return new TrackColumnPresentation();
@@ -37,6 +38,7 @@ public class TrackColumnFactory implements IColumnPresentationFactory {
/* (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)
*/
+ @Override
public String getColumnPresentationId(IPresentationContext context, Object element) {
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(context.getId()) || CheckboxView.ID.equals(context.getId())) {
return TrackColumnPresentation.ID;
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
index a24ce8c19..bc51c663e 100644
--- 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
@@ -45,6 +45,7 @@ public class TrackColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getAvailableColumns()
*/
+ @Override
public String[] getAvailableColumns() {
return COLUMN_IDS;
}
@@ -52,6 +53,7 @@ public class TrackColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getHeader(java.lang.String)
*/
+ @Override
public String getHeader(String id) {
if (COL_TICK.equals(id)) {
return "Tick"; //$NON-NLS-1$
@@ -71,6 +73,7 @@ public class TrackColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getId()
*/
+ @Override
public String getId() {
return ID;
}
@@ -78,6 +81,7 @@ public class TrackColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#getInitialColumns()
*/
+ @Override
public String[] getInitialColumns() {
return COLUMN_INITIAL;
}
@@ -85,6 +89,7 @@ public class TrackColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation#isOptional()
*/
+ @Override
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
index 1606038d0..04ace9c2e 100644
--- 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
@@ -32,6 +32,7 @@ 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)
*/
+ @Override
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()) ) {
@@ -43,6 +44,7 @@ public class TrackContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
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;
@@ -58,6 +60,7 @@ public class TrackContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
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
index 817ebb5be..14c80acdf 100644
--- 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
@@ -28,6 +28,7 @@ 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)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Track track = (Track) elementPath.getLastSegment();
MidiLaunch launch = (MidiLaunch) elementPath.getSegment(0);
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
index 4fe083c60..cb10aa824 100644
--- 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
@@ -25,6 +25,7 @@ public class TrackModelProxy extends AbstractModelProxy {
fTrack = track;
}
+ @Override
public void installed(Viewer viewer) {
super.installed(viewer);
@@ -36,6 +37,7 @@ public class TrackModelProxy extends AbstractModelProxy {
fireModelChanged(delta);
}
+ @Override
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
index d80481839..b34c8edc1 100644
--- 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
@@ -34,11 +34,13 @@ public class ClockSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fSlider = new Slider(parent, SWT.HORIZONTAL);
fSlider.setMinimum(0);
fSlider.setMaximum(1000);
fSlider.addSelectionListener(new SelectionAdapter(){
+ @Override
public void widgetSelected(SelectionEvent e) {
int selection = fSlider.getSelection();
if (fControl != null) {
@@ -52,6 +54,7 @@ public class ClockSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void display(IStructuredSelection selection) {
fControl = null;
if (selection == null || selection.isEmpty()) {
@@ -70,12 +73,14 @@ public class ClockSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getDescription()
*/
+ @Override
public String getDescription() {
return "Location (seconds)"; //$NON-NLS-1$
}
@@ -83,6 +88,7 @@ public class ClockSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getID()
*/
+ @Override
public String getID() {
return ControlDetailPaneFactory.ID_CLOCK_SLIDER;
}
@@ -90,6 +96,7 @@ public class ClockSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getName()
*/
+ @Override
public String getName() {
return "Clock Slider (seconds)"; //$NON-NLS-1$
}
@@ -97,12 +104,14 @@ public class ClockSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite)
*/
+ @Override
public void init(IWorkbenchPartSite partSite) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#setFocus()
*/
+ @Override
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
index fda22c034..25cf833d6 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -21,16 +21,16 @@ 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"; //$NON-NLS-1$
-
+
/**
* Identifier for the clock slider detail pane
*/
@@ -39,6 +39,7 @@ public class ControlDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPaneFactory#createDetailPane(java.lang.String)
*/
+ @Override
public IDetailPane createDetailPane(String paneID) {
if (ID_TEMPO_SLIDER.equals(paneID)) {
return new TempoSliderDetailPane();
@@ -52,6 +53,7 @@ public class ControlDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public String getDefaultDetailPane(IStructuredSelection selection) {
if (selection.size() == 1) {
Object element = selection.getFirstElement();
@@ -68,6 +70,7 @@ public class ControlDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneDescription(java.lang.String)
*/
+ @Override
public String getDetailPaneDescription(String paneID) {
if (ID_TEMPO_SLIDER.equals(paneID)) {
return "Tempo Slider"; //$NON-NLS-1$
@@ -81,6 +84,7 @@ public class ControlDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneName(java.lang.String)
*/
+ @Override
public String getDetailPaneName(String paneID) {
if (ID_TEMPO_SLIDER.equals(paneID)) {
return "Tempo Slider"; //$NON-NLS-1$
@@ -94,8 +98,9 @@ public class ControlDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneTypes(org.eclipse.jface.viewers.IStructuredSelection)
*/
- public Set getDetailPaneTypes(IStructuredSelection selection) {
- Set set = new HashSet();
+ @Override
+ public Set<String> getDetailPaneTypes(IStructuredSelection selection) {
+ Set<String> set = new HashSet<String>();
if (selection.size() == 1) {
Object element = selection.getFirstElement();
if (element instanceof TempoControl) {
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
index ccce38df3..bf13b8b8f 100644
--- 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
@@ -34,11 +34,13 @@ public class TempoSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fSlider = new Slider(parent, SWT.HORIZONTAL);
fSlider.setMinimum(20);
fSlider.setMaximum(500);
fSlider.addSelectionListener(new SelectionAdapter(){
+ @Override
public void widgetSelected(SelectionEvent e) {
int selection = fSlider.getSelection();
if (fControl != null) {
@@ -52,6 +54,7 @@ public class TempoSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void display(IStructuredSelection selection) {
fControl = null;
if (selection == null || selection.isEmpty()) {
@@ -67,12 +70,14 @@ public class TempoSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getDescription()
*/
+ @Override
public String getDescription() {
return "Tempo (beats per minute)"; //$NON-NLS-1$
}
@@ -80,6 +85,7 @@ public class TempoSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getID()
*/
+ @Override
public String getID() {
return ControlDetailPaneFactory.ID_TEMPO_SLIDER;
}
@@ -87,6 +93,7 @@ public class TempoSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getName()
*/
+ @Override
public String getName() {
return "Tempo Slider (BPM)"; //$NON-NLS-1$
}
@@ -94,12 +101,14 @@ public class TempoSliderDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite)
*/
+ @Override
public void init(IWorkbenchPartSite partSite) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#setFocus()
*/
+ @Override
public boolean setFocus() {
fSlider.setFocus();
return true;
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/ExampleLaunchStatusHandler.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/ExampleLaunchStatusHandler.java
index 2af3957ef..03b8672cc 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/ExampleLaunchStatusHandler.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/midi/launcher/ExampleLaunchStatusHandler.java
@@ -22,6 +22,7 @@ import org.eclipse.debug.ui.ILaunchConfigurationDialog;
*/
public class ExampleLaunchStatusHandler implements IStatusHandler {
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
if (source instanceof ILaunchConfigurationDialog) {
return null;
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
index 987b12bb4..ea72138af 100644
--- 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
@@ -34,7 +34,7 @@ import org.eclipse.ui.dialogs.ElementListSelectionDialog;
/**
* Launch shortcut for a MIDI file.
- *
+ *
* @since 1.0
*/
public class MidiLaunchShortcut implements ILaunchShortcut {
@@ -42,6 +42,7 @@ public class MidiLaunchShortcut implements ILaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.jface.viewers.ISelection, java.lang.String)
*/
+ @Override
public void launch(ISelection selection, String mode) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
@@ -60,14 +61,14 @@ public class MidiLaunchShortcut implements ILaunchShortcut {
/**
* Returns a MIDI configuration to use for the given file or
- * <code>null</code> to cancel. Creates a new configuration
+ * <code>null</code> to cancel. Creates a new configuration
* if required.
- *
+ *
* @param file file
* @return associated launch configuration or <code>null</code>
*/
private ILaunchConfiguration getConfiguration(IFile file) {
- List candiates = new ArrayList();
+ List<ILaunchConfiguration> candiates = new ArrayList<ILaunchConfiguration>();
try {
ILaunchConfiguration[] configurations = getLaunchManager().getLaunchConfigurations(getLaunchType());
for (int i = 0; i < configurations.length; i++) {
@@ -88,7 +89,7 @@ public class MidiLaunchShortcut implements ILaunchShortcut {
/**
* Returns the MIDI launch configuration type.
- *
+ *
* @return the MIDI launch configuration type
*/
private ILaunchConfigurationType getLaunchType() {
@@ -99,24 +100,24 @@ public class MidiLaunchShortcut implements ILaunchShortcut {
/**
* 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 <code>null</code> to cancel.
- *
+ *
* @param configList list of configurations to choose from
* @return configuration to launch or <code>null</code> to cancel
*/
- private ILaunchConfiguration chooseConfiguration(List configList) {
+ private ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList) {
if (configList.size() == 1) {
- return (ILaunchConfiguration) configList.get(0);
+ return configList.get(0);
}
IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
ElementListSelectionDialog dialog= new ElementListSelectionDialog(DebugUIPlugin.getActiveWorkbenchShell(), labelProvider);
@@ -129,13 +130,13 @@ public class MidiLaunchShortcut implements ILaunchShortcut {
if (result == Window.OK) {
return (ILaunchConfiguration) dialog.getFirstResult();
}
- return null;
+ return null;
}
-
+
/**
* Creates and returns a new MIDI launch configuration for the
* given file.
- *
+ *
* @param file MIDI file
* @return new launch configuration
*/
@@ -157,6 +158,7 @@ public class MidiLaunchShortcut implements ILaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
*/
+ @Override
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
index b7d2bd092..c7f1b3448 100644
--- 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
@@ -57,6 +57,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Font font = parent.getFont();
@@ -81,6 +82,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
fFileText.setLayoutData(gd);
fFileText.setFont(font);
fFileText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
updateLaunchConfigurationDialog();
}
@@ -88,6 +90,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
fFileButton = createPushButton(comp, "&Browse...", null); //$NON-NLS-1$
fFileButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
browseMidiFiles();
}
@@ -109,6 +112,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
gd.horizontalSpan = 3;
fExceptions.setLayoutData(gd);
fExceptions.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fHandled.setEnabled(fExceptions.getSelection());
fUnhandled.setEnabled(fExceptions.getSelection());
@@ -118,6 +122,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
fHandled = new Button(test, SWT.RADIO);
fHandled.setText("Throw a handled e&xception during launch to re-open launch dialog"); //$NON-NLS-1$
SelectionAdapter sa = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
@@ -145,11 +150,13 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
String file = null;
@@ -174,6 +181,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String file = fFileText.getText().trim();
if (file.length() == 0) {
@@ -205,6 +213,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return "Main"; //$NON-NLS-1$
}
@@ -212,6 +221,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
@@ -231,6 +241,7 @@ public class MidiMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
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
index 52e8b9dbd..6678753a0 100644
--- 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
@@ -24,6 +24,7 @@ public class MidiTabGroup extends AbstractLaunchConfigurationTabGroup {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
*/
+ @Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
setTabs(new ILaunchConfigurationTab[] {
new MidiMainTab(),
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
index 6bdfbf4fa..1ea844c16 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2005, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -41,15 +41,15 @@ public class DebugUIPlugin extends AbstractUIPlugin {
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$
-
+
/**
* The id of the plugin
- *
+ *
* @since 1.4.200
*/
public static final String PLUGIN_ID = "org.eclipse.debug.examples.ui"; //$NON-NLS-1$
@@ -58,34 +58,34 @@ public class DebugUIPlugin extends AbstractUIPlugin {
*/
public final static String IMG_ELCL_POP = "IMG_ELCL_POP"; //$NON-NLS-1$
public final static String IMG_DLCL_POP = "IMG_DLCL_POP"; //$NON-NLS-1$
-
+
/**
* Toolbar action to push onto data stack
*/
public final static String IMG_ELCL_PUSH = "IMG_ELCL_PUSH"; //$NON-NLS-1$
public final static String IMG_DLCL_PUSH = "IMG_DLCL_PUSH"; //$NON-NLS-1$
-
+
/**
* PDA program image
*/
public final static String IMG_OBJ_PDA = "IMB_OBJ_PDA"; //$NON-NLS-1$
-
+
/**
* MIDI file image
*/
public final static String IMG_OBJ_MIDI = "IMB_OBJ_MIDI"; //$NON-NLS-1$
-
+
/**
* 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 final Map fColors = new HashMap();
-
+ private final Map<RGB, Color> fColors = new HashMap<RGB, Color>();
+
/**
* The constructor.
*/
@@ -97,6 +97,7 @@ public class DebugUIPlugin extends AbstractUIPlugin {
/**
* This method is called upon plug-in activation
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
// Toggles single threaded adapter example
@@ -108,14 +109,15 @@ public class DebugUIPlugin extends AbstractUIPlugin {
/**
* This method is called when the plug-in is stopped
*/
+ @Override
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
resourceBundle = null;
- Iterator colors = fColors.entrySet().iterator();
+ Iterator<Entry<RGB, Color>> colors = fColors.entrySet().iterator();
while (colors.hasNext()) {
- Map.Entry entry = (Entry) colors.next();
- ((Color)entry.getValue()).dispose();
+ Entry<RGB, Color> entry = colors.next();
+ entry.getValue().dispose();
}
}
@@ -153,11 +155,12 @@ public class DebugUIPlugin extends AbstractUIPlugin {
}
return resourceBundle;
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
*/
+ @Override
protected void initializeImageRegistry(ImageRegistry reg) {
declareImage(IMG_OBJ_PDA, PATH_OBJECT + "pda.gif"); //$NON-NLS-1$
declareImage(IMG_OBJ_MIDI, PATH_OBJECT + "note.gif"); //$NON-NLS-1$
@@ -166,12 +169,12 @@ public class DebugUIPlugin extends AbstractUIPlugin {
declareImage(IMG_ELCL_PUSH, PATH_ELOCALTOOL + "push.gif"); //$NON-NLS-1$
declareImage(IMG_DLCL_PUSH, PATH_DLOCALTOOL + "push.gif"); //$NON-NLS-1$
}
-
+
/**
* 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 <code>declareImage</code> 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
@@ -189,34 +192,34 @@ public class DebugUIPlugin extends AbstractUIPlugin {
}
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);
+ 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 <code>null</code> if none
- *
+ *
* @return the active workbench shell or <code>null</code> if none
*/
public static Shell getActiveWorkbenchShell() {
@@ -225,6 +228,6 @@ public class DebugUIPlugin extends AbstractUIPlugin {
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
index 689c50649..02a382c5c 100644
--- 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
@@ -30,6 +30,7 @@ public class AdapterFactory implements IAdapterFactory {
private static IModelProxyFactory fgFactory = new ModelProxyFactory();
private static IViewActionProvider fgViewActionProvider = new PDAViewActionProvider();
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (IElementContentProvider.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
@@ -49,6 +50,7 @@ public class AdapterFactory implements IAdapterFactory {
return null;
}
+ @Override
public Class[] getAdapterList() {
return new Class[]{IElementContentProvider.class, IModelProxyFactory.class, IViewActionProvider.class};
}
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AddPDAMemoryBlockAction.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AddPDAMemoryBlockAction.java
index 1a8ff182d..8ce7996f1 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AddPDAMemoryBlockAction.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/AddPDAMemoryBlockAction.java
@@ -34,6 +34,7 @@ public class AddPDAMemoryBlockAction implements IActionDelegate2{
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
@@ -73,6 +74,7 @@ public class AddPDAMemoryBlockAction implements IActionDelegate2{
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
PDADebugTarget target = getTarget(selection);
action.setEnabled(target != null && !target.isTerminated());
@@ -81,18 +83,21 @@ public class AddPDAMemoryBlockAction implements IActionDelegate2{
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
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
index 3375fb088..3eed074e3 100644
--- 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
@@ -24,7 +24,8 @@ public class CommandAdapterFactory implements IAdapterFactory {
private static IRestartHandler fgRestartHandler = new PDARestartDebugCommand();
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
if (IRestartHandler.class.equals(adapterType)) {
if (adaptableObject instanceof PDADebugTarget) {
return fgRestartHandler;
@@ -33,7 +34,8 @@ public class CommandAdapterFactory implements IAdapterFactory {
return null;
}
- public Class[] getAdapterList() {
+ @Override
+ 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
index a8e5959f1..4f5586ee1 100644
--- 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
@@ -20,6 +20,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
public class ModelProxyFactory implements IModelProxyFactory {
+ @Override
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (element instanceof PDADebugTarget){
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
index ed0c069ee..fad17ae43 100644
--- 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
@@ -27,7 +27,8 @@ 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 {
+ @Override
+ protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
PDAThread thread = ((PDADebugTarget) element).getThread(0);
if (thread != null) {
if (thread.hasStackFrames()) {
@@ -40,6 +41,7 @@ public class PDADebugTargetContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
PDAThread thread = ((PDADebugTarget) element).getThread(0);
if (thread != null) {
@@ -51,6 +53,7 @@ public class PDADebugTargetContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
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);
@@ -64,6 +67,7 @@ public class PDADebugTargetContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
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
index e905e12fe..7aee1b507 100644
--- 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
@@ -31,6 +31,7 @@ public class PDADebugTargetProxy extends DebugTargetProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugTargetProxy#createEventHandlers()
*/
+ @Override
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
index 7bb788b24..41ff6c1de 100644
--- 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
@@ -24,14 +24,16 @@ import org.eclipse.debug.examples.core.pda.model.PDADebugTarget;
*/
public class PDARestartDebugCommand extends AbstractDebugCommand implements IRestartHandler {
- protected void doExecute(Object[] targets, IProgressMonitor monitor, IRequest request) throws CoreException {
+ @Override
+ 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) {
+ @Override
+ protected Object getTarget(Object element) {
IDebugTarget target = (IDebugTarget)getAdapter(element, IDebugTarget.class);
if (target instanceof PDADebugTarget) {
return target;
@@ -39,7 +41,8 @@ public class PDARestartDebugCommand extends AbstractDebugCommand implements IRes
return null;
}
- protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request)
+ @Override
+ protected boolean isExecutable(Object[] targets, IProgressMonitor monitor, IEnabledStateRequest request)
throws CoreException
{
for (int i = 0; i < targets.length; i++) {
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
index 60d0bbc6c..ed3082637 100644
--- 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
@@ -41,6 +41,7 @@ public class PDAThreadEventHandler extends DebugEventHandler {
super(proxy);
}
+ @Override
protected void handleSuspend(DebugEvent event) {
IThread thread = (IThread) event.getSource();
int extras = IModelDelta.STATE;
@@ -60,28 +61,34 @@ public class PDAThreadEventHandler extends DebugEventHandler {
return o1.equals(o2);
}
+ @Override
protected void handleResume(DebugEvent event) {
IThread thread = (IThread) event.getSource();
fireDeltaAndClearTopFrame(thread, IModelDelta.STATE | IModelDelta.CONTENT);
}
+ @Override
protected void handleCreate(DebugEvent event) {
fireDeltaAndClearTopFrame((IThread) event.getSource(), IModelDelta.ADDED);
}
+ @Override
protected void handleTerminate(DebugEvent event) {
fireDeltaAndClearTopFrame((IThread) event.getSource(), IModelDelta.REMOVED);
}
+ @Override
protected void handleChange(DebugEvent event) {
fireDeltaUpdatingTopFrame((IThread) event.getSource(), IModelDelta.STATE);
}
+ @Override
protected void handleLateSuspend(DebugEvent suspend, DebugEvent resume) {
IThread thread = (IThread) suspend.getSource();
fireDeltaUpdatingTopFrame(thread, IModelDelta.CONTENT | IModelDelta.EXPAND);
}
+ @Override
protected void handleSuspendTimeout(DebugEvent event) {
IThread thread = (IThread) event.getSource();
fireDeltaAndClearTopFrame(thread, IModelDelta.CONTENT);
@@ -144,6 +151,7 @@ public class PDAThreadEventHandler extends DebugEventHandler {
fireDelta(delta);
}
+ @Override
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/adapters/PDAViewActionProvider.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAViewActionProvider.java
index cb575878e..9af6fc981 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAViewActionProvider.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAViewActionProvider.java
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems and others.
+ * Copyright (c) 2012, 2013 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 implementation
+ * Wind River Systems - initial implementation
+ * IBM Corporation - bug fixing
*/
package org.eclipse.debug.examples.ui.pda.adapters;
@@ -27,16 +28,17 @@ import org.eclipse.jface.action.IAction;
*/
public class PDAViewActionProvider implements IViewActionProvider {
- Map fActions = new HashMap();
-
+ Map<IPresentationContext, Action> fActions = new HashMap<IPresentationContext, Action>();
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewActionProvider#getAction(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
public IAction getAction(IPresentationContext presentationContext, String actionID) {
if (presentationContext.getId().equals(IDebugUIConstants.ID_VARIABLE_VIEW) &&
- IDebugView.FIND_ACTION.equals(actionID) )
+ IDebugView.FIND_ACTION.equals(actionID) )
{
- Action action = (Action)fActions.get(presentationContext);
+ Action action = fActions.get(presentationContext);
if (action == null) {
action = new PDAVirtualFindAction(presentationContext);
fActions.put(presentationContext, action);
diff --git a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java
index b5e613ef3..204227995 100644
--- a/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java
+++ b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/adapters/PDAVirtualFindAction.java
@@ -57,46 +57,54 @@ import org.eclipse.ui.texteditor.IUpdate;
/**
* Action which prompts user with a filtered list selection dialog to find an element in tree.
- *
+ *
* @since 3.3
*/
public class PDAVirtualFindAction extends Action implements IUpdate {
-
+
private final TreeModelViewer fClientViewer;
-
+
protected class VirtualViewerListener implements IViewerUpdateListener, ILabelUpdateListener {
-
+
private boolean fViewerUpdatesComplete = false;
private boolean fLabelUpdatesComplete = false;
private IProgressMonitor fProgressMonitor;
- private int fRemainingUpdatesCount = 0;
-
- public void labelUpdateStarted(ILabelUpdate update) {}
- public void labelUpdateComplete(ILabelUpdate update) {
- incrementProgress(1);
+ private int fRemainingUpdatesCount = 0;
+
+ @Override
+ public void labelUpdateStarted(ILabelUpdate update) {}
+ @Override
+ public void labelUpdateComplete(ILabelUpdate update) {
+ incrementProgress(1);
}
- public void labelUpdatesBegin() {
- fLabelUpdatesComplete = false;
+ @Override
+ public void labelUpdatesBegin() {
+ fLabelUpdatesComplete = false;
}
- public void labelUpdatesComplete() {
+ @Override
+ public void labelUpdatesComplete() {
fLabelUpdatesComplete = true;
completeProgress();
}
-
- public void updateStarted(IViewerUpdate update) {}
- public void updateComplete(IViewerUpdate update) {
+
+ @Override
+ public void updateStarted(IViewerUpdate update) {}
+ @Override
+ public void updateComplete(IViewerUpdate update) {
if (update instanceof IChildrenUpdate) {
incrementProgress(((IChildrenUpdate)update).getLength());
}
}
- public void viewerUpdatesBegin() {
- fViewerUpdatesComplete = false;
+ @Override
+ public void viewerUpdatesBegin() {
+ fViewerUpdatesComplete = false;
}
- public void viewerUpdatesComplete() {
+ @Override
+ public void viewerUpdatesComplete() {
fViewerUpdatesComplete = true;
completeProgress();
}
-
+
private void completeProgress() {
IProgressMonitor pm;
synchronized (this) {
@@ -104,9 +112,9 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
}
if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
pm.done();
- }
+ }
}
-
+
private void incrementProgress(int count) {
IProgressMonitor pm;
synchronized (this) {
@@ -115,28 +123,31 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
}
if (pm != null && fLabelUpdatesComplete && fViewerUpdatesComplete) {
pm.worked(count);
- }
+ }
}
}
-
+
private static class FindLabelProvider extends LabelProvider {
private final VirtualTreeModelViewer fVirtualViewer;
- private final Map fTextCache = new HashMap();
- public FindLabelProvider(VirtualTreeModelViewer viewer, List items) {
+ private final Map<VirtualItem, String> fTextCache = new HashMap<VirtualItem, String>();
+
+ public FindLabelProvider(VirtualTreeModelViewer viewer, List<VirtualItem> items) {
fVirtualViewer = viewer;
for (int i = 0; i < items.size(); i++) {
- VirtualItem item = (VirtualItem)items.get(i);
+ VirtualItem item = items.get(i);
fTextCache.put(item, fVirtualViewer.getText(item, 0));
}
}
-
+
+ @Override
public Image getImage(Object element) {
return fVirtualViewer.getImage((VirtualItem) element, 0);
}
+ @Override
public String getText(Object element) {
- return (String)fTextCache.get(element);
+ return fTextCache.get(element);
}
}
@@ -154,8 +165,8 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
clientViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND);
listener.fRemainingUpdatesCount = calcUpdatesCount(stateDelta);
VirtualTreeModelViewer fVirtualViewer = new VirtualTreeModelViewer(
- clientViewer.getDisplay(),
- SWT.NONE,
+ clientViewer.getDisplay(),
+ SWT.NONE,
makeVirtualPresentationContext(clientViewer.getPresentationContext()));
fVirtualViewer.addViewerUpdateListener(listener);
fVirtualViewer.addLabelUpdateListener(listener);
@@ -166,59 +177,62 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
fVirtualViewer.updateViewer(stateDelta);
return fVirtualViewer;
}
-
+
protected IPresentationContext makeVirtualPresentationContext(final IPresentationContext clientViewerContext) {
return new PresentationContext(clientViewerContext.getId()) {
-
+
{
String[] clientProperties = clientViewerContext.getProperties();
for (int i = 0; i < clientProperties.length; i++) {
setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
}
-
+
}
-
- public String[] getColumns() {
+
+ @Override
+ public String[] getColumns() {
String[] clientColumns = super.getColumns();
-
+
if (clientColumns == null || clientColumns.length == 0) {
// No columns are used.
return null;
}
-
+
// Try to find the name column.
for (int i = 0; i < clientColumns.length; i++) {
if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(clientColumns[i])) {
- return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
+ return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
}
}
-
+
return new String[] { clientColumns[0] };
}
};
}
-
+
+ @Override
public void run() {
final VirtualViewerListener listener = new VirtualViewerListener();
VirtualTreeModelViewer virtualViewer = initVirtualViewer(fClientViewer, listener);
-
+
ProgressMonitorDialog dialog = new TimeTriggeredProgressMonitorDialog(fClientViewer.getControl().getShell(), 500);
final IProgressMonitor monitor = dialog.getProgressMonitor();
dialog.setCancelable(true);
-
+
try {
dialog.run(
- true, true,
+ true, true,
new IRunnableWithProgress() {
- public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
+ @Override
+ public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
synchronized(listener) {
listener.fProgressMonitor = m;
listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
}
-
+
while ((!listener.fLabelUpdatesComplete || !listener.fViewerUpdatesComplete) && !listener.fProgressMonitor.isCanceled()) {
Thread.sleep(1);
- }
+ }
synchronized(listener) {
listener.fProgressMonitor = null;
}
@@ -230,10 +244,10 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
} catch (InterruptedException e) {
return;
}
-
+
VirtualItem root = virtualViewer.getTree();
if (!monitor.isCanceled()) {
- List list = new ArrayList();
+ List<VirtualItem> list = new ArrayList<VirtualItem>();
collectAllChildren(root, list);
FindLabelProvider labelProvider = new FindLabelProvider(virtualViewer, list);
VirtualItem result = performFind(list, labelProvider);
@@ -246,11 +260,12 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
virtualViewer.removeViewerUpdateListener(listener);
virtualViewer.dispose();
}
-
+
private int calcUpdatesCount(IModelDelta stateDelta) {
final int[] count = new int[] {0};
stateDelta.accept( new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
count[0] += delta.getChildCount();
return true;
@@ -258,12 +273,12 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
return false;
}
});
-
+
// Double it to account for separate element and label update ticks.
return count[0] * 2;
}
-
- private void collectAllChildren(VirtualItem element, List collect) {
+
+ private void collectAllChildren(VirtualItem element, List<VirtualItem> collect) {
VirtualItem[] children = element.getItems();
if (children != null) {
for (int i = 0; i < children.length; i++) {
@@ -274,11 +289,11 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
}
}
}
-
- protected VirtualItem performFind(List items, FindLabelProvider labelProvider) {
+
+ protected VirtualItem performFind(List<VirtualItem> items, FindLabelProvider labelProvider) {
FindElementDialog dialog = new FindElementDialog(
- fClientViewer.getControl().getShell(),
- labelProvider,
+ fClientViewer.getControl().getShell(),
+ labelProvider,
items.toArray());
dialog.setTitle("PDA Variables View Find"); //$NON-NLS-1$
dialog.setMessage("&Specify an element to select (? = any character, * = any String):"); //$NON-NLS-1$
@@ -290,28 +305,29 @@ public class PDAVirtualFindAction extends Action implements IUpdate {
}
return null;
}
-
+
protected void setSelectionToClient(VirtualTreeModelViewer virtualViewer, ILabelProvider labelProvider, VirtualItem findItem) {
virtualViewer.getTree().setSelection(new VirtualItem[] { findItem } );
ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.SELECT);
fClientViewer.updateViewer(stateDelta);
-
+
ISelection selection = fClientViewer.getSelection();
if (!selection.isEmpty() &&
- selection instanceof IStructuredSelection &&
+ selection instanceof IStructuredSelection &&
((IStructuredSelection)selection).getFirstElement().equals(findItem.getData()) ) {
} else {
DebugUIPlugin.errorDialog(
- fClientViewer.getControl().getShell(),
+ fClientViewer.getControl().getShell(),
"Error", //$NON-NLS-1$
"Could not select item:" + labelProvider.getText(findItem), //$NON-NLS-1$
new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), "Element no longer in viewer.")); //$NON-NLS-1$
- }
+ }
}
-
+
+ @Override
public void update() {
setEnabled( fClientViewer.getInput() != null && fClientViewer.getChildCount(TreePath.EMPTY) > 0 );
}
-
+
}
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
index 6eba0bad9..ca4706959 100644
--- 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
@@ -38,6 +38,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void toggleLineBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
ITextEditor textEditor = getEditor(part);
if (textEditor != null) {
@@ -63,6 +64,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleLineBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public boolean canToggleLineBreakpoints(IWorkbenchPart part, ISelection selection) {
return getEditor(part) != null;
}
@@ -92,17 +94,20 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleMethodBreakpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
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)
*/
+ @Override
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)
*/
+ @Override
public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
String[] variableAndFunctionName = getVariableAndFunctionName(part, selection);
if (variableAndFunctionName != null && part instanceof ITextEditor && selection instanceof ITextSelection) {
@@ -117,6 +122,7 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#canToggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
return getVariableAndFunctionName(part, selection) != null;
}
@@ -210,7 +216,8 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
/* (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 {
+ @Override
+ public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
if (canToggleWatchpoints(part, selection)) {
toggleWatchpoints(part, selection);
} else {
@@ -221,7 +228,8 @@ public class PDABreakpointAdapter implements IToggleBreakpointsTargetExtension {
/* (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) {
+ @Override
+ 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
index 4fd2f8504..a81d6d2c8 100644
--- 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
@@ -26,6 +26,7 @@ public class PDAEditorAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject instanceof PDAEditor) {
ITextEditor editorPart = (ITextEditor) adaptableObject;
@@ -51,6 +52,7 @@ public class PDAEditorAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
+ @Override
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
index 3d5fa42d0..9855de3c2 100644
--- 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
@@ -39,6 +39,7 @@ 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)
*/
+ @Override
public void runToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) throws CoreException {
IEditorPart editorPart = (IEditorPart)part;
ITextEditor textEditor = (ITextEditor)editorPart;
@@ -64,6 +65,7 @@ public class PDARunToLineAdapter implements IRunToLineTarget {
/* (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)
*/
+ @Override
public boolean canRunToLine(IWorkbenchPart part, ISelection selection, ISuspendResume target) {
//#ifdef ex7
//# // TODO: Exercise 7 - ensure the target is a PDA target
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
index f5f6afb89..2e716724c 100644
--- 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
@@ -47,7 +47,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
fModificationModeEnabled = modification;
}
- public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
if (super.canToggleWatchpoints(part, selection)) {
return true;
} else {
@@ -62,6 +63,7 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.IToggleBreakpointsTarget#toggleWatchpoints(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void toggleWatchpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
String[] variableAndFunctionName = getVariableAndFunctionName(part, selection);
@@ -88,7 +90,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
new Job("Toggle PDA Watchpoint") { //$NON-NLS-1$
{ setSystem(true); }
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
try {
IFile file = getResource(var.getStackFrame());
String varName = var.getName();
@@ -101,7 +104,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
new WorkbenchJob(shell.getDisplay(), "Toggle PDA Watchpoint") { //$NON-NLS-1$
{ setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor submonitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor submonitor) {
ErrorDialog.openError(shell, "Failed to create PDA watchpoint", "Failed to create PDA watchpoint.\n", e.getStatus()); //$NON-NLS-1$ //$NON-NLS-2$
return Status.OK_STATUS;
}
@@ -151,7 +155,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
/* (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 {
+ @Override
+ public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) throws CoreException {
if (canToggleWatchpoints(part, selection)) {
toggleWatchpoints(part, selection);
} else {
@@ -162,7 +167,8 @@ public class PDAToggleWatchpointsTarget extends PDABreakpointAdapter {
/* (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) {
+ @Override
+ 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
index e0f5c2652..65d1ee022 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -22,8 +22,8 @@ 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
+ * 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 {
@@ -31,19 +31,20 @@ public class PDAToggleWatchpointsTargetFactory implements IToggleBreakpointsTarg
private static final String TOGGLE_WATCHPOINT_TARGET_ACCESS = "org.eclipse.debug.examples.ui.pda.watchpoint_access"; //$NON-NLS-1$
private static final String TOGGLE_WATCHPOINT_TARGET_MODIFICATION = "org.eclipse.debug.examples.ui.pda.watchpoint_modification"; //$NON-NLS-1$
private static final String TOGGLE_WATCHPOINT_TARGET_BOTH = "org.eclipse.debug.examples.ui.pda.watchpoint_both"; //$NON-NLS-1$
-
- private static Set TOGGLE_WATCHPOINTS_TARGETS = new LinkedHashSet();
-
- private final Map fToggleWatchpointTargets = new HashMap(3);
-
+
+ private static Set<String> TOGGLE_WATCHPOINTS_TARGETS = new LinkedHashSet<String>();
+
+ private final Map<String, IToggleBreakpointsTarget> fToggleWatchpointTargets = new HashMap<String, IToggleBreakpointsTarget>(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);
+ }
+
+ @Override
+ public IToggleBreakpointsTarget createToggleTarget(String targetID) {
+ IToggleBreakpointsTarget target = fToggleWatchpointTargets.get(targetID);
if (target == null) {
if (TOGGLE_WATCHPOINT_TARGET_BOTH.equals(targetID)) {
target = new PDAToggleWatchpointsTarget(true, true);
@@ -51,35 +52,39 @@ public class PDAToggleWatchpointsTargetFactory implements IToggleBreakpointsTarg
target = new PDAToggleWatchpointsTarget(true, false);
} else if (TOGGLE_WATCHPOINT_TARGET_MODIFICATION.equals(targetID)) {
target = new PDAToggleWatchpointsTarget(false, true);
- } else {
+ } else {
return null;
}
fToggleWatchpointTargets.put(targetID, target);
}
return target;
}
-
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
+
+ @Override
+ public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
return TOGGLE_WATCHPOINT_TARGET_BOTH;
}
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public Set<String> getToggleTargets(IWorkbenchPart part, ISelection selection) {
return TOGGLE_WATCHPOINTS_TARGETS;
}
- public String getToggleTargetName(String targetID) {
+ @Override
+ public String getToggleTargetName(String targetID) {
if (TOGGLE_WATCHPOINT_TARGET_BOTH.equals(targetID)) {
return "Watchpoints (Read/Write)"; //$NON-NLS-1$
} else if (TOGGLE_WATCHPOINT_TARGET_ACCESS.equals(targetID)) {
return "Watchpoints (Read)"; //$NON-NLS-1$
} else if (TOGGLE_WATCHPOINT_TARGET_MODIFICATION.equals(targetID)) {
return "Watchpoints (Write)"; //$NON-NLS-1$
- } else {
+ } else {
return null;
}
}
- public String getToggleTargetDescription(String targetID) {
+ @Override
+ 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
index 6b79056b7..5367419a0 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -25,11 +25,12 @@ import org.eclipse.jface.text.source.ISourceViewer;
*/
public class AnnotationHover implements IAnnotationHover {
+ @Override
public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
IAnnotationModel annotationModel = sourceViewer.getAnnotationModel();
- Iterator iterator = annotationModel.getAnnotationIterator();
+ Iterator<Annotation> iterator = annotationModel.getAnnotationIterator();
while (iterator.hasNext()) {
- Annotation annotation = (Annotation) iterator.next();
+ Annotation annotation = iterator.next();
Position position = annotationModel.getPosition(annotation);
try {
int lineOfAnnotation = sourceViewer.getDocument().getLineOfOffset(position.getOffset());
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
index 469bf452f..0e0d4ad7b 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
* Copyright (c) 2005, 2013 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
+ * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -25,7 +25,8 @@ import org.eclipse.jface.text.contentassist.IContextInformationValidator;
public class PDAContentAssistProcessor implements IContentAssistProcessor {
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+ @Override
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
int index = offset - 1;
StringBuffer prefix = new StringBuffer();
IDocument document = viewer.getDocument();
@@ -40,8 +41,8 @@ public class PDAContentAssistProcessor implements IContentAssistProcessor {
} catch (BadLocationException e) {
}
}
-
- List proposals = new ArrayList();
+
+ List<CompletionProposal> proposals = new ArrayList<CompletionProposal>();
String[] keywords = PDAScanner.fgKeywords;
if (prefix.length() > 0) {
String word = prefix.toString();
@@ -59,7 +60,7 @@ public class PDAContentAssistProcessor implements IContentAssistProcessor {
}
}
if (!proposals.isEmpty()) {
- return (ICompletionProposal[]) proposals.toArray(new ICompletionProposal[proposals.size()]);
+ return proposals.toArray(new ICompletionProposal[proposals.size()]);
}
return null;
}
@@ -67,35 +68,40 @@ public class PDAContentAssistProcessor implements IContentAssistProcessor {
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeContextInformation(org.eclipse.jface.text.ITextViewer, int)
*/
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
+ @Override
+ public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters()
*/
- public char[] getCompletionProposalAutoActivationCharacters() {
+ @Override
+ public char[] getCompletionProposalAutoActivationCharacters() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters()
*/
- public char[] getContextInformationAutoActivationCharacters() {
+ @Override
+ public char[] getContextInformationAutoActivationCharacters() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getErrorMessage()
*/
- public String getErrorMessage() {
+ @Override
+ public String getErrorMessage() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
*/
- public IContextInformationValidator getContextInformationValidator() {
+ @Override
+ 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
index 01f71928e..a051aa268 100644
--- 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
@@ -34,7 +34,8 @@ public class PDAContentAssistant extends ContentAssistant {
private IInformationControlCreator getInformationControlCreator() {
return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
+ @Override
+ 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
index 2d7ab812e..6ab57fdc9 100644
--- 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
@@ -36,7 +36,8 @@ public class PDAEditor extends AbstractDecoratedTextEditor {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractTextEditor#createActions()
*/
- protected void createActions() {
+ @Override
+ 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$
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
index 2956ada7a..f2e864c7a 100644
--- 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
@@ -41,14 +41,16 @@ public class PDAScanner extends BufferedRuleBasedScanner {
/* (non-Javadoc)
* @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
*/
- public boolean isWordStart(char c) {
+ @Override
+ 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) {
+ @Override
+ public boolean isWordPart(char c) {
return Character.isLetter(c) || c == '_';
}
}
@@ -61,14 +63,16 @@ public class PDAScanner extends BufferedRuleBasedScanner {
/* (non-Javadoc)
* @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
*/
- public boolean isWordStart(char c) {
+ @Override
+ public boolean isWordStart(char c) {
return c == ':';
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char)
*/
- public boolean isWordPart(char c) {
+ @Override
+ public boolean isWordPart(char c) {
return super.isWordPart(c) || Character.isDigit(c);
}
}
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
index 6c24c36a0..676906253 100644
--- 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
@@ -29,13 +29,15 @@ 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) {
+ @Override
+ 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)
*/
+ @Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new AnnotationHover();
}
@@ -43,7 +45,8 @@ public class PDASourceViewerConfiguration extends TextSourceViewerConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
*/
- public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
+ @Override
+ public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
PresentationReconciler reconciler = new PresentationReconciler();
reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
DefaultDamagerRepairer dr = new DefaultDamagerRepairer(new PDAScanner());
@@ -55,7 +58,8 @@ public class PDASourceViewerConfiguration extends TextSourceViewerConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
*/
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ @Override
+ 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
index 43e35dc26..7fb40ed11 100644
--- 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
@@ -31,12 +31,14 @@ public class PopFrameActionDelegate implements IObjectActionDelegate, IActionDel
/* (non-Javadoc)
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
//#ifdef ex5
//# // TODO: Exercise 5 - pop the top frame
@@ -51,6 +53,7 @@ public class PopFrameActionDelegate implements IObjectActionDelegate, IActionDel
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
@@ -76,12 +79,14 @@ public class PopFrameActionDelegate implements IObjectActionDelegate, IActionDel
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
fThread = null;
}
@@ -89,6 +94,7 @@ public class PopFrameActionDelegate implements IObjectActionDelegate, IActionDel
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
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
index 26ca31c0c..cbd294fe8 100644
--- 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
@@ -33,7 +33,8 @@ 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) {
+ @Override
+ public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
String varName = null;
try {
varName = textViewer.getDocument().get(hoverRegion.getOffset(), hoverRegion.getLength());
@@ -84,7 +85,8 @@ public class TextHover implements ITextHover {
/* (non-Javadoc)
* @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int)
*/
- public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
+ @Override
+ 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/launcher/PDALaunchShortcut.java b/org.eclipse.debug.examples.ui/src/org/eclipse/debug/examples/ui/pda/launcher/PDALaunchShortcut.java
index 78fc73d48..08d4ecefa 100644
--- 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
@@ -35,7 +35,8 @@ 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) {
+ @Override
+ public void launch(ISelection selection, String mode) {
// must be a structured selection with one file selected
IFile file = (IFile) ((IStructuredSelection)selection).getFirstElement();
@@ -71,7 +72,8 @@ public class PDALaunchShortcut implements ILaunchShortcut {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut#launch(org.eclipse.ui.IEditorPart, java.lang.String)
*/
- public void launch(IEditorPart editor, String mode) {
+ @Override
+ 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
index a99f6834d..4fad594f8 100644
--- 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
@@ -52,6 +52,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Font font = parent.getFont();
@@ -76,6 +77,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
fProgramText.setLayoutData(gd);
fProgramText.setFont(font);
fProgramText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
updateLaunchConfigurationDialog();
}
@@ -83,6 +85,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
fProgramButton = createPushButton(comp, "&Browse...", null); //$NON-NLS-1$
fProgramButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
browsePDAFiles();
}
@@ -106,11 +109,13 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
//#ifdef ex1
//# // TODO: Exercise 1 - retrieve the program path attribute from the launch configuration
@@ -133,6 +138,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String program = fProgramText.getText().trim();
if (program.length() == 0) {
@@ -160,6 +166,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return "Main"; //$NON-NLS-1$
}
@@ -167,6 +174,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setWarningMessage(null);
@@ -197,6 +205,7 @@ public class PDAMainTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
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
index 6f1753c45..38e42d4e0 100644
--- 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
@@ -24,6 +24,7 @@ public class PDATabGroup extends AbstractLaunchConfigurationTabGroup {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
*/
+ @Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
//#ifdef ex1
//# // TODO: Exercise 1 - add the PDA main tab, source lookup tab and common
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
index 4f5455edb..821446167 100644
--- 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
@@ -39,12 +39,14 @@ public class PDAModelPresentation extends LabelProvider implements IDebugModelPr
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(java.lang.String, java.lang.Object)
*/
+ @Override
public void setAttribute(String attribute, Object value) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof PDADebugTarget) {
return getTargetText((PDADebugTarget)element);
@@ -160,6 +162,7 @@ public class PDAModelPresentation extends LabelProvider implements IDebugModelPr
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugModelPresentation#computeDetail(org.eclipse.debug.core.model.IValue, org.eclipse.debug.ui.IValueDetailListener)
*/
+ @Override
public void computeDetail(IValue value, IValueDetailListener listener) {
String detail = ""; //$NON-NLS-1$
try {
@@ -171,6 +174,7 @@ public class PDAModelPresentation extends LabelProvider implements IDebugModelPr
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ISourcePresentation#getEditorInput(java.lang.Object)
*/
+ @Override
public IEditorInput getEditorInput(Object element) {
if (element instanceof IFile) {
return new FileEditorInput((IFile)element);
@@ -183,6 +187,7 @@ public class PDAModelPresentation extends LabelProvider implements IDebugModelPr
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(org.eclipse.ui.IEditorInput, java.lang.Object)
*/
+ @Override
public String getEditorId(IEditorInput input, Object element) {
if (element instanceof IFile || element instanceof ILineBreakpoint) {
return "pda.editor"; //$NON-NLS-1$
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
index de469e544..73d061936 100644
--- 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
@@ -27,7 +27,8 @@ import org.eclipse.ui.handlers.HandlerUtil;
*/
abstract public class AbstractDataStackViewHandler extends AbstractHandler {
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchPart part = HandlerUtil.getActivePartChecked(event);
if (part instanceof DataStackView) {
DataStackView view = (DataStackView)part;
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
index f44bf86da..c937d1493 100644
--- 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
@@ -25,7 +25,8 @@ public class CanPushTester extends PropertyTester {
private static final String CAN_PUSH_PROPERTY = "canPush"; //$NON-NLS-1$
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (CAN_PUSH_PROPERTY.equals(property)) {
if (receiver instanceof IAdaptable) {
PDADebugElement element = (PDADebugElement)
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
index 5accdf183..a66daf7e2 100644
--- 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
@@ -17,14 +17,17 @@ import org.eclipse.swt.SWT;
public class CheckboxView extends VariablesView {
public static String ID = "CHECKBOX_VIEW_ID"; //$NON-NLS-1$
+ @Override
protected int getViewerStyle() {
return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.CHECK;
}
+ @Override
protected String getHelpContextId() {
return ID;
}
+ @Override
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
index d6ec8a50a..78bc82bc8 100644
--- 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
@@ -48,6 +48,7 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof PDAThread) {
try {
@@ -61,6 +62,7 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof PDAThread) {
return null;
@@ -72,6 +74,7 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return element instanceof PDAThread;
}
@@ -79,6 +82,7 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
@@ -86,12 +90,14 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
@@ -100,6 +106,7 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Viewer createViewer(Composite parent) {
TreeViewer viewer = new TreeViewer(parent);
viewer.setLabelProvider(DebugUITools.newDebugModelPresentation());
@@ -111,40 +118,47 @@ public class DataStackView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createActions()
*/
+ @Override
protected void createActions() {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
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)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
DebugUITools.getDebugContextManager().getContextService(getSite().getWorkbenchWindow()).removeDebugContextListener(this);
super.dispose();
}
+ @Override
public void debugContextChanged(final DebugContextEvent event) {
new UIJob(getSite().getShell().getDisplay(), "DataStackView update") { //$NON-NLS-1$
{
setSystem(true);
}
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
if (getViewer() != null) { // runs asynchronously, view may be disposed
update(event.getContext());
}
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
index 37157162b..1c7f6b4ba 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -28,14 +28,15 @@ import org.eclipse.jface.viewers.TreeViewer;
*/
public class PopHandler extends AbstractDataStackViewHandler {
- protected void doExecute(DataStackView view, PDAThread thread, ISelection selection) throws ExecutionException {
+ @Override
+ protected void doExecute(DataStackView view, PDAThread thread, ISelection selection) throws ExecutionException {
TreeViewer viewer = (TreeViewer)view.getViewer();
- Object popee = selection instanceof IStructuredSelection
+ Object popee = selection instanceof IStructuredSelection
? ((IStructuredSelection)selection).getFirstElement() : null;
if (popee != null) {
try {
IValue[] stack = thread.getDataStack();
- List restore = new ArrayList();
+ List<IValue> restore = new ArrayList<IValue>();
for (int i = 0; i < stack.length; i++) {
Object value = stack[i];
if (popee.equals(value)) {
@@ -48,7 +49,7 @@ public class PopHandler extends AbstractDataStackViewHandler {
}
}
while (!restore.isEmpty()) {
- IValue value = (IValue) restore.remove(restore.size() - 1);
+ IValue value = restore.remove(restore.size() - 1);
thread.pushData(value.getValueString());
}
} catch (DebugException e) {
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
index d8fb433cc..88ef28b26 100644
--- 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
@@ -23,7 +23,8 @@ import org.eclipse.jface.window.Window;
*/
public class PushHandler extends AbstractDataStackViewHandler {
- protected void doExecute(DataStackView view, PDAThread thread, ISelection selection) throws ExecutionException {
+ @Override
+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); //$NON-NLS-1$ //$NON-NLS-2$
if (dialog.open() == Window.OK) {
try {
diff --git a/org.eclipse.debug.tests/.classpath b/org.eclipse.debug.tests/.classpath
index 2fbb7a23e..ad32c83a7 100644
--- a/org.eclipse.debug.tests/.classpath
+++ b/org.eclipse.debug.tests/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..caf704038 100644
--- a/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.tests/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -81,8 +81,8 @@ 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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.debug.tests/META-INF/MANIFEST.MF b/org.eclipse.debug.tests/META-INF/MANIFEST.MF
index 02801facd..54d5bec36 100644
--- a/org.eclipse.debug.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.tests/META-INF/MANIFEST.MF
@@ -7,14 +7,14 @@ Bundle-Activator: org.eclipse.debug.tests.TestsPlugin
Bundle-Localization: plugin
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.eclipse.debug.ui;bundle-version="[3.10.0,4.0.0)",
org.junit,
org.eclipse.core.filesystem;bundle-version="[1.3.0,2.0.0)",
org.eclipse.test.performance;bundle-version="3.6.0",
org.eclipse.core.resources;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.6.0,4.0.0)"
+ org.eclipse.debug.core;bundle-version="[3.9.0,4.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %providerName
Export-Package: org.eclipe.debug.tests.launching,
org.eclipe.debug.tests.view.memory,
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/ArgumentParsingTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/ArgumentParsingTests.java
index 3330c2872..c43a0ccc6 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/ArgumentParsingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/launching/ArgumentParsingTests.java
@@ -35,41 +35,41 @@ import org.eclipse.osgi.service.environment.Constants;
* {@link org.eclipse.debug.core.DebugPlugin#renderArguments(String[], int[])}.
*/
public class ArgumentParsingTests extends TestCase {
-
+
private void execute1Arg(String cmdLine) throws Exception {
execute1Arg(cmdLine, cmdLine);
}
-
+
private void execute1Arg(String cmdLine, String argParsed) throws Exception {
execute1Arg(cmdLine, argParsed, cmdLine);
}
-
+
private void execute1Arg(String cmdLine, String argParsed, String rendered) throws Exception {
execute("a " + cmdLine + " b", new String[] { "a", argParsed, "b" }, "a " + rendered + " b"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
}
-
+
private static void execute(String commandLine, String[] expectedArgs) throws Exception {
execute(commandLine, expectedArgs, commandLine);
}
-
+
private static void execute(String commandLine, String[] expectedArgs, String expectedRendered) throws Exception {
String[] arguments = DebugPlugin.parseArguments(commandLine);
assertEquals("unexpected parseArguments result;", //$NON-NLS-1$
Arrays.asList(expectedArgs).toString(),
Arrays.asList(arguments).toString());
-
+
runCommandLine(commandLine, arguments);
-
+
String rendered = DebugPlugin.renderArguments(arguments, null);
assertEquals("unexpected renderArguments result;", expectedRendered, rendered); //$NON-NLS-1$
-
+
if (!commandLine.equals(rendered)) {
String[] arguments2 = DebugPlugin.parseArguments(rendered);
assertEquals("parsing rendered command line doesn't yield original arguments;", //$NON-NLS-1$
Arrays.asList(expectedArgs).toString(),
Arrays.asList(arguments2).toString());
}
-
+
}
private static void runCommandLine(String commandLine, String[] arguments) throws IOException,
@@ -80,20 +80,20 @@ public class ArgumentParsingTests extends TestCase {
}
classPathUrl = FileLocator.toFileURL(classPathUrl);
File classPathFile = URIUtil.toFile(URIUtil.toURI(classPathUrl));
-
+
String[] execArgs= new String[arguments.length + 4];
execArgs[0] = new Path(System.getProperty("java.home")).append("bin/java").toOSString(); //$NON-NLS-1$ //$NON-NLS-2$
execArgs[1] = "-cp"; //$NON-NLS-1$
execArgs[2]= classPathFile.getAbsolutePath();
execArgs[3]= ArgumentsPrinter.class.getName();
System.arraycopy(arguments, 0, execArgs, 4, arguments.length);
-
- ArrayList resultArgs = runCommandLine(execArgs);
-
+
+ ArrayList<String> resultArgs = runCommandLine(execArgs);
+
assertEquals("unexpected exec result;", //$NON-NLS-1$
Arrays.asList(arguments).toString(),
resultArgs.toString());
-
+
if (! Platform.getOS().equals(Constants.OS_WIN32)) {
execArgs = new String[] { "sh", "-c", execArgs[0] + " " + execArgs[1] + " " + execArgs[2] + " " + execArgs[3] + " " + commandLine }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
resultArgs = runCommandLine(execArgs);
@@ -103,20 +103,20 @@ public class ArgumentParsingTests extends TestCase {
}
}
- private static ArrayList runCommandLine(String[] execArgs)
+ private static ArrayList<String> runCommandLine(String[] execArgs)
throws CoreException, IOException {
execArgs = quoteWindowsArgs(execArgs);
Process process = DebugPlugin.exec(execArgs, null);
BufferedReader procOut = new BufferedReader(new InputStreamReader(process.getInputStream()));
-
- ArrayList procArgs= new ArrayList();
+
+ ArrayList<String> procArgs = new ArrayList<String>();
String procArg;
while ((procArg = procOut.readLine()) != null) {
procArgs.add(procArg);
}
return procArgs;
}
-
+
private static String[] quoteWindowsArgs(String[] cmdLine) {
// see https://bugs.eclipse.org/387504#c13 , workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511002
if (Platform.getOS().equals(Constants.OS_WIN32)) {
@@ -128,8 +128,8 @@ public class ArgumentParsingTests extends TestCase {
}
return cmdLine;
}
-
-
+
+
private static boolean needsQuoting(String s) {
int len = s.length();
if (len == 0) {
@@ -139,6 +139,8 @@ public class ArgumentParsingTests extends TestCase {
switch (s.charAt(i)) {
case ' ': case '\t': case '\\': case '"':
return true;
+ default:
+ break;
}
}
return false;
@@ -152,7 +154,7 @@ public class ArgumentParsingTests extends TestCase {
s = s.replaceAll("([\\\\]*)\\z", "$1$1"); //$NON-NLS-1$ //$NON-NLS-2$
return "\"" + s + "\""; //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
// -- tests:
public void testEmpty() throws Exception {
@@ -177,7 +179,7 @@ public class ArgumentParsingTests extends TestCase {
Arrays.fill(args, "a"); //$NON-NLS-1$
execute(buf.toString(), args, buf.toString().trim());
}
-
+
public void testEscape() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute1Arg("\\1"); //$NON-NLS-1$
@@ -185,15 +187,15 @@ public class ArgumentParsingTests extends TestCase {
execute1Arg("\\1", "1", "1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
-
+
public void testEscapeDoubleQuote1() throws Exception {
execute1Arg("\\\"", "\"", "\\\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
public void testEscapeDoubleQuote2() throws Exception {
execute1Arg("arg=\\\"bla\\\"", "arg=\"bla\"", "arg=\\\"bla\\\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
public void testDoubleQuoted1() throws Exception {
execute1Arg("\"1 2\"", "1 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -201,7 +203,7 @@ public class ArgumentParsingTests extends TestCase {
public void testDoubleQuoted2() throws Exception {
execute1Arg("\"1\"", "1", "1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
public void testDoubleQuoted3() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
// execute1Arg("\"\"", "", "\"\""); // would be correct, but ProcessImpl is buggy on Windows JDKs
@@ -210,7 +212,7 @@ public class ArgumentParsingTests extends TestCase {
execute1Arg("\"\"", "", "\"\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
-
+
public void testDoubleQuoted4() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute1Arg("\"\"\"\"", "\"", "\\\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -218,11 +220,11 @@ public class ArgumentParsingTests extends TestCase {
execute1Arg("\"\"\"\"", "", "\"\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
-
+
public void testDoubleQuoted5() throws Exception {
execute1Arg("ab\"cd\"ef\"gh\"", "abcdefgh", "abcdefgh"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
+
public void testDoubleQuotedWithSpace1() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute1Arg("\"\"\"1\"\" 2\"", "\"1\" 2", "\"\\\"1\\\" 2\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -230,11 +232,11 @@ public class ArgumentParsingTests extends TestCase {
execute1Arg("\"\"\"1\"\" 2\"", "1 2", "\"1 2\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
-
+
public void testDoubleQuotedWithSpace2() throws Exception {
execute1Arg("\"\\\"1\\\" 2\"", "\"1\" 2"); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
public void testSingleQuoted1() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute("'1 2'", new String[] { "'1", "2'" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -242,7 +244,7 @@ public class ArgumentParsingTests extends TestCase {
execute("'1 2'", new String[] { "1 2" }, "\"1 2\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
-
+
public void testSingleQuoted2() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute1Arg("'1'", "'1'", "'1'"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
@@ -250,11 +252,11 @@ public class ArgumentParsingTests extends TestCase {
execute1Arg("'1'", "1", "1"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
}
-
+
public void testWindows1() throws Exception {
execute("\"a b c\" d e", new String[] { "a b c", "d", "e" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
-
+
public void testWindows2() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute("\"ab\\\"c\" \"\\\\\" d", new String[] { "ab\"c", "\\", "d" }, "ab\\\"c \\ d"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
@@ -262,7 +264,7 @@ public class ArgumentParsingTests extends TestCase {
execute("\"ab\\\"c\" \"\\\\\" d", new String[] { "ab\"c", "\\", "d" }, "ab\\\"c \\\\ d"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
}
-
+
public void testWindows3() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute("a\\\\\\b d\"e f\"g h", new String[] { "a\\\\\\b", "de fg", "h" }, "a\\\\\\b \"de fg\" h"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
@@ -270,11 +272,11 @@ public class ArgumentParsingTests extends TestCase {
execute("a\\\\\\b d\"e f\"g h", new String[] { "a\\b", "de fg", "h" }, "a\\\\b \"de fg\" h"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
}
-
+
public void testWindows4() throws Exception {
execute("a\\\\\\\"b c d", new String[] { "a\\\"b", "c", "d" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
-
+
public void testWindows5() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute("a\\\\\\\\\"b c\" d e", new String[] { "a\\\\b c", "d", "e" }, "\"a\\\\b c\" d e"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
@@ -282,7 +284,7 @@ public class ArgumentParsingTests extends TestCase {
execute("a\\\\\\\\\"b c\" d e", new String[] { "a\\\\b c", "d", "e" }, "\"a\\\\\\\\b c\" d e"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
}
-
+
public void testAllInOne() throws Exception {
if (Platform.getOS().equals(Constants.OS_WIN32)) {
execute("1 \"\" 2 \" \" 3 \\\" 4 \"a b\" 5 \\\"bla\\\" 6 \"ab\"cd 7 ef\"gh\" 8 i\"\"j 9 \"x\\\"y\\\\\" 10 z\\\\z 11 \"two-quotes:\"\"\"\"\" 12 \"g\"\"h\" 13 \"\"\"a\"\" b\"", //$NON-NLS-1$
@@ -294,5 +296,5 @@ public class ArgumentParsingTests extends TestCase {
"1 \"\" 2 \" \" 3 \\\" 4 \"a b\" 5 \\\"bla\\\" 6 abcd 7 efgh 8 ij 9 x\\\"y\\\\ 10 z\\\\z 11 two-quotes: 12 gh 13 \"a b\""); //$NON-NLS-1$
}
}
-
+
}
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
index 283c461fc..d3f42a73b 100644
--- 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
@@ -36,24 +36,25 @@ 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()
*/
+ @Override
public void close() throws IOException {
super.close();
DebugFileSystem.getDefault().setContents(toURI(), toByteArray());
}
-
+
}
-
+
private final URI uri;
-
+
public DebugFileStore(URI id) {
uri = id;
}
@@ -61,9 +62,10 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#childNames(int, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public String[] childNames(int options, IProgressMonitor monitor) throws CoreException {
URI[] uris = DebugFileSystem.getDefault().getFileURIs();
- List children = new ArrayList();
+ List<String> children = new ArrayList<String>();
IPath me = getPath();
for (int i = 0; i < uris.length; i++) {
URI id = uris[i];
@@ -74,12 +76,13 @@ public class DebugFileStore extends FileStore {
}
}
}
- return (String[]) children.toArray(new String[children.size()]);
+ return children.toArray(new String[children.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#fetchInfo(int, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException {
byte[] contents = DebugFileSystem.getDefault().getContents(toURI());
FileInfo info = new FileInfo();
@@ -102,6 +105,7 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#getChild(java.lang.String)
*/
+ @Override
public IFileStore getChild(String name) {
try {
return new DebugFileStore(new URI(getFileSystem().getScheme(), getPath().append(name).toString(), null));
@@ -113,6 +117,7 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#getName()
*/
+ @Override
public String getName() {
IPath path = getPath();
if (path.segmentCount() > 0) {
@@ -133,6 +138,7 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#getParent()
*/
+ @Override
public IFileStore getParent() {
IPath path = getPath();
if (path.segmentCount() > 0) {
@@ -147,6 +153,7 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#openInputStream(int, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException {
byte[] contents = DebugFileSystem.getDefault().getContents(toURI());
if (contents != null) {
@@ -155,17 +162,19 @@ public class DebugFileStore extends FileStore {
throw new CoreException(new Status(IStatus.ERROR, "org.eclipse.jdt.debug.tests", //$NON-NLS-1$
"File does not exist: " + toURI())); //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#openOutputStream(int, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
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)
*/
+ @Override
public IFileStore mkdir(int options, IProgressMonitor monitor) throws CoreException {
IFileInfo info = fetchInfo();
if (info.exists()) {
@@ -192,6 +201,7 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#toURI()
*/
+ @Override
public URI toURI() {
return uri;
}
@@ -199,6 +209,7 @@ public class DebugFileStore extends FileStore {
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileStore#delete(int, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
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
index 7ec08bf71..3c876f687 100644
--- 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
@@ -23,18 +23,18 @@ 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 final Map files = new HashMap();
+ private final Map<URI, byte[]> files = new HashMap<URI, byte[]>();
/**
* Constructs the singleton
@@ -46,50 +46,53 @@ public class DebugFileSystem extends FileSystem {
setContents(new URI("debug", Path.ROOT.toString(), null), DIRECTORY_BYTES); //$NON-NLS-1$
} 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)
*/
+ @Override
public IFileStore getStore(URI uri) {
return new DebugFileStore(uri);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileSystem#canDelete()
*/
+ @Override
public boolean canDelete() {
return true;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.core.filesystem.provider.FileSystem#canWrite()
*/
+ @Override
public boolean canWrite() {
return true;
}
-
+
/**
* Returns whether contents of the file or <code>null</code> if none.
- *
+ *
* @param uri
* @return bytes or <code>null</code>
*/
public byte[] getContents(URI uri) {
- return (byte[]) files.get(uri);
+ return files.get(uri);
}
-
+
/**
* Deletes the file.
- *
+ *
* @param uri
*/
public void delete(URI uri) {
@@ -98,21 +101,21 @@ public class DebugFileSystem extends FileSystem {
/**
* 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()]);
+ return 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
index 167667c3e..707ac8465 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -61,23 +61,24 @@ import org.eclipse.ui.PlatformUI;
/**
* Tests for launch configurations
*/
+@SuppressWarnings("deprecation")
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"; //$NON-NLS-1$
-
+
/**
* 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 to hold resource description infos
* @since 3.9.0
@@ -90,16 +91,17 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
String path;
Integer type;
}
-
+
class Listener implements ILaunchConfigurationListener {
-
- private final List addedList = new ArrayList();
- private final List removedList = new ArrayList();
- private final List changedList = new ArrayList();
+
+ private final List<ILaunchConfiguration> addedList = new ArrayList<ILaunchConfiguration>();
+ private final List<ILaunchConfiguration> removedList = new ArrayList<ILaunchConfiguration>();
+ private final List<ILaunchConfiguration> changedList = new ArrayList<ILaunchConfiguration>();
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
addedList.add(configuration);
}
@@ -107,6 +109,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
changedList.add(configuration);
}
@@ -114,27 +117,30 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
removedList.add(configuration);
}
-
- public List getAdded() {
+
+ public List<ILaunchConfiguration> getAdded() {
return addedList;
}
- public List getChanged() {
+
+ public List<ILaunchConfiguration> getChanged() {
return changedList;
}
- public List getRemoved() {
+
+ public List<ILaunchConfiguration> 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
+ * @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.
*/
@@ -157,7 +163,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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
@@ -206,8 +212,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
}
}
return contents;
- }
-
+ }
+
/**
* Constructor
* @param name
@@ -215,17 +221,17 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
public LaunchConfigurationTests(String name) {
super(name);
}
-
+
/**
* Returns a scratch project for launch configurations
- *
+ *
* @return
*/
protected IProject getProject() throws CoreException {
return TestsPlugin.createProject("LaunchConfigurationTests"); //$NON-NLS-1$
}
-
- /**
+
+ /**
* Creates and returns a new launch config the given name, local
* or shared, with 4 attributes:
* - String1 = "String1"
@@ -245,8 +251,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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
*/
@@ -255,8 +261,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
ILaunchConfigurationWorkingCopy wc = type.newInstance(container, name);
assertEquals("Should have no attributes", 0, wc.getAttributes().size()); //$NON-NLS-1$
return wc;
- }
-
+ }
+
/**
* Returns whether the given handle is contained in the specified
* array of handles.
@@ -269,11 +275,11 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
}
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 {
@@ -282,40 +288,40 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
+ assertEquals("Wrong name", handle.getName(), "localName"); //$NON-NLS-1$ //$NON-NLS-2$
// 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.
*/
@@ -323,15 +329,15 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
-
+ assertEquals("Wrong name", handle.getName(), "sharedName"); //$NON-NLS-1$ //$NON-NLS-2$
+
// 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
@@ -343,7 +349,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
File file = location.toFile();
assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$
- Map attributes = handle.getAttributes();
+ 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$
@@ -353,15 +359,15 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
// 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<String, Object> map = new HashMap<String, Object>();
map.put("ATTR1", "ONE"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("ATTR2", "TWO"); //$NON-NLS-1$ //$NON-NLS-2$
wc.setAttributes(map);
@@ -370,7 +376,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
File file = location.toFile();
assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$
- Map attributes = handle.getAttributes();
+ 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$
@@ -379,8 +385,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
// cleanup
handle.delete();
assertTrue("Config should not exist after deletion", !handle.exists()); //$NON-NLS-1$
- }
-
+ }
+
/**
* Ensures that set attributes to <code>null</code> works
* @throws CoreException
@@ -393,13 +399,13 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
File file = location.toFile();
assertTrue("Configuration file should exist", file.exists()); //$NON-NLS-1$
- Map attributes = handle.getAttributes();
+ 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.
@@ -412,17 +418,17 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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();
@@ -432,16 +438,16 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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.
@@ -453,32 +459,32 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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
@@ -490,22 +496,22 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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();
+
+ // 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
@@ -519,13 +525,13 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
@@ -535,7 +541,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
@@ -546,12 +552,12 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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
@@ -593,8 +599,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
// 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
@@ -636,8 +642,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
// 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.
@@ -647,22 +653,22 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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.
@@ -673,36 +679,36 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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
+
+ // 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,
@@ -714,22 +720,22 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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();
+
+ // 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
@@ -741,13 +747,13 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
@@ -757,7 +763,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
@@ -768,12 +774,12 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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.
*/
@@ -781,8 +787,8 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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
@@ -790,24 +796,24 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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();
@@ -821,14 +827,15 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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)
*/
+ @Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
fFrom = getLaunchManager().getMovedFrom(configuration);
synchronized (fLock) {
@@ -840,12 +847,14 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
}
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
fTo = getLaunchManager().getMovedTo(configuration);
synchronized (fLock) {
@@ -857,15 +866,15 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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 {
@@ -877,11 +886,11 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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);
@@ -897,10 +906,10 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
removeConfigListener();
}
}
-
+
/**
* Tests a nested working copy.
- *
+ *
* @throws CoreException
*/
public void testNestedWorkingCopyLocalConfiguration() throws CoreException {
@@ -909,33 +918,33 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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$
@@ -943,84 +952,84 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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"); //$NON-NLS-1$
assertNotNull("Missing debug EFS", fileSystem); //$NON-NLS-1$
-
+
// create folder in EFS
IFolder folder = getProject().getFolder("efs"); //$NON-NLS-1$
folder.createLink(new URI("debug", Path.ROOT.toString(), null), 0, null); //$NON-NLS-1$
-
+
// 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$
-
+ 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"); //$NON-NLS-1$
assertNotNull("Missing debug EFS", fileSystem); //$NON-NLS-1$
-
+
// create folder in EFS
IFolder folder = getProject().getFolder("efs2"); //$NON-NLS-1$
folder.createLink(new URI("debug", Path.ROOT.toString(), null), 0, null); //$NON-NLS-1$
-
+
// 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$
-
+ 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 {
@@ -1031,33 +1040,33 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
}
// create project
IProject project = TestsPlugin.createProject("RenameEFS"); //$NON-NLS-1$
-
+
IFileSystem fileSystem = EFS.getFileSystem("debug"); //$NON-NLS-1$
assertNotNull("Missing debug EFS", fileSystem); //$NON-NLS-1$
-
+
// create folder in EFS
IFolder folder = project.getFolder("efs2"); //$NON-NLS-1$
folder.createLink(new URI("debug", Path.ROOT.toString(), null), 0, null); //$NON-NLS-1$
-
+
// 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$
-
+ 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 //$NON-NLS-1$
project.move(description, IResource.SHALLOW, 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"); //$NON-NLS-1$
assertTrue("Project should exist", project.exists()); //$NON-NLS-1$
@@ -1065,25 +1074,25 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
assertTrue("launch config file should exist", file.exists()); //$NON-NLS-1$
handle = getLaunchManager().getLaunchConfiguration(file);
assertTrue("launch config 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$
-
+ 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()); //$NON-NLS-1$
-
+
// 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 {
@@ -1091,7 +1100,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
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")); //$NON-NLS-1$
assertTrue("Import directory does not exist", dir.exists()); //$NON-NLS-1$
LaunchManager manager = (LaunchManager) getLaunchManager();
@@ -1102,6 +1111,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
// import
manager.importConfigurations(dir.listFiles(
new FileFilter() {
+ @Override
public boolean accept(File file) {
return file.isFile() &&
file.getName().endsWith(
@@ -1109,17 +1119,17 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
}
}),
null);
-
+
// should be one removed
- List removed = listener.getRemoved();
+ List<ILaunchConfiguration> removed = listener.getRemoved();
assertEquals("Should be one removed config", 1, removed.size()); //$NON-NLS-1$
assertTrue("Import4 should be removed", removed.contains(handle)); //$NON-NLS-1$
-
+
// should be 5 added
- List added = listener.getAdded();
+ List<?> added = listener.getAdded();
assertEquals("Should be 5 added configs", 5, added.size()); //$NON-NLS-1$
- Set names = new HashSet();
- Iterator iterator = added.iterator();
+ Set<String> names = new HashSet<String>();
+ Iterator<?> iterator = added.iterator();
while (iterator.hasNext()) {
ILaunchConfiguration lc = (ILaunchConfiguration) iterator.next();
names.add(lc.getName());
@@ -1129,20 +1139,20 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
assertTrue("Missing Name", names.contains("Import3")); //$NON-NLS-1$ //$NON-NLS-2$
assertTrue("Missing Name", names.contains("Import4")); //$NON-NLS-1$ //$NON-NLS-2$
assertTrue("Missing Name", names.contains("Import5")); //$NON-NLS-1$ //$NON-NLS-2$
-
+
// should be one changed
- List changed = listener.getChanged();
+ List<ILaunchConfiguration> changed = listener.getChanged();
assertEquals("Should be 1 changed config", 1, changed.size()); //$NON-NLS-1$
- assertEquals("Wrong changed config", "Import4", ((ILaunchConfiguration) changed.get(0)).getName()); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("Wrong changed config", "Import4", changed.get(0).getName()); //$NON-NLS-1$ //$NON-NLS-2$
} finally {
manager.removeLaunchConfigurationListener(listener);
}
-
+
}
-
+
/**
* Tests the location of a local working copy.
- *
+ *
* @throws CoreException
*/
public void testWorkingCopyGetLocation() throws CoreException {
@@ -1150,7 +1160,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
IPath location = workingCopy.getLocation();
assertEquals("Wrong path for local working copy", LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.append("test-get-location.launch"), location); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
* Tests that the framework adds time stamps to launch objects.
*/
@@ -1167,15 +1177,15 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
}
}
}
-
+
/**
* 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"); //$NON-NLS-1$
- HashMap map = new HashMap();
+ HashMap<String, String> map = new HashMap<String, String>();
map.put("Z", "z-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("Y", "y-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("X", "x-value"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1204,9 +1214,9 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
map.put("A", "a-value"); //$NON-NLS-1$ //$NON-NLS-2$
c1.setAttribute("Map-Attribute", map); //$NON-NLS-1$
c1.doSave();
-
+
ILaunchConfigurationWorkingCopy c2 = newEmptyConfiguration(getProject(), "testMapAttributes2"); //$NON-NLS-1$
- map = new HashMap();
+ map = new HashMap<String, String>();
map.put("A", "a-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("Z", "z-value"); //$NON-NLS-1$ //$NON-NLS-2$
map.put("B", "b-value"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -1235,7 +1245,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
map.put("N", "n-value"); //$NON-NLS-1$ //$NON-NLS-2$
c2.setAttribute("Map-Attribute", map); //$NON-NLS-1$
c2.doSave();
-
+
// file contents should be the same
char[] chars1 = getInputStreamAsCharArray(c1.getFile().getContents());
char[] chars2 = getInputStreamAsCharArray(c2.getFile().getContents());
@@ -1243,17 +1253,17 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
for (int i = 0; i < chars2.length; i++) {
assertEquals("Should be the same character", chars1[i], chars2[i]); //$NON-NLS-1$
}
-
+
}
/**
* 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"); //$NON-NLS-1$
- Set set = new HashSet();
+ Set<String> set = new HashSet<String>();
set.add("z-value"); //$NON-NLS-1$
set.add("y-value"); //$NON-NLS-1$
set.add("x-value"); //$NON-NLS-1$
@@ -1282,9 +1292,9 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
set.add("a-value"); //$NON-NLS-1$
c1.setAttribute("Set-Attribute", set); //$NON-NLS-1$
c1.doSave();
-
+
ILaunchConfigurationWorkingCopy c2 = newEmptyConfiguration(getProject(), "testSetAttributes2"); //$NON-NLS-1$
- set = new HashSet();
+ set = new HashSet<String>();
set.add("a-value"); //$NON-NLS-1$
set.add("z-value"); //$NON-NLS-1$
set.add("b-value"); //$NON-NLS-1$
@@ -1313,7 +1323,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
set.add("n-value"); //$NON-NLS-1$
c2.setAttribute("Set-Attribute", set); //$NON-NLS-1$
c2.doSave();
-
+
// file contents should be the same
char[] chars1 = getInputStreamAsCharArray(c1.getFile().getContents());
char[] chars2 = getInputStreamAsCharArray(c2.getFile().getContents());
@@ -1321,13 +1331,13 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
for (int i = 0; i < chars2.length; i++) {
assertEquals("Should be the same character", chars1[i], chars2[i]); //$NON-NLS-1$
}
-
+
}
-
+
/**
* 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() {
@@ -1339,12 +1349,12 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
}
assertTrue("Should be an illegal argument - cannot nest local configurations", false); //$NON-NLS-1$
}
-
+
/**
* 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() {
@@ -1353,11 +1363,11 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
} catch (CoreException e) {
assertTrue("Should *not* be an illegal argument - can nest shared cofigurations", false); //$NON-NLS-1$
}
- }
-
+ }
+
/**
* Test that an illegal name with '<' causes an exception
- *
+ *
* @throws CoreException
*/
public void testIllegalCharName() {
@@ -1368,11 +1378,11 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
return;
}
assertTrue("Should be an illegal argument - illegal character used in name", false); //$NON-NLS-1$
- }
-
+ }
+
/**
* Test that moving and renaming a shared configuration at the same time works.
- *
+ *
* @throws CoreException
*/
public void testRenameAndMoveShared() throws CoreException {
@@ -1384,19 +1394,19 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
ILaunchConfigurationWorkingCopy wc = newConfiguration(f1, "start-here"); //$NON-NLS-1$
ILaunchConfiguration orig = wc.doSave();
wc = orig.getWorkingCopy();
-
+
wc.setContainer(f2);
wc.rename("end-here"); //$NON-NLS-1$
ILaunchConfiguration next = wc.doSave();
-
+
assertFalse("Original should not exist", orig.exists()); //$NON-NLS-1$
assertTrue("Renamed and moved config should exist", next.exists()); //$NON-NLS-1$
-
+
}
-
+
/**
* Test support for a URL in the 'icon' part of the launchConfigurationTypeImages extension point
- *
+ *
* Bug 381175 - [patch] launchConfigurationTypeImage to support platform: style icons
* @throws Exception
*/
@@ -1405,7 +1415,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
assertNotNull("The image descriptior type.image.1 must exist", descriptor); //$NON-NLS-1$
assertNotSame("The image descriptor is not type.image.1", ImageDescriptor.getMissingImageDescriptor(), descriptor); //$NON-NLS-1$
}
-
+
/**
* Test support for a declared launch configuration type image
* @throws Exception
@@ -1415,10 +1425,10 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
assertNotNull("The image descriptior type.image.2 must exist", descriptor); //$NON-NLS-1$
assertNotSame("The image descriptor is not type.image.2", ImageDescriptor.getMissingImageDescriptor(), descriptor); //$NON-NLS-1$
}
-
+
/**
* Tests that we can get a project handle from a project name
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=395441
* @throws Exception
* @since 3.9.0
@@ -1437,10 +1447,10 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
lc.delete();
}
}
-
+
/**
* Tests that we cannot get a project handle from a bogus project name
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=395441
* @throws Exception
* @since 3.9.0
@@ -1458,10 +1468,10 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
lc.delete();
}
}
-
+
/**
* Tests that we cannot get a project handle from a bogus project name
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=395441
* @throws Exception
* @since 3.9.0
@@ -1487,7 +1497,7 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
/**
* Tests that we can get a project handle from an absolute project name
- *
+ *
* @see https://bugs.eclipse.org/bugs/show_bug.cgi?id=395441
* @throws Exception
* @since 3.9.0
@@ -1505,19 +1515,19 @@ public class LaunchConfigurationTests extends AbstractLaunchTest implements ILau
lc.delete();
}
}
-
+
/**
* Proxy to set resource paths, allowing invalid resource paths to be set
* @param resources
* @since 3.9.0
*/
protected void setResourceMappings(ILaunchConfigurationWorkingCopy config, ResourceItem[] resources) {
- List/*<String>*/ paths = null;
- List/*<String>*/ types = null;
+ List/* <String> */<String> paths = null;
+ List/* <String> */<String> types = null;
int size = resources.length;
if(resources != null && size > 0) {
- paths = new ArrayList(size);
- types = new ArrayList(size);
+ paths = new ArrayList<String>(size);
+ types = new ArrayList<String>(size);
for(int i = 0; i < size; i++) {
paths.add(resources[i].path);
types.add(resources[i].type.toString());
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
index 485e8dec4..8b5989ccf 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -22,13 +22,13 @@ 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
+ * Configuration to use for the test. One is created for each test during
* setup and deleted during tear down.
*/
private ILaunchConfiguration fConfig;
@@ -40,7 +40,7 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
public LaunchFavoriteTests(String name) {
super(name);
}
-
+
/**
* Returns the run launch history
* @return
@@ -48,7 +48,7 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
private LaunchHistory getRunLaunchHistory() {
return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_RUN_LAUNCH_GROUP);
}
-
+
/**
* Returns the debug launch history
* @return
@@ -56,10 +56,11 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
private LaunchHistory getDebugLaunchHistory() {
return getLaunchConfigurationManager().getLaunchHistory(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP);
}
-
+
/* (non-Javadoc)
* @see junit.framework.TestCase#setUp()
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
// clear the favorites
@@ -67,10 +68,11 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
getDebugLaunchHistory().setFavorites(new ILaunchConfiguration[0]);
fConfig = getLaunchConfiguration(getName());
}
-
+
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
super.tearDown();
// delete the configuration used during this test
@@ -79,40 +81,40 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
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);
+ List<String> list = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<String>();
}
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
@@ -120,7 +122,7 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
*/
private ILaunchConfigurationWorkingCopy removeFavorite(ILaunchConfiguration config, String groupId) throws CoreException {
ILaunchConfigurationWorkingCopy wc = getWorkingCopy(config);
- List list = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
+ List<String> list = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (list != null) {
if (list.remove(groupId)) {
if (list.isEmpty()) {
@@ -131,7 +133,7 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
}
return wc;
}
-
+
private ILaunchConfigurationWorkingCopy getWorkingCopy(ILaunchConfiguration config) throws CoreException {
ILaunchConfigurationWorkingCopy wc = null;
if (config.isWorkingCopy()) {
@@ -141,15 +143,15 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
}
return wc;
}
-
+
/**
- * Returns whether the launch history contains the given configuration as a favorite and is
+ * 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
+ * @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) {
@@ -165,10 +167,10 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
}
return false;
}
-
+
/**
* Tests that a configuration becoming a favorite appears in the favorites.
- *
+ *
* @throws CoreException
*/
public void testBecomeFavorite() throws CoreException {
@@ -178,10 +180,10 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
assertTrue("Missing from debug favorites", containsFavorite(getDebugLaunchHistory(), saved, 1)); //$NON-NLS-1$
assertTrue("Missing from run favorites", containsFavorite(getRunLaunchHistory(), saved, 1)); //$NON-NLS-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 {
@@ -192,10 +194,10 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
assertFalse("Should not be a debug favorite", containsFavorite(getDebugLaunchHistory(), saved, 0)); //$NON-NLS-1$
assertFalse("Should not be a run favorite", containsFavorite(getRunLaunchHistory(), saved, 0)); //$NON-NLS-1$
}
-
+
/**
* When a configuration is deleted, it should no longer be in the list.
- *
+ *
* @throws CoreException
*/
public void testDeleteConfiguration() throws CoreException {
@@ -205,10 +207,10 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
assertFalse("Should not be a debug favorite", containsFavorite(getDebugLaunchHistory(), configuration, 0)); //$NON-NLS-1$
assertFalse("Should not be a run favorite", containsFavorite(getRunLaunchHistory(), configuration, 0)); //$NON-NLS-1$
}
-
+
/**
* When a favorite is renamed, it should still be in the list, with the new name.
- *
+ *
* @throws CoreException
*/
public void testRenameFavorite() throws CoreException {
@@ -221,10 +223,10 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
assertTrue("Missing from run favorites", containsFavorite(getRunLaunchHistory(), saved, 1)); //$NON-NLS-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 {
@@ -238,10 +240,10 @@ public class LaunchFavoriteTests extends AbstractLaunchTest {
assertTrue("Missing from run favorites", containsFavorite(getRunLaunchHistory(), saved, 1)); //$NON-NLS-1$
saved.delete();
}
-
+
/**
* Renaming a configuration and removing its favorite status should remove it from the list.
- *
+ *
* @throws CoreException
*/
public void testRenameUnFavorite() throws CoreException {
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
index e841160b3..10cd892f7 100644
--- 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
@@ -15,11 +15,12 @@ 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
*/
+@SuppressWarnings("deprecation")
public class LaunchManagerTests extends AbstractLaunchTest {
/**
@@ -38,7 +39,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
String name = getLaunchManager().generateLaunchConfigurationName(configname);
assertTrue("the name nust be '" + configname + "'", name.equals(configname)); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
* Tests generating a launch configuration name with an unsupported char using
* the deprecated method
@@ -48,7 +49,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
String name = getLaunchManager().generateUniqueLaunchConfigurationNameFrom(configname);
assertEquals("config name should be '" + configname + "'", configname, name); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
* Tests that a valid name is accepted as is.
*/
@@ -57,7 +58,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
String name = getLaunchManager().generateLaunchConfigurationName(configname);
assertEquals("Should be the same as the seed", configname, name); //$NON-NLS-1$
}
-
+
/**
* Tests generating a launch configuration name using a name that is an OS reserved
* name. Win 32 test only.
@@ -69,7 +70,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
assertEquals("config name should be 'aux'", configname, name); //$NON-NLS-1$
}
}
-
+
/**
* Tests generating a configuration name that contains an invalid character
*/
@@ -78,9 +79,9 @@ public class LaunchManagerTests extends AbstractLaunchTest {
String name = getLaunchManager().generateLaunchConfigurationName(configname);
assertEquals("config name should be 'config_name'", "config_name", name); //$NON-NLS-1$ //$NON-NLS-2$
}
-
+
/**
- * Tests generating a name that conflicts with an OS reserved name. This test is for windows only as there
+ * 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() {
@@ -90,7 +91,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
assertEquals("config name should be 'launch_configuration'", "launch_configuration", name); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
/**
* Tests generating a configuration name that contains an invalid character and where there
* is another config with the replaced name already
@@ -105,10 +106,10 @@ public class LaunchManagerTests extends AbstractLaunchTest {
ILaunchConfiguration config = getLaunchConfiguration("config_name"); //$NON-NLS-1$
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
+ * 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 {
@@ -123,7 +124,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
config.delete();
}
}
-
+
/**
* Tests the {@link org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(String)} method for correctness
*/
@@ -136,7 +137,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
fail("the config name should not have thrown an exception during validation"); //$NON-NLS-1$
}
}
-
+
/**
* Tests the {@link org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(String)} method for correctness
*/
@@ -150,7 +151,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
}
fail("the config name should have thrown an exception during validation"); //$NON-NLS-1$
}
-
+
/**
* Tests the {@link org.eclipse.debug.core.ILaunchManager#isValidLaunchConfigurationName(String)} method for correctness
*/
@@ -166,7 +167,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
fail("the config name should have thrown an exception during validation"); //$NON-NLS-1$
}
}
-
+
/**
* Tests that generating a configuration name when there exists a configuration with that name
* already properly updates a '(N)' counter at the end
@@ -188,7 +189,7 @@ public class LaunchManagerTests extends AbstractLaunchTest {
config.delete();
}
}
-
+
/**
* Tests that removing an accelerator properly removes it without affecting the base string (readable) value
*/
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
index 54994d369..df62ebd8c 100644
--- 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
@@ -24,6 +24,7 @@ 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)
*/
+ @Override
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
index 648b97674..527ba3665 100644
--- 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
@@ -37,21 +37,24 @@ public class DynamicRenderingBindings extends AbstractMemoryRenderingBindingsPro
/**
* @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
*/
- public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
+ @Override
+ 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) {
+ @Override
+ 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) {
+ @Override
+ public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
return DebugUITools.getMemoryRenderingManager().getRenderingType(fId);
}
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
index 994f4a158..4c5e84082 100644
--- 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
@@ -25,6 +25,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IMemoryBlock#getStartAddress()
*/
+ @Override
public long getStartAddress() {
return 0;
}
@@ -32,6 +33,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IMemoryBlock#getLength()
*/
+ @Override
public long getLength() {
return 100;
}
@@ -39,6 +41,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IMemoryBlock#getBytes()
*/
+ @Override
public byte[] getBytes() throws DebugException {
byte[] bytes = new byte[(int)getLength()];
for (int i = 0; i < bytes.length; i++) {
@@ -50,6 +53,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IMemoryBlock#supportsValueModification()
*/
+ @Override
public boolean supportsValueModification() {
return false;
}
@@ -57,6 +61,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[])
*/
+ @Override
public void setValue(long offset, byte[] bytes) throws DebugException {
}
@@ -64,6 +69,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
+ @Override
public String getModelIdentifier() {
return "no.debugger"; //$NON-NLS-1$
}
@@ -71,6 +77,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
+ @Override
public IDebugTarget getDebugTarget() {
return null;
}
@@ -78,6 +85,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
return null;
}
@@ -85,6 +93,7 @@ public class MemoryBlock implements IMemoryBlock {
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
return null;
}
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
index 8c7a9f2ca..6e5816bf1 100644
--- 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
@@ -118,6 +118,7 @@ public class MemoryRenderingTests extends TestCase {
public void testBindingChangeNotification() {
final boolean[] changed = new boolean[1];
IMemoryRenderingBindingsListener listener = new IMemoryRenderingBindingsListener() {
+ @Override
public void memoryRenderingBindingsChanged() {
changed[0] = true;
}
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
index b4f9a70be..1b0f41bd1 100644
--- 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
@@ -24,6 +24,7 @@ public class RenderingTypeDelegate implements IMemoryRenderingTypeDelegate {
/**
* @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
*/
+ @Override
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
index 9cc09fec0..8ac3e964d 100644
--- 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
@@ -45,7 +45,8 @@ abstract public class CheckTests extends TestCase {
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -63,7 +64,8 @@ abstract public class CheckTests extends TestCase {
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
@@ -76,7 +78,8 @@ abstract public class CheckTests extends TestCase {
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
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
index 9c85204e0..db5a43710 100644
--- 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
@@ -45,129 +45,184 @@ public class ChildrenUpdateTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider#getViewer()
*/
+ @Override
protected IInternalTreeModelViewer getViewer() {
return new IInternalTreeModelViewer(){
+ @Override
public void setSelection(ISelection selection) {}
+ @Override
public void removeSelectionChangedListener(ISelectionChangedListener listener) {}
+ @Override
public void addSelectionChangedListener(ISelectionChangedListener listener) {}
+ @Override
public void updateViewer(IModelDelta delta) {}
+ @Override
public void setSelection(ISelection selection, boolean reveal, boolean force) {}
+ @Override
public void clearSelectionQuiet() {}
+ @Override
public boolean trySelection(ISelection selection, boolean reveal, boolean force) { return true; }
+ @Override
public void setInput(Object object) {}
+ @Override
public void setAutoExpandLevel(int level) {}
+ @Override
public boolean saveElementState(TreePath path, ModelDelta delta, int flags) { return true; }
+ @Override
public void removeStateUpdateListener(IStateUpdateListener listener) {}
+ @Override
public void removeViewerUpdateListener(IViewerUpdateListener listener) {}
+ @Override
public void removeModelChangedListener(IModelChangedListener listener) {}
+ @Override
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) {}
+ @Override
+ public void addViewerUpdateListener(IViewerUpdateListener listener) {}
+ @Override
+ public void addStateUpdateListener(IStateUpdateListener listener) {}
+ @Override
+ public void addModelChangedListener(IModelChangedListener listener) {}
+ @Override
+ public void addLabelUpdateListener(ILabelUpdateListener listener) {}
+ @Override
+ public void update(Object element) {}
+ @Override
+ public void setHasChildren(Object elementOrTreePath, boolean hasChildren) {}
+ @Override
+ public void setExpandedState(Object elementOrTreePath, boolean expanded) {}
+ @Override
+ public void setChildCount(Object elementOrTreePath, int count) {}
+ @Override
+ public void reveal(TreePath path, int index) {}
+ @Override
+ public void replace(Object parentOrTreePath, int index, Object element) {}
+ @Override
+ public void remove(Object parentOrTreePath, int index) {}
+ @Override
+ public void remove(Object elementOrTreePath) {}
+ @Override
+ public void refresh() {}
+ @Override
+ public void refresh(Object element) {}
+ @Override
public ISelection getSelection() {
return null;
}
+ @Override
public IPresentationContext getPresentationContext() {
return null;
}
+ @Override
public Object getInput() {
return null;
}
+ @Override
public ViewerLabel getElementLabel(TreePath path, String columnId) {
return null;
}
+ @Override
public Display getDisplay() {
return DebugUIPlugin.getStandardDisplay();
}
+ @Override
public int getAutoExpandLevel() {
return 0;
}
+ @Override
public boolean overrideSelection(ISelection current, ISelection candidate) {
return false;
}
+ @Override
public void insert(Object parentOrTreePath, Object element, int position) {
}
+ @Override
public TreePath getTopElementPath() {
return null;
}
+ @Override
public ViewerFilter[] getFilters() {
return null;
}
+ @Override
public void addFilter(ViewerFilter filter) {}
+ @Override
public void setFilters(ViewerFilter[] filters) {}
+ @Override
public boolean getExpandedState(Object elementOrTreePath) {
return false;
}
+ @Override
public Object getChildElement(TreePath path, int index) {
return null;
}
- public boolean getHasChildren(Object elementOrTreePath) {
+ @Override
+ public boolean getHasChildren(Object elementOrTreePath) {
return false;
}
+ @Override
public int getChildCount(TreePath path) {
return 0;
}
+ @Override
public int findElementIndex(TreePath parentPath, Object element) {
return 0;
}
+ @Override
public void expandToLevel(Object elementOrTreePath, int level) {
}
+ @Override
public void autoExpand(TreePath elementPath) {
}
- public boolean getElementChildrenRealized(TreePath parentPath) {
+ @Override
+ public boolean getElementChildrenRealized(TreePath parentPath) {
return false;
}
- public boolean getElementChecked(TreePath path) {
+ @Override
+ public boolean getElementChecked(TreePath path) {
return false;
}
- public boolean getElementGrayed(TreePath path) {
+ @Override
+ public boolean getElementGrayed(TreePath path) {
return false;
}
- public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
+ @Override
+ public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
}
- public TreePath[] getElementPaths(Object element) {
+ @Override
+ public TreePath[] getElementPaths(Object element) {
return null;
}
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images,
+ @Override
+ public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images,
FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
}
- public String[] getVisibleColumns() {
+ @Override
+ public String[] getVisibleColumns() {
return null;
}
};
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ColumnPresentationTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ColumnPresentationTests.java
index b8f406e75..62f7593e1 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ColumnPresentationTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/ColumnPresentationTests.java
@@ -52,6 +52,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
/**
* @throws java.lang.Exception
*/
+ @Override
protected void setUp() throws Exception {
createViewer();
}
@@ -59,6 +60,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
/**
* @throws java.lang.Exception
*/
+ @Override
protected void tearDown() throws Exception {
destroyViewer();
}
@@ -70,11 +72,13 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
fShell.setLayout(new FillLayout());
fViewer = new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
fViewer.getTree().addControlListener(new ControlListener() {
- public void controlResized(ControlEvent e) {
+ @Override
+ public void controlResized(ControlEvent e) {
fResized = true;
}
- public void controlMoved(ControlEvent e) {
+ @Override
+ public void controlMoved(ControlEvent e) {
}
});
fListener = new TestModelUpdatesListener(fViewer, false, false);
@@ -118,14 +122,17 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
this.columnIds = columnIds;
}
+ @Override
public void init(IPresentationContext context) {
fContext = context;
}
+ @Override
public void dispose() {
fContext = null;
}
+ @Override
public ImageDescriptor getImageDescriptor(String id) {
return null;
}
@@ -134,14 +141,17 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
return fContext;
}
+ @Override
public String[] getAvailableColumns() {
return columnIds;
}
+ @Override
public String[] getInitialColumns() {
return columnIds;
}
+ @Override
public String getHeader(String id) {
if (Arrays.asList(columnIds).indexOf(id) != -1) {
return id;
@@ -149,10 +159,12 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
return null;
}
+ @Override
public String getId() {
return "MyColumnPresentationID"; //$NON-NLS-1$
}
+ @Override
public boolean isOptional() {
return true;
}
@@ -171,6 +183,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
Arrays.fill(repliedWidths, -2);
}
+ @Override
public int getInitialColumnWidth(String id, int treeWidgetWidth,
String[] visibleColumnIds) {
for (int i = 0; i < columnIds.length; i++) {
@@ -194,6 +207,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
return -1;
}
+ @Override
public String getId() {
return "MyColumnPresentation2ID"; //$NON-NLS-1$
}
@@ -206,6 +220,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
colPresenation = cp1;
}
+ @Override
public IColumnPresentation createColumnPresentation(
IPresentationContext context, Object element) {
if (colPresenation != null) {
@@ -214,6 +229,7 @@ public class ColumnPresentationTests extends TestCase implements ITestModelUpdat
return null;
}
+ @Override
public String getColumnPresentationId(IPresentationContext context,
Object element) {
if (colPresenation != null) {
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
index d2dff371a..387879a47 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - clean-up
@@ -25,6 +25,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
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.ITreeModelViewer;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.swt.layout.FillLayout;
@@ -33,18 +34,18 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
/**
- * Tests that verify that the viewer property retrieves all the content
+ * Tests that verify that the viewer property retrieves all the content
* from the model.
- *
+ *
* @since 3.6
*/
abstract public class ContentTests extends TestCase implements ITestModelUpdatesListenerConstants {
-
+
Display fDisplay;
Shell fShell;
ITreeModelViewer fViewer;
TestModelUpdatesListener fListener;
-
+
public ContentTests(String name) {
super(name);
}
@@ -52,28 +53,30 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
fShell.setLayout(new FillLayout());
fViewer = createViewer(fDisplay, fShell);
-
+
fListener = new TestModelUpdatesListener(fViewer, true, true);
fShell.open ();
}
abstract protected IInternalTreeModelViewer createViewer(Display display, Shell shell);
-
+
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
-
+
// Close the shell and exit.
fShell.close();
while (!fShell.isDisposed()) {
@@ -83,50 +86,51 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
public void testSimpleSingleLevel() throws InterruptedException {
// 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);
-
+ 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 ()) {
Thread.sleep(0);
}
}
-
+
model.validateData(fViewer, TreePath.EMPTY);
-
+
assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
}
public void testSimpleMultiLevel() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleMultiLevel();
fViewer.setAutoExpandLevel(-1);
-
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, true);
-
+
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, true);
+
fViewer.setInput(model.getRootElement());
while (!fListener.isFinished()) {
@@ -136,22 +140,23 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 3) );
}
-
+
/**
- * Modified test model that optionally captures (i.e. doesn't compete)
- * udpates after filling in their data.
+ * Modified test model that optionally captures (i.e. doesn't compete)
+ * udpates after filling in their data.
*/
class TestModelWithCapturedUpdates extends TestModel {
-
+
boolean fCaptureLabelUpdates = false;
boolean fCaptureChildrenUpdates = false;
-
- List fCapturedUpdates = Collections.synchronizedList(new ArrayList());
-
- public void update(IChildrenUpdate[] updates) {
+
+ List<IViewerUpdate> fCapturedUpdates = Collections.synchronizedList(new ArrayList<IViewerUpdate>());
+
+ @Override
+ 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();
@@ -167,13 +172,14 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
}
}
}
-
- public void update(ILabelUpdate[] updates) {
+
+ @Override
+ 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)))
+ if (updates[i] instanceof ICheckUpdate &&
+ Boolean.TRUE.equals(updates[i].getPresentationContext().getProperty(ICheckUpdate.PROP_CHECK)))
{
((ICheckUpdate)updates[i]).setChecked(element.getChecked(), element.getGrayed());
}
@@ -182,19 +188,19 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
} else {
updates[i].done();
}
- }
- }
+ }
+ }
}
-
+
/**
- * Test to make sure that label provider cancels stale updates and doesn't
+ * Test to make sure that label provider cancels stale updates and doesn't
* use data from stale updates to populate the viewer.<br>
* See bug 210027
*/
public void testLabelUpdatesCompletedOutOfSequence1() throws InterruptedException {
TestModelWithCapturedUpdates model = new TestModelWithCapturedUpdates();
model.fCaptureLabelUpdates = true;
-
+
model.setRoot(new TestElement(model, "root", new TestElement[] { //$NON-NLS-1$
new TestElement(model, "1", new TestElement[0]), //$NON-NLS-1$
new TestElement(model, "2", new TestElement[0]), //$NON-NLS-1$
@@ -208,28 +214,28 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
- List firstUpdates = model.fCapturedUpdates;
- model.fCapturedUpdates = new ArrayList(2);
-
-// // Change the model and run another update set.
+ List<IViewerUpdate> firstUpdates = model.fCapturedUpdates;
+ model.fCapturedUpdates = new ArrayList<IViewerUpdate>(2);
+
+// // Change the model and run another update set.
model.getElement(model.findElement("1")).setLabelAppendix(" - changed"); //$NON-NLS-1$ //$NON-NLS-2$
model.getElement(model.findElement("2")).setLabelAppendix(" - changed"); //$NON-NLS-1$ //$NON-NLS-2$
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
while (model.fCapturedUpdates.size() < model.getRootElement().fChildren.length) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
// Complete the second set of children updates
for (int i = 0; i < model.fCapturedUpdates.size(); i++) {
((ILabelUpdate)model.fCapturedUpdates.get(i)).done();
}
-
+
// Then complete the first set.
for (int i = 0; i < firstUpdates.size(); i++) {
- ILabelUpdate capturedUpdate = (ILabelUpdate)firstUpdates.get(i);
+ ILabelUpdate capturedUpdate = (ILabelUpdate)firstUpdates.get(i);
assertTrue(capturedUpdate.isCanceled());
capturedUpdate.done();
}
@@ -239,23 +245,23 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
-
+
// Check viewer data
model.validateData(fViewer, TreePath.EMPTY);
}
/**
- * Test to make sure that label provider cancels stale updates and doesn't
+ * Test to make sure that label provider cancels stale updates and doesn't
* use data from stale updates to populate the viewer.<br>
- * This version of the test changes the elements in the view, and not just
- * the elements' labels. In this case, the view should still cancel stale
- * updates.<br>
+ * This version of the test changes the elements in the view, and not just
+ * the elements' labels. In this case, the view should still cancel stale
+ * updates.<br>
* See bug 210027
*/
public void testLabelUpdatesCompletedOutOfSequence2() throws InterruptedException {
TestModelWithCapturedUpdates model = new TestModelWithCapturedUpdates();
model.fCaptureLabelUpdates = true;
-
+
model.setRoot(new TestElement(model, "root", new TestElement[] { //$NON-NLS-1$
new TestElement(model, "1", new TestElement[0]), //$NON-NLS-1$
new TestElement(model, "2", new TestElement[0]), //$NON-NLS-1$
@@ -269,30 +275,30 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
- List firstUpdates = model.fCapturedUpdates;
- model.fCapturedUpdates = new ArrayList(2);
-
- // Change the model and run another update set.
+ List<IViewerUpdate> firstUpdates = model.fCapturedUpdates;
+ model.fCapturedUpdates = new ArrayList<IViewerUpdate>(2);
+
+ // Change the model and run another update set.
model.setElementChildren(TreePath.EMPTY, new TestElement[] {
new TestElement(model, "1-new", new TestElement[0]), //$NON-NLS-1$
new TestElement(model, "2-new", new TestElement[0]), //$NON-NLS-1$
});
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
while (model.fCapturedUpdates.size() < model.getRootElement().fChildren.length) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
// Complete the second set of children updates
for (int i = 0; i < model.fCapturedUpdates.size(); i++) {
((ILabelUpdate)model.fCapturedUpdates.get(i)).done();
}
-
+
// Then complete the first set.
for (int i = 0; i < firstUpdates.size(); i++) {
- ILabelUpdate capturedUpdate = (ILabelUpdate)firstUpdates.get(i);
+ ILabelUpdate capturedUpdate = (ILabelUpdate)firstUpdates.get(i);
assertTrue(capturedUpdate.isCanceled());
capturedUpdate.done();
}
@@ -302,24 +308,24 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
-
+
// Check viewer data
model.validateData(fViewer, TreePath.EMPTY);
}
/**
- * Test to make sure that content provider cancels stale updates and doesn't
+ * Test to make sure that content provider cancels stale updates and doesn't
* use data from stale updates to populate the viewer.<br>
- * Note: this test is disabled because currently the viewer will not issue
+ * Note: this test is disabled because currently the viewer will not issue
* a new update for an until the previous update is completed. This is even
- * if the previous update is canceled. If this behavior is changed at some
+ * if the previous update is canceled. If this behavior is changed at some
* point, then this test should be re-enabled.<br>
* See bug 210027
*/
public void _x_testChildrenUpdatesCompletedOutOfSequence() throws InterruptedException {
TestModelWithCapturedUpdates model = new TestModelWithCapturedUpdates();
model.fCaptureChildrenUpdates = true;
-
+
model.setRoot(new TestElement(model, "root", new TestElement[] { //$NON-NLS-1$
new TestElement(model, "1", new TestElement[0]), //$NON-NLS-1$
new TestElement(model, "2", new TestElement[0]), //$NON-NLS-1$
@@ -333,27 +339,27 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
- IChildrenUpdate[] firstUpdates = (IChildrenUpdate[])model.fCapturedUpdates.toArray(new IChildrenUpdate[0]);
+ IChildrenUpdate[] firstUpdates = model.fCapturedUpdates.toArray(new IChildrenUpdate[0]);
model.fCapturedUpdates.clear();
-
- // Change the model and run another update set.
+
+ // Change the model and run another update set.
model.setElementChildren(TreePath.EMPTY, new TestElement[] {
new TestElement(model, "1-new", new TestElement[0]), //$NON-NLS-1$
new TestElement(model, "2-new", new TestElement[0]), //$NON-NLS-1$
});
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
while (!areCapturedChildrenUpdatesComplete(model.fCapturedUpdates, model.getRootElement().fChildren.length)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
// Complete the second set of children updates
for (int i = 0; i < model.fCapturedUpdates.size(); i++) {
((IChildrenUpdate)model.fCapturedUpdates.get(i)).done();
}
-
+
// Then complete the first set.
for (int i = 0; i < firstUpdates.length; i++) {
firstUpdates[i].done();
@@ -364,17 +370,17 @@ abstract public class ContentTests extends TestCase implements ITestModelUpdates
Thread.sleep(0);
}
}
-
+
// Check viewer data
model.validateData(fViewer, TreePath.EMPTY);
}
-
- private boolean areCapturedChildrenUpdatesComplete(List capturedUpdates, int childCount) {
- List expectedChildren = new ArrayList();
+
+ private boolean areCapturedChildrenUpdatesComplete(List<IViewerUpdate> capturedUpdates, int childCount) {
+ List<Integer> expectedChildren = new ArrayList<Integer>();
for (int i = 0; i < childCount; i++) {
expectedChildren.add(new Integer(i));
}
- IChildrenUpdate[] updates = (IChildrenUpdate[])capturedUpdates.toArray(new IChildrenUpdate[0]);
+ IChildrenUpdate[] updates = capturedUpdates.toArray(new IChildrenUpdate[0]);
for (int i = 0; i < updates.length; i++) {
for (int j = 0; j < updates[i].getLength(); j++) {
expectedChildren.remove( new Integer(updates[i].getOffset() + j) );
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
index 93fac0a2c..d183c0ff5 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - clean-up
@@ -31,15 +31,15 @@ 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.
+ * 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);
}
@@ -47,29 +47,31 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
-
+
fShell.setLayout(new FillLayout());
fViewer = createViewer(fDisplay, fShell);
-
+
fListener = new TestModelUpdatesListener(fViewer, false, false);
fShell.open ();
}
abstract protected IInternalTreeModelViewer createViewer(Display display, Shell shell);
-
+
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
-
+
// Close the shell and exit.
fShell.close();
while (!fShell.isDisposed()) {
@@ -79,22 +81,23 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
public void testUpdateLabel() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -104,13 +107,13 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
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"); //$NON-NLS-1$
-
- fListener.reset(elementPath, element, -1, true, false);
+
+ fListener.reset(elementPath, element, -1, true, false);
model.postDelta(delta);
while (!fListener.isFinished(LABEL_COMPLETE | MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -122,12 +125,12 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
public void testRefreshStruct() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -137,7 +140,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
TestElement element = model.getRootElement().getChildren()[0];
TreePath elementPath = new TreePath(new Object[] { element });
@@ -147,8 +150,8 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
new TestElement(model, "1.3 - new", new TestElement[0]), //$NON-NLS-1$
};
ModelDelta delta = model.setElementChildren(elementPath, newChildren);
-
- fListener.reset(elementPath, element, -1, true, false);
+
+ fListener.reset(elementPath, element, -1, true, false);
model.postDelta(delta);
while (!fListener.isFinished()) {
if (!fDisplay.readAndDispatch ()) {
@@ -160,12 +163,12 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
public void testRefreshStruct2() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleMultiLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -202,10 +205,10 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}),
})
});
-
+
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 ()) {
@@ -217,20 +220,20 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
public void testRefreshCoalesceStruct() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
// Create a single level model and add a single child to each element.
TestModel model = TestModel.simpleSingleLevel();
- TestElement[] rootChildren = model.getRootElement().getChildren();
+ TestElement[] rootChildren = model.getRootElement().getChildren();
for (int i = 0; i < rootChildren.length; i++) {
model.setElementChildren(
- new TreePath(new Object[] { rootChildren[i]} ),
+ new TreePath(new Object[] { rootChildren[i]} ),
new TestElement[] { new TestElement(model, i + ".1", new TestElement[0]) }); //$NON-NLS-1$
}
-
+
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -240,7 +243,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) {
@@ -248,36 +251,36 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
-
+
model.validateData(fViewer, TreePath.EMPTY);
assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 6) );
}
-
-
+
+
public void testInsert() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ 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 ()) {
Thread.sleep(0);
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
TestElement element = new TestElement(model, "7", new TestElement[0]); //$NON-NLS-1$
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
@@ -295,14 +298,14 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
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() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
@@ -311,15 +314,15 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
-
+
while (!fListener.isFinished()) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
- model.validateData(fViewer, TreePath.EMPTY);
-
+
+ model.validateData(fViewer, TreePath.EMPTY);
+
// Update the model
// Insert two new elements at once
TestElement element0 = new TestElement(model, "00", new TestElement[] {}); //$NON-NLS-1$
@@ -328,7 +331,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
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);
@@ -338,7 +341,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
fListener.addHasChildrenUpdate(elementPath1);
fListener.addLabelUpdate(elementPath0);
fListener.addLabelUpdate(elementPath1);
-
+
// TODO: list full set of expected updates.
fListener.setFailOnRedundantUpdates(false);
@@ -348,34 +351,34 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
-
+
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.
+ * remove deltas are processed first then insert deltas.
*/
public void testInsertAndRemove() throws InterruptedException {
//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 ()) {
Thread.sleep(0);
}
}
-
- model.validateData(fViewer, TreePath.EMPTY);
-
+
+ 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[] {}); //$NON-NLS-1$
TreePath elementPath = new TreePath(new Object[] { element });
@@ -385,12 +388,12 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
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);
@@ -400,19 +403,19 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
-
+
model.validateData(fViewer, TreePath.EMPTY);
}
-
+
public void testAddElement() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -422,14 +425,14 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
TestElement element = new TestElement(model, "7", new TestElement[0]); //$NON-NLS-1$
TreePath elementPath = new TreePath(new Object[] { element });
ModelDelta delta = model.addElementChild(TreePath.EMPTY, null, 6, element);
-
+
// Add causes the update of parent child count and element's children.
- fListener.reset(elementPath, element, -1, true, false);
+ fListener.reset(elementPath, element, -1, true, false);
fListener.addChildreUpdate(TreePath.EMPTY, 6);
// TODO: redundant updates on add!
fListener.setFailOnRedundantUpdates(false);
@@ -442,17 +445,17 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY);
}
- // This test currently fails. When (if) bug 311442 gets address we should re-enable it.
+ // This test currently fails. When (if) bug 311442 gets address we should re-enable it.
public void _x_testAddUnexpandedElement() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleMultiLevel();
// Turn off auto-expansion
fViewer.setAutoExpandLevel(0);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -468,7 +471,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.addElementChild(parentPath, rootDelta, 1, new TestElement(model, "1.2", new TestElement[0])); //$NON-NLS-1$
model.addElementChild(parentPath, rootDelta, 2, new TestElement(model, "1.3", new TestElement[0])); //$NON-NLS-1$
model.addElementChild(parentPath, rootDelta, 3, new TestElement(model, "1.4", new TestElement[0])); //$NON-NLS-1$
-
+
// Add causes the update of parent child count and element's children.
fListener.reset();
fListener.setFailOnRedundantUpdates(false);
@@ -487,14 +490,14 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.getElementDelta(rootDelta, model.findElement("1.2"), true).setFlags(IModelDelta.CONTENT); //$NON-NLS-1$
model.getElementDelta(rootDelta, model.findElement("1.3"), true).setFlags(IModelDelta.CONTENT); //$NON-NLS-1$
model.getElementDelta(rootDelta, model.findElement("1.4"), true).setFlags(IModelDelta.CONTENT); //$NON-NLS-1$
-
+
model.postDelta(rootDelta);
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
fListener.reset(parentPath, model.getElement(parentPath), 1, false, true);
((IInternalTreeModelViewer)fViewer).expandToLevel(parentPath, 1);
@@ -509,14 +512,14 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
public void _x_testRefreshUnexpandedElementsChildren() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleMultiLevel();
// Turn off auto-expansion
fViewer.setAutoExpandLevel(0);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -539,7 +542,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Collapse back element "2"
((IInternalTreeModelViewer)fViewer).setExpandedState(parentPath, false);
-
+
// Update the children of element "2".
fListener.reset();
fListener.addUpdates((IInternalTreeModelViewer)fViewer, TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE);
@@ -547,7 +550,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.getElementDelta(rootDelta, model.findElement("2.1"), true).setFlags(IModelDelta.CONTENT); //$NON-NLS-1$
model.getElementDelta(rootDelta, model.findElement("2.2"), true).setFlags(IModelDelta.CONTENT); //$NON-NLS-1$
model.getElementDelta(rootDelta, model.findElement("2.3"), true).setFlags(IModelDelta.CONTENT); //$NON-NLS-1$
-
+
model.postDelta(rootDelta);
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -568,15 +571,15 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, parentPath, true);
}
-
+
public void testRemove() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -586,13 +589,13 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
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();
+ fListener.reset();
model.postDelta(delta);
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -601,10 +604,10 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
model.validateData(fViewer, TreePath.EMPTY);
}
-
+
public void testExpandAndSelect() throws InterruptedException {
TestModel model = TestModel.simpleMultiLevel();
-
+
// Create the listener
fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
@@ -619,8 +622,8 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// 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:
+ // 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();
@@ -637,7 +640,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
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);
+ //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);
@@ -651,7 +654,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
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);
+ // 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);
@@ -660,12 +663,12 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
fListener.addHasChildrenUpdate(path_root_3_2_2);
// Validate the expansion state BEFORE posting the delta.
-
- IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
+
+ IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
assertFalse(contentProviderViewer.getExpandedState(path_root_3));
assertFalse(contentProviderViewer.getExpandedState(path_root_3_2));
assertFalse(contentProviderViewer.getExpandedState(path_root_3_2_2));
-
+
model.postDelta(deltaRoot);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -678,11 +681,11 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
assertTrue(contentProviderViewer.getExpandedState(path_root_3));
assertTrue(contentProviderViewer.getExpandedState(path_root_3_2));
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() );
+ List<TreePath> selectionPathsList = Arrays.asList(((ITreeSelection) selection).getPaths());
assertTrue(selectionPathsList.contains(path_root_3_2_2));
} else {
fail("Not a tree selection"); //$NON-NLS-1$
@@ -694,7 +697,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
*/
public void testExpandAndSelect_simple() throws InterruptedException {
TestModel model = TestModel.simpleMultiLevel();
-
+
// Create the listener
fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
@@ -709,8 +712,8 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// 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:
+ // 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();
@@ -722,10 +725,10 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
delta.addNode(element, 2, IModelDelta.SELECT | IModelDelta.EXPAND, element.fChildren.length);
// Validate the expansion state BEFORE posting the delta.
-
- IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
+
+ IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
assertFalse(contentProviderViewer.getExpandedState(path_root_3));
-
+
model.postDelta(deltaRoot);
while (true) {
if (fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
@@ -741,11 +744,11 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Validate the expansion state AFTER posting the delta.
assertTrue(contentProviderViewer.getExpandedState(path_root_3));
-
+
// Verify selection
ISelection selection = fViewer.getSelection();
if (selection instanceof ITreeSelection) {
- List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() );
+ List<TreePath> selectionPathsList = Arrays.asList(((ITreeSelection) selection).getPaths());
assertTrue(selectionPathsList.contains(path_root_3));
} else {
fail("Not a tree selection"); //$NON-NLS-1$
@@ -754,12 +757,12 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
public void testCompositeModelRefreshStruct() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.compositeMultiLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- // TODO: redundant updates on install deltas
+ // 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.
@@ -782,8 +785,8 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
};
ModelDelta delta = m4.setElementChildren(m4_2_1Path, newChildren);
-
- fListener.reset(m4_2_1Path, m4_2_1, -1, true, false);
+
+ fListener.reset(m4_2_1Path, m4_2_1, -1, true, false);
model.postDelta(delta);
while (!fListener.isFinished()) {
if (!fDisplay.readAndDispatch ()) {
@@ -798,7 +801,7 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
fViewer.setAutoExpandLevel(-1);
// Create the listener
- // TODO: redundant updates on install deltas
+ // 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.
@@ -809,32 +812,32 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
model.validateData(fViewer, TreePath.EMPTY, true);
-
+
TreePath m3_1Path = model.findElement("m3.1"); //$NON-NLS-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]); //$NON-NLS-1$
TreePath m3_1_newPath = m3_1Path.createChildPath(m3_1_new);
ModelDelta delta = m3.addElementChild(m3_1Path, null, 0, m3_1_new);
-
- fListener.reset(m3_1_newPath, m3_1_new, -1, true, false);
+
+ 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 ()) {
Thread.sleep(0);
}
}
-
+
model.validateData(fViewer, TreePath.EMPTY);
}
-
+
public void testBug292322() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
TestModel model = TestModel.simpleMultiLevel();
- fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -844,13 +847,13 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
}
}
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"); //$NON-NLS-1$
TestElement parentElement = model.getElement(parentPath);
ModelDelta delta = model.removeElementChild(parentPath, 0);
-
+
// Update the viewer
fListener.reset(parentPath, parentElement, 0, false, false);
//fListener.addChildreCountUpdate(parentPath);
@@ -864,10 +867,10 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Validate the viewer data.
model.validateData(fViewer, TreePath.EMPTY, true);
- // Update the model: remove the remaining children and make sure that
+ // 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);
@@ -880,10 +883,10 @@ abstract public class DeltaTests extends TestCase implements ITestModelUpdatesLi
// Validate the viewer data.
model.validateData(fViewer, TreePath.EMPTY, true);
- // Update the model: remove the remaining children and make sure that
+ // 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);
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java
index 52308e2d1..9cd850cd2 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/FilterTests.java
@@ -52,7 +52,8 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -70,7 +71,8 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
@@ -83,7 +85,8 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
@@ -104,7 +107,8 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
}
- public boolean select(Viewer viewer, Object parentElement, Object element) {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof TestElement) {
TestElement te = (TestElement)element;
return !fPattern.matcher(te.getLabel()).find();
@@ -122,7 +126,8 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
fParentElement = parentElement;
}
- public boolean isApplicable(ITreeModelViewer viewer, Object parentElement) {
+ @Override
+ public boolean isApplicable(ITreeModelViewer viewer, Object parentElement) {
if (fParentElement != null) {
return fParentElement.equals(parentElement);
}
@@ -130,7 +135,8 @@ abstract public class FilterTests extends TestCase implements ITestModelUpdatesL
return true;
}
- public boolean select(Viewer viewer, Object parentElement, Object element) {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof TestElement) {
TestElement te = (TestElement)element;
return !fPattern.matcher(te.getLabel()).find();
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
index afe51e13c..07f1151c3 100644
--- 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
@@ -45,6 +45,7 @@ public class FilterTransformTests extends TestCase {
* and elements 0, 2, 3, 6, 7 are filtered. Elements
* 1, 4, 5 are visible.
*/
+ @Override
protected void setUp() throws Exception {
super.setUp();
transform = new FilterTransform();
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
index b2f3db69a..79472fb34 100644
--- 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
@@ -27,7 +27,8 @@ public class JFaceViewerCheckTests extends CheckTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL | SWT.CHECK, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index 68e860470..fcd8dfe66 100644
--- 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
@@ -27,7 +27,8 @@ public class JFaceViewerContentTests extends ContentTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index 8853315a0..d606f6097 100644
--- 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
@@ -27,13 +27,15 @@ public class JFaceViewerDeltaTests extends DeltaTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
/**
* TODO: remove this method when bug 292322 gets fixed in TreeViewer
*/
- public void testBug292322() {
+ @Override
+ public void testBug292322() {
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerFilterTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerFilterTests.java
index 654d97b9f..ac9a7c598 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerFilterTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerFilterTests.java
@@ -27,7 +27,8 @@ public class JFaceViewerFilterTests extends FilterTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL | SWT.MULTI, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerLazyTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerLazyTests.java
index b511a32d3..9347e274e 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerLazyTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerLazyTests.java
@@ -26,7 +26,8 @@ public class JFaceViewerLazyTests extends LazyTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index e046751c9..180f88398 100644
--- 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
@@ -26,11 +26,13 @@ public class JFaceViewerPerformanceTests extends PerformanceTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
- protected int getTestModelDepth() {
+ @Override
+ 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
index 8c4b923a6..df2732a0c 100644
--- 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
@@ -27,7 +27,8 @@ public class JFaceViewerPopupTests extends PopupTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell, int style) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell, int style) {
return new TreeModelViewer(fShell, SWT.VIRTUAL | style, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index 94009bb2c..dd63dcc6a 100644
--- 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
@@ -27,7 +27,8 @@ public class JFaceViewerSelectionTests extends SelectionTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index a20055571..c07316b9e 100644
--- 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
@@ -27,7 +27,8 @@ public class JFaceViewerStateTests extends StateTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL | SWT.MULTI, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
index b51a4247b..6e7911115 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/JFaceViewerTopIndexTests.java
@@ -47,7 +47,8 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setSize(300, 80);
@@ -63,7 +64,8 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
@@ -76,7 +78,8 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
@@ -514,7 +517,8 @@ public class JFaceViewerTopIndexTests extends TestCase implements ITestModelUpda
ModelDelta revealDelta = model.makeElementDelta(pathToBeRevealed, IModelDelta.REVEAL);
revealDelta.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
((ModelDelta)delta).setFlags(delta.getFlags() | IModelDelta.EXPAND);
return true;
}
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
index 4ebd01ad7..518eeadd7 100644
--- 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
@@ -27,7 +27,8 @@ public class JFaceViewerUpdateTests extends UpdateTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell) {
return new TreeModelViewer(fShell, SWT.VIRTUAL, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java
index 7dacab8ef..920345ebd 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/LazyTests.java
@@ -46,7 +46,8 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -63,7 +64,8 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
@@ -76,7 +78,8 @@ abstract public class LazyTests extends TestCase implements ITestModelUpdatesLis
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
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
index 0caaf4593..6c1b0416c 100644
--- 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
@@ -46,7 +46,8 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
@@ -65,7 +66,8 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
@@ -78,7 +80,8 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
@@ -375,7 +378,8 @@ abstract public class PerformanceTests extends TestCase implements ITestModelUpd
fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
fViewer.addFilter(new ViewerFilter() {
- public boolean select(Viewer viewer, Object parentElement, Object element) {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof TestElement) {
String id = ((TestElement)element).getID();
if (id.startsWith("model.")) { //$NON-NLS-1$
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
index d99c149ae..37487c566 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - clean-up
@@ -35,8 +35,8 @@ import org.eclipse.ui.PlatformUI;
/**
* Tests to verify that the viewer property updates when created
- * with the SWT.POPUP style.
- *
+ * with the SWT.POPUP style.
+ *
* @since 3.6
*/
abstract public class PopupTests extends TestCase implements ITestModelUpdatesListenerConstants {
@@ -44,7 +44,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
Shell fShell;
ITreeModelViewer fViewer;
TestModelUpdatesListener fListener;
-
+
public PopupTests(String name) {
super(name);
}
@@ -52,14 +52,15 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
fShell.setMaximized(true);
fShell.setLayout(new FillLayout());
fViewer = createViewer(fDisplay, fShell, SWT.POP_UP);
-
+
fListener = new TestModelUpdatesListener(fViewer, false, false);
fShell.open ();
@@ -68,17 +69,18 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
protected IInternalTreeModelViewer getCTargetViewer() {
return (IInternalTreeModelViewer)fViewer;
}
-
+
abstract protected ITreeModelViewer createViewer(Display display, Shell shell, int style);
-
+
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
-
+
// Close the shell and exit.
fShell.close();
while (!fShell.isDisposed()) {
@@ -89,16 +91,16 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
}
/**
- * This test verifies that content updates are still being performed.
+ * This test verifies that content updates are still being performed.
*/
public void testRefreshStruct() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -108,7 +110,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
TestElement element = model.getRootElement().getChildren()[0];
TreePath elementPath = new TreePath(new Object[] { element });
@@ -118,8 +120,8 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
new TestElement(model, "1.3 - new", new TestElement[0]), //$NON-NLS-1$
};
ModelDelta delta = model.setElementChildren(elementPath, newChildren);
-
- fListener.reset(elementPath, element, -1, true, false);
+
+ fListener.reset(elementPath, element, -1, true, false);
model.postDelta(delta);
while (!fListener.isFinished()) {
if (!fDisplay.readAndDispatch ()) {
@@ -134,7 +136,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
*/
public void testExpandAndSelect() throws InterruptedException {
TestModel model = TestModel.simpleMultiLevel();
-
+
// Create the listener
fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
@@ -149,8 +151,8 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
// 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:
+ // 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();
@@ -162,10 +164,10 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
delta.addNode(element, 2, IModelDelta.SELECT | IModelDelta.EXPAND, element.fChildren.length);
// Validate the expansion state BEFORE posting the delta.
-
- IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
+
+ IInternalTreeModelViewer contentProviderViewer = (IInternalTreeModelViewer)fViewer;
assertFalse(contentProviderViewer.getExpandedState(path_root_3));
-
+
model.postDelta(deltaRoot);
while (true) {
if (fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
@@ -185,28 +187,28 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
// Validate the expansion state AFTER posting the delta.
assertFalse(contentProviderViewer.getExpandedState(path_root_3));
-
+
// Verify selection
ISelection selection = fViewer.getSelection();
if (selection instanceof ITreeSelection) {
- List selectionPathsList = Arrays.asList( ((ITreeSelection)selection).getPaths() );
+ List<TreePath> selectionPathsList = Arrays.asList(((ITreeSelection) selection).getPaths());
assertFalse(selectionPathsList.contains(path_root_3));
} else {
fail("Not a tree selection"); //$NON-NLS-1$
}
}
-
-
+
+
public void testPreserveExpandedOnSubTreeContent() throws InterruptedException {
//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);
+
+ // 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());
@@ -219,14 +221,14 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
// Turn off auto-expansion
fViewer.setAutoExpandLevel(0);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("3.3.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
// Update the model
model.addElementChild(model.findElement("3"), null, 0, new TestElement(model, "3.0 - new", new TestElement[0])); //$NON-NLS-1$ //$NON-NLS-2$
-
+
// Create the delta for element "3" with content update.
TreePath elementPath = model.findElement("3"); //$NON-NLS-1$
ModelDelta rootDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -236,7 +238,7 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
// 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)) {
@@ -257,14 +259,14 @@ abstract public class PopupTests extends TestCase implements ITestModelUpdatesLi
}
private boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) {
- Set sel1Set = new HashSet();
+ Set<TreePath> sel1Set = new HashSet<TreePath>();
sel1Set.addAll( Arrays.asList(sel1.getPaths()) );
-
- Set sel2Set = new HashSet();
+
+ Set<TreePath> sel2Set = new HashSet<TreePath>();
sel2Set.addAll( Arrays.asList(sel2.getPaths()) );
-
+
return sel1Set.equals(sel2Set);
}
-
+
}
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
index 8f51de89c..625edb48a 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -31,7 +31,7 @@ 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 {
@@ -39,7 +39,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
Shell fShell;
ITreeModelViewer fViewer;
TestModelUpdatesListener fListener;
-
+
public SelectionTests(String name) {
super(name);
}
@@ -47,28 +47,30 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
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 {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
-
+
// Close the shell and exit.
fShell.close();
while (!fShell.isDisposed()) {
@@ -79,9 +81,10 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
}
private static class SelectionListener implements ISelectionChangedListener {
- private final List fEvents = new ArrayList(1);
-
- public void selectionChanged(SelectionChangedEvent event) {
+ private final List<SelectionChangedEvent> fEvents = new ArrayList<SelectionChangedEvent>(1);
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
fEvents.add(event);
}
}
@@ -89,7 +92,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
private TestModel makeMultiLevelModel() throws InterruptedException {
TestModel model = TestModel.simpleMultiLevel();
fViewer.setAutoExpandLevel(-1);
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
fViewer.setInput(model.getRootElement());
while (!fListener.isFinished()) {
if (!fDisplay.readAndDispatch ()) {
@@ -99,17 +102,17 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
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
+ * - verify that the selection is in the viewer is correct
*/
public void testSimpleSetSelection() throws InterruptedException {
// 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);
@@ -120,7 +123,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
assertTrue(listener.fEvents.size() == 1);
// Check that the new selection is what was requested.
- ISelection viewerSelection = fViewer.getSelection();
+ ISelection viewerSelection = fViewer.getSelection();
assertEquals(selection, viewerSelection);
}
@@ -132,27 +135,31 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
public void testSelectionPolicy() throws InterruptedException {
// 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")); //$NON-NLS-1$
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) {
+
+ @Override
+ public ISelection replaceInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
return null;
}
-
- public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context) {
+
+ @Override
+ public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context) {
return false;
}
-
- public boolean isSticky(ISelection selection, IPresentationContext context) {
+
+ @Override
+ public boolean isSticky(ISelection selection, IPresentationContext context) {
return true;
}
-
- public boolean contains(ISelection selection, IPresentationContext context) {
+
+ @Override
+ public boolean contains(ISelection selection, IPresentationContext context) {
return true;
}
});
@@ -165,8 +172,8 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
// 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
+
+ // 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"); //$NON-NLS-1$
ModelDelta baseDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -192,11 +199,11 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
assertEquals(selection_3_3_3, fViewer.getSelection());
}
-
+
/**
* In this test:
- * - set a seleciton to an element
- * - then remove that element
+ * - set a seleciton to an element
+ * - then remove that element
* - update the view with remove delta
* -> The selection should be re-set to empty.
*/
@@ -205,7 +212,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
// 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"); //$NON-NLS-1$
TreeSelection selection = new TreeSelection(elementPath);
@@ -225,7 +232,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
// Reset the listener and update the viewer. With a remove
// delta only wait for the delta to be processed.
- fListener.reset();
+ fListener.reset();
model.postDelta(delta);
while (!fListener.isFinished(ITestModelUpdatesListenerConstants.MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -237,15 +244,15 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
//assertTrue(listener.fEvents.size() == 1);
// Check that the new selection is empty
- ISelection viewerSelection = fViewer.getSelection();
+ ISelection viewerSelection = fViewer.getSelection();
assertTrue(viewerSelection.isEmpty());
}
-
+
/**
* In this test:
- * - set a selection to an element
- * - then remove that element
+ * - set a selection to an element
+ * - then remove that element
* - then refresh the view.
* -> The selection should be re-set to empty.
*/
@@ -254,7 +261,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
// 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"); //$NON-NLS-1$
TreeSelection selection = new TreeSelection(elementPath);
@@ -273,8 +280,8 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
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);
+ // 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) );
@@ -289,7 +296,7 @@ abstract public class SelectionTests extends TestCase implements ITestModelUpdat
//assertTrue(listener.fEvents.size() == 1);
// Check that the new selection is empty
- ISelection viewerSelection = fViewer.getSelection();
+ 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
index ee5206699..fffc38b7f 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - clean-up
@@ -32,9 +32,9 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
/**
- * Tests to verify that the viewer can save and restore correctly the expansion
+ * 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 {
@@ -42,7 +42,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
Shell fShell;
ITreeModelViewer fViewer;
TestModelUpdatesListener fListener;
-
+
public StateTests(String name) {
super(name);
}
@@ -50,7 +50,8 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
@@ -58,21 +59,22 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
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, InterruptedException {
+ @Override
+ protected void tearDown() throws Exception, InterruptedException {
fListener.dispose();
fViewer.getPresentationContext().dispose();
-
+
// Close the shell and exit.
fShell.close();
while (!fShell.isDisposed()) {
@@ -82,23 +84,24 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
protected IInternalTreeModelViewer getInternalViewer() {
return (IInternalTreeModelViewer)fViewer;
}
-
+
public void testUpdateViewer() throws InterruptedException {
//TreeModelViewerAutopopulateAgent autopopulateAgent = new TreeModelViewerAutopopulateAgent(fViewer);
-
+
TestModel model = TestModel.simpleMultiLevel();
-
+
// Create the listener
fListener.reset();
fListener.addChildreUpdate(TreePath.EMPTY, 0);
@@ -114,7 +117,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
}
model.validateData(fViewer, TreePath.EMPTY, true);
- // Create the update delta
+ // Create the update delta
TestElement element = model.getRootElement();
TreePath path0 = TreePath.EMPTY;
ModelDelta delta = new ModelDelta(model.getRootElement(), -1, IModelDelta.EXPAND, element.getChildren().length);
@@ -128,7 +131,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
element = element.getChildren()[1];
TreePath path3 = path2.createChildPath(element);
delta = delta.addNode(element, 1, IModelDelta.SELECT);
-
+
fListener.reset(false, false);
fListener.addChildreUpdate(path0, 2);
@@ -144,7 +147,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
fListener.addChildreUpdate(path2, 1);
fListener.addHasChildrenUpdate(path3);
fListener.addLabelUpdate(path3);
-
+
fViewer.updateViewer(updateDelta);
while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE | LABEL_UPDATES)) {
if (!fDisplay.readAndDispatch ()) {
@@ -155,7 +158,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
// 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) ) {
fail("Expected:\n" + updateDelta.toString() + "\nGot:\n" + savedDelta); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -166,9 +169,9 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
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)
+ ((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];
@@ -184,7 +187,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
/**
* Creates a model in the pattern of:
- *
+ *
* root
* 1
* 1.1
@@ -202,36 +205,36 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
*/
static 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[] {
+ elements[i] =
+ new TestElement(model, text, new TestElement[] {
new TestElement(model, text + ".1", new TestElement[] { //$NON-NLS-1$
new TestElement(model, text + ".1.1", new TestElement[0]) //$NON-NLS-1$
})
- });
+ });
}
model.setRoot(new TestElement(model, "root", elements)); //$NON-NLS-1$
-
+
return model;
}
static boolean areTreeSelectionsEqual(ITreeSelection sel1, ITreeSelection sel2) {
- Set sel1Set = new HashSet();
+ Set<TreePath> sel1Set = new HashSet<TreePath>();
sel1Set.addAll( Arrays.asList(sel1.getPaths()) );
-
- Set sel2Set = new HashSet();
+
+ Set<TreePath> sel2Set = new HashSet<TreePath>();
sel2Set.addAll( Arrays.asList(sel2.getPaths()) );
-
+
return sel1Set.equals(sel2Set);
}
-
+
static void expandAlternateElements(TestModelUpdatesListener listener, TestModel model, boolean waitForAllUpdates) throws InterruptedException {
- listener.reset();
+ listener.reset();
listener.setFailOnRedundantUpdates(false);
-
+
TestElement rootElement = model.getRootElement();
TestElement[] children = rootElement.getChildren();
ModelDelta rootDelta = new ModelDelta(rootElement, IModelDelta.NO_CHANGE);
@@ -241,7 +244,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
if (i % 2 == 1) {
continue;
}
-
+
// Expand the element and the first child of each sub-element
TestElement element = children[i];
ModelDelta delta = expandDelta;
@@ -249,7 +252,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
while (element.getChildren().length != 0) {
TreePath elementPath = model.findElement(element.getLabel());
listener.addUpdates(
- elementPath, element, 1,
+ elementPath, element, 1,
CHILD_COUNT_UPDATES | (waitForAllUpdates ? CHILDREN_UPDATES : 0) );
delta = delta.addNode(element, index, IModelDelta.EXPAND, element.getChildren().length);
element = element.getChildren()[0];
@@ -264,15 +267,15 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
}
}
}
-
+
public void testPreserveExpandedOnRemove() throws InterruptedException {
//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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -284,23 +287,23 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY, true);
expandAlternateElements(fListener, model, true);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
// Update the model
ModelDelta delta = model.removeElementChild(TreePath.EMPTY, 0);
-
+
// Remove delta should not generate any new updates
- fListener.reset();
+ fListener.reset();
model.postDelta(delta);
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
assertTrue(getInternalViewer().getExpandedState(model.findElement("2")) == false); //$NON-NLS-1$
@@ -318,9 +321,9 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -332,18 +335,18 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY, true);
expandAlternateElements(fListener, model, true);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
-
+
// Update the model
ModelDelta delta = model.insertElementChild(TreePath.EMPTY, 0, new TestElement(model, "0 - new", new TestElement[0])); //$NON-NLS-1$
-
+
// Insert delta should generate updates only for the new element
TreePath path = model.findElement("0 - new"); //$NON-NLS-1$
// Note: redundant label updates on insert.
- fListener.reset(path, (TestElement)path.getLastSegment(), 0, false, false);
+ 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)) {
@@ -351,7 +354,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
Thread.sleep(0);
}
}
-
+
// Validate data
model.validateData(fViewer, TreePath.EMPTY, true);
assertTrue(getInternalViewer().getExpandedState(model.findElement("1")) == true); //$NON-NLS-1$
@@ -371,9 +374,9 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -385,7 +388,7 @@ abstract public class StateTests extends TestCase implements ITestModelUpdatesLi
model.validateData(fViewer, TreePath.EMPTY, true);
expandAlternateElements(fListener, model, true);
-
+
// Set a selection in view
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(
@@ -395,16 +398,16 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Update the model
model.removeElementChild(TreePath.EMPTY, 0);
-
+
// Note: Re-expanding nodes causes redundant updates.
fListener.reset(false, false);
fListener.addUpdates(getInternalViewer(), TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE);
-
- // Create the delta which has nodes with CONTENT flag set at multiple levels.
+
+ // 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); //$NON-NLS-1$
elementDelta.setFlags(IModelDelta.CONTENT);
-
+
// Post the multi-content update delta
model.postDelta(rootDelta);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE | STATE_RESTORE_COMPLETE)) {
@@ -423,8 +426,8 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true); //$NON-NLS-1$
assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$
assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
-
- // Note: in past it was observed sub-optimal coalescing in this test due
+
+ // Note: in past it was observed sub-optimal coalescing in this test due
// to scattered update requests from viewer.
assertTrue( fListener.checkCoalesced(TreePath.EMPTY, 0, 5) );
}
@@ -436,9 +439,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Expand all
fViewer.setAutoExpandLevel(-1);
-
- // Create the listener,
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+
+ // 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());
@@ -451,14 +454,14 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Turn off auto-expansion
fViewer.setAutoExpandLevel(0);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("3.3.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
// Update the model
model.addElementChild(model.findElement("3"), null, 0, new TestElement(model, "3.0 - new", new TestElement[0])); //$NON-NLS-1$ //$NON-NLS-2$
-
+
// Create the delta for element "3" with content update.
TreePath elementPath = model.findElement("3"); //$NON-NLS-1$
ModelDelta rootDelta = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
@@ -468,7 +471,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Note: Re-expanding nodes causes redundant updates.
fListener.reset(false, false);
fListener.addUpdates(getInternalViewer(), 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)) {
@@ -493,9 +496,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -507,7 +510,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
model.validateData(fViewer, TreePath.EMPTY, true);
expandAlternateElements(fListener, model, true);
-
+
// Set a selection in view
// TreeSelection originalSelection = new TreeSelection(
// new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findElement("6") });
@@ -515,15 +518,15 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
fViewer.setSelection(originalSelection);
assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
- // Run this test ten times as we've seen intermittent failures related
+ // 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(getInternalViewer(), TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE);
+ fListener.addUpdates(getInternalViewer(), 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 ()) {
@@ -541,13 +544,13 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true); //$NON-NLS-1$
assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$
assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
-
+
// Update the model again
model.addElementChild(TreePath.EMPTY, null, 0, new TestElement(model, "1", new TestElement[0])); //$NON-NLS-1$
-
+
// Note: Re-expanding nodes causes redundant updates.
fListener.reset(false, false);
- fListener.addUpdates(getInternalViewer(), TreePath.EMPTY, model.getRootElement(), -1, ALL_UPDATES_COMPLETE);
+ fListener.addUpdates(getInternalViewer(), 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 ()) {
@@ -573,7 +576,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
TestModel model = alternatingSubsreesModel(100);
// NOTE: WE ARE NOT EXPANDING ANY CHILDREN
-
+
// Create the listener, only check the first level
fListener.reset();
@@ -589,7 +592,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
expandAlternateElements(fListener, model, false);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
@@ -597,7 +600,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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));
@@ -616,10 +619,10 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
assertTrue(getInternalViewer().getExpandedState(model.findElement("5.1")) == true); //$NON-NLS-1$
assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$
assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
-
+
// Update the model again
model.addElementChild(TreePath.EMPTY, null, 0, new TestElement(model, "1", new TestElement[0])); //$NON-NLS-1$
-
+
// Note: Re-expanding nodes causes redundant updates.
fListener.reset(false, false);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
@@ -639,9 +642,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$
assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
-
+
/**
- * This test verifies that if the model selects a new element
+ * 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.
*/
@@ -651,9 +654,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Expand all
fViewer.setAutoExpandLevel(-1);
-
+
// Create the listener.
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -669,7 +672,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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));
@@ -690,7 +693,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
Thread.sleep(0);
}
}
-
+
// 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)) {
@@ -709,9 +712,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Expand all
fViewer.setAutoExpandLevel(-1);
-
+
// Create the listener.
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -724,10 +727,10 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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));
@@ -739,8 +742,8 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Update the viewer to collapse an element
ModelDelta collapseDelta = model.makeElementDelta(model.findElement("3.1"), IModelDelta.COLLAPSE); //$NON-NLS-1$
-
- // Remove updates for the collapsed element from listener, because they
+
+ // 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")); //$NON-NLS-1$
@@ -761,7 +764,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
Thread.sleep(0);
}
}
-
+
// 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)) {
@@ -779,9 +782,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
TestModel model = TestModel.simpleMultiLevel();
// Note: Do not auto-expand!
-
+
// Create the listener.
- fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -794,7 +797,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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));
@@ -806,7 +809,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Update the viewer to expand an element
ModelDelta expandDelta = model.makeElementDelta(model.findElement("3.1"), IModelDelta.EXPAND); //$NON-NLS-1$
-
+
// Wait for the second model delta to process
fListener.resetModelChanged();
model.postDelta(expandDelta);
@@ -815,7 +818,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
Thread.sleep(0);
}
}
-
+
// 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)) {
@@ -828,15 +831,15 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
assertTrue(getInternalViewer().getExpandedState(model.findElement("3.1")) == true); //$NON-NLS-1$
}
-
+
public void testSaveAndRestore1() throws InterruptedException {
//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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -852,7 +855,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
+
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
fViewer.saveElementState(TreePath.EMPTY, originalState, IModelDelta.EXPAND | IModelDelta.SELECT);
@@ -866,9 +869,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
Thread.sleep(0);
}
}
-
+
// Set the viewer input back to the model. When view updates are complete
- // the viewer
+ // 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?
@@ -887,16 +890,16 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
fail("Expected:\n" + originalState.toString() + "\nGot:\n" + restoredState); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
public void testSaveAndRestore2() throws InterruptedException {
//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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -910,7 +913,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Set a selection in view
fViewer.setSelection(new TreeSelection(new TreePath[] { model.findElement("3.2"), model.findElement("3.2.1"), model.findElement("2") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
fViewer.setSelection(new TreeSelection(model.findElement("3.2.3"))); //$NON-NLS-1$
-
+
// Turn off the auto-expand now since we want to text the auto-expand logic
fViewer.setAutoExpandLevel(-1);
@@ -930,7 +933,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
// Set the viewer input back to the model. When view updates are complete
- // the viewer
+ // 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?
@@ -955,9 +958,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -973,15 +976,15 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
+
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
fViewer.saveElementState(TreePath.EMPTY, originalState, IModelDelta.EXPAND | IModelDelta.SELECT);
// Do not reset to null, just reset input to the same object.
-
+
// Set the viewer input back to the model. When view updates are complete
- // the viewer
+ // the viewer
// Note: disable redundant updates because the reveal delta triggers one.
fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false);
fViewer.setInput(model.getRootElement());
@@ -1005,9 +1008,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -1023,20 +1026,20 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// 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") })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
+
// Extract the original state from viewer
ModelDelta originalState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
fViewer.saveElementState(TreePath.EMPTY, originalState, IModelDelta.EXPAND | IModelDelta.SELECT);
- // Create a copy of the input object and set it to model.
+ // Create a copy of the input object and set it to model.
TestElement newRoot = new TestElement(model, model.getRootElement().getID(), model.getRootElement().getChildren());
model.setRoot(newRoot);
-
+
// Set the viewer input back to the model. When view updates are complete
- // the viewer
+ // the viewer
// Note: disable redundant updates because the reveal delta triggers one.
fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false);
-
+
fViewer.setInput(model.getRootElement());
while (!fListener.isFinished()) {
if (!fDisplay.readAndDispatch ()) {
@@ -1053,13 +1056,13 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
}
-
+
public void testSaveAndRestoreLarge() throws InterruptedException {
//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();
@@ -1072,7 +1075,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
expandAlternateElements(fListener, model, false);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
@@ -1094,7 +1097,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
// Set the viewer input back to the model. When view updates are complete
- // the viewer
+ // the viewer
// Note: disable redundant updates because the reveal delta triggers one.
fListener.reset();
fViewer.setInput(model.getRootElement());
@@ -1118,16 +1121,16 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
/**
- * This test saves state of a large tree. Then the tree is modified
+ * 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.
+ * rest of the saved state delta once all the elements are visible.
*/
public void testSaveAndRestorePartialStateLarge() throws InterruptedException {
//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();
@@ -1140,7 +1143,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
expandAlternateElements(fListener, model, false);
-
+
// Set a selection in view
TreeSelection originalSelection = new TreeSelection(model.findElement("5.1.1")); //$NON-NLS-1$
fViewer.setSelection(originalSelection);
@@ -1161,19 +1164,19 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
}
-
+
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
+ // 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
+
+ // MONITOR FOR THE STATE RESTORE TO COMPLETE
while (!fListener.isFinished(CONTENT_SEQUENCE_COMPLETE| STATE_RESTORE_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
@@ -1192,16 +1195,16 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
assertTrue(getInternalViewer().getExpandedState(model.findElement("6")) == false); //$NON-NLS-1$
assertTrue( areTreeSelectionsEqual(originalSelection, (ITreeSelection)fViewer.getSelection()) );
}
-
+
public void testPreserveCollapseAndSelectDeltaAfterSaveAndRestore() throws InterruptedException {
//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);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -1216,7 +1219,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Turn off auto-expand
fViewer.setAutoExpandLevel(0);
-
+
// Set the viewer input to null. This will trigger the view to save the viewer state.
fListener.reset(false, false);
fViewer.setInput(null);
@@ -1225,9 +1228,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
Thread.sleep(0);
}
}
-
+
// Set the viewer input back to the model. When view updates are complete
- // the viewer
+ // the viewer
// Note: disable redundant updates because the reveal delta triggers one.
fListener.reset(TreePath.EMPTY, model.getRootElement(), 1, false, false);
fViewer.setInput(model.getRootElement());
@@ -1237,14 +1240,14 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
fListener.addUpdates(null, path, (TestElement)path.getLastSegment(), 0, STATE_UPDATES);
// Wait till we restore state of elements we want to collapse and select
- // Bug 372619 - Need to wait until proxy installed delta is processed before
+ // Bug 372619 - Need to wait until proxy installed delta is processed before
// posting the next delta.
while (!fListener.isFinished(STATE_RESTORE_STARTED | STATE_UPDATES | CHILDREN_UPDATES | MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
// Post first collapse delta
fListener.resetModelChanged();
model.postDelta(model.makeElementDelta(model.findElement("2"), IModelDelta.COLLAPSE)); //$NON-NLS-1$
@@ -1295,9 +1298,9 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
// Expand all
fViewer.setAutoExpandLevel(-1);
-
+
// Create the listener.
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -1307,10 +1310,10 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
}
model.validateData(fViewer, TreePath.EMPTY, true);
-
+
// a new similar model
TestModel copyModel = TestModel.simpleMultiLevel();
-
+
// Trigger save - restore sequence.
fListener.reset();
fListener.expectRestoreAfterSaveComplete();
@@ -1321,7 +1324,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
}
}
assertTrue("RESTORE started before SAVE to complete", fListener.isFinished(STATE_SAVE_COMPLETE)); //$NON-NLS-1$
- }
+ }
/**
* This test tries to restore a viewer state while input == null.
@@ -1332,7 +1335,7 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -1345,19 +1348,19 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
ModelDelta expandedState = new ModelDelta(model.getRootElement(), IModelDelta.NO_CHANGE);
fViewer.saveElementState(TreePath.EMPTY, expandedState, IModelDelta.EXPAND);
-
+
// Refresh the viewer so that updates are generated.
fListener.reset();
fListener.addChildreCountUpdate(TreePath.EMPTY);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
fViewer.setInput(null);
fViewer.updateViewer(expandedState);
@@ -1366,6 +1369,6 @@ new TreePath[] { model.findElement("5"), model.findElement("5.1"), model.findEle
Thread.sleep(0);
}
}
-
+
}
}
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
index fd46141f7..47e03d33c 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -45,14 +45,14 @@ import org.eclipse.swt.widgets.Display;
import org.junit.Assert;
/**
- * 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
+ * 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;
@@ -61,7 +61,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
boolean fExpanded;
boolean fChecked;
boolean fGrayed;
-
+
public TestElement(TestModel model, String text, TestElement[] children) {
this (model, text, false, false, children);
}
@@ -73,42 +73,43 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
fChecked = checked;
fGrayed = grayed;
}
-
+
public TestModel getModel() {
return fModel;
}
-
- public Object getAdapter(Class adapter) {
+
+ @Override
+ 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;
}
@@ -117,32 +118,36 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
fChecked = checked;
fGrayed = grayed;
}
-
- public boolean equals(Object obj) {
+
+ @Override
+ public boolean equals(Object obj) {
return obj instanceof TestElement && fID.equals(((TestElement)obj).fID);
}
-
- public int hashCode() {
+
+ @Override
+ public int hashCode() {
return fID.hashCode();
}
-
- public String toString() {
+
+ @Override
+ 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) {
+ @Override
+ 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) {
@@ -150,7 +155,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
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));
}
@@ -165,25 +170,26 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
private IModelSelectionPolicy fModelSelectionPolicy;
private boolean fQueueingUpdates = false;
private boolean fDelayUpdates = false;
- private List fQueuedUpdates = new LinkedList();
-
+ private List<IViewerUpdate> fQueuedUpdates = new LinkedList<IViewerUpdate>();
+
/**
- * Constructor private. Use static factory methods instead.
+ * 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) {
+
+ @Override
+ 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++) {
@@ -200,9 +206,9 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
public int getModelDepth() {
return getDepth(getRootElement(), 0);
}
-
+
private int getDepth(TestElement element, int atDepth) {
- TestElement[] children = element.getChildren();
+ TestElement[] children = element.getChildren();
if (children.length == 0) {
return atDepth;
}
@@ -213,7 +219,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
return depth;
}
-
+
public void setQeueueingUpdate(boolean queueingUpdates) {
fQueueingUpdates = queueingUpdates;
if (!fQueueingUpdates) {
@@ -225,18 +231,18 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
fDelayUpdates = delayUpdates;
}
- public List getQueuedUpdates() {
+ public List<IViewerUpdate> getQueuedUpdates() {
return fQueuedUpdates;
}
-
+
public void processQueuedUpdates() {
- List updates = new ArrayList(fQueuedUpdates);
+ List<IViewerUpdate> updates = new ArrayList<IViewerUpdate>(fQueuedUpdates);
fQueuedUpdates.clear();
for (int i = 0; i < updates.size(); i++) {
- processUpdate((IViewerUpdate)updates.get(i));
+ processUpdate(updates.get(i));
}
}
-
+
public void processUpdate(IViewerUpdate update) {
if (update instanceof IHasChildrenUpdate) {
doHasChildrenUpdate((IHasChildrenUpdate)update);
@@ -256,24 +262,26 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
private void processUpdates(IViewerUpdate[] updates) {
for (int i = 0; i < updates.length; i++) {
processUpdate(updates[i]);
- }
+ }
}
-
+
private void doUpdate(final IViewerUpdate[] updates) {
if (fQueueingUpdates) {
fQueuedUpdates.addAll(Arrays.asList(updates));
} else if (fDelayUpdates) {
Display.getDefault().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
processUpdates(updates);
}
});
} else {
processUpdates(updates);
- }
+ }
}
-
- public void update(IHasChildrenUpdate[] updates) {
+
+ @Override
+ public void update(IHasChildrenUpdate[] updates) {
doUpdate(updates);
}
@@ -282,9 +290,10 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
update.setHasChilren(element.getChildren().length > 0);
update.done();
}
-
-
- public void update(IChildrenCountUpdate[] updates) {
+
+
+ @Override
+ public void update(IChildrenCountUpdate[] updates) {
doUpdate(updates);
}
@@ -293,8 +302,9 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
update.setChildCount(element.getChildren().length);
update.done();
}
-
- public void update(IChildrenUpdate[] updates) {
+
+ @Override
+ public void update(IChildrenUpdate[] updates) {
doUpdate(updates);
}
@@ -308,25 +318,27 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}
update.done();
}
-
- public void update(ILabelUpdate[] updates) {
+
+ @Override
+ public void update(ILabelUpdate[] updates) {
doUpdate(updates);
}
private void doLabelUpdate(ILabelUpdate update) {
TestElement element = (TestElement)update.getElement();
update.setLabel(element.getLabel(), 0);
- if (update instanceof ICheckUpdate &&
- Boolean.TRUE.equals(update.getPresentationContext().getProperty(ICheckUpdate.PROP_CHECK)))
+ if (update instanceof ICheckUpdate &&
+ Boolean.TRUE.equals(update.getPresentationContext().getProperty(ICheckUpdate.PROP_CHECK)))
{
((ICheckUpdate)update).setChecked(element.getChecked(), element.getGrayed());
}
update.done();
}
-
+
public final static String ELEMENT_MEMENTO_ID = "id"; //$NON-NLS-1$
-
- public void compareElements(final IElementCompareRequest[] updates) {
+
+ @Override
+ public void compareElements(final IElementCompareRequest[] updates) {
doUpdate(updates);
}
@@ -336,17 +348,18 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
update.setEqual( elementID.equals(mementoID) );
update.done();
}
-
- public void encodeElements(IElementMementoRequest[] updates) {
+
+ @Override
+ public void encodeElements(IElementMementoRequest[] updates) {
doUpdate(updates);
}
-
+
private void doEncodeElements(IElementMementoRequest update) {
String elementID = ((TestElement)update.getElement()).getID();
update.getMemento().putString(ELEMENT_MEMENTO_ID, elementID);
- update.done();
+ update.done();
}
-
+
/**
* @param context the context
* @param viewerInput the input
@@ -354,22 +367,23 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
* @param checked the checked state
*/
public void elementChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) {
- TestElement element = getElement(path);
+ TestElement element = getElement(path);
Assert.assertFalse(element.getGrayed());
element.setChecked(checked, false);
}
-
- public IModelProxy createTreeModelProxy(Object input, TreePath path, IPresentationContext context) {
+
+ @Override
+ 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();
@@ -381,7 +395,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
public void setAllExpanded() {
doSetExpanded(fRoot);
}
-
+
private void doSetExpanded(TestElement element) {
element.fExpanded = true;
for (int i = 0; i < element.fChildren.length; i++) {
@@ -392,7 +406,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
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++) {
@@ -403,11 +417,11 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
public void validateData(ITreeModelViewer viewer, TreePath path) {
validateData(viewer, path, false);
}
-
+
public void validateData(ITreeModelViewer _viewer, TreePath path, boolean expandedElementsOnly) {
validateData(_viewer, path, expandedElementsOnly, TestModelUpdatesListener.EMPTY_FILTER_ARRAY);
}
-
+
public void validateData(ITreeModelViewer _viewer, TreePath path, boolean expandedElementsOnly, ViewerFilter[] filters) {
IInternalTreeModelViewer viewer = (IInternalTreeModelViewer)_viewer;
TestElement element = getElement(path);
@@ -415,7 +429,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
Assert.assertTrue(element.getChecked() == viewer.getElementChecked(path));
Assert.assertTrue(element.getGrayed() == viewer.getElementGrayed(path));
}
-
+
if (!expandedElementsOnly || path.getSegmentCount() == 0 || viewer.getExpandedState(path) ) {
TestElement[] children = element.getChildren();
@@ -428,7 +442,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
validateData(viewer, path.createChildPath(children[i]), expandedElementsOnly, filters);
viewerIndex++;
}
- Assert.assertEquals(viewerIndex, viewer.getChildCount(path));
+ Assert.assertEquals(viewerIndex, viewer.getChildCount(path));
} else if (!viewer.getExpandedState(path)) {
// If element not expanded, verify the plus sign.
Assert.assertTrue(viewer.getHasChildren(path) == element.getChildren().length > 0);
@@ -438,20 +452,20 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
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();
+ TestElement[] children = element.getChildren();
delta.setChildCount(children.length);
Object segment = path.getSegment(i);
int j;
@@ -474,9 +488,9 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}
}
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++) {
@@ -484,7 +498,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}
return new TreePath(segments);
}
-
+
public ModelDelta appendElementLabel(TreePath path, String labelAppendix) {
org.junit.Assert.assertTrue(path.startsWith(fRootPath, null));
ModelDelta rootDelta = new ModelDelta(fInput, IModelDelta.NO_CHANGE);
@@ -520,31 +534,31 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
// 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.
+
+ // 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];
+ 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, ModelDelta rootDelta, int index, TestElement newChild) {
if (rootDelta == null) {
@@ -559,17 +573,17 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
// 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) {
@@ -581,19 +595,19 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
// 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
+ // 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);
@@ -601,7 +615,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
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);
@@ -609,7 +623,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
// 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];
@@ -621,9 +635,9 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
// 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);
@@ -631,10 +645,10 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
// 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);
@@ -656,14 +670,15 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}
return null;
}
-
- public String toString() {
+
+ @Override
+ public String toString() {
return getElementString(fRoot, ""); //$NON-NLS-1$
}
-
+
public String getElementString(TestElement element, String indent) {
StringBuffer builder = new StringBuffer();
- builder.append(indent);
+ builder.append(indent);
builder.append(element.toString());
builder.append('\n');
TestElement[] children = element.getChildren();
@@ -672,7 +687,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}
return builder.toString();
}
-
+
public static TestModel simpleSingleLevel() {
TestModel model = new TestModel();
model.setRoot( new TestElement(model, "root", makeSingleLevelModelElements(model, 6, ""))); //$NON-NLS-1$ //$NON-NLS-2$
@@ -686,8 +701,8 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
elements[i - 1] = new TestElement(model, name, new TestElement[0]);
}
return elements;
- }
-
+ }
+
public static TestElement[] makeMultiLevelElements(TestModel model, int depth, String prefix) {
TestElement[] elements = new TestElement[depth];
for (int i = 0; i < depth; i++) {
@@ -695,10 +710,12 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
elements[i] = new TestElement(model, name, makeMultiLevelElements(model, i, name + ".")); //$NON-NLS-1$
}
return elements;
- }
+ }
public static TestElement[] makeMultiLevelElements2(TestModel model, int[] levelCounts, String prefix) {
- if (levelCounts.length == 0) return new TestElement[0];
+ if (levelCounts.length == 0) {
+ return new TestElement[0];
+ }
int count = levelCounts[0];
int[] oldLevelCounts = levelCounts;
levelCounts = new int[levelCounts.length - 1];
@@ -709,7 +726,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
elements[i] = new TestElement(model, name, makeMultiLevelElements2(model, levelCounts, name + ".")); //$NON-NLS-1$
}
return elements;
- }
+ }
public static TestModel simpleMultiLevel() {
TestModel model = new TestModel();
@@ -740,7 +757,7 @@ public class TestModel implements IElementContentProvider, IElementLabelProvider
}) );
return model;
}
-
+
public static TestModel compositeMultiLevel() {
TestModel m2 = new TestModel();
m2.setRoot( new TestElement(m2, "m2.root", new TestElement[] { //$NON-NLS-1$
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
index fe151710b..88ae8610a 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Wind River Systems - initial API and implementation
* Dorin Ciuca - Top index fix (Bug 324100)
@@ -43,42 +43,42 @@ import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerFilter;
import org.junit.Assert;
-public class TestModelUpdatesListener
+public class TestModelUpdatesListener
implements IViewerUpdateListener, ILabelUpdateListener, IModelChangedListener, ITestModelUpdatesListenerConstants,
- IStateUpdateListener, IJobChangeListener
+ IStateUpdateListener, IJobChangeListener
{
- public static final ViewerFilter[] EMPTY_FILTER_ARRAY = new ViewerFilter[0];
-
+ public static final ViewerFilter[] EMPTY_FILTER_ARRAY = new ViewerFilter[0];
+
private final ITreeModelViewer fViewer;
-
+
private IStatus fJobError;
-
+
private boolean fFailOnRedundantUpdates;
private boolean fFailOnRedundantLabelUpdates;
- private Set fRedundantUpdates = new HashSet();
- private Set fRedundantLabelUpdates = new HashSet();
- private Set fRedundantHasChildrenUpdateExceptions = new HashSet();
- private Set fRedundantChildCountUpdateExceptions = new HashSet();
- private Set fRedundantChildrenUpdateExceptions = new HashSet();
- private Set fRedundantLabelUpdateExceptions = new HashSet();
-
+ private Set<IViewerUpdate> fRedundantUpdates = new HashSet<IViewerUpdate>();
+ private Set<ILabelUpdate> fRedundantLabelUpdates = new HashSet<ILabelUpdate>();
+ private Set<TreePath> fRedundantHasChildrenUpdateExceptions = new HashSet<TreePath>();
+ private Set<TreePath> fRedundantChildCountUpdateExceptions = new HashSet<TreePath>();
+ private Set<TreePath> fRedundantChildrenUpdateExceptions = new HashSet<TreePath>();
+ private Set<TreePath> fRedundantLabelUpdateExceptions = new HashSet<TreePath>();
+
private boolean fFailOnMultipleModelUpdateSequences;
private boolean fFailOnMultipleLabelUpdateSequences;
-
- 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 Set<TreePath> fHasChildrenUpdatesScheduled = new HashSet<TreePath>();
+ private Set<IViewerUpdate> fHasChildrenUpdatesRunning = new HashSet<IViewerUpdate>();
+ private Set<IViewerUpdate> fHasChildrenUpdatesCompleted = new HashSet<IViewerUpdate>();
+ private Map<TreePath, Set<Integer>> fChildrenUpdatesScheduled = new HashMap<TreePath, Set<Integer>>();
+ private Set<IViewerUpdate> fChildrenUpdatesRunning = new HashSet<IViewerUpdate>();
+ private Set<IViewerUpdate> fChildrenUpdatesCompleted = new HashSet<IViewerUpdate>();
+ private Set<TreePath> fChildCountUpdatesScheduled = new HashSet<TreePath>();
+ private Set<IViewerUpdate> fChildCountUpdatesRunning = new HashSet<IViewerUpdate>();
+ private Set<IViewerUpdate> fChildCountUpdatesCompleted = new HashSet<IViewerUpdate>();
+ private Set<TreePath> fLabelUpdates = new HashSet<TreePath>();
+ private Set<ILabelUpdate> fLabelUpdatesRunning = new HashSet<ILabelUpdate>();
+ private Set<ILabelUpdate> fLabelUpdatesCompleted = new HashSet<ILabelUpdate>();
+ private Set<TestModel> fProxyModels = new HashSet<TestModel>();
+ private Set<TreePath> fStateUpdates = new HashSet<TreePath>();
private int fViewerUpdatesStarted = 0;
private int fViewerUpdatesComplete = 0;
private int fViewerUpdatesStartedAtReset;
@@ -100,8 +100,8 @@ public class TestModelUpdatesListener
private boolean fExpectRestoreAfterSaveComplete;
private RuntimeException fFailExpectation;
-
-
+
+
public TestModelUpdatesListener(ITreeModelViewer viewer, boolean failOnRedundantUpdates, boolean failOnMultipleModelUpdateSequences) {
this(viewer);
setFailOnRedundantUpdates(failOnRedundantUpdates);
@@ -124,19 +124,33 @@ public class TestModelUpdatesListener
fViewer.removeStateUpdateListener(this);
fViewer.removeViewerUpdateListener(this);
}
-
- public void aboutToRun(IJobChangeEvent event) {}
- public void awake(IJobChangeEvent event) {}
- public void running(IJobChangeEvent event) {}
- public void scheduled(IJobChangeEvent event) {}
- public void sleeping(IJobChangeEvent event) {}
- public void done(IJobChangeEvent event) {
- IStatus result = event.getJob().getResult();
+
+ @Override
+ public void aboutToRun(IJobChangeEvent event) {}
+
+ @Override
+ public void awake(IJobChangeEvent event) {
+ }
+
+ @Override
+ public void running(IJobChangeEvent event) {
+ }
+
+ @Override
+ public void scheduled(IJobChangeEvent event) {
+ }
+
+ @Override
+ public void sleeping(IJobChangeEvent event) {
+ }
+ @Override
+ public void done(IJobChangeEvent event) {
+ IStatus result = event.getJob().getResult();
if (result != null && result.getSeverity() == IStatus.ERROR) {
- fJobError = result;
+ fJobError = result;
}
}
-
+
public void setFailOnRedundantUpdates(boolean failOnRedundantUpdates) {
fFailOnRedundantUpdates = failOnRedundantUpdates;
}
@@ -152,19 +166,19 @@ public class TestModelUpdatesListener
public void setFailOnMultipleLabelUpdateSequences(boolean failOnMultipleLabelUpdateSequences) {
fFailOnMultipleLabelUpdateSequences = failOnMultipleLabelUpdateSequences;
}
-
+
public void expectRestoreAfterSaveComplete() {
fExpectRestoreAfterSaveComplete = true;
}
/**
- * 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.
+ * 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(path, element, EMPTY_FILTER_ARRAY, levels, failOnRedundantUpdates, failOnMultipleUpdateSequences);
}
@@ -220,11 +234,11 @@ public class TestModelUpdatesListener
fTimeoutTime = System.currentTimeMillis() + fTimeoutInterval;
resetModelChanged();
}
-
+
public void resetModelChanged() {
fModelChangedComplete = false;
}
-
+
public void addHasChildrenUpdate(TreePath path) {
fHasChildrenUpdatesScheduled.add(path);
}
@@ -242,16 +256,16 @@ public class TestModelUpdatesListener
}
public void addChildreUpdate(TreePath path, int index) {
- Set childrenIndexes = (Set)fChildrenUpdatesScheduled.get(path);
+ Set<Integer> childrenIndexes = fChildrenUpdatesScheduled.get(path);
if (childrenIndexes == null) {
- childrenIndexes = new TreeSet();
+ childrenIndexes = new TreeSet<Integer>();
fChildrenUpdatesScheduled.put(path, childrenIndexes);
}
childrenIndexes.add(new Integer(index));
}
public void removeChildrenUpdate(TreePath path, int index) {
- Set childrenIndexes = (Set)fChildrenUpdatesScheduled.get(path);
+ Set<?> childrenIndexes = fChildrenUpdatesScheduled.get(path);
if (childrenIndexes != null) {
childrenIndexes.remove(new Integer(index));
if (childrenIndexes.isEmpty()) {
@@ -271,7 +285,7 @@ public class TestModelUpdatesListener
public void addUpdates(TreePath path, TestElement element, int levels) {
addUpdates(null, path, element, EMPTY_FILTER_ARRAY, levels, ALL_UPDATES_COMPLETE );
}
-
+
public void addUpdates(TreePath path, TestElement element, ViewerFilter[] filters, int levels) {
addUpdates(null, path, element, filters, levels, ALL_UPDATES_COMPLETE );
}
@@ -279,7 +293,7 @@ public class TestModelUpdatesListener
public void addStateUpdates(IInternalTreeModelViewer viewer, TreePath path, TestElement element) {
addUpdates(viewer, path, element, -1, STATE_UPDATES);
}
-
+
public void addStateUpdates(IInternalTreeModelViewer viewer, IModelDelta pendingDelta, int deltaFlags) {
TreePath treePath = getViewerTreePath(pendingDelta);
if ( !TreePath.EMPTY.equals(treePath) && (pendingDelta.getFlags() & deltaFlags) != 0 ) {
@@ -288,9 +302,9 @@ public class TestModelUpdatesListener
IModelDelta[] childDeltas = pendingDelta.getChildDeltas();
for (int i = 0; i < childDeltas.length; i++) {
addStateUpdates(viewer, childDeltas[i], deltaFlags);
- }
+ }
}
-
+
public void addRedundantExceptionHasChildren(TreePath path) {
fRedundantHasChildrenUpdateExceptions.add(path);
}
@@ -306,43 +320,43 @@ public class TestModelUpdatesListener
public void addRedundantExceptionLabel(TreePath path) {
fRedundantLabelUpdateExceptions.add(path);
}
-
+
public boolean checkCoalesced(TreePath path, int offset, int length) {
- for (Iterator itr = fChildrenUpdatesCompleted.iterator(); itr.hasNext();) {
+ for (Iterator<IViewerUpdate> itr = fChildrenUpdatesCompleted.iterator(); itr.hasNext();) {
IChildrenUpdate update = (IChildrenUpdate)itr.next();
if (path.equals( update.getElementPath() ) &&
offset == update.getOffset() &&
- length == update.getLength())
+ length == update.getLength())
{
return true;
}
}
return false;
}
-
-
- public Set getHasChildrenUpdatesCompleted() {
+
+
+ public Set<IViewerUpdate> getHasChildrenUpdatesCompleted() {
return fHasChildrenUpdatesCompleted;
}
-
- public Set getChildCountUpdatesCompleted() {
+
+ public Set<IViewerUpdate> getChildCountUpdatesCompleted() {
return fChildCountUpdatesCompleted;
}
-
- public Set getChildrenUpdatesCompleted() {
+
+ public Set<IViewerUpdate> getChildrenUpdatesCompleted() {
return fChildrenUpdatesCompleted;
}
-
+
/**
* Returns a tree path for the node, *not* including the root element.
- *
+ *
* @param node
* model delta
* @return corresponding tree path
*/
private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
+ ArrayList<Object> list = new ArrayList<Object>();
IModelDelta parentDelta = node.getParentDelta();
while (parentDelta != null) {
list.add(0, node.getElement());
@@ -359,7 +373,7 @@ public class TestModelUpdatesListener
public void addUpdates(IInternalTreeModelViewer viewer, TreePath path, TestElement element, int levels, int flags) {
addUpdates(viewer, path, element, EMPTY_FILTER_ARRAY, levels, flags);
}
-
+
public static boolean isFiltered(Object element, ViewerFilter[] filters) {
for (int i = 0; i < filters.length; i++) {
if (!filters[i].select(null, null, element)) {
@@ -368,12 +382,12 @@ public class TestModelUpdatesListener
}
return false;
}
-
+
public void addUpdates(IInternalTreeModelViewer viewer, TreePath path, TestElement element, ViewerFilter[] filters, int levels, int flags) {
if (isFiltered(path.getLastSegment(), filters)) {
return;
}
-
+
if (!path.equals(TreePath.EMPTY)) {
if ((flags & LABEL_UPDATES) != 0) {
fLabelUpdates.add(path);
@@ -381,7 +395,7 @@ public class TestModelUpdatesListener
if ((flags & HAS_CHILDREN_UPDATES) != 0) {
fHasChildrenUpdatesScheduled.add(path);
}
-
+
if ((flags & STATE_UPDATES) != 0) {
fStateUpdates.add(path);
}
@@ -394,7 +408,7 @@ public class TestModelUpdatesListener
fChildCountUpdatesScheduled.add(path);
}
if ((flags & CHILDREN_UPDATES) != 0) {
- Set childrenIndexes = new HashSet();
+ Set<Integer> childrenIndexes = new HashSet<Integer>();
for (int i = 0; i < children.length; i++) {
if (!isFiltered(children[i], filters)) {
childrenIndexes.add(new Integer(i));
@@ -407,7 +421,7 @@ public class TestModelUpdatesListener
addUpdates(viewer, path.createChildPath(children[i]), children[i], filters, levels, flags);
}
}
-
+
}
}
@@ -421,24 +435,24 @@ public class TestModelUpdatesListener
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)); //$NON-NLS-1$
}
-
+
if (fFailExpectation != null) {
throw fFailExpectation;
}
-
+
if (fJobError != null) {
throw new RuntimeException("Job Error: " + fJobError); //$NON-NLS-1$
}
@@ -448,7 +462,7 @@ public class TestModelUpdatesListener
}
if (fFailOnRedundantLabelUpdates && !fRedundantLabelUpdates.isEmpty()) {
Assert.fail("Redundant Label Updates: " + fRedundantLabelUpdates.toString()); //$NON-NLS-1$
- }
+ }
if (fFailOnMultipleLabelUpdateSequences && fLabelUpdatesComplete > (fLabelUpdatesCompleteAtReset + 1)) {
Assert.fail("Multiple label update sequences detected"); //$NON-NLS-1$
}
@@ -458,57 +472,91 @@ public class TestModelUpdatesListener
if ( (flags & LABEL_SEQUENCE_COMPLETE) != 0) {
if (fLabelUpdatesComplete == fLabelUpdatesCompleteAtReset ||
- fLabelUpdatesComplete != fLabelUpdatesStarted) return false;
+ fLabelUpdatesComplete != fLabelUpdatesStarted) {
+ return false;
+ }
}
if ( (flags & LABEL_SEQUENCE_STARTED) != 0) {
- if (fLabelUpdatesStarted == fLabelUpdatesStartedAtReset) return false;
+ if (fLabelUpdatesStarted == fLabelUpdatesStartedAtReset) {
+ return false;
+ }
}
if ( (flags & LABEL_UPDATES) != 0) {
- if (!fLabelUpdates.isEmpty()) return false;
+ if (!fLabelUpdates.isEmpty()) {
+ return false;
+ }
}
if ( (flags & CONTENT_SEQUENCE_STARTED) != 0) {
- if (fViewerUpdatesStarted == fViewerUpdatesStartedAtReset) return false;
+ if (fViewerUpdatesStarted == fViewerUpdatesStartedAtReset) {
+ return false;
+ }
}
if ( (flags & CONTENT_SEQUENCE_COMPLETE) != 0) {
- if (fViewerUpdatesComplete == fViewerUpdatesCompleteAtReset ||
- fViewerUpdatesStarted != fViewerUpdatesComplete) return false;
+ if (fViewerUpdatesComplete == fViewerUpdatesCompleteAtReset ||
+ fViewerUpdatesStarted != fViewerUpdatesComplete) {
+ return false;
+ }
}
if ( (flags & HAS_CHILDREN_UPDATES_STARTED) != 0) {
- if (fHasChildrenUpdatesRunning.isEmpty() && fHasChildrenUpdatesCompleted.isEmpty()) return false;
+ if (fHasChildrenUpdatesRunning.isEmpty() && fHasChildrenUpdatesCompleted.isEmpty()) {
+ return false;
+ }
}
if ( (flags & HAS_CHILDREN_UPDATES) != 0) {
- if (!fHasChildrenUpdatesScheduled.isEmpty()) return false;
+ if (!fHasChildrenUpdatesScheduled.isEmpty()) {
+ return false;
+ }
}
if ( (flags & CHILD_COUNT_UPDATES_STARTED) != 0) {
- if (fChildCountUpdatesRunning.isEmpty() && fChildCountUpdatesCompleted.isEmpty()) return false;
+ if (fChildCountUpdatesRunning.isEmpty() && fChildCountUpdatesCompleted.isEmpty()) {
+ return false;
+ }
}
if ( (flags & CHILD_COUNT_UPDATES) != 0) {
- if (!fChildCountUpdatesScheduled.isEmpty()) return false;
+ if (!fChildCountUpdatesScheduled.isEmpty()) {
+ return false;
+ }
}
if ( (flags & CHILDREN_UPDATES_STARTED) != 0) {
// Some children updates have already been started or completed.
- if (fChildrenUpdatesRunning.isEmpty() && fChildrenUpdatesCompleted.isEmpty()) return false;
+ if (fChildrenUpdatesRunning.isEmpty() && fChildrenUpdatesCompleted.isEmpty()) {
+ return false;
+ }
}
if ( (flags & CHILDREN_UPDATES_RUNNING) != 0) {
- if (!isFinishedChildrenRunning()) return false;
+ if (!isFinishedChildrenRunning()) {
+ return false;
+ }
}
if ( (flags & CHILDREN_UPDATES) != 0) {
- if (!fChildrenUpdatesScheduled.isEmpty()) return false;
+ if (!fChildrenUpdatesScheduled.isEmpty()) {
+ return false;
+ }
}
if ( (flags & MODEL_CHANGED_COMPLETE) != 0) {
- if (!fModelChangedComplete) return false;
+ if (!fModelChangedComplete) {
+ return false;
+ }
}
if ( (flags & STATE_SAVE_COMPLETE) != 0) {
- if (!fStateSaveComplete) return false;
+ if (!fStateSaveComplete) {
+ return false;
+ }
}
if ( (flags & STATE_SAVE_STARTED) != 0) {
- if (!fStateSaveStarted) return false;
+ if (!fStateSaveStarted) {
+ return false;
+ }
}
if ( (flags & STATE_RESTORE_COMPLETE) != 0) {
- if (!fStateRestoreComplete) return false;
+ if (!fStateRestoreComplete) {
+ return false;
+ }
}
if ( (flags & STATE_RESTORE_STARTED) != 0) {
- if (!fStateRestoreStarted) return false;
+ if (!fStateRestoreStarted) {
+ return false;
+ }
}
if ( (flags & STATE_UPDATES) != 0) {
if (!fStateUpdates.isEmpty()) {
@@ -516,7 +564,9 @@ public class TestModelUpdatesListener
}
}
if ( (flags & MODEL_PROXIES_INSTALLED) != 0) {
- if (fProxyModels.size() != 0) return false;
+ if (fProxyModels.size() != 0) {
+ return false;
+ }
}
if ( (flags & VIEWER_UPDATES_RUNNING) != 0) {
if (fViewerUpdatesCounter != 0) {
@@ -528,43 +578,48 @@ public class TestModelUpdatesListener
return false;
}
}
-
+
return true;
}
/**
- * Returns true if all children updates that were scheduled are either currently
+ * Returns true if all children updates that were scheduled are either currently
* running or have already completed.
- *
+ *
* @see CHILDREN_UPDATES_RUNNING
* @return
*/
private boolean isFinishedChildrenRunning() {
// All children updates that have been scheduled are either running or completed.
int scheduledCount = 0;
- for (Iterator itr = fChildrenUpdatesScheduled.values().iterator(); itr.hasNext();) {
- scheduledCount += ((Set)itr.next()).size();
+ for (Iterator<Set<Integer>> itr = fChildrenUpdatesScheduled.values().iterator(); itr.hasNext();) {
+ scheduledCount += ((Set<?>) itr.next()).size();
}
-
+
int runningCount = 0;
- for (Iterator itr = fChildrenUpdatesRunning.iterator(); itr.hasNext();) {
+ for (Iterator<IViewerUpdate> itr = fChildrenUpdatesRunning.iterator(); itr.hasNext();) {
IChildrenUpdate update = ((IChildrenUpdate)itr.next());
- Set set = (Set)fChildrenUpdatesScheduled.get( update.getElementPath() );
+ Set<?> set = fChildrenUpdatesScheduled.get(update.getElementPath());
for (int i = update.getOffset(); set != null && i < update.getOffset() + update.getLength(); i++) {
- if (set.contains(new Integer(i))) runningCount++;
+ if (set.contains(new Integer(i))) {
+ runningCount++;
+ }
}
}
- for (Iterator itr = fChildrenUpdatesCompleted.iterator(); itr.hasNext();) {
+ for (Iterator<IViewerUpdate> itr = fChildrenUpdatesCompleted.iterator(); itr.hasNext();) {
IChildrenUpdate update = ((IChildrenUpdate)itr.next());
- Set set = (Set)fChildrenUpdatesScheduled.get( update.getElementPath() );
+ Set<?> set = fChildrenUpdatesScheduled.get(update.getElementPath());
for (int i = update.getOffset(); set != null && i < update.getOffset() + update.getLength(); i++) {
- if (set.contains(new Integer(i))) runningCount++;
+ if (set.contains(new Integer(i))) {
+ runningCount++;
+ }
}
}
return scheduledCount == runningCount;
}
-
- public void updateStarted(IViewerUpdate update) {
+
+ @Override
+ public void updateStarted(IViewerUpdate update) {
synchronized (this) {
fViewerUpdatesCounter++;
if (update instanceof IHasChildrenUpdate) {
@@ -573,11 +628,12 @@ public class TestModelUpdatesListener
fChildCountUpdatesRunning.add(update);
} else if (update instanceof IChildrenUpdate) {
fChildrenUpdatesRunning.add(update);
- }
+ }
}
}
-
- public void updateComplete(IViewerUpdate update) {
+
+ @Override
+ public void updateComplete(IViewerUpdate update) {
synchronized (this) {
fViewerUpdatesCounter--;
}
@@ -586,30 +642,30 @@ public class TestModelUpdatesListener
TreePath updatePath = update.getElementPath();
if (update instanceof IHasChildrenUpdate) {
fHasChildrenUpdatesRunning.remove(update);
- fHasChildrenUpdatesCompleted.add(update);
+ fHasChildrenUpdatesCompleted.add(update);
if (!fHasChildrenUpdatesScheduled.remove(updatePath) &&
- fFailOnRedundantUpdates &&
- fRedundantHasChildrenUpdateExceptions.contains(updatePath))
+ fFailOnRedundantUpdates &&
+ fRedundantHasChildrenUpdateExceptions.contains(updatePath))
{
fRedundantUpdates.add(update);
}
} if (update instanceof IChildrenCountUpdate) {
fChildCountUpdatesRunning.remove(update);
- fChildCountUpdatesCompleted.add(update);
+ fChildCountUpdatesCompleted.add(update);
if (!fChildCountUpdatesScheduled.remove(updatePath) &&
fFailOnRedundantUpdates &&
- !fRedundantChildCountUpdateExceptions.contains(updatePath))
+ !fRedundantChildCountUpdateExceptions.contains(updatePath))
{
fRedundantUpdates.add(update);
}
} else if (update instanceof IChildrenUpdate) {
fChildrenUpdatesRunning.remove(update);
- fChildrenUpdatesCompleted.add(update);
-
+ fChildrenUpdatesCompleted.add(update);
+
int start = ((IChildrenUpdate)update).getOffset();
int end = start + ((IChildrenUpdate)update).getLength();
-
- Set childrenIndexes = (Set)fChildrenUpdatesScheduled.get(updatePath);
+
+ Set<?> childrenIndexes = fChildrenUpdatesScheduled.get(updatePath);
if (childrenIndexes != null) {
for (int i = start; i < end; i++) {
childrenIndexes.remove(new Integer(i));
@@ -620,97 +676,110 @@ public class TestModelUpdatesListener
} else if (fFailOnRedundantUpdates && fRedundantChildrenUpdateExceptions.contains(updatePath)) {
fRedundantUpdates.add(update);
}
- }
+ }
}
}
-
- public void viewerUpdatesBegin() {
+
+ @Override
+ public void viewerUpdatesBegin() {
if (fViewerUpdatesStarted > fViewerUpdatesComplete) {
fFailExpectation = new RuntimeException("Unmatched updatesStarted/updateCompleted notifications observed."); //$NON-NLS-1$
}
fViewerUpdatesStarted++;
}
-
- public void viewerUpdatesComplete() {
+
+ @Override
+ public void viewerUpdatesComplete() {
if (fViewerUpdatesStarted <= fViewerUpdatesComplete) {
fFailExpectation = new RuntimeException("Unmatched updatesStarted/updateCompleted notifications observed."); //$NON-NLS-1$
}
fViewerUpdatesComplete++;
}
- public void labelUpdateComplete(ILabelUpdate update) {
+ @Override
+ public void labelUpdateComplete(ILabelUpdate update) {
fLabelUpdatesRunning.remove(update);
fLabelUpdatesCompleted.add(update);
fLabelUpdatesCounter--;
- if (!fLabelUpdates.remove(update.getElementPath()) &&
- fFailOnRedundantLabelUpdates &&
- !fRedundantLabelUpdateExceptions.contains(update.getElementPath()))
+ if (!fLabelUpdates.remove(update.getElementPath()) &&
+ fFailOnRedundantLabelUpdates &&
+ !fRedundantLabelUpdateExceptions.contains(update.getElementPath()))
{
fRedundantLabelUpdates.add(update);
Assert.fail("Redundant update: " + update); //$NON-NLS-1$
}
}
- public void labelUpdateStarted(ILabelUpdate update) {
+ @Override
+ public void labelUpdateStarted(ILabelUpdate update) {
fLabelUpdatesRunning.add(update);
fLabelUpdatesCounter++;
}
- public void labelUpdatesBegin() {
+ @Override
+ public void labelUpdatesBegin() {
if (fLabelUpdatesStarted > fLabelUpdatesComplete) {
fFailExpectation = new RuntimeException("Unmatched labelUpdatesStarted/labelUpdateCompleted notifications observed."); //$NON-NLS-1$
}
fLabelUpdatesStarted++;
}
- public void labelUpdatesComplete() {
+ @Override
+ public void labelUpdatesComplete() {
if (fLabelUpdatesStarted <= fLabelUpdatesComplete) {
fFailExpectation = new RuntimeException("Unmatched labelUpdatesStarted/labelUpdateCompleted notifications observed."); //$NON-NLS-1$
}
fLabelUpdatesComplete++;
}
-
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
+
+ @Override
+ public void modelChanged(IModelDelta delta, IModelProxy proxy) {
fModelChangedComplete = true;
- for (Iterator itr = fProxyModels.iterator(); itr.hasNext();) {
- TestModel model = (TestModel)itr.next();
+ for (Iterator<TestModel> itr = fProxyModels.iterator(); itr.hasNext();) {
+ TestModel model = itr.next();
if (model.getModelProxy() == proxy) {
itr.remove();
break;
}
}
}
-
- public void stateRestoreUpdatesBegin(Object input) {
+
+ @Override
+ public void stateRestoreUpdatesBegin(Object input) {
if (fExpectRestoreAfterSaveComplete && !fStateSaveComplete) {
fFailExpectation = new RuntimeException("RESTORE should begin after SAVE completed!"); //$NON-NLS-1$
}
fStateRestoreStarted = true;
}
-
- public void stateRestoreUpdatesComplete(Object input) {
+
+ @Override
+ public void stateRestoreUpdatesComplete(Object input) {
Assert.assertFalse("RESTORE STATE already complete!", fStateRestoreComplete); //$NON-NLS-1$
fStateRestoreComplete = true;
}
-
- public void stateSaveUpdatesBegin(Object input) {
+
+ @Override
+ public void stateSaveUpdatesBegin(Object input) {
fStateSaveStarted = true;
}
- public void stateSaveUpdatesComplete(Object input) {
+ @Override
+ public void stateSaveUpdatesComplete(Object input) {
fStateSaveComplete = true;
}
-
- public void stateUpdateComplete(Object input, IViewerUpdate update) {
+
+ @Override
+ public void stateUpdateComplete(Object input, IViewerUpdate update) {
if ( !(update instanceof ElementCompareRequest) || ((ElementCompareRequest)update).isEqual()) {
fStateUpdates.remove(update.getElementPath());
- }
+ }
}
-
- public void stateUpdateStarted(Object input, IViewerUpdate update) {
+
+ @Override
+ public void stateUpdateStarted(Object input, IViewerUpdate update) {
}
-
+
private String toString(int flags) {
StringBuffer buf = new StringBuffer("Viewer Update Listener"); //$NON-NLS-1$
@@ -725,7 +794,7 @@ public class TestModelUpdatesListener
}
}
}
-
+
if (fFailOnRedundantUpdates) {
buf.append("\n\t"); //$NON-NLS-1$
buf.append("fRedundantUpdates = " + fRedundantUpdates); //$NON-NLS-1$
@@ -832,34 +901,34 @@ public class TestModelUpdatesListener
return buf.toString();
}
- private String toString(Set set) {
+ private String toString(Set<TreePath> set) {
if (set.isEmpty()) {
return "(EMPTY)"; //$NON-NLS-1$
}
StringBuffer buf = new StringBuffer();
- for (Iterator itr = set.iterator(); itr.hasNext(); ) {
+ for (Iterator<TreePath> itr = set.iterator(); itr.hasNext();) {
buf.append("\n\t\t"); //$NON-NLS-1$
- buf.append(toString((TreePath)itr.next()));
+ buf.append(toString(itr.next()));
}
return buf.toString();
}
-
- private String toString(Map map) {
+
+ private String toString(Map<TreePath, Set<Integer>> map) {
if (map.isEmpty()) {
return "(EMPTY)"; //$NON-NLS-1$
}
StringBuffer buf = new StringBuffer();
- for (Iterator itr = map.keySet().iterator(); itr.hasNext(); ) {
+ for (Iterator<TreePath> itr = map.keySet().iterator(); itr.hasNext();) {
buf.append("\n\t\t"); //$NON-NLS-1$
- TreePath path = (TreePath)itr.next();
+ TreePath path = itr.next();
buf.append(toString(path));
- Set updates = (Set)map.get(path);
+ Set<?> updates = map.get(path);
buf.append(" = "); //$NON-NLS-1$
buf.append(updates.toString());
}
return buf.toString();
}
-
+
private String toString(TreePath path) {
if (path.getSegmentCount() == 0) {
return "/"; //$NON-NLS-1$
@@ -871,12 +940,13 @@ public class TestModelUpdatesListener
}
return buf.toString();
}
-
- public String toString() {
+
+ @Override
+ public String toString() {
return toString(ALL_UPDATES_COMPLETE | MODEL_CHANGED_COMPLETE | STATE_SAVE_COMPLETE | STATE_RESTORE_COMPLETE | ALL_VIEWER_UPDATES_STARTED | LABEL_SEQUENCE_STARTED | STATE_UPDATES);
}
-
-
+
+
}
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
index 5d70a64c4..af897a4fd 100644
--- 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
@@ -1,12 +1,13 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 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 Corporation - bug fixing
*******************************************************************************/
package org.eclipe.debug.tests.viewer.model;
@@ -24,28 +25,29 @@ 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 dispose() {
fViewer.removeViewerUpdateListener(this);
fViewer = null;
}
-
- public void updateComplete(IViewerUpdate update) {
+
+ @Override
+ public void updateComplete(IViewerUpdate update) {
if (update instanceof IChildrenCountUpdate) {
TreePath path = update.getElementPath();
- ILazyTreePathContentProvider contentProvider = (ILazyTreePathContentProvider) fViewer.getContentProvider();
-
+ 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])) ) {
@@ -58,25 +60,28 @@ public class TreeModelViewerAutopopulateAgent implements IViewerUpdateListener {
}
}
- public void updateStarted(IViewerUpdate update) {
+ @Override
+ public void updateStarted(IViewerUpdate update) {
// TODO Auto-generated method stub
}
- public void viewerUpdatesBegin() {
+ @Override
+ public void viewerUpdatesBegin() {
// TODO Auto-generated method stub
}
- public void viewerUpdatesComplete() {
+ @Override
+ 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();
+ LinkedList<Object> segments = new LinkedList<Object>();
while (item != null) {
Object segment = item.getData();
Assert.isNotNull(segment);
@@ -95,5 +100,5 @@ public class TreeModelViewerAutopopulateAgent implements IViewerUpdateListener {
return ((TreeItem)w).getItemCount();
}
return 0;
- }
+ }
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreePathWrapper.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreePathWrapper.java
index bac73a857..06bc29911 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreePathWrapper.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/TreePathWrapper.java
@@ -27,16 +27,19 @@ public class TreePathWrapper {
fPath = path;
}
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fPath.hashCode();
}
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
return obj instanceof TreePathWrapper &&
fPath.equals( ((TreePathWrapper)obj).fPath );
}
- public String toString() {
+ @Override
+ public String toString() {
if (fPath.getSegmentCount() == 0) {
return "TreePath:EMPTY"; //$NON-NLS-1$
}
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
index 2af970dc6..bf9682368 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* 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 Corporation - bug fixing
@@ -35,9 +35,9 @@ import org.eclipse.ui.PlatformUI;
import org.junit.Assert;
/**
- * Tests to verify that the viewer property updates following changes in the
- * model, following simple content update deltas from the model.
- *
+ * 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 {
@@ -45,7 +45,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
Shell fShell;
ITreeModelViewer fViewer;
TestModelUpdatesListener fListener;
-
+
public UpdateTests(String name) {
super(name);
}
@@ -53,28 +53,30 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay);
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 {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
-
+
// Close the shell and exit.
fShell.close();
while (!fShell.isDisposed()) {
@@ -84,14 +86,15 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
- protected void runTest() throws Throwable {
+ @Override
+ protected void runTest() throws Throwable {
try {
super.runTest();
} catch (Throwable t) {
throw new ExecutionException("Test failed: " + t.getMessage() + "\n fListener = " + fListener.toString(), t); //$NON-NLS-1$ //$NON-NLS-2$
}
}
-
+
/**
* This test:
* - creates a simple model
@@ -103,7 +106,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -113,7 +116,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
TestElement root = model.getRootElement();
TreePath rootPath = new TreePath(new Object[] {});
@@ -123,13 +126,13 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
new TestElement(model, "3", new TestElement[0]), //$NON-NLS-1$
};
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
+ // 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 ()) {
@@ -140,7 +143,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
/**
- * This test:
+ * This test:
* - creates a simple model
* - sets a list of children to one of the elements
* - refreshes the viewer
@@ -150,7 +153,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, true, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -160,7 +163,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
TestElement element = model.getRootElement().getChildren()[0];
TreePath elementPath = new TreePath(new Object[] { element });
@@ -171,12 +174,12 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
};
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
+ // 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);
+ fListener.reset(rootPath, rootElement, -1, false, false);
// Refresh the viewer
model.postDelta(new ModelDelta(rootElement, IModelDelta.CONTENT));
@@ -188,10 +191,10 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
model.validateData(fViewer, TreePath.EMPTY);
}
-
+
private void removeElement(TestModel model, int index, boolean validate) throws InterruptedException {
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();
@@ -203,25 +206,25 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
if (validate) {
- model.validateData(fViewer, TreePath.EMPTY);
+ model.validateData(fViewer, TreePath.EMPTY);
}
}
-
+
private void addElement(TestModel model, String label, int position, boolean validate) throws InterruptedException {
ModelDelta delta = model.addElementChild(TreePath.EMPTY, null, 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_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
- model.validateData(fViewer, TreePath.EMPTY);
+ model.validateData(fViewer, TreePath.EMPTY);
} else {
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -233,19 +236,19 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
private void insertElement(TestModel model, String label, int position, boolean validate) throws InterruptedException {
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_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
- model.validateData(fViewer, TreePath.EMPTY);
+ model.validateData(fViewer, TreePath.EMPTY);
} else {
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -262,7 +265,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -272,7 +275,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
// Update the model
removeElement(model, 2, true);
addElement(model, "3-new", 3, true); //$NON-NLS-1$
@@ -285,8 +288,8 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
/**
- * This test verifies that when the viewer processes a delta that causes viewer
- * updates it initiates the model update sequence before it finishes processing
+ * This test verifies that when the viewer processes a delta that causes viewer
+ * updates it initiates the model update sequence before it finishes processing
* the delta.
*/
public void testNotifyUpdatesTartedOnModelChanged() throws InterruptedException {
@@ -294,7 +297,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -308,30 +311,30 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
// Refresh the viewer so that updates are generated.
fListener.reset();
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
Assert.assertTrue( fListener.isFinished(CONTENT_SEQUENCE_STARTED) );
}
/**
- * This test case attempts to create a race condition between processing
- * of the content updates and processing of add/remove model deltas.
+ * This test case attempts to create a race condition between processing
+ * of the content updates and processing of add/remove model deltas.
* <br>
- * See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=304066">bug 304066</a>
+ * See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=304066">bug 304066</a>
*/
public void testContentPlusAddRemoveUpdateRaceConditionsElement() throws InterruptedException {
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -342,12 +345,12 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
model.validateData(fViewer, TreePath.EMPTY);
- // Create a listener to listen only to a children count update for the root.
+ // 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; //$NON-NLS-1$
-
+
// Request a content update for view
childrenCountUpdateListener.reset();
childrenCountUpdateListener.addChildreCountUpdate(TreePath.EMPTY);
@@ -358,7 +361,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
Thread.sleep(0);
}
}
-
+
removeElement(model, 5, false);
removeElement(model, 4, false);
removeElement(model, 3, false);
@@ -366,46 +369,46 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
removeElement(model, 1, false);
removeElement(model, 0, false);
- // Wait until the children count update is completed using the count from
+ // 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 ()) {
Thread.sleep(0);
}
}
-
+
insertElement(model, "1 - " + pass, 0, false); //$NON-NLS-1$
insertElement(model, "2 - " + pass, 1, false); //$NON-NLS-1$
insertElement(model, "3 - " + pass, 2, false); //$NON-NLS-1$
insertElement(model, "4 - " + pass, 3, false); //$NON-NLS-1$
insertElement(model, "5 - " + pass, 4, false); //$NON-NLS-1$
insertElement(model, "6 - " + pass, 5, false); //$NON-NLS-1$
-
+
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
- model.validateData(fViewer, TreePath.EMPTY);
+ model.validateData(fViewer, TreePath.EMPTY);
}
-
+
childrenCountUpdateListener.dispose();
}
/**
- * This test case attempts to create a race condition between processing
- * of the content updates and processing of add/remove model deltas.
+ * This test case attempts to create a race condition between processing
+ * of the content updates and processing of add/remove model deltas.
* <br>
- * See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=304066">bug 304066</a>
+ * See <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=304066">bug 304066</a>
*/
public void testInsertAtInvalidIndex() throws InterruptedException {
TestModel model = TestModel.simpleSingleLevel();
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -421,7 +424,8 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
ModelDelta delta = model.insertElementChild(TreePath.EMPTY, insertIndex, new TestElement(model, "last - invalid index", new TestElement[0])); //$NON-NLS-1$
// Change insert index to out of range
delta.accept(new IModelDeltaVisitor() {
-
+
+ @Override
public boolean visit(IModelDelta visitorDelta, int depth) {
if ((visitorDelta.getFlags() & IModelDelta.INSERTED) != 0) {
((ModelDelta)visitorDelta).setIndex(insertIndex + 1);
@@ -430,20 +434,20 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
return true;
}
});
-
+
// 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 | CONTENT_SEQUENCE_COMPLETE | LABEL_SEQUENCE_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
- model.validateData(fViewer, TreePath.EMPTY);
+ model.validateData(fViewer, TreePath.EMPTY);
}
-
+
/**
* This test forces the viewer to reschedule pending content updates
* due to a remove event from the model.
@@ -454,7 +458,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -471,14 +475,14 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
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 | CHILDREN_UPDATES_STARTED)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
// Update the model
removeElement(model, 0, true);
addElement(model, "1", 0, true); //$NON-NLS-1$
@@ -497,7 +501,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -508,32 +512,32 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
model.setQeueueingUpdate(true);
-
+
for (int i = 0; i < 5; i++) {
// Refresh the viewer so that updates are generated.
fListener.reset();
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES_STARTED)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
}
-
+
model.setQeueueingUpdate(false);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
}
-
+
/**
* This test forces the viewer to cancel updates then process them at once.
* <p>
@@ -546,7 +550,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -557,29 +561,29 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
model.setQeueueingUpdate(true);
-
+
for (int i = 0; i < 5; i++) {
// Refresh the viewer so that updates are generated.
fListener.reset();
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES_STARTED)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
}
-
- List updates = new ArrayList(model.getQueuedUpdates());
+
+ ArrayList<IViewerUpdate> updates = new ArrayList<IViewerUpdate>(model.getQueuedUpdates());
model.getQueuedUpdates().clear();
for (int i = updates.size() - 1; i >= 0; i--) {
- model.processUpdate((IViewerUpdate)updates.get(i));
+ model.processUpdate(updates.get(i));
}
-
+
model.setQeueueingUpdate(false);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -587,7 +591,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
}
-
+
/**
* This test forces the viewer to cancel updates then process them at once.
* <p>
@@ -600,7 +604,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -611,14 +615,14 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
model.setQeueueingUpdate(true);
-
+
for (int i = 0; i < 5; i++) {
// Refresh the viewer so that updates are generated.
fListener.reset();
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILDREN_UPDATES_STARTED)) {
completeQueuedUpdatesOfType(model, IChildrenCountUpdate.class);
@@ -628,16 +632,16 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
}
-
+
model.setQeueueingUpdate(false);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
}
-
+
/**
* This test forces the viewer to cancel updates then process them at once.
* <p>
@@ -650,7 +654,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -661,14 +665,14 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
model.validateData(fViewer, TreePath.EMPTY);
-
+
model.setQeueueingUpdate(true);
-
+
for (int i = 0; i < 5; i++) {
// Refresh the viewer so that updates are generated.
fListener.reset();
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILDREN_UPDATES_STARTED)) {
completeQueuedUpdatesOfType(model, IChildrenCountUpdate.class);
@@ -677,15 +681,15 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
Thread.sleep(0);
}
}
-
+
}
-
- List updates = new ArrayList(model.getQueuedUpdates());
+
+ ArrayList<IViewerUpdate> updates = new ArrayList<IViewerUpdate>(model.getQueuedUpdates());
model.getQueuedUpdates().clear();
for (int i = updates.size() - 1; i >= 0; i--) {
- model.processUpdate((IViewerUpdate)updates.get(i));
+ model.processUpdate(updates.get(i));
}
-
+
model.setQeueueingUpdate(false);
while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -693,9 +697,9 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
}
}
}
-
+
/**
- * This test removes an element while there are updates running on its
+ * This test removes an element while there are updates running on its
* sub-tree. With a precise timing this operation caused Bug 373790.
* <p>
* See Bug 373790 - Debug view stays busy after Resume
@@ -707,7 +711,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -724,7 +728,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fListener.addUpdates(path, model.getElement(path), 1, CHILD_COUNT_UPDATES);
fListener.addChildreUpdate(path, 0);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed and child updates for "2" to get started.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES | CHILDREN_UPDATES_RUNNING)) {
if (!fDisplay.readAndDispatch ()) {
@@ -734,7 +738,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
// Remove element "2"
removeElement(model, 1, true);
-
+
// Wait for all updates to finish.
while (!fListener.isFinished(ALL_UPDATES_COMPLETE)) {
if (!fDisplay.readAndDispatch ()) {
@@ -755,7 +759,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -767,19 +771,19 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
model.validateData(fViewer, TreePath.EMPTY);
model.setQeueueingUpdate(false);
-
+
// Refresh the viewer so that updates are generated.
fListener.reset();
fListener.addChildreCountUpdate(TreePath.EMPTY);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
TestModel model2 = new TestModel();
model2.setRoot(new TestElement(model2, "root", new TestElement[0])); //$NON-NLS-1$
fViewer.setInput(model2.getRootElement());
@@ -789,7 +793,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
Thread.sleep(0);
}
}
-
+
}
/**
@@ -804,7 +808,7 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
fViewer.setAutoExpandLevel(-1);
// Create the listener
- fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
+ fListener.reset(TreePath.EMPTY, model.getRootElement(), -1, false, false);
// Set the input into the view and update the view.
fViewer.setInput(model.getRootElement());
@@ -816,19 +820,19 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
model.validateData(fViewer, TreePath.EMPTY);
model.setQeueueingUpdate(false);
-
+
// Refresh the viewer so that updates are generated.
fListener.reset();
fListener.addChildreCountUpdate(TreePath.EMPTY);
model.postDelta(new ModelDelta(model.getRootElement(), IModelDelta.CONTENT));
-
+
// Wait for the delta to be processed.
while (!fListener.isFinished(MODEL_CHANGED_COMPLETE | CHILD_COUNT_UPDATES)) {
if (!fDisplay.readAndDispatch ()) {
Thread.sleep(0);
}
}
-
+
fViewer.setInput(null);
while (!fListener.isFinished(CONTENT_COMPLETE | VIEWER_UPDATES_RUNNING)) {
@@ -836,24 +840,24 @@ abstract public class UpdateTests extends TestCase implements ITestModelUpdatesL
Thread.sleep(0);
}
}
-
+
}
-
- private void completeQueuedUpdatesOfType(TestModel model, Class updateClass) {
- List updatesToComplete = new LinkedList();
-
- for (Iterator itr = model.getQueuedUpdates().iterator(); itr.hasNext();) {
- IViewerUpdate update = (IViewerUpdate)itr.next();
+
+ private void completeQueuedUpdatesOfType(TestModel model, Class<?> updateClass) {
+ List<IViewerUpdate> updatesToComplete = new LinkedList<IViewerUpdate>();
+
+ for (Iterator<IViewerUpdate> itr = model.getQueuedUpdates().iterator(); itr.hasNext();) {
+ IViewerUpdate update = itr.next();
if (updateClass.isInstance(update)) {
updatesToComplete.add(update);
itr.remove();
}
- }
+ }
if (updatesToComplete != null) {
- for (Iterator itr = updatesToComplete.iterator(); itr.hasNext();) {
- model.processUpdate((IViewerUpdate)itr.next());
+ for (Iterator<IViewerUpdate> itr = updatesToComplete.iterator(); itr.hasNext();) {
+ model.processUpdate(itr.next());
}
}
}
-
+
}
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
index 6f06e6346..9cf942bc6 100644
--- 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
@@ -26,7 +26,8 @@ public class VirtualViewerContentTests extends ContentTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index a2ab1a21b..f7dd72850 100644
--- 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
@@ -26,7 +26,8 @@ public class VirtualViewerDeltaTests extends DeltaTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerFilterTests.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerFilterTests.java
index fd584069a..9814cb5d6 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerFilterTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VirtualViewerFilterTests.java
@@ -27,7 +27,8 @@ public class VirtualViewerFilterTests extends FilterTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, SWT.VIRTUAL, new PresentationContext("TestViewer"), new VisibleVirtualItemValidator(0, 100)); //$NON-NLS-1$
}
}
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
index 94c370675..4139b5c4c 100644
--- 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
@@ -42,7 +42,8 @@ public class VirtualViewerLazyModeTests extends TestCase {
/**
* @throws java.lang.Exception
*/
- protected void setUp() throws Exception {
+ @Override
+ protected void setUp() throws Exception {
fDisplay = PlatformUI.getWorkbench().getDisplay();
fShell = new Shell(fDisplay/*, SWT.ON_TOP | SWT.SHELL_TRIM*/);
fShell.setMaximized(true);
@@ -67,7 +68,8 @@ public class VirtualViewerLazyModeTests extends TestCase {
/**
* @throws java.lang.Exception
*/
- protected void tearDown() throws Exception {
+ @Override
+ protected void tearDown() throws Exception {
fListener.dispose();
fViewer.getPresentationContext().dispose();
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
index e21fd505b..8c08a904e 100644
--- 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
@@ -27,11 +27,13 @@ public class VirtualViewerPerformanceTests extends PerformanceTests {
super(name);
}
- protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected IInternalTreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, SWT.VIRTUAL, new PresentationContext("TestViewer"), fVirtualItemValidator); //$NON-NLS-1$
}
- protected int getTestModelDepth() {
+ @Override
+ 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
index 4c2dcda52..1d127be36 100644
--- 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
@@ -26,7 +26,8 @@ public class VirtualViewerPopupTests extends PopupTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell, int style) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell, int style) {
return new VirtualTreeModelViewer(fDisplay, style, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
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
index a0df1576f..5a7dd44dd 100644
--- 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
@@ -26,7 +26,8 @@ public class VirtualViewerSelectionTests extends SelectionTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index b441ca685..46cdd3ad8 100644
--- 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
@@ -26,7 +26,8 @@ public class VirtualViewerStateTests extends StateTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
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
index d1ce76967..6fc572a21 100644
--- 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
@@ -26,7 +26,8 @@ public class VirtualViewerUpdateTests extends UpdateTests {
super(name);
}
- protected ITreeModelViewer createViewer(Display display, Shell shell) {
+ @Override
+ protected ITreeModelViewer createViewer(Display display, Shell shell) {
return new VirtualTreeModelViewer(fDisplay, 0, new PresentationContext("TestViewer")); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VisibleVirtualItemValidator.java b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VisibleVirtualItemValidator.java
index aa8c4c51b..bcb6e8659 100644
--- a/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VisibleVirtualItemValidator.java
+++ b/org.eclipse.debug.tests/src/org/eclipe/debug/tests/viewer/model/VisibleVirtualItemValidator.java
@@ -40,7 +40,8 @@ public class VisibleVirtualItemValidator implements IVirtualItemValidator {
return fEnd - fStart;
}
- public boolean isItemVisible(VirtualItem item) {
+ @Override
+ public boolean isItemVisible(VirtualItem item) {
int position = 0;
while (item.getParent() != null) {
position += item.getIndex().intValue();
@@ -49,7 +50,8 @@ public class VisibleVirtualItemValidator implements IVirtualItemValidator {
return position >= fStart && position < fEnd || isSelected(item);
}
- public void showItem(VirtualItem item) {
+ @Override
+ public void showItem(VirtualItem item) {
int length = fEnd - fStart;
fStart = calcPosition(item);
fEnd = fStart + length;
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
index 36de236c9..6324b079b 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/TestsPlugin.java
@@ -49,6 +49,7 @@ public class TestsPlugin extends AbstractUIPlugin {
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -58,6 +59,7 @@ public class TestsPlugin extends AbstractUIPlugin {
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
index 2454caa1c..1e5155548 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/breakpoint/BreakpointOrderingTests.java
@@ -65,6 +65,7 @@ public class BreakpointOrderingTests extends TestCase {
final IResource resource = ResourcesPlugin.getWorkspace().getRoot();
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
+ @Override
public void run( IProgressMonitor monitor ) throws CoreException {
// create the marker
setMarker(resource.createMarker(markerType));
@@ -88,51 +89,62 @@ public class BreakpointOrderingTests extends TestCase {
return fText;
}
+ @Override
public void delete() throws CoreException {
fMarker.delete();
}
+ @Override
public IMarker getMarker() {
return fMarker;
}
+ @Override
public String getModelIdentifier() {
return "Test"; //$NON-NLS-1$
}
+ @Override
public boolean isEnabled() throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
return false;
}
+ @Override
public boolean isPersisted() throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
return false;
}
+ @Override
public boolean isRegistered() throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
return false;
}
+ @Override
public void setEnabled(boolean enabled) throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public void setMarker(IMarker marker) throws CoreException {
assertTrue(fMarker == null && marker != null);
fMarker = marker;
}
+ @Override
public void setPersisted(boolean registered) throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public void setRegistered(boolean registered) throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public Object getAdapter(Class adapter) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
@@ -151,15 +163,18 @@ public class BreakpointOrderingTests extends TestCase {
fLineNum = lineNum;
}
+ @Override
public int getLineNumber() throws CoreException {
return fLineNum;
}
+ @Override
public int getCharEnd() throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
return 0;
}
+ @Override
public int getCharStart() throws CoreException {
fail("not implemented in test"); //$NON-NLS-1$
return 0;
@@ -171,41 +186,50 @@ public class BreakpointOrderingTests extends TestCase {
*/
StructuredViewer fTestViewer = new StructuredViewer() {
+ @Override
public IBaseLabelProvider getLabelProvider() {
return fDebugModelPres;
}
+ @Override
protected Widget doFindInputItem(Object element) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}
+ @Override
protected Widget doFindItem(Object element) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}
+ @Override
protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
protected List getSelectionFromWidget() {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}
+ @Override
protected void internalRefresh(Object element) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public void reveal(Object element) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
protected void setSelectionToWidget(List l, boolean reveal) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public Control getControl() {
fail("not implemented in test"); //$NON-NLS-1$
return null;
@@ -214,46 +238,56 @@ public class BreakpointOrderingTests extends TestCase {
// Test debug model presentation for label text retrieval.
IDebugModelPresentation fDebugModelPres = new IDebugModelPresentation() {
+ @Override
public void computeDetail(IValue value, IValueDetailListener listener) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public Image getImage(Object element) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}
+ @Override
public String getText(Object element) {
assertTrue("Unexpected element", element instanceof TestBreakpoint); //$NON-NLS-1$
return ((TestBreakpoint)element).getText();
}
+ @Override
public void setAttribute(String attribute, Object value) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public void addListener(ILabelProviderListener listener) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public void dispose() {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
fail("not implemented in test"); //$NON-NLS-1$
return false;
}
+ @Override
public void removeListener(ILabelProviderListener listener) {
fail("not implemented in test"); //$NON-NLS-1$
}
+ @Override
public String getEditorId(IEditorInput input, Object element) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
}
+ @Override
public IEditorInput getEditorInput(Object element) {
fail("not implemented in test"); //$NON-NLS-1$
return null;
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
index 7238c93f7..962c0bd68 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/expressions/ExpressionManagerTests.java
@@ -28,12 +28,12 @@ import org.eclipse.debug.internal.core.IExpressionsListener2;
* Tests expression manager and listener call backs
*/
public class ExpressionManagerTests extends TestCase {
-
+
class SinlgeListener implements IExpressionListener {
-
- List added = new ArrayList();
- List removed = new ArrayList();
- List changed = new ArrayList();
+
+ List<IExpression> added = new ArrayList<IExpression>();
+ List<IExpression> removed = new ArrayList<IExpression>();
+ List<IExpression> changed = new ArrayList<IExpression>();
int addedCallbacks = 0;
int removedCallbacks = 0;
int changedCallbacks = 0;
@@ -41,6 +41,7 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionListener#expressionAdded(org.eclipse.debug.core.model.IExpression)
*/
+ @Override
public void expressionAdded(IExpression expression) {
added.add(expression);
addedCallbacks++;
@@ -49,6 +50,7 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionListener#expressionRemoved(org.eclipse.debug.core.model.IExpression)
*/
+ @Override
public void expressionRemoved(IExpression expression) {
removed.add(expression);
removedCallbacks++;
@@ -57,18 +59,19 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionListener#expressionChanged(org.eclipse.debug.core.model.IExpression)
*/
+ @Override
public void expressionChanged(IExpression expression) {
changed.add(expression);
changedCallbacks++;
}
-
+
}
-
+
class MultiListener implements IExpressionsListener {
-
- List added = new ArrayList();
- List removed = new ArrayList();
- List changed = new ArrayList();
+
+ List<IExpression> added = new ArrayList<IExpression>();
+ List<IExpression> removed = new ArrayList<IExpression>();
+ List<IExpression> changed = new ArrayList<IExpression>();
int addedCallbacks = 0;
int removedCallbacks = 0;
int changedCallbacks = 0;
@@ -76,6 +79,7 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsAdded(IExpression[] expressions) {
for (int i = 0; i < expressions.length; i++) {
added.add(expressions[i]);
@@ -86,6 +90,7 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsRemoved(IExpression[] expressions) {
for (int i = 0; i < expressions.length; i++) {
removed.add(expressions[i]);
@@ -96,26 +101,28 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsChanged(IExpression[] expressions) {
for (int i = 0; i < expressions.length; i++) {
changed.add(expressions[i]);
}
changedCallbacks++;
}
-
+
}
-
+
class InsertMoveListener extends MultiListener implements IExpressionsListener2 {
- List moved = new ArrayList();
- List inserted = new ArrayList();
+ List<IExpression> moved = new ArrayList<IExpression>();
+ List<IExpression> inserted = new ArrayList<IExpression>();
int insertIndex = -1;
int movedCallbacks = 0;
int insertedCallbacks = 0;
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsMoved(org.eclipse.debug.core.model.IExpression[], int)
*/
+ @Override
public void expressionsMoved(IExpression[] expressions, int index) {
for (int i = 0; i < expressions.length; i++) {
moved.add(expressions[i]);
@@ -127,6 +134,7 @@ public class ExpressionManagerTests extends TestCase {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsInserted(org.eclipse.debug.core.model.IExpression[], int)
*/
+ @Override
public void expressionsInserted(IExpression[] expressions, int index) {
for (int i = 0; i < expressions.length; i++) {
inserted.add(expressions[i]);
@@ -134,30 +142,31 @@ public class ExpressionManagerTests extends TestCase {
insertedCallbacks++;
insertIndex = index;
}
-
+
}
/**
* Returns the expression manager.
- *
+ *
* @return expression manager
*/
protected IExpressionManager getManager() {
return DebugPlugin.getDefault().getExpressionManager();
}
-
+
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
+ @Override
protected void tearDown() throws Exception {
// remove all expressions from the manager
super.tearDown();
getManager().removeExpressions(getManager().getExpressions());
}
-
+
/**
* Returns the index of the given expression in the given list or -1 if not present.
- *
+ *
* @param expression candidate
* @param list list to search
* @return index or -1
@@ -170,7 +179,7 @@ public class ExpressionManagerTests extends TestCase {
}
return -1;
}
-
+
/**
* Add expressions and ensure proper call backs are received.
*/
@@ -205,7 +214,7 @@ public class ExpressionManagerTests extends TestCase {
manager.removeExpressionListener(multi);
}
}
-
+
/**
* Remove expressions and ensure proper call backs are received.
*/
@@ -245,7 +254,7 @@ public class ExpressionManagerTests extends TestCase {
manager.removeExpressionListener(multi);
}
}
-
+
/**
* Change expressions and ensure proper call backs are received.
*/
@@ -285,8 +294,8 @@ public class ExpressionManagerTests extends TestCase {
manager.removeExpressionListener(single);
manager.removeExpressionListener(multi);
}
- }
-
+ }
+
/**
* Insert expressions and ensure proper call backs are received.
*/
@@ -311,9 +320,9 @@ public class ExpressionManagerTests extends TestCase {
manager.addExpressionListener(single);
manager.addExpressionListener(multi);
manager.addExpressionListener(insert);
-
+
manager.insertExpressions(new IExpression[] {exp4, exp5}, exp2, true);
-
+
assertEquals(2, single.addedCallbacks);
assertEquals(2, single.added.size());
assertEquals(0, single.removedCallbacks);
@@ -328,7 +337,7 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(2, insert.inserted.size());
assertEquals(0, insert.inserted.indexOf(exp4));
assertEquals(1, insert.inserted.indexOf(exp5));
-
+
expressions = manager.getExpressions();
assertEquals("Wrong number of expressions", 5, expressions.length); //$NON-NLS-1$
assertEquals(0, indexOf(exp1, expressions));
@@ -336,14 +345,14 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(2, indexOf(exp5, expressions));
assertEquals(3, indexOf(exp2, expressions));
assertEquals(4, indexOf(exp3, expressions));
-
+
} finally {
manager.removeExpressionListener(single);
manager.removeExpressionListener(multi);
manager.removeExpressionListener(insert);
}
}
-
+
/**
* Insert expressions and ensure proper call backs are received.
*/
@@ -368,9 +377,9 @@ public class ExpressionManagerTests extends TestCase {
manager.addExpressionListener(single);
manager.addExpressionListener(multi);
manager.addExpressionListener(insert);
-
+
manager.insertExpressions(new IExpression[] {exp4, exp5}, exp2, false);
-
+
assertEquals(2, single.addedCallbacks);
assertEquals(2, single.added.size());
assertEquals(0, single.removedCallbacks);
@@ -385,7 +394,7 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(2, insert.inserted.size());
assertEquals(0, insert.inserted.indexOf(exp4));
assertEquals(1, insert.inserted.indexOf(exp5));
-
+
expressions = manager.getExpressions();
assertEquals("Wrong number of expressions", 5, expressions.length); //$NON-NLS-1$
assertEquals(0, indexOf(exp1, expressions));
@@ -393,14 +402,14 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(2, indexOf(exp4, expressions));
assertEquals(3, indexOf(exp5, expressions));
assertEquals(4, indexOf(exp3, expressions));
-
+
} finally {
manager.removeExpressionListener(single);
manager.removeExpressionListener(multi);
manager.removeExpressionListener(insert);
}
- }
-
+ }
+
/**
* Move expressions and ensure proper call backs are received.
*/
@@ -420,9 +429,9 @@ public class ExpressionManagerTests extends TestCase {
manager.addExpressionListener(single);
manager.addExpressionListener(multi);
manager.addExpressionListener(insert);
-
+
manager.moveExpressions(new IExpression[]{exp1,exp2}, exp5, true);
-
+
assertEquals(0, single.addedCallbacks);
assertEquals(0, single.removedCallbacks);
assertEquals(0, single.changedCallbacks);
@@ -435,7 +444,7 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(0, insert.moved.indexOf(exp1));
assertEquals(1, insert.moved.indexOf(exp2));
assertEquals(2, insert.insertIndex);
-
+
IExpression[] expressions = manager.getExpressions();
assertEquals("Wrong number of expressions", 5, expressions.length); //$NON-NLS-1$
assertEquals(0, indexOf(exp3, expressions));
@@ -443,14 +452,14 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(2, indexOf(exp1, expressions));
assertEquals(3, indexOf(exp2, expressions));
assertEquals(4, indexOf(exp5, expressions));
-
+
} finally {
manager.removeExpressionListener(single);
manager.removeExpressionListener(multi);
manager.removeExpressionListener(insert);
}
}
-
+
/**
* Move expressions and ensure proper call backs are received.
*/
@@ -470,9 +479,9 @@ public class ExpressionManagerTests extends TestCase {
manager.addExpressionListener(single);
manager.addExpressionListener(multi);
manager.addExpressionListener(insert);
-
+
manager.moveExpressions(new IExpression[]{exp1,exp2}, exp3, false);
-
+
assertEquals(0, single.addedCallbacks);
assertEquals(0, single.removedCallbacks);
assertEquals(0, single.changedCallbacks);
@@ -485,7 +494,7 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(0, insert.moved.indexOf(exp1));
assertEquals(1, insert.moved.indexOf(exp2));
assertEquals(1, insert.insertIndex);
-
+
IExpression[] expressions = manager.getExpressions();
assertEquals("Wrong number of expressions", 5, expressions.length); //$NON-NLS-1$
assertEquals(0, indexOf(exp3, expressions));
@@ -493,14 +502,14 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(2, indexOf(exp2, expressions));
assertEquals(3, indexOf(exp4, expressions));
assertEquals(4, indexOf(exp5, expressions));
-
+
} finally {
manager.removeExpressionListener(single);
manager.removeExpressionListener(multi);
manager.removeExpressionListener(insert);
}
- }
-
+ }
+
/**
* Test persist and restore of expressions
*/
@@ -513,7 +522,7 @@ public class ExpressionManagerTests extends TestCase {
IWatchExpression exp5 = manager.newWatchExpression("exp5"); //$NON-NLS-1$
manager.addExpressions(new IExpression[]{exp1, exp2, exp3, exp4, exp5});
manager.storeWatchExpressions();
-
+
// create a new manager that will restore the expressions
ExpressionManager manager2 = new ExpressionManager();
IExpression[] expressions = manager2.getExpressions();
@@ -524,16 +533,17 @@ public class ExpressionManagerTests extends TestCase {
assertEquals("exp4", expressions[3].getExpressionText()); //$NON-NLS-1$
assertEquals("exp5", expressions[4].getExpressionText()); //$NON-NLS-1$
}
-
+
/**
* Tests concurrent access to expressions.
- *
+ *
* @throws InterruptedException
*/
public void testConcurrentAccess() throws InterruptedException {
final boolean[] done = new boolean[]{false};
final Exception[] ex = new Exception[]{null};
Runnable add = new Runnable() {
+ @Override
public void run() {
try {
for (int i = 0; i < 1000; i++) {
@@ -546,6 +556,7 @@ public class ExpressionManagerTests extends TestCase {
}
};
Runnable remove = new Runnable() {
+ @Override
public void run() {
try {
do {
@@ -565,5 +576,5 @@ public class ExpressionManagerTests extends TestCase {
assertEquals(0, getManager().getExpressions().length);
assertNull(ex[0]);
}
-
+
}
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
index 6315b43f1..b8feaa035 100644
--- 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
@@ -22,6 +22,7 @@ public class StatusHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
return null;
}
diff --git a/org.eclipse.debug.ui/.classpath b/org.eclipse.debug.ui/.classpath
index 95b3cfac3..37819fca2 100644
--- a/org.eclipse.debug.ui/.classpath
+++ b/org.eclipse.debug.ui/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="ui"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="ui"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.debug.ui/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.debug.ui/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..e78e0ef8a 100644
--- a/org.eclipse.debug.ui/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.debug.ui/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=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
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.debug.ui/META-INF/MANIFEST.MF b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
index b069c2af8..df34e68a6 100644
--- a/org.eclipse.debug.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.debug.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.debug.ui; singleton:=true
-Bundle-Version: 3.9.100.qualifier
+Bundle-Version: 3.10.0.qualifier
Bundle-Activator: org.eclipse.debug.internal.ui.DebugUIPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -73,11 +73,11 @@ Export-Package: org.eclipse.debug.internal.ui;
org.eclipse.debug.ui.sourcelookup,
org.eclipse.debug.ui.stringsubstitution
Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.variables;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.variables;bundle-version="[3.2.800,4.0.0)",
org.eclipse.ui;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.ui.console;bundle-version="[3.4.0,4.0.0)",
+ org.eclipse.ui.console;bundle-version="[3.5.300,4.0.0)",
org.eclipse.help;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.7.0,4.0.0)";visibility:=reexport,
+ org.eclipse.debug.core;bundle-version="[3.9.0,4.0.0)";visibility:=reexport,
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.ui.ide;bundle-version="[3.5.0,4.0.0)",
@@ -89,4 +89,4 @@ Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Import-Package: com.ibm.icu.text,
org.eclipse.ui.forms.widgets
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/org.eclipse.debug.ui/pom.xml b/org.eclipse.debug.ui/pom.xml
index 03457df19..b3468fbfb 100644
--- a/org.eclipse.debug.ui/pom.xml
+++ b/org.eclipse.debug.ui/pom.xml
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.debug</groupId>
<artifactId>org.eclipse.debug.ui</artifactId>
- <version>3.9.100-SNAPSHOT</version>
+ <version>3.10.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java
index 38f483cee..c79039ec2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugCheckboxSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,8 +61,9 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#initializeControls()
*/
+ @Override
protected void initializeControls() {
- List selectedElements = getInitialElementSelections();
+ List<?> selectedElements = getInitialElementSelections();
if (selectedElements != null && !selectedElements.isEmpty()){
getCheckBoxTableViewer().setCheckedElements(selectedElements.toArray());
getCheckBoxTableViewer().setSelection(StructuredSelection.EMPTY);
@@ -73,6 +74,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#createViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected StructuredViewer createViewer(Composite parent){
//by default return a checkbox table viewer
Table table = new Table(parent, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
@@ -86,6 +88,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
+ @Override
protected void addViewerListeners(StructuredViewer viewer) {
getCheckBoxTableViewer().addCheckStateListener(new DefaultCheckboxListener());
}
@@ -96,6 +99,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
*
*/
private class DefaultCheckboxListener implements ICheckStateListener{
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
getButton(IDialogConstants.OK_ID).setEnabled(isValid());
}
@@ -104,6 +108,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.AbstractDebugSelectionDialog#isValid()
*/
+ @Override
protected boolean isValid() {
return getCheckBoxTableViewer().getCheckedElements().length > 0;
}
@@ -111,6 +116,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
Object[] elements = getCheckBoxTableViewer().getCheckedElements();
setResult(Arrays.asList(elements));
@@ -120,6 +126,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addCustomFooterControls(Composite parent) {
if (fShowSelectButtons){
Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL);
@@ -127,6 +134,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
gd.horizontalAlignment = SWT.END;
Button button = SWTFactory.createPushButton(comp, DebugUIMessages.AbstractDebugCheckboxSelectionDialog_0, null);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
getCheckBoxTableViewer().setAllChecked(true);
getButton(IDialogConstants.OK_ID).setEnabled(isValid());
@@ -134,6 +142,7 @@ public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebug
});
button = SWTFactory.createPushButton(comp, DebugUIMessages.AbstractDebugCheckboxSelectionDialog_1, null);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
getCheckBoxTableViewer().setAllChecked(false);
getButton(IDialogConstants.OK_ID).setEnabled(isValid());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
index 068772088..9910e0c4e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugListSelectionDialog.java
@@ -45,6 +45,7 @@ public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSele
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.AbstractDebugSelectionDialog#createViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected StructuredViewer createViewer(Composite parent){
//by default return a table viewer
fListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
@@ -57,13 +58,16 @@ public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSele
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
+ @Override
protected void addViewerListeners(StructuredViewer viewer) {
viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
getButton(IDialogConstants.OK_ID).setEnabled(isValid());
}
});
viewer.addDoubleClickListener(new IDoubleClickListener(){
+ @Override
public void doubleClick(DoubleClickEvent event) {
if (isValid()){
okPressed();
@@ -75,6 +79,7 @@ public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSele
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.AbstractDebugSelectionDialog#isValid()
*/
+ @Override
protected boolean isValid() {
if(fListViewer != null) {
ISelection sel = fListViewer.getSelection();
@@ -88,7 +93,8 @@ public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSele
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
- protected void okPressed() {
+ @Override
+ protected void okPressed() {
ISelection selection = fViewer.getSelection();
if (selection instanceof IStructuredSelection) {
setResult(((IStructuredSelection) selection).toList());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java
index e105846d1..fcbe5bd16 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/AbstractDebugSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -155,6 +155,7 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite comp = (Composite) super.createContents(parent);
initializeControls();
@@ -164,6 +165,7 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
initializeDialogUnits(parent);
Composite comp = (Composite) super.createDialogArea(parent);
@@ -180,7 +182,7 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
fViewer.setLabelProvider(getLabelProvider());
fViewer.setContentProvider(getContentProvider());
fViewer.setInput(getViewerInput());
- List selectedElements = getInitialElementSelections();
+ List<?> selectedElements = getInitialElementSelections();
if (selectedElements != null && !selectedElements.isEmpty()){
fViewer.setSelection(new StructuredSelection(selectedElements));
}
@@ -204,6 +206,7 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings()
*/
+ @Override
protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsId());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java
index 6f8b99ebc..91b5a2a07 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/BreakpointImageProvider.java
@@ -29,6 +29,7 @@ public class BreakpointImageProvider implements IAnnotationImageProvider {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
*/
+ @Override
public Image getManagedImage(Annotation annotation) {
if (annotation instanceof MarkerAnnotation) {
IMarker marker = ((MarkerAnnotation)annotation).getMarker();
@@ -44,12 +45,14 @@ public class BreakpointImageProvider implements IAnnotationImageProvider {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
*/
+ @Override
public String getImageDescriptorId(Annotation annotation) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
*/
+ @Override
public ImageDescriptor getImageDescriptor(String imageDescritporId) {
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
index a09ae6d0b..c1255ac30 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.debug.internal.ui;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.swt.graphics.Color;
@@ -36,10 +35,10 @@ public class ColorManager {
return fgColorManager;
}
- protected Map fColorTable= new HashMap(10);
+ protected Map<RGB, Color> fColorTable = new HashMap<RGB, Color>(10);
public Color getColor(RGB rgb) {
- Color color= (Color) fColorTable.get(rgb);
+ Color color= fColorTable.get(rgb);
if (color == null) {
color= new Color(Display.getCurrent(), rgb);
fColorTable.put(rgb, color);
@@ -48,9 +47,9 @@ public class ColorManager {
}
public void dispose() {
- Iterator e= fColorTable.values().iterator();
- while (e.hasNext())
- ((Color) e.next()).dispose();
+ for (Color color : fColorTable.values()) {
+ color.dispose();
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java
index e43235ce7..53cb70276 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/CompositeDebugImageDescriptor.java
@@ -46,6 +46,7 @@ public class CompositeDebugImageDescriptor extends CompositeImageDescriptor {
/**
* @see CompositeImageDescriptor#getSize()
*/
+ @Override
protected Point getSize() {
if (fSize == null) {
ImageData data= getBaseImage().getImageData();
@@ -57,6 +58,7 @@ public class CompositeDebugImageDescriptor extends CompositeImageDescriptor {
/**
* @see Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
if (!(object instanceof CompositeDebugImageDescriptor)){
return false;
@@ -68,6 +70,7 @@ public class CompositeDebugImageDescriptor extends CompositeImageDescriptor {
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
return getBaseImage().hashCode() | getFlags();
}
@@ -75,6 +78,7 @@ public class CompositeDebugImageDescriptor extends CompositeImageDescriptor {
/**
* @see CompositeImageDescriptor#drawCompositeImage(int, int)
*/
+ @Override
protected void drawCompositeImage(int width, int height) {
ImageData bg= getBaseImage().getImageData();
if (bg == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
index 39b92de65..37419aadb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugModelPropertyTester.java
@@ -38,6 +38,7 @@ public class DebugModelPropertyTester extends PropertyTester {
/* (non-Javadoc)
* @see org.eclipse.core.expressions.PropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (MODEL_TYPE_PROPERTY.equals(property)){
IDebugTarget target = null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
index 12f0af24b..028ecc353 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPerspectiveFactory.java
@@ -25,6 +25,7 @@ public class DebugPerspectiveFactory implements IPerspectiveFactory {
/**
* @see IPerspectiveFactory#createInitialLayout(IPageLayout)
*/
+ @Override
public void createInitialLayout(IPageLayout layout) {
IFolderLayout consoleFolder = layout.createFolder(IInternalDebugUIConstants.ID_CONSOLE_FOLDER_VIEW, IPageLayout.BOTTOM, (float)0.75, layout.getEditorArea());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
index f44a5243e..49b09b5bf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIAdapterFactory.java
@@ -25,6 +25,7 @@ public class DebugUIAdapterFactory implements IAdapterFactory {
/**
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(Object, Class)
*/
+ @Override
public Object getAdapter(Object obj, Class adapterType) {
if (adapterType.isInstance(obj)) {
return obj;
@@ -54,6 +55,7 @@ public class DebugUIAdapterFactory implements IAdapterFactory {
/**
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
+ @Override
public Class[] getAdapterList() {
return new Class[] {IPersistableElement.class, IWorkbenchAdapter.class, IWorkbenchAdapter2.class};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index 0d3679b71..541a80d46 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -19,7 +19,6 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.Set;
import javax.xml.parsers.DocumentBuilder;
@@ -216,7 +215,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
*
* @since 3.3
*/
- private Set fSaveParticipants = new HashSet();
+ private Set<ISaveParticipant> fSaveParticipants = new HashSet<ISaveParticipant>();
/**
* Theme listener.
@@ -240,11 +239,13 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
// Allow the user to terminate the dummy launch as a means to
// cancel the launch while waiting for a build to finish.
- public boolean canTerminate() {
+ @Override
+ public boolean canTerminate() {
return true;
}
- public void terminate() throws DebugException {
+ @Override
+ public void terminate() throws DebugException {
fJob.cancel();
}
}
@@ -398,6 +399,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
final Object [] ret = new Object[1];
final CoreException [] exc = new CoreException[1];
BusyIndicator.showWhile(null, new Runnable() {
+ @Override
public void run() {
try {
ret[0] = element.createExecutableExtension(classAttribute);
@@ -415,6 +417,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
/**
* @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry()
*/
+ @Override
protected ImageRegistry createImageRegistry() {
return DebugPluginImages.initializeImageRegistry();
}
@@ -422,6 +425,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
try {
if (fProcessConsoleManager != null) {
@@ -463,8 +467,9 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
ResourcesPlugin.getWorkspace().removeSaveParticipant(getUniqueIdentifier());
if (fThemeListener != null) {
- if (PlatformUI.isWorkbenchRunning())
+ if (PlatformUI.isWorkbenchRunning()) {
PlatformUI.getWorkbench().getThemeManager().removePropertyChangeListener(fThemeListener);
+ }
fThemeListener= null;
}
@@ -499,13 +504,15 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
- Hashtable props = new Hashtable(2);
+ Hashtable<String, String> props = new Hashtable<String, String>(2);
props.put(org.eclipse.osgi.service.debug.DebugOptions.LISTENER_SYMBOLICNAME, getUniqueIdentifier());
context.registerService(DebugOptionsListener.class.getName(), this, props);
ResourcesPlugin.getWorkspace().addSaveParticipant(getUniqueIdentifier(),
new ISaveParticipant() {
+ @Override
public void saving(ISaveContext saveContext) throws CoreException {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(getUniqueIdentifier());
if(node != null) {
@@ -515,23 +522,26 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
log(e);
}
}
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).saving(saveContext);
+ for (ISaveParticipant sp : fSaveParticipants) {
+ sp.saving(saveContext);
}
}
+ @Override
public void rollback(ISaveContext saveContext) {
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).rollback(saveContext);
+ for (ISaveParticipant sp : fSaveParticipants) {
+ sp.rollback(saveContext);
}
}
+ @Override
public void prepareToSave(ISaveContext saveContext) throws CoreException {
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).prepareToSave(saveContext);
+ for (ISaveParticipant sp : fSaveParticipants) {
+ sp.prepareToSave(saveContext);
}
}
+ @Override
public void doneSaving(ISaveContext saveContext) {
- for(Iterator iter = fSaveParticipants.iterator(); iter.hasNext();) {
- ((ISaveParticipant)iter.next()).doneSaving(saveContext);
+ for (ISaveParticipant sp : fSaveParticipants) {
+ sp.doneSaving(saveContext);
}
}
});
@@ -562,9 +572,11 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
if (PlatformUI.isWorkbenchRunning()) {
fThemeListener= new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
- if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty()))
+ if (IThemeManager.CHANGE_CURRENT_THEME.equals(event.getProperty())) {
DebugUIPreferenceInitializer.setThemeBasedPreferences(getPreferenceStore(), true);
+ }
}
};
PlatformUI.getWorkbench().getThemeManager().addPropertyChangeListener(fThemeListener);
@@ -573,6 +585,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
// do the asynchronous exec last - see bug 209920
getStandardDisplay().asyncExec(
new Runnable() {
+ @Override
public void run() {
//initialize the selected resource `
SelectedResourceManager.getDefault();
@@ -585,6 +598,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
/* (non-Javadoc)
* @see org.eclipse.osgi.service.debug.DebugOptionsListener#optionsChanged(org.eclipse.osgi.service.debug.DebugOptions)
*/
+ @Override
public void optionsChanged(DebugOptions options) {
fgDebugTrace = options.newDebugTrace(getUniqueIdentifier());
DEBUG = options.getBooleanOption(DEBUG_FLAG, false);
@@ -740,7 +754,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
* @since 3.3
*
*/
- public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, Set reservednames, IStatus status, boolean setDefaults) {
+ public static int openLaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration configuration, String groupIdentifier, Set<String> reservednames, IStatus status, boolean setDefaults) {
LaunchGroupExtension group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier);
if (group != null) {
LaunchConfigurationPropertiesDialog dialog = new LaunchConfigurationPropertiesDialog(shell, configuration, group, reservednames);
@@ -783,6 +797,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
* @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
* of resources that are only involved in the current launch, no longer the entire workspace
*/
+ @Deprecated
protected static boolean saveAllEditors(boolean confirm) {
if (getActiveWorkbenchWindow() == null) {
return false;
@@ -798,6 +813,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
* @deprecated this method is no longer to be used. It is an artifact from 2.0, and all saving is now done with the
* launch delegate <code>LaunchConfigurationDelegate</code>
*/
+ @Deprecated
public static boolean saveAndBuild() {
boolean status = true;
String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
@@ -821,6 +837,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
private static boolean doBuild() {
try {
PlatformUI.getWorkbench().getProgressService().busyCursorWhile(new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException {
try {
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
@@ -897,6 +914,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
*
* @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchAdded(ILaunch launch) {
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
initializeLaunchListeners();
@@ -929,11 +947,13 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
/**
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchChanged(ILaunch launch) {}
/**
* @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchRemoved(ILaunch launch) {}
/**
@@ -990,6 +1010,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
* @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
* of resources that are only involved in the current launch, no longer the entire workspace
*/
+ @Deprecated
public static boolean preLaunchSave() {
String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
if (saveDirty.equals(MessageDialogWithToggle.NEVER)) {
@@ -1056,6 +1077,8 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
case IDialogConstants.NO_ID:
wait = true;
break;
+ default:
+ break;
}
} else if (waitForBuild.equals(MessageDialogWithToggle.ALWAYS)) {
wait = true;
@@ -1066,6 +1089,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
IWorkbench workbench = DebugUIPlugin.getDefault().getWorkbench();
IProgressService progressService = workbench.getProgressService();
final IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException {
/* Setup progress monitor
* - Waiting for jobs to finish (2)
@@ -1096,6 +1120,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
}
} else {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException {
/* Setup progress monitor
* - Build & launch (1) */
@@ -1172,6 +1197,8 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
case IDialogConstants.NO_ID:
wait = false;
break;
+ default:
+ break;
}
}
else {
@@ -1180,6 +1207,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
}
final boolean waitInJob = wait;
Job job = new Job(MessageFormat.format(DebugUIMessages.DebugUIPlugin_25, new Object[] {configuration.getName()})) {
+ @Override
public IStatus run(final IProgressMonitor monitor) {
/* Setup progress monitor
* - Waiting for jobs to finish (2)
@@ -1194,12 +1222,18 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
final ILaunch pendingLaunch = new PendingLaunch(workingCopy, mode, this);
DebugPlugin.getDefault().getLaunchManager().addLaunch(pendingLaunch);
IJobChangeListener listener= new IJobChangeListener() {
- public void sleeping(IJobChangeEvent event) {}
- public void scheduled(IJobChangeEvent event) {}
- public void running(IJobChangeEvent event) {}
- public void awake(IJobChangeEvent event) {}
- public void aboutToRun(IJobChangeEvent event) {}
- public void done(IJobChangeEvent event) {
+ @Override
+ public void sleeping(IJobChangeEvent event) {}
+ @Override
+ public void scheduled(IJobChangeEvent event) {}
+ @Override
+ public void running(IJobChangeEvent event) {}
+ @Override
+ public void awake(IJobChangeEvent event) {}
+ @Override
+ public void aboutToRun(IJobChangeEvent event) {}
+ @Override
+ public void done(IJobChangeEvent event) {
DebugPlugin dp = DebugPlugin.getDefault();
if (dp != null) {
dp.getLaunchManager().removeLaunch(pendingLaunch);
@@ -1232,6 +1266,7 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
return status;
}
Runnable r = new Runnable() {
+ @Override
public void run() {
DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(configuration), group.getIdentifier(), status);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
index b575f8323..7a51a3239 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPreferenceInitializer.java
@@ -31,6 +31,7 @@ public class DebugUIPreferenceInitializer extends AbstractPreferenceInitializer
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore prefs = DebugUIPlugin.getDefault().getPreferenceStore();
// Debug PreferencePage
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
index b3ebe63a9..7a80d996a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DefaultLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@ package org.eclipse.debug.internal.ui;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.resources.IMarker;
@@ -61,11 +60,12 @@ public class DefaultLabelProvider implements ILabelProvider {
/**
* Maps image descriptors to images.
*/
- private Map fImages = new HashMap();
+ private Map<ImageDescriptor, Image> fImages = new HashMap<ImageDescriptor, Image>();
/**
* @see ILabelProvider#getImage(Object)
*/
+ @Override
public Image getImage(Object element) {
String key= getImageKey(element);
if (key == null && element instanceof ILaunch) {
@@ -95,7 +95,7 @@ public class DefaultLabelProvider implements ILabelProvider {
* @return image or <code>null</code>
*/
private Image getImage(ImageDescriptor descriptor) {
- Image image = (Image) fImages.get(descriptor);
+ Image image = fImages.get(descriptor);
if (image != null) {
return image;
}
@@ -197,6 +197,7 @@ public class DefaultLabelProvider implements ILabelProvider {
/**
* @see ILabelProvider#getText(Object)
*/
+ @Override
public String getText(Object element) {
StringBuffer label= new StringBuffer();
try {
@@ -254,7 +255,7 @@ public class DefaultLabelProvider implements ILabelProvider {
if (element instanceof IProcess) {
IProcess process = (IProcess)element;
int exit = process.getExitValue();
- terminatedMessage= MessageFormat.format(DebugUIMessages.DefaultLabelProvider_16, new String[]{new Integer(exit).toString()});
+ terminatedMessage = MessageFormat.format(DebugUIMessages.DefaultLabelProvider_16, new Object[] { new Integer(exit).toString() });
} else {
terminatedMessage= DebugUIMessages.DefaultLabelProvider_1;
}
@@ -287,7 +288,7 @@ public class DefaultLabelProvider implements ILabelProvider {
if (breakpoint instanceof ILineBreakpoint) {
try {
int lineNumber = ((ILineBreakpoint)breakpoint).getLineNumber();
- label.append(MessageFormat.format(DebugUIMessages.DefaultLabelProvider_17, new String[]{Integer.toString(lineNumber)}));
+ label.append(MessageFormat.format(DebugUIMessages.DefaultLabelProvider_17, new Object[] { Integer.toString(lineNumber) }));
} catch (CoreException e) {
}
}
@@ -475,16 +476,16 @@ public class DefaultLabelProvider implements ILabelProvider {
/**
* @see IBaseLabelProvider#addListener(ILabelProviderListener)
*/
+ @Override
public void addListener(ILabelProviderListener listener) {
}
/**
* @see IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
- Iterator iterator = fImages.values().iterator();
- while (iterator.hasNext()) {
- Image image = (Image) iterator.next();
+ for (Image image : fImages.values()) {
image.dispose();
}
fImages.clear();
@@ -493,6 +494,7 @@ public class DefaultLabelProvider implements ILabelProvider {
/**
* @see IBaseLabelProvider#isLabelProperty(Object, String)
*/
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@@ -500,6 +502,7 @@ public class DefaultLabelProvider implements ILabelProvider {
/**
* @see IBaseLabelProvider#removeListener(ILabelProviderListener)
*/
+ @Override
public void removeListener(ILabelProviderListener listener) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
index 8f3425e57..994ca765a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.debug.internal.ui;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.resources.IMarker;
@@ -35,6 +34,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.IInstructionPointerPresentation;
import org.eclipse.debug.ui.IValueDetailListener;
import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -59,15 +59,16 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
* A mapping of attribute ids to their values
* @see IDebugModelPresentation#setAttribute
*/
- private HashMap fAttributes= new HashMap(3);
+ private HashMap<String, Object> fAttributes = new HashMap<String, Object>(3);
/**
* A table of label providers keyed by debug model identifiers.
*/
- private HashMap fLabelProviders= new HashMap(5);
+ private HashMap<String, IDebugModelPresentation> fLabelProviders = new HashMap<String, IDebugModelPresentation>(5);
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugEditorPresentation#removeAnnotations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IThread)
*/
+ @Override
public void removeAnnotations(IEditorPart editorPart, IThread thread) {
IDebugModelPresentation presentation = getConfiguredPresentation(thread);
if (presentation instanceof IDebugEditorPresentation) {
@@ -78,6 +79,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugEditorPresentation#addAnnotations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public boolean addAnnotations(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getConfiguredPresentation(frame);
if (presentation instanceof IDebugEditorPresentation) {
@@ -114,10 +116,10 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
*
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
+ @Override
public void addListener(ILabelProviderListener listener) {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).addListener(listener);
+ for (ILabelProvider p : fLabelProviders.values()) {
+ p.addListener(listener);
}
}
@@ -126,16 +128,17 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
*
* @see IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).dispose();
+ for (ILabelProvider p : fLabelProviders.values()) {
+ p.dispose();
}
}
/**
* @see IDebugModelPresentation#getImage(Object)
*/
+ @Override
public Image getImage(Object item) {
// Attempt to delegate
IDebugModelPresentation lp= getConfiguredPresentation(item);
@@ -152,7 +155,8 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/**
* @see IDebugModelPresentation#getText(Object)
*/
- public String getText(Object item) {
+ @Override
+ public String getText(Object item) {
IDebugModelPresentation lp= getConfiguredPresentation(item);
if (lp != null) {
return lp.getText(item);
@@ -163,6 +167,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ISourcePresentation#getEditorInput(java.lang.Object)
*/
+ @Override
public IEditorInput getEditorInput(Object item) {
IDebugModelPresentation lp= getConfiguredPresentation(item);
if (lp != null) {
@@ -174,6 +179,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ISourcePresentation#getEditorId(org.eclipse.ui.IEditorInput, java.lang.Object)
*/
+ @Override
public String getEditorId(IEditorInput input, Object objectInput) {
IDebugModelPresentation lp= getConfiguredPresentation(objectInput);
if (lp != null) {
@@ -200,6 +206,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugModelPresentation#computeDetail(org.eclipse.debug.core.model.IValue, org.eclipse.debug.ui.IValueDetailListener)
*/
+ @Override
public void computeDetail(IValue value, IValueDetailListener listener) {
IDebugModelPresentation lp= getConfiguredPresentation(value);
if (lp != null) {
@@ -214,10 +221,10 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
*
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
+ @Override
public void removeListener(ILabelProviderListener listener) {
- Iterator i= getLabelProviders().values().iterator();
- while (i.hasNext()) {
- ((ILabelProvider) i.next()).removeListener(listener);
+ for (ILabelProvider p : fLabelProviders.values()) {
+ p.removeListener(listener);
}
}
@@ -226,6 +233,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
*
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean isLabelProperty(Object element, String property) {
if (element instanceof IDebugElement) {
IDebugModelPresentation lp= getConfiguredPresentation(element);
@@ -267,20 +275,20 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
* of nothing is registered for the id.
*/
public IDebugModelPresentation getPresentation(String id) {
- return (IDebugModelPresentation) getLabelProviders().get(id);
+ return getLabelProviders().get(id);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugModelPresentation#setAttribute(java.lang.String, java.lang.Object)
*/
+ @Override
public void setAttribute(String id, Object value) {
if (value == null) {
return;
}
basicSetAttribute(id, value);
- Iterator presentations = fLabelProviders.values().iterator();
- while (presentations.hasNext()) {
- ((IDebugModelPresentation)presentations.next()).setAttribute(id, value);
+ for (IDebugModelPresentation p : fLabelProviders.values()) {
+ p.setAttribute(id, value);
}
}
@@ -291,7 +299,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
* @param value value
*/
protected void basicSetAttribute(String id, Object value) {
- getAttributes().put(id, value);
+ fAttributes.put(id, value);
}
/**
@@ -309,7 +317,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
* Returns the raw attribute map
* @return the raw attribute map
*/
- public HashMap getAttributes() {
+ public HashMap<String, Object> getAttributes() {
return fAttributes;
}
@@ -319,18 +327,24 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
* @return a copy of the attribute map for this presentation
* @since 3.0
*/
- public Map getAttributeMap() {
- return (Map) getAttributes().clone();
+ public Map<String, Object> getAttributeMap() {
+ return new HashMap<String, Object>(fAttributes);
}
- protected HashMap getLabelProviders() {
+ /**
+ * Returns the live-list of registered {@link ILabelProvider}s
+ *
+ * @return the live list of label providers
+ */
+ protected HashMap<String, IDebugModelPresentation> getLabelProviders() {
return fLabelProviders;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
*/
- public Color getForeground(Object element) {
+ @Override
+ public Color getForeground(Object element) {
IDebugModelPresentation presentation = getConfiguredPresentation(element);
if (presentation instanceof IColorProvider) {
IColorProvider colorProvider = (IColorProvider) presentation;
@@ -342,7 +356,8 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
*/
- public Color getBackground(Object element) {
+ @Override
+ public Color getBackground(Object element) {
IDebugModelPresentation presentation = getConfiguredPresentation(element);
if (presentation instanceof IColorProvider) {
IColorProvider colorProvider = (IColorProvider) presentation;
@@ -354,7 +369,8 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
*/
- public Font getFont(Object element) {
+ @Override
+ public Font getFont(Object element) {
IDebugModelPresentation presentation = getConfiguredPresentation(element);
if (presentation instanceof IFontProvider) {
IFontProvider fontProvider = (IFontProvider) presentation;
@@ -366,6 +382,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerAnnotation(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public Annotation getInstructionPointerAnnotation(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getConfiguredPresentation(frame);
Annotation annotation = null;
@@ -431,6 +448,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getMarkerAnnotationSpecificationId(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public String getInstructionPointerAnnotationType(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getConfiguredPresentation(frame);
if (presentation instanceof IInstructionPointerPresentation) {
@@ -442,6 +460,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerImage(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public Image getInstructionPointerImage(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getConfiguredPresentation(frame);
if (presentation instanceof IInstructionPointerPresentation) {
@@ -453,6 +472,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerText(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public String getInstructionPointerText(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getConfiguredPresentation(frame);
if (presentation instanceof IInstructionPointerPresentation) {
@@ -464,6 +484,7 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugModelPresentationExtension#requiresUIThread(java.lang.Object)
*/
+ @Override
public boolean requiresUIThread(Object element) {
IDebugModelPresentation presentation = getConfiguredPresentation(element);
if (presentation == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
index 6ca45c424..8d377a251 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DynamicInstructionPointerAnnotation.java
@@ -39,6 +39,7 @@ public class DynamicInstructionPointerAnnotation extends Annotation {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object other) {
if (other instanceof DynamicInstructionPointerAnnotation) {
return getStackFrame().equals(((DynamicInstructionPointerAnnotation)other).getStackFrame());
@@ -49,6 +50,7 @@ public class DynamicInstructionPointerAnnotation extends Annotation {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getStackFrame().hashCode();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
index a6e697a96..df92d2657 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IInternalDebugUIConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,8 @@ public interface IInternalDebugUIConstants {
/**
* @deprecated Use IDebugUIConstants#IMG_LCL_ADD
*/
- public static final String IMG_LCL_MONITOR_EXPRESSION= IDebugUIConstants.IMG_LCL_ADD;
+ @Deprecated
+ public static final String IMG_LCL_MONITOR_EXPRESSION= IDebugUIConstants.IMG_LCL_ADD;
public static final String IMG_LCL_REMOVE_MEMORY= "IMG_LCL_REMOVE_MEMORY"; //$NON-NLS-1$
public static final String IMG_LCL_RESET_MEMORY= "IMG_LCL_RESET_MEMORY";//$NON-NLS-1$
public static final String IMG_LCL_COPY_VIEW_TO_CLIPBOARD = "IMG_LCL_COPY_VIEW_TO_CLIPBOARD"; //$NON-NLS-1$
@@ -361,7 +362,8 @@ public interface IInternalDebugUIConstants {
* @deprecated There is an API equivalent constant that should be used, see
* {@link IDebugUIConstants#BREAKPOINT_WORKINGSET_ID}
*/
- public static final String ID_BREAKPOINT_WORKINGSET = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$
+ @Deprecated
+ public static final String ID_BREAKPOINT_WORKINGSET = "org.eclipse.debug.ui.breakpointWorkingSet"; //$NON-NLS-1$
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
index 83e340315..e2d19e2c0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ImageDescriptorRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@ package org.eclipse.debug.internal.ui;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
import org.eclipse.core.runtime.Assert;
@@ -27,7 +26,7 @@ import org.eclipse.swt.widgets.Display;
*/
public class ImageDescriptorRegistry {
- private Map fRegistry= Collections.synchronizedMap(new HashMap(10));
+ private Map<ImageDescriptor, Image> fRegistry = Collections.synchronizedMap(new HashMap<ImageDescriptor, Image>(10));
private Display fDisplay;
/**
@@ -58,17 +57,20 @@ public class ImageDescriptorRegistry {
* if the image descriptor can't create the requested image.
*/
public Image get(ImageDescriptor descriptor) {
- if (descriptor == null)
+ if (descriptor == null) {
descriptor= ImageDescriptor.getMissingImageDescriptor();
+ }
- Image result= (Image)fRegistry.get(descriptor);
- if (result != null)
+ Image result= fRegistry.get(descriptor);
+ if (result != null) {
return result;
+ }
Assert.isTrue(fDisplay == DebugUIPlugin.getStandardDisplay(), DebugUIMessages.ImageDescriptorRegistry_0);
result= descriptor.createImage();
- if (result != null)
+ if (result != null) {
fRegistry.put(descriptor, result);
+ }
return result;
}
@@ -76,8 +78,7 @@ public class ImageDescriptorRegistry {
* Disposes all images managed by this registry.
*/
public void dispose() {
- for (Iterator iter= fRegistry.values().iterator(); iter.hasNext(); ) {
- Image image= (Image)iter.next();
+ for (Image image : fRegistry.values()) {
image.dispose();
}
fRegistry.clear();
@@ -85,9 +86,11 @@ public class ImageDescriptorRegistry {
private void hookDisplay() {
fDisplay.asyncExec(new Runnable() {
+ @Override
public void run() {
fDisplay.disposeExec(new Runnable() {
+ @Override
public void run() {
dispose();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
index e7ca30e7f..7a8216f25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerContext.java
@@ -52,6 +52,7 @@ public class InstructionPointerContext {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object other) {
if (other instanceof InstructionPointerContext) {
InstructionPointerContext otherContext = (InstructionPointerContext) other;
@@ -65,6 +66,7 @@ public class InstructionPointerContext {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getAnnotation().hashCode() + getEditor().hashCode();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java
index 93a5ef7ee..da3e4857c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerImageProvider.java
@@ -21,6 +21,7 @@ public class InstructionPointerImageProvider implements IAnnotationImageProvider
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getManagedImage(org.eclipse.jface.text.source.Annotation)
*/
+ @Override
public Image getManagedImage(Annotation annotation) {
return ((InstructionPointerAnnotation)annotation).getImage();
}
@@ -28,6 +29,7 @@ public class InstructionPointerImageProvider implements IAnnotationImageProvider
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptorId(org.eclipse.jface.text.source.Annotation)
*/
+ @Override
public String getImageDescriptorId(Annotation annotation) {
return null;
}
@@ -35,6 +37,7 @@ public class InstructionPointerImageProvider implements IAnnotationImageProvider
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IAnnotationImageProvider#getImageDescriptor(java.lang.String)
*/
+ @Override
public ImageDescriptor getImageDescriptor(String imageDescritporId) {
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
index 51a6ab472..19401b008 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/InstructionPointerManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,12 +50,12 @@ public class InstructionPointerManager{
/**
* Set containing all instruction pointer contexts this class manages
*/
- private Set fIPCSet = new HashSet();
+ private Set<InstructionPointerContext> fIPCSet = new HashSet<InstructionPointerContext>();
/**
* Maps ITextEditors to the set of instruction pointer contexts that are displayed in the editor
*/
- private Map fEditorMap = new HashMap();
+ private Map<ITextEditor, Set<InstructionPointerContext>> fEditorMap = new HashMap<ITextEditor, Set<InstructionPointerContext>>();
/**
* Part listener added to editors that contain annotations. Allows instruction pointer contexts to
@@ -142,9 +142,9 @@ public class InstructionPointerManager{
InstructionPointerContext ipc = new InstructionPointerContext(frame.getDebugTarget(), frame.getThread(), textEditor, annotation);
// Add the IPC to the set and map
- Set editorIPCs = (Set)fEditorMap.get(textEditor);
+ Set<InstructionPointerContext> editorIPCs = fEditorMap.get(textEditor);
if (editorIPCs == null){
- editorIPCs = new HashSet();
+ editorIPCs = new HashSet<InstructionPointerContext>();
fEditorMap.put(textEditor, editorIPCs);
} else {
editorIPCs.remove(ipc);
@@ -165,9 +165,9 @@ public class InstructionPointerManager{
*/
public void removeAnnotations(IDebugTarget debugTarget) {
synchronized (fIPCSet) {
- Iterator ipcIter = fIPCSet.iterator();
+ Iterator<InstructionPointerContext> ipcIter = fIPCSet.iterator();
while (ipcIter.hasNext()) {
- InstructionPointerContext currentIPC = (InstructionPointerContext) ipcIter.next();
+ InstructionPointerContext currentIPC = ipcIter.next();
if (currentIPC.getDebugTarget().equals(debugTarget)){
removeAnnotationFromModel(currentIPC);
ipcIter.remove();
@@ -183,9 +183,9 @@ public class InstructionPointerManager{
*/
public void removeAnnotations(IThread thread) {
synchronized (fIPCSet) {
- Iterator ipcIter = fIPCSet.iterator();
+ Iterator<InstructionPointerContext> ipcIter = fIPCSet.iterator();
while (ipcIter.hasNext()) {
- InstructionPointerContext currentIPC = (InstructionPointerContext) ipcIter.next();
+ InstructionPointerContext currentIPC = ipcIter.next();
if (currentIPC.getThread().equals(thread)){
removeAnnotationFromModel(currentIPC);
ipcIter.remove();
@@ -201,11 +201,11 @@ public class InstructionPointerManager{
*/
public void removeAnnotations(ITextEditor editor) {
synchronized (fIPCSet) {
- Set editorIPCs = (Set)fEditorMap.get(editor);
+ Set<InstructionPointerContext> editorIPCs = fEditorMap.get(editor);
if (editorIPCs != null){
- Iterator ipcIter = editorIPCs.iterator();
+ Iterator<InstructionPointerContext> ipcIter = editorIPCs.iterator();
while (ipcIter.hasNext()) {
- InstructionPointerContext currentIPC = (InstructionPointerContext) ipcIter.next();
+ InstructionPointerContext currentIPC = ipcIter.next();
removeAnnotationFromModel(currentIPC);
fIPCSet.remove(currentIPC);
}
@@ -218,7 +218,7 @@ public class InstructionPointerManager{
* Remove the given ipc from the mapping of editors.
*/
private void removeAnnotationFromEditorMapping(InstructionPointerContext ipc) {
- Set editorIPCs = (Set)fEditorMap.get(ipc.getEditor());
+ Set<InstructionPointerContext> editorIPCs = fEditorMap.get(ipc.getEditor());
if (editorIPCs != null){
editorIPCs.remove(ipc);
if (editorIPCs.isEmpty()){
@@ -288,16 +288,23 @@ public class InstructionPointerManager{
* the input containing instruction pointer annotations.
*/
class PartListener implements IPartListener2{
+ @Override
public void partActivated(IWorkbenchPartReference partRef) {}
+ @Override
public void partDeactivated(IWorkbenchPartReference partRef) {}
+ @Override
public void partHidden(IWorkbenchPartReference partRef) {}
+ @Override
public void partOpened(IWorkbenchPartReference partRef) {}
+ @Override
public void partVisible(IWorkbenchPartReference partRef) {}
+ @Override
public void partBroughtToTop(IWorkbenchPartReference partRef) {}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partClosed(IWorkbenchPartReference partRef) {
IWorkbenchPart part = partRef.getPart(false);
if (part instanceof ITextEditor){
@@ -309,6 +316,7 @@ public class InstructionPointerManager{
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partInputChanged(IWorkbenchPartReference partRef) {
IWorkbenchPart part = partRef.getPart(false);
if (part instanceof ITextEditor){
@@ -322,12 +330,15 @@ public class InstructionPointerManager{
*/
class PageListener implements IPageListener{
+ @Override
public void pageActivated(IWorkbenchPage page) {}
+ @Override
public void pageOpened(IWorkbenchPage page) {}
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
*/
+ @Override
public void pageClosed(IWorkbenchPage page) {
page.removePartListener(getPartListener());
page.getWorkbenchWindow().removePageListener(getPageListener());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
index fbede662f..ba0aaac3e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LaunchConfigurationTabExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@ public final class LaunchConfigurationTabExtension {
* The configuration element backing this proxy
*/
IConfigurationElement fElement = null;
- private Set fDelegates = null;
+ private Set<String> fDelegates = null;
/**
* Constructor
@@ -102,9 +102,9 @@ public final class LaunchConfigurationTabExtension {
* Returns a set of strings of the launch delegates that this tab contribution is associated with
* @return the set of strings of the associated launch delegates, which can be an empty collection, never <code>null</code>.
*/
- public Set getDelegateSet() {
+ public Set<String> getDelegateSet() {
if(fDelegates == null) {
- fDelegates = new HashSet();
+ fDelegates = new HashSet<String>();
IConfigurationElement[] children = fElement.getChildren(IConfigurationElementConstants.ASSOCIATED_DELEGATE);
String id = null;
for(int i = 0; i < children.length; i++) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
index 0ef0b2f4c..5337908f8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/LazyModelPresentation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,8 +12,8 @@ package org.eclipse.debug.internal.ui;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -31,9 +31,11 @@ import org.eclipse.debug.ui.IDebugEditorPresentation;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugModelPresentationExtension;
import org.eclipse.debug.ui.IInstructionPointerPresentation;
+import org.eclipse.debug.ui.ISourcePresentation;
import org.eclipse.debug.ui.IValueDetailListener;
import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
@@ -55,7 +57,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
* A temporary mapping of attribute ids to their values
* @see IDebugModelPresentation#setAttribute
*/
- protected HashMap fAttributes= new HashMap(3);
+ protected HashMap<String, Object> fAttributes = new HashMap<String, Object>(3);
/**
* The config element that defines the extension
@@ -82,6 +84,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugEditorPresentation#removeAnntations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IThread)
*/
+ @Override
public void removeAnnotations(IEditorPart editorPart, IThread thread) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IDebugEditorPresentation) {
@@ -92,6 +95,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugEditorPresentation#addAnnotations(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public boolean addAnnotations(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IDebugEditorPresentation) {
@@ -122,6 +126,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IDebugModelPresentation#getImage(Object)
*/
+ @Override
public Image getImage(Object element) {
initImageRegistry();
Image image = getPresentation().getImage(element);
@@ -179,6 +184,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IDebugModelPresentation#getText(Object)
*/
+ @Override
public String getText(Object element) {
if (!(element instanceof IndexedVariablePartition)) {
// Attempt to delegate
@@ -218,14 +224,15 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
* This allows this option to be set per view, for example.
*/
protected boolean showVariableTypeNames() {
- Boolean show= (Boolean) fAttributes.get(DISPLAY_VARIABLE_TYPE_NAMES);
- show= show == null ? Boolean.FALSE : show;
+ Boolean show = (Boolean) fAttributes.get(DISPLAY_VARIABLE_TYPE_NAMES);
+ show = show == null ? Boolean.FALSE : show;
return show.booleanValue();
}
/**
* @see IDebugModelPresentation#computeDetail(IValue, IValueDetailListener)
*/
+ @Override
public void computeDetail(IValue value, IValueDetailListener listener) {
getPresentation().computeDetail(value, listener);
}
@@ -233,6 +240,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see ISourcePresentation#getEditorInput(Object)
*/
+ @Override
public IEditorInput getEditorInput(Object element) {
return getPresentation().getEditorInput(element);
}
@@ -240,6 +248,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see ISourcePresentation#getEditorId(IEditorInput, Object)
*/
+ @Override
public String getEditorId(IEditorInput input, Object inputObject) {
return getPresentation().getEditorId(input, inputObject);
}
@@ -247,6 +256,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IBaseLabelProvider#addListener(ILabelProviderListener)
*/
+ @Override
public void addListener(ILabelProviderListener listener) {
if (fPresentation != null) {
getPresentation().addListener(listener);
@@ -257,6 +267,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
if (fPresentation != null) {
getPresentation().dispose();
@@ -267,6 +278,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IBaseLabelProvider#isLabelProperty(Object, String)
*/
+ @Override
public boolean isLabelProperty(Object element, String property) {
if (fPresentation != null) {
return getPresentation().isLabelProperty(element, property);
@@ -277,6 +289,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IBaseLabelProvider#removeListener(ILabelProviderListener)
*/
+ @Override
public void removeListener(ILabelProviderListener listener) {
if (fPresentation != null) {
getPresentation().removeListener(listener);
@@ -307,10 +320,8 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
tempPresentation.addListener((ILabelProviderListener)list[i]);
}
}
- Iterator keys= fAttributes.keySet().iterator();
- while (keys.hasNext()) {
- String key= (String)keys.next();
- tempPresentation.setAttribute(key, fAttributes.get(key));
+ for (Entry<String, Object> entry : fAttributes.entrySet()) {
+ tempPresentation.setAttribute(entry.getKey(), entry.getValue());
}
// Only assign to the instance variable after it's been configured. Otherwise,
// the synchronization is defeated (a thread could return the presentation before
@@ -327,6 +338,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/**
* @see IDebugModelPresentation#setAttribute(String, Object)
*/
+ @Override
public void setAttribute(String id, Object value) {
if (value == null) {
return;
@@ -373,22 +385,24 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
* @return a copy of the attributes in this model presentation
* @since 3.0
*/
- public Map getAttributeMap() {
- return (Map) fAttributes.clone();
+ public Map<String, Object> getAttributeMap() {
+ return new HashMap<String, Object>(fAttributes);
}
/**
* Returns the raw attribute map
+ *
* @return the raw attribute map
*/
- public Map getAttributes() {
+ public Map<String, Object> getAttributes() {
return fAttributes;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
*/
- public Color getForeground(Object element) {
+ @Override
+ public Color getForeground(Object element) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IColorProvider) {
IColorProvider colorProvider = (IColorProvider) presentation;
@@ -400,7 +414,8 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
*/
- public Color getBackground(Object element) {
+ @Override
+ public Color getBackground(Object element) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IColorProvider) {
IColorProvider colorProvider = (IColorProvider) presentation;
@@ -412,7 +427,8 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
*/
- public Font getFont(Object element) {
+ @Override
+ public Font getFont(Object element) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IFontProvider) {
IFontProvider fontProvider = (IFontProvider) presentation;
@@ -424,6 +440,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerAnnotation(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public Annotation getInstructionPointerAnnotation(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IInstructionPointerPresentation) {
@@ -436,6 +453,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getMarkerAnnotationSpecificationId(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public String getInstructionPointerAnnotationType(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IInstructionPointerPresentation) {
@@ -448,6 +466,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerImage(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public Image getInstructionPointerImage(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IInstructionPointerPresentation) {
@@ -460,6 +479,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IInstructionPointerPresentation#getInstructionPointerText(org.eclipse.ui.IEditorPart, org.eclipse.debug.core.model.IStackFrame)
*/
+ @Override
public String getInstructionPointerText(IEditorPart editorPart, IStackFrame frame) {
IDebugModelPresentation presentation = getPresentation();
if (presentation instanceof IInstructionPointerPresentation) {
@@ -472,6 +492,7 @@ public class LazyModelPresentation implements IDebugModelPresentation, IDebugEdi
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugModelPresentationExtension#requiresUIThread(java.lang.Object)
*/
+ @Override
public boolean requiresUIThread(Object element) {
if (!DebugPluginImages.isInitialized()) {
// need UI thread for breakpoint adornment and default images
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
index 640ec2f2a..d02ea8404 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/MultipleInputDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2012 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@ package org.eclipse.debug.internal.ui;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -48,10 +47,10 @@ public class MultipleInputDialog extends Dialog {
protected Composite panel;
- protected List fieldList = new ArrayList();
- protected List controlList = new ArrayList();
- protected List validators = new ArrayList();
- protected Map valueMap = new HashMap();
+ protected List<FieldSummary> fieldList = new ArrayList<FieldSummary>();
+ protected List<Text> controlList = new ArrayList<Text>();
+ protected List<Validator> validators = new ArrayList<Validator>();
+ protected Map<Object, String> valueMap = new HashMap<Object, String>();
private String title;
@@ -66,6 +65,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
if (title != null) {
@@ -77,6 +77,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createButtonBar(Composite parent) {
Control bar = super.createButtonBar(parent);
validateFields();
@@ -86,6 +87,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite)super.createDialogArea(parent);
container.setLayout(new GridLayout(2, false));
@@ -95,9 +97,7 @@ public class MultipleInputDialog extends Dialog {
GridLayout layout = new GridLayout(2, false);
panel.setLayout(layout);
panel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- for (Iterator i = fieldList.iterator(); i.hasNext();) {
- FieldSummary field = (FieldSummary)i.next();
+ for (FieldSummary field : fieldList) {
switch(field.type) {
case TEXT:
createTextField(field.name, field.initialValue, field.allowsEmpty);
@@ -111,6 +111,8 @@ public class MultipleInputDialog extends Dialog {
case MULTILINE_VARIABLE:
createMultilineVariablesField(field.name, field.initialValue, field.allowsEmpty);
break;
+ default:
+ break;
}
}
@@ -150,11 +152,13 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) {
validators.add(new Validator() {
+ @Override
public boolean validate() {
return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateFields();
}
@@ -191,12 +195,14 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) {
validators.add(new Validator() {
+ @Override
public boolean validate() {
return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateFields();
}
@@ -205,6 +211,7 @@ public class MultipleInputDialog extends Dialog {
Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_6, false);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setMessage(DebugUIMessages.MultipleInputDialog_7);
@@ -255,12 +262,14 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) {
validators.add(new Validator() {
+ @Override
public boolean validate() {
return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateFields();
}
@@ -269,6 +278,7 @@ public class MultipleInputDialog extends Dialog {
Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_8, false);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
int code = dialog.open();
@@ -301,7 +311,8 @@ public class MultipleInputDialog extends Dialog {
text.setData(FIELD_NAME, labelText);
text.addTraverseListener(new TraverseListener () {
- public void keyTraversed(TraverseEvent e) {
+ @Override
+ public void keyTraversed(TraverseEvent e) {
if(e.detail == SWT.TRAVERSE_RETURN && e.stateMask == SWT.SHIFT) {
e.doit = true;
}
@@ -317,12 +328,14 @@ public class MultipleInputDialog extends Dialog {
if (!allowEmpty) {
validators.add(new Validator() {
+ @Override
public boolean validate() {
return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
}
});
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateFields();
}
@@ -336,6 +349,7 @@ public class MultipleInputDialog extends Dialog {
Button button = createButton(comp, IDialogConstants.IGNORE_ID, DebugUIMessages.MultipleInputDialog_8, false);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
int code = dialog.open();
@@ -354,12 +368,10 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
- for (Iterator i = controlList.iterator(); i.hasNext(); ) {
- Control control = (Control)i.next();
- if (control instanceof Text) {
- valueMap.put(control.getData(FIELD_NAME), ((Text)control).getText());
- }
+ for (Text control : controlList) {
+ valueMap.put(control.getData(FIELD_NAME), control.getText());
}
controlList = null;
super.okPressed();
@@ -369,6 +381,7 @@ public class MultipleInputDialog extends Dialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#open()
*/
+ @Override
public int open() {
applyDialogFont(panel);
return super.open();
@@ -383,8 +396,7 @@ public class MultipleInputDialog extends Dialog {
}
public void validateFields() {
- for(Iterator i = validators.iterator(); i.hasNext(); ) {
- Validator validator = (Validator) i.next();
+ for (Validator validator : validators) {
if (!validator.validate()) {
getButton(IDialogConstants.OK_ID).setEnabled(false);
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
index fca1043e4..1b8b97e1e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ResourceExtender.java
@@ -46,7 +46,8 @@ public class ResourceExtender 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 method, Object[] args, Object expectedValue) {
+ @Override
+ public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
IResource resource = (IResource) ((IAdaptable) receiver).getAdapter(IResource.class);
if (resource == null) {
if (PROPERTY_MATCHES_CONTENT_TYPE.equals(method)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
index c02ac4d54..b1fda8424 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariableValueEditorManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,7 +37,7 @@ public class VariableValueEditorManager {
* which are replaced by IVariableValueEditors as the editors
* are instantiated (editors are loaded lazily, then cached).
*/
- private Map fEditorMap= new HashMap();
+ private Map<String, Object> fEditorMap = new HashMap<String, Object>();
/**
* The singleton instance of this manager.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java
index 2084afc7d..eb01c255e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/VariablesViewModelPresentation.java
@@ -20,6 +20,7 @@ public class VariablesViewModelPresentation extends DelegatingModelPresentation
*
* Strips out control characters and replaces them with string representations
*/
+ @Override
public String getText(Object element) {
StringBuffer string= new StringBuffer();
StringTokenizer tokenizer= new StringTokenizer(super.getText(element), "\b\f\n\r\t\\", true); //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
index 8b257588d..94e4cede3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/WorkingDirectoryStatusHandler.java
@@ -24,9 +24,11 @@ public class WorkingDirectoryStatusHandler implements IStatusHandler {
/**
* @see IStatusHandler#handleStatus(IStatus, Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) {
final boolean[] result = new boolean[1];
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
String title= DebugUIMessages.WorkingDirectoryStatusHandler_Eclipse_Runtime_1;
String message= DebugUIMessages.WorkingDirectoryStatusHandler_0;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
index 1e4de1297..0a7e13f05 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractDebugActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -68,6 +68,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose(){
fSelection= null;
}
@@ -75,6 +76,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action){
if (action.isEnabled()) {
IStructuredSelection selection = getSelection();
@@ -93,16 +95,18 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
final MultiStatus status=
new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, getStatusMessage(), null);
BusyIndicator.showWhile(Display.getCurrent(), new Runnable() {
+ @Override
public void run() {
- Iterator selectionIter = selection.iterator();
+ Iterator<?> selectionIter = selection.iterator();
while (selectionIter.hasNext()) {
Object element= selectionIter.next();
try {
// Action's enablement could have been changed since
// it was last enabled. Check that the action is still
// enabled before running the action.
- if (isEnabledFor(element))
+ if (isEnabledFor(element)) {
doAction(element);
+ }
} catch (DebugException e) {
status.merge(e.getStatus());
}
@@ -130,6 +134,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection s) {
boolean wasInitialized= initialize(action, s);
if (!wasInitialized) {
@@ -202,6 +207,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fViewPart = view;
}
@@ -295,7 +301,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
if (selection.size() == 0) {
return false;
}
- Iterator itr= selection.iterator();
+ Iterator<?> itr = selection.iterator();
while (itr.hasNext()) {
Object element= itr.next();
if (!isEnabledFor(element)) {
@@ -317,6 +323,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -324,6 +331,7 @@ public abstract class AbstractDebugActionDelegate implements IViewActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
index 67b9f5250..c32ae9b09 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractRemoveAllActionDelegate.java
@@ -43,6 +43,7 @@ public abstract class AbstractRemoveAllActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
fAction = null;
}
@@ -50,6 +51,7 @@ public abstract class AbstractRemoveAllActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
}
@@ -66,6 +68,7 @@ public abstract class AbstractRemoveAllActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -73,6 +76,7 @@ public abstract class AbstractRemoveAllActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
initialize();
update();
@@ -81,6 +85,7 @@ public abstract class AbstractRemoveAllActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
initialize();
update();
@@ -111,6 +116,7 @@ public abstract class AbstractRemoveAllActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection s) {
// do nothing
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
index 5008a7331..ebe3fbc8c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AbstractSelectionActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,6 +70,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
*
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
fSelection = null;
}
@@ -77,6 +78,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection s) {
if (s instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) s;
@@ -115,6 +117,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
*
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
setView(view);
fProgressService = (IWorkbenchSiteProgressService) view.getAdapter(IWorkbenchSiteProgressService.class);
@@ -184,7 +187,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
if (selection.size() == 0) {
return false;
}
- Iterator itr = selection.iterator();
+ Iterator<?> itr = selection.iterator();
while (itr.hasNext()) {
Object element = itr.next();
if (!isEnabledFor(element)) {
@@ -207,6 +210,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -214,6 +218,7 @@ public abstract class AbstractSelectionActionDelegate implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
setAction(action);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
index b1378b869..8de05528a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/AddToFavoritesAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,9 +11,9 @@
package org.eclipse.debug.internal.ui.actions;
-import com.ibm.icu.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.ILaunch;
@@ -33,6 +33,8 @@ import org.eclipse.swt.custom.BusyIndicator;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Adds the selected launch configuration to the launch favorites.
*/
@@ -54,6 +56,7 @@ public class AddToFavoritesAction extends SelectionListenerAction {
/**
* @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
setLaunchConfiguration(null);
setMode(null);
@@ -83,7 +86,7 @@ public class AddToFavoritesAction extends SelectionListenerAction {
setGroup(group);
setLaunchConfiguration(configuration);
setMode(launch.getLaunchMode());
- setText(MessageFormat.format(ActionMessages.AddToFavoritesAction_1, new String[]{DebugUIPlugin.removeAccelerators(getGroup().getLabel())}));
+ setText(MessageFormat.format(ActionMessages.AddToFavoritesAction_1, new Object[] { DebugUIPlugin.removeAccelerators(getGroup().getLabel()) }));
}
}
}
@@ -99,7 +102,7 @@ public class AddToFavoritesAction extends SelectionListenerAction {
if (getGroup() != null) {
try {
- List groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
+ List<String> groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (groups != null) {
return !groups.contains(getGroup().getIdentifier());
}
@@ -163,14 +166,16 @@ public class AddToFavoritesAction extends SelectionListenerAction {
/**
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
final CoreException[] ex = new CoreException[1];
BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
public void run() {
try {
- List list = getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
+ List<String> list = getLaunchConfiguration().getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<String>();
}
list.add(getGroup().getIdentifier());
ILaunchConfigurationWorkingCopy copy = getLaunchConfiguration().getWorkingCopy();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
index f5e90fd4a..be528d019 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/CollapseAllAction.java
@@ -37,10 +37,12 @@ public class CollapseAllAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fViewer.collapseAll();
}
+ @Override
public void update() {
setEnabled( fViewer.getInput() != null && fViewer.getChildCount(TreePath.EMPTY) > 0 );
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
index 61161732c..d2721208b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ConfigureColumnsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.debug.internal.ui.actions;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -45,6 +44,7 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return ((IColumnPresentation)inputElement).getAvailableColumns();
}
@@ -52,12 +52,14 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
@@ -65,12 +67,13 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
class ColumnLabelProvider extends LabelProvider {
- private Map fImages = new HashMap();
+ private Map<ImageDescriptor, Image> fImages = new HashMap<ImageDescriptor, Image>();
+ @Override
public Image getImage(Object element) {
ImageDescriptor imageDescriptor = fViewer.getColumnPresentation().getImageDescriptor((String)element);
if (imageDescriptor != null) {
- Image image = (Image) fImages.get(imageDescriptor);
+ Image image = fImages.get(imageDescriptor);
if (image == null) {
image = imageDescriptor.createImage();
fImages.put(imageDescriptor, image);
@@ -80,15 +83,15 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
return null;
}
+ @Override
public String getText(Object element) {
return fViewer.getColumnPresentation().getHeader((String)element);
}
+ @Override
public void dispose() {
super.dispose();
- Iterator iterator = fImages.values().iterator();
- while (iterator.hasNext()) {
- Image image = (Image) iterator.next();
+ for (Image image : fImages.values()) {
image.dispose();
}
fImages.clear();
@@ -108,6 +111,7 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
setEnabled(fViewer.isShowColumns());
}
@@ -115,6 +119,7 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
ListSelectionDialog dialog = new ListSelectionDialog(
fViewer.getControl().getShell(),
@@ -124,7 +129,7 @@ public class ConfigureColumnsAction extends Action implements IUpdate {
ActionMessages.ConfigureColumnsAction_1);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.CONFIGURE_COLUMNS_DIALOG);
String[] visibleColumns = fViewer.getVisibleColumns();
- List initialSelection = new ArrayList(visibleColumns.length);
+ List<String> initialSelection = new ArrayList<String>(visibleColumns.length);
for (int i = 0; i < visibleColumns.length; i++) {
initialSelection.add(visibleColumns[i]);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java
index 7e5ee495a..8a46b096f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/DebugLastAction.java
@@ -31,6 +31,7 @@ public class DebugLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getMode()
*/
+ @Override
public String getMode() {
return ILaunchManager.DEBUG_MODE;
}
@@ -38,6 +39,7 @@ public class DebugLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getLaunchGroupId()
*/
+ @Override
public String getLaunchGroupId() {
return IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP;
}
@@ -45,6 +47,7 @@ public class DebugLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getText()
*/
+ @Override
protected String getText() {
if(LaunchingResourceManager.isContextLaunchEnabled()) {
return ActionMessages.DebugLastAction_1;
@@ -57,6 +60,7 @@ public class DebugLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getTooltipText()
*/
+ @Override
protected String getTooltipText() {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
@@ -64,6 +68,7 @@ public class DebugLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getCommandId()
*/
+ @Override
protected String getCommandId() {
return "org.eclipse.debug.ui.commands.DebugLast"; //$NON-NLS-1$
}
@@ -71,6 +76,7 @@ public class DebugLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getDescription()
*/
+ @Override
protected String getDescription() {
if(LaunchingResourceManager.isContextLaunchEnabled()) {
return ActionMessages.DebugLastAction_2;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
index 8edf58c1a..0bfbb4b55 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/EditLaunchConfigurationAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.actions;
-import com.ibm.icu.text.MessageFormat;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.DebugPlugin;
@@ -30,6 +29,8 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionListenerAction;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Opens the launch configuration dialog on a single launch configuration, based
* on the the launch associated with the selected element.
@@ -52,6 +53,7 @@ public class EditLaunchConfigurationAction extends SelectionListenerAction {
/**
* @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
setLaunchConfiguration(null);
setMode(null);
@@ -90,7 +92,7 @@ public class EditLaunchConfigurationAction extends SelectionListenerAction {
setLaunchConfiguration(configuration);
setMode(launch.getLaunchMode());
setIsTerminated(launch.isTerminated());
- setText(MessageFormat.format(ActionMessages.EditLaunchConfigurationAction_1, new String[]{configuration.getName()}));
+ setText(MessageFormat.format(ActionMessages.EditLaunchConfigurationAction_1, new Object[] { configuration.getName() }));
ImageDescriptor descriptor = null;
try {
descriptor = DebugPluginImages.getImageDescriptor(configuration.getType().getIdentifier());
@@ -137,6 +139,7 @@ public class EditLaunchConfigurationAction extends SelectionListenerAction {
/**
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
ILaunchGroup group = DebugUITools.getLaunchGroup(getLaunchConfiguration(), getMode());
if (group != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
index 8ffc08db5..d6659102c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ExecutionAction.java
@@ -36,6 +36,7 @@ public abstract class ExecutionAction implements IActionDelegate2 {
/**
* @see IActionDelegate2#runWithEvent(IAction, Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -63,18 +64,21 @@ public abstract class ExecutionAction implements IActionDelegate2 {
/**
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
}
/**
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
}
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
ILaunchConfiguration configuration = getLaunchConfigurationManager().getLastLaunch(fLaunchGroupIdentifier);
if (configuration == null) {
@@ -87,6 +91,7 @@ public abstract class ExecutionAction implements IActionDelegate2 {
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
index 2eb957e54..e318c0b53 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchConfigurationAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,7 +41,8 @@ public class LaunchConfigurationAction extends Action {
* @param image the image for the action
*/
public LaunchConfigurationAction(ILaunchConfiguration config, String mode, String text, ImageDescriptor image, int accelerator) {
- super(MessageFormat.format(ActionMessages.LaunchConfigurationAction_0, new String[] {Integer.toString(accelerator), text}), image);
+ super(MessageFormat.format(ActionMessages.LaunchConfigurationAction_0, new Object[] {
+ Integer.toString(accelerator), text }), image);
fConfig = config;
fMode = mode;
}
@@ -57,6 +58,7 @@ public class LaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
DebugUITools.launch(fConfig, fMode);
}
@@ -64,6 +66,7 @@ public class LaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(Event event) {
if ((event.stateMask & SWT.MOD1) > 0) {
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
index 5affdaa8a..ff296338c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchShortcutAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -63,6 +63,7 @@ public class LaunchShortcutAction extends Action {
*
* @see IAction#run()
*/
+ @Override
public void run() {
IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
Object o = ss.getFirstElement();
@@ -77,19 +78,20 @@ public class LaunchShortcutAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(Event event) {
if ((event.stateMask & SWT.MOD1) > 0) {
- Set types = fShortcut.getAssociatedConfigurationTypes();
+ Set<String> types = fShortcut.getAssociatedConfigurationTypes();
if(!types.isEmpty()) {
LaunchingResourceManager lrm = DebugUIPlugin.getDefault().getLaunchingResourceManager();
IStructuredSelection selection = SelectedResourceManager.getDefault().getCurrentSelection();
- ArrayList shortcuts = new ArrayList();
+ ArrayList<LaunchShortcutExtension> shortcuts = new ArrayList<LaunchShortcutExtension>();
shortcuts.add(fShortcut);
IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
if(resource == null) {
resource = lrm.getLaunchableResource(shortcuts, selection);
}
- List configs = lrm.getParticipatingLaunchConfigurations(selection, resource, shortcuts, fMode);
+ List<ILaunchConfiguration> configs = lrm.getParticipatingLaunchConfigurations(selection, resource, shortcuts, fMode);
LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType((String) types.toArray()[0]);
String groupid = null;
@@ -100,7 +102,7 @@ public class LaunchShortcutAction extends Action {
ILaunchConfiguration config = lcm.getMRUConfiguration(configs, group, resource);
if(config == null) {
if(configs.size() > 0) {
- config = (ILaunchConfiguration) configs.get(0);
+ config = configs.get(0);
}
}
if(config != null) {
@@ -140,7 +142,7 @@ public class LaunchShortcutAction extends Action {
if (expression == null) {
enabled = !ss.isEmpty();
} else {
- List list = ss.toList();
+ List<?> list = ss.toList();
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(list);
context.addVariable("selection", list); //$NON-NLS-1$
enabled = fShortcut.evalEnablementExpression(context, expression);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
index 6a28f7d3f..02c03f87f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/LaunchablePropertyTester.java
@@ -27,6 +27,7 @@ public class LaunchablePropertyTester extends PropertyTester {
/**
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
+ @Override
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if ("launchable".equals(property)) { //$NON-NLS-1$
if (DebugUIPlugin.getDefault().getLaunchConfigurationManager().launchModeAvailable((String)expectedValue)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java
index 9e1c56ea9..fcb010d7c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ProfileLastAction.java
@@ -32,6 +32,7 @@ public class ProfileLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getMode()
*/
+ @Override
public String getMode() {
return ILaunchManager.PROFILE_MODE;
}
@@ -39,6 +40,7 @@ public class ProfileLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getLaunchGroupId()
*/
+ @Override
public String getLaunchGroupId() {
return IDebugUIConstants.ID_PROFILE_LAUNCH_GROUP;
}
@@ -46,6 +48,7 @@ public class ProfileLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getText()
*/
+ @Override
protected String getText() {
if(LaunchingResourceManager.isContextLaunchEnabled()) {
return ActionMessages.ProfileLastAction_1;
@@ -58,6 +61,7 @@ public class ProfileLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getTooltipText()
*/
+ @Override
protected String getTooltipText() {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
@@ -65,6 +69,7 @@ public class ProfileLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getCommandId()
*/
+ @Override
protected String getCommandId() {
return "org.eclipse.debug.ui.commands.ProfileLast"; //$NON-NLS-1$
}
@@ -72,6 +77,7 @@ public class ProfileLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getDescription()
*/
+ @Override
protected String getDescription() {
if(LaunchingResourceManager.isContextLaunchEnabled()) {
return ActionMessages.ProfileLastAction_2;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
index ca18fc06b..3b0f1a059 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,6 +28,7 @@ public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
/**
* @see AbstractDebugActionDelegate#doAction(Object)
*/
+ @Override
protected void doAction(Object object) {
ILaunch launch= DebugUIPlugin.getLaunch(object);
if (launch != null) {
@@ -45,6 +46,7 @@ public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
/**
* @see AbstractDebugActionDelegate#isEnabledFor(Object)
*/
+ @Override
protected boolean isEnabledFor(Object element) {
ILaunch launch= DebugUIPlugin.getLaunch(element);
return launch != null && launch.getLaunchConfiguration() != null && LaunchConfigurationManager.isVisible(launch.getLaunchConfiguration());
@@ -53,12 +55,13 @@ public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#getTargetSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected IStructuredSelection getTargetSelection(IStructuredSelection s) {
if (s.isEmpty()) {
return s;
}
- Set dups = new LinkedHashSet();
- Iterator iterator = s.iterator();
+ Set<ILaunch> dups = new LinkedHashSet<ILaunch>();
+ Iterator<?> iterator = s.iterator();
while (iterator.hasNext()) {
Object object = iterator.next();
ILaunch launch = DebugUIPlugin.getLaunch(object);
@@ -73,6 +76,7 @@ public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
/**
* @see AbstractDebugActionDelegate#getErrorDialogMessage()
*/
+ @Override
protected String getErrorDialogMessage() {
return ActionMessages.RelaunchActionDelegate_Launch_Failed_1;
}
@@ -80,6 +84,7 @@ public class RelaunchActionDelegate extends AbstractDebugActionDelegate {
/**
* @see AbstractDebugActionDelegate#getStatusMessage()
*/
+ @Override
protected String getStatusMessage() {
return ActionMessages.RelaunchActionDelegate_An_exception_occurred_while_launching_2;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
index 785dbfa49..b89310db6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RelaunchLastAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,6 +27,7 @@ import org.eclipse.debug.internal.ui.contextlaunching.ContextRunner;
* @deprecated This class has been promoted to API as <code>org.eclipse.debug.ui.actions.RelaunchLastAction</code>. Clients
* should discontinue use of this class and use the new API version.
*/
+@Deprecated
public abstract class RelaunchLastAction extends org.eclipse.debug.ui.actions.RelaunchLastAction {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
index 70a349337..7f542dbf3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RemoveAllTerminatedAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,7 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
*/
+ @Override
protected boolean isEnabled() {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
if (launches != null) {
@@ -42,7 +43,7 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
}
public static void removeTerminatedLaunches(ILaunch[] elements) {
- List removed = new ArrayList();
+ List<ILaunch> removed = new ArrayList<ILaunch>();
for (int i = 0; i < elements.length; i++) {
ILaunch launch = elements[i];
if (launch.isTerminated()) {
@@ -51,13 +52,14 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
}
if (!removed.isEmpty()) {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- manager.removeLaunches((ILaunch[])removed.toArray(new ILaunch[removed.size()]));
+ manager.removeLaunches(removed.toArray(new ILaunch[removed.size()]));
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
*/
+ @Override
protected void initialize() {
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
}
@@ -65,6 +67,7 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
@@ -73,18 +76,21 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
IAction action = getAction();
if (action != null) {
@@ -97,6 +103,7 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
update();
}
@@ -104,6 +111,7 @@ public class RemoveAllTerminatedAction extends AbstractRemoveAllActionDelegate i
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
removeTerminatedLaunches(launches);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
index 0d430b362..fc047374d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ISelection#isEmpty()
*/
+ @Override
public boolean isEmpty() {
return true;
}
@@ -78,6 +79,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
fWindow.getPartService().removePartListener(this);
fActivePart = null;
@@ -87,6 +89,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
this.fWindow = window;
IPartService partService = window.getPartService();
@@ -99,6 +102,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fTargetAdapter != null) {
try {
@@ -136,6 +140,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
// if the active part did not provide an adapter, see if the selection does
if (fTargetAdapter == null && selection instanceof IStructuredSelection) {
@@ -153,6 +158,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void partActivated(IWorkbenchPart part) {
fActivePart = part;
IResource resource = (IResource) part.getAdapter(IResource.class);
@@ -186,16 +192,18 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
*
* @return the type of adapter this action works on
*/
- protected abstract Class getAdapterClass();
+ protected abstract Class<?> getAdapterClass();
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPart part) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void partClosed(IWorkbenchPart part) {
clearPart(part);
}
@@ -215,12 +223,14 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void partDeactivated(IWorkbenchPart part) {
clearPart(part);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void partOpened(IWorkbenchPart part) {
}
@@ -251,6 +261,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
}
@@ -258,6 +269,7 @@ public abstract class RetargetAction implements IWorkbenchWindowActionDelegate,
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
index ad243b984..759d55e5d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RetargetRunToLineAction.java
@@ -52,6 +52,7 @@ public class RetargetRunToLineAction extends RetargetAction {
}
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
contextActivated(event.getContext());
}
@@ -62,6 +63,7 @@ public class RetargetRunToLineAction extends RetargetAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
DebugUITools.getDebugContextManager().getContextService(fWindow).removeDebugContextListener(fContextListener);
super.dispose();
@@ -69,6 +71,7 @@ public class RetargetRunToLineAction extends RetargetAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
super.init(window);
IDebugContextService service = DebugUITools.getDebugContextManager().getContextService(window);
@@ -77,6 +80,7 @@ public class RetargetRunToLineAction extends RetargetAction {
fContextListener.contextActivated(activeContext);
}
+ @Override
public void init(IAction action) {
super.init(action);
action.setActionDefinitionId("org.eclipse.debug.ui.commands.RunToLine"); //$NON-NLS-1$
@@ -85,6 +89,7 @@ public class RetargetRunToLineAction extends RetargetAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
return fTargetElement != null &&
((IRunToLineTarget)target).canRunToLine(part, selection, fTargetElement);
@@ -93,12 +98,14 @@ public class RetargetRunToLineAction extends RetargetAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getAdapterClass()
*/
- protected Class getAdapterClass() {
+ @Override
+ protected Class<IRunToLineTarget> getAdapterClass() {
return IRunToLineTarget.class;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
((IRunToLineTarget)target).runToLine(part, selection, fTargetElement);
}
@@ -106,6 +113,7 @@ public class RetargetRunToLineAction extends RetargetAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
*/
+ @Override
protected String getOperationUnavailableMessage() {
return ActionMessages.RetargetRunToLineAction_0;
}
@@ -113,6 +121,7 @@ public class RetargetRunToLineAction extends RetargetAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (fTargetElement == null) {
action.setEnabled(false);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java
index 3cf1daf48..f3635497d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/RunLastAction.java
@@ -31,6 +31,7 @@ public class RunLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getMode()
*/
+ @Override
public String getMode() {
return ILaunchManager.RUN_MODE;
}
@@ -38,6 +39,7 @@ public class RunLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getLaunchGroupId()
*/
+ @Override
public String getLaunchGroupId() {
return IDebugUIConstants.ID_RUN_LAUNCH_GROUP;
}
@@ -45,6 +47,7 @@ public class RunLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getText()
*/
+ @Override
protected String getText() {
if(LaunchingResourceManager.isContextLaunchEnabled()) {
return ActionMessages.RunLastAction_1;
@@ -57,6 +60,7 @@ public class RunLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.RelaunchLastAction#getTooltipText()
*/
+ @Override
protected String getTooltipText() {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
@@ -64,6 +68,7 @@ public class RunLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getCommandId()
*/
+ @Override
protected String getCommandId() {
return "org.eclipse.debug.ui.commands.RunLast"; //$NON-NLS-1$
}
@@ -71,6 +76,7 @@ public class RunLastAction extends RelaunchLastAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RelaunchLastAction#getDescription()
*/
+ @Override
protected String getDescription() {
if(LaunchingResourceManager.isContextLaunchEnabled()) {
return ActionMessages.RunLastAction_2;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
index 466aa55e7..1baa069a2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/SelectAllAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IActionDelegate;
import org.eclipse.ui.IViewPart;
public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
@@ -28,6 +29,7 @@ public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractSelectionActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView = view;
IDebugView debugView = (IDebugView) getView().getAdapter(IDebugView.class);
@@ -43,7 +45,7 @@ public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
protected abstract String getActionId();
- private void collectExpandedAndVisible(TreeItem[] items, List result) {
+ private void collectExpandedAndVisible(TreeItem[] items, List<TreeItem> result) {
for (int i= 0; i < items.length; i++) {
TreeItem item= items[i];
result.add(item);
@@ -56,16 +58,17 @@ public abstract class SelectAllAction extends AbstractRemoveAllActionDelegate {
/**
* @see IActionDelegate#run(IAction)
*/
+ @Override
public void run(IAction action){
if (!(getView() instanceof IDebugView)) {
return;
}
Viewer viewer = ((IDebugView) getView()).getViewer();
if (viewer instanceof TreeViewer) {
- ArrayList allVisible= new ArrayList();
+ ArrayList<TreeItem> allVisible= new ArrayList<TreeItem>();
Tree tree= ((TreeViewer) viewer).getTree();
collectExpandedAndVisible(tree.getItems(), allVisible);
- tree.setSelection((TreeItem[]) allVisible.toArray(new TreeItem[allVisible.size()]));
+ tree.setSelection(allVisible.toArray(new TreeItem[allVisible.size()]));
// force viewer selection change
viewer.setSelection(viewer.getSelection());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java
index 6263e6d98..11aa17932 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/StatusInfo.java
@@ -45,6 +45,7 @@ public class StatusInfo implements IStatus {
/**
* Returns if the status' severity is OK.
*/
+ @Override
public boolean isOK() {
return fSeverity == IStatus.OK;
}
@@ -73,6 +74,7 @@ public class StatusInfo implements IStatus {
/**
* @see IStatus#getMessage
*/
+ @Override
public String getMessage() {
return fStatusMessage;
}
@@ -118,6 +120,7 @@ public class StatusInfo implements IStatus {
/*
* @see IStatus#matches(int)
*/
+ @Override
public boolean matches(int severityMask) {
return (fSeverity & severityMask) != 0;
}
@@ -126,6 +129,7 @@ public class StatusInfo implements IStatus {
* Returns always <code>false</code>.
* @see IStatus#isMultiStatus()
*/
+ @Override
public boolean isMultiStatus() {
return false;
}
@@ -133,6 +137,7 @@ public class StatusInfo implements IStatus {
/*
* @see IStatus#getSeverity()
*/
+ @Override
public int getSeverity() {
return fSeverity;
}
@@ -140,6 +145,7 @@ public class StatusInfo implements IStatus {
/*
* @see IStatus#getPlugin()
*/
+ @Override
public String getPlugin() {
return DebugUIPlugin.getUniqueIdentifier();
}
@@ -148,6 +154,7 @@ public class StatusInfo implements IStatus {
* Returns always <code>null</code>.
* @see IStatus#getException()
*/
+ @Override
public Throwable getException() {
return null;
}
@@ -156,6 +163,7 @@ public class StatusInfo implements IStatus {
* Returns always the error severity.
* @see IStatus#getCode()
*/
+ @Override
public int getCode() {
return fSeverity;
}
@@ -164,6 +172,7 @@ public class StatusInfo implements IStatus {
* Returns always <code>null</code>.
* @see IStatus#getChildren()
*/
+ @Override
public IStatus[] getChildren() {
return new IStatus[0];
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
index c4a99df8d..19789ebd7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleBreakpointsTargetManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2013 Wind River Systems and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.actions;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -54,6 +53,7 @@ import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetManagerListener;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.jface.viewers.ISelection;
@@ -80,7 +80,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
*/
public static String DEFAULT_TOGGLE_TARGET_ID = "default"; //$NON-NLS-1$
- private static Set DEFAULT_TOGGLE_TARGET_ID_SET = new TreeSet();
+ private static Set<String> DEFAULT_TOGGLE_TARGET_ID_SET = new TreeSet<String>();
static {
DEFAULT_TOGGLE_TARGET_ID_SET.add(DEFAULT_TOGGLE_TARGET_ID);
}
@@ -104,7 +104,9 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @return Returns the instantiated factory specified by the class property.
*/
private IToggleBreakpointsTargetFactory getFactory() {
- if (fFactory != null) return fFactory;
+ if (fFactory != null) {
+ return fFactory;
+ }
try{
Object obj = fConfigElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
if(obj instanceof IToggleBreakpointsTargetFactory) {
@@ -165,11 +167,11 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
private boolean evalEnablementExpression(IWorkbenchPart part, ISelection selection, Expression exp) {
if (exp != null){
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(part);
- List debugContextList = getDebugContext(part).toList();
+ List<Object> debugContextList = getDebugContext(part).toList();
context.addVariable(IConfigurationElementConstants.DEBUG_CONTEXT, debugContextList);
if (selection instanceof IStructuredSelection) {
- List selectionList = ((IStructuredSelection)selection).toList();
+ List<Object> selectionList = ((IStructuredSelection) selection).toList();
context.addVariable(IConfigurationElementConstants.SELECTION, selectionList);
}
@@ -190,9 +192,9 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
}
/**
- * @return Returns an expression that represents the enablement logic for the
- * breakpiont toggle target.
- */
+ * @return Returns an expression that represents the enablement logic
+ * for the breakpoint toggle target.
+ */
private Expression getEnablementExpression(){
if (fEnablementExpression == null) {
try{
@@ -215,7 +217,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param targetID ID to create toggle target for
* @return The created toggle target, or null.
*/
- public IToggleBreakpointsTarget createToggleTarget(String targetID) {
+ @Override
+ public IToggleBreakpointsTarget createToggleTarget(String targetID) {
IToggleBreakpointsTargetFactory factory = getFactory();
if (factory != null) {
return factory.createToggleTarget(targetID);
@@ -231,7 +234,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @return Set of <code>String</code> IDs for possible toggle breakpoint
* targets, possibly empty
*/
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public Set<String> getToggleTargets(IWorkbenchPart part, ISelection selection) {
IToggleBreakpointsTargetFactory factory = getFactory();
if (factory != null) {
return factory.getToggleTargets(part, selection);
@@ -245,7 +249,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param targetID toggle breakpoints target identifier
* @return toggle target name
*/
- public String getToggleTargetName(String targetID) {
+ @Override
+ public String getToggleTargetName(String targetID) {
IToggleBreakpointsTargetFactory factory = getFactory();
if (factory != null) {
return factory.getToggleTargetName(targetID);
@@ -259,7 +264,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param targetID toggle breakpoints target identifier
* @return toggle target name or <code>null</code> if none
*/
- public String getToggleTargetDescription(String targetID) {
+ @Override
+ public String getToggleTargetDescription(String targetID) {
IToggleBreakpointsTargetFactory factory = getFactory();
if (factory != null) {
return factory.getToggleTargetDescription(targetID);
@@ -274,7 +280,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param selection The current selection
* @return a breakpoint toggle target identifier or <code>null</code>
*/
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
IToggleBreakpointsTargetFactory factory = getFactory();
if (factory != null) {
return factory.getDefaultToggleTarget(part, selection);
@@ -361,7 +368,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param targetID not used
* @return always returns null
*/
- public IToggleBreakpointsTarget createToggleTarget(String targetID) {
+ @Override
+ public IToggleBreakpointsTarget createToggleTarget(String targetID) {
return null;
}
@@ -375,22 +383,26 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
return getToggleBreakpointsTarget(part, getSelectionElement(selection));
}
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public Set<String> getToggleTargets(IWorkbenchPart part, ISelection selection) {
if (isEnabled(part, selection)) {
return DEFAULT_TOGGLE_TARGET_ID_SET;
}
return Collections.EMPTY_SET;
}
- public String getToggleTargetName(String targetID) {
+ @Override
+ public String getToggleTargetName(String targetID) {
return ActionMessages.ToggleBreakpointsTargetManager_defaultToggleTarget_name;
}
- public String getToggleTargetDescription(String targetID) {
+ @Override
+ public String getToggleTargetDescription(String targetID) {
return ActionMessages.ToggleBreakpointsTargetManager_defaultToggleTarget_description;
}
- public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) {
return DEFAULT_TOGGLE_TARGET_ID;
}
}
@@ -410,7 +422,9 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
private static ToggleBreakpointsTargetManager fgSingleton;
public static ToggleBreakpointsTargetManager getDefault(){
- if (fgSingleton == null) fgSingleton = new ToggleBreakpointsTargetManager();
+ if (fgSingleton == null) {
+ fgSingleton = new ToggleBreakpointsTargetManager();
+ }
return fgSingleton;
}
@@ -418,18 +432,18 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* Maps the IDs of toggle breakpoint targets to their instances. The target
* IDs must be unique.
*/
- private Map fKnownFactories;
+ private Map<String, IToggleBreakpointsTargetFactory> fKnownFactories;
/**
* Maps a Set of target id's to the one target id that is preferred.
*/
- private Map fPreferredTargets;
+ private Map<Set<String>, String> fPreferredTargets;
/**
* Maps the IDs of toggle targets to the factory that can create them.
* There can currently only be one factory for a given toggle target.
*/
- private Map fFactoriesByTargetID = new HashMap();
+ private Map<String, IToggleBreakpointsTargetFactory> fFactoriesByTargetID = new HashMap<String, IToggleBreakpointsTargetFactory>();
/**
* List of listeners to changes in the preferred toggle targets list.
@@ -440,7 +454,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* Initializes the collection of known factories from extension point contributions.
*/
private void initializeFactories() {
- fKnownFactories = new LinkedHashMap();
+ fKnownFactories = new LinkedHashMap<String, IToggleBreakpointsTargetFactory>();
fKnownFactories.put(DEFAULT_TOGGLE_TARGET_ID, new ToggleBreakpointsTargetAdapterFactory());
IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_TOGGLE_BREAKPOINTS_TARGET_FACTORIES);
IConfigurationElement[] elements = ep.getConfigurationElements();
@@ -475,13 +489,13 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @return The factories enabled for the part and selection or an empty
* collection.
*/
- private Set getEnabledFactories(IWorkbenchPart part, ISelection selection) {
- if (fKnownFactories == null) initializeFactories();
-
- Set set = new HashSet();
- for (Iterator itr = fKnownFactories.keySet().iterator(); itr.hasNext(); ) {
- String id = (String)itr.next();
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fKnownFactories.get(id);
+ private Set<IToggleBreakpointsTargetFactory> getEnabledFactories(IWorkbenchPart part, ISelection selection) {
+ if (fKnownFactories == null) {
+ initializeFactories();
+ }
+ Set<IToggleBreakpointsTargetFactory> set = new HashSet<IToggleBreakpointsTargetFactory>();
+ for (Entry<String, IToggleBreakpointsTargetFactory> entry : fKnownFactories.entrySet()) {
+ IToggleBreakpointsTargetFactory factory = entry.getValue();
if (factory instanceof ToggleTargetFactory &&
((ToggleTargetFactory)factory).isEnabled(part, selection)) {
set.add(factory);
@@ -502,14 +516,10 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param selection active selection in part
* @return Set of toggle target IDs or an empty set
*/
- private Set getEnabledTargetIDs(Collection factoriesToQuery, IWorkbenchPart part, ISelection selection){
- Set idsForSelection = new TreeSet();
- Iterator factoriesItr = factoriesToQuery.iterator();
- while (factoriesItr.hasNext()) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory) factoriesItr.next();
- Iterator targetIDsItr = factory.getToggleTargets(part, selection).iterator();
- while (targetIDsItr.hasNext()) {
- String targetID = (String) targetIDsItr.next();
+ private Set<String> getEnabledTargetIDs(Set<IToggleBreakpointsTargetFactory> factoriesToQuery, IWorkbenchPart part, ISelection selection) {
+ Set<String> idsForSelection = new TreeSet<String>();
+ for (IToggleBreakpointsTargetFactory factory : factoriesToQuery) {
+ for(String targetID : factory.getToggleTargets(part, selection)) {
fFactoriesByTargetID.put(targetID, factory);
idsForSelection.add(targetID);
}
@@ -517,19 +527,28 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
return idsForSelection;
}
- public Set getEnabledToggleBreakpointsTargetIDs(IWorkbenchPart part, ISelection selection) {
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.actions.IToggleBreakpointsTargetManager#
+ * getEnabledToggleBreakpointsTargetIDs(org.eclipse.ui.IWorkbenchPart,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public Set<String> getEnabledToggleBreakpointsTargetIDs(IWorkbenchPart part, ISelection selection) {
return getEnabledTargetIDs(getEnabledFactories(part, selection), part, selection);
}
- public String getPreferredToggleBreakpointsTargetID(IWorkbenchPart part, ISelection selection) {
- Set factories = getEnabledFactories(part, selection);
- Set possibleIDs = getEnabledTargetIDs(factories, part, selection);
+ @Override
+ public String getPreferredToggleBreakpointsTargetID(IWorkbenchPart part, ISelection selection) {
+ Set<IToggleBreakpointsTargetFactory> factories = getEnabledFactories(part, selection);
+ Set<String> possibleIDs = getEnabledTargetIDs(factories, part, selection);
return chooseToggleTargetIDInSet(possibleIDs, part, selection);
}
- public IToggleBreakpointsTarget getToggleBreakpointsTarget(IWorkbenchPart part, ISelection selection) {
+ @Override
+ public IToggleBreakpointsTarget getToggleBreakpointsTarget(IWorkbenchPart part, ISelection selection) {
String id = getPreferredToggleBreakpointsTargetID(part, selection);
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fFactoriesByTargetID.get(id);
+ IToggleBreakpointsTargetFactory factory = fFactoriesByTargetID.get(id);
if (factory != null) {
if (DEFAULT_TOGGLE_TARGET_ID.equals(id)) {
return ((ToggleBreakpointsTargetAdapterFactory)factory).createDefaultToggleTarget(part, selection);
@@ -540,27 +559,31 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
return null;
}
- public String getToggleBreakpointsTargetName(String id) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fFactoriesByTargetID.get(id);
+ @Override
+ public String getToggleBreakpointsTargetName(String id) {
+ IToggleBreakpointsTargetFactory factory = fFactoriesByTargetID.get(id);
if (factory != null) {
return factory.getToggleTargetName(id);
}
return null;
}
- public String getToggleBreakpointsTargetDescription(String id) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)fFactoriesByTargetID.get(id);
+ @Override
+ public String getToggleBreakpointsTargetDescription(String id) {
+ IToggleBreakpointsTargetFactory factory = fFactoriesByTargetID.get(id);
if (factory != null) {
return factory.getToggleTargetDescription(id);
}
return null;
}
- public void addChangedListener(IToggleBreakpointsTargetManagerListener listener) {
+ @Override
+ public void addChangedListener(IToggleBreakpointsTargetManagerListener listener) {
fChangedListners.add(listener);
}
- public void removeChangedListener(IToggleBreakpointsTargetManagerListener listener) {
+ @Override
+ public void removeChangedListener(IToggleBreakpointsTargetManagerListener listener) {
fChangedListners.remove(listener);
}
@@ -574,12 +597,8 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
*/
private void storePreferredTargets() {
StringBuffer buffer= new StringBuffer();
- Iterator iter = fPreferredTargets.entrySet().iterator();
- while (iter.hasNext()) {
- Entry entry = (Entry) iter.next();
- Iterator setIter = ((Set)entry.getKey()).iterator();
- while (setIter.hasNext()) {
- String currentID = (String) setIter.next();
+ for (Entry<Set<String>, String> entry : fPreferredTargets.entrySet()) {
+ for (String currentID : entry.getKey()) {
buffer.append(currentID);
buffer.append(',');
}
@@ -600,7 +619,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @see #storePreferredTargets()
*/
private void loadPreferredTargets() {
- fPreferredTargets = new HashMap();
+ fPreferredTargets = new HashMap<Set<String>, String>();
String preferenceValue = Platform.getPreferencesService().getString(
DebugUIPlugin.getUniqueIdentifier(),
PREF_TARGETS,
@@ -614,7 +633,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
String token = entryTokenizer.nextToken();
int valueStart = token.indexOf(':');
StringTokenizer keyTokenizer = new StringTokenizer(token.substring(0,valueStart),","); //$NON-NLS-1$
- Set keys = new TreeSet();
+ Set<String> keys = new TreeSet<String>();
while (keyTokenizer.hasMoreTokens()){
keys.add(keyTokenizer.nextToken());
}
@@ -629,15 +648,19 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param possibleIDs The set of possible IDs
* @param preferredID The preferred ID in the set.
*/
- public void setPreferredTarget(Set possibleIDs, String preferredID) {
- if (possibleIDs == null) return;
+ public void setPreferredTarget(Set<String> possibleIDs, String preferredID) {
+ if (possibleIDs == null) {
+ return;
+ }
- if (fKnownFactories == null) initializeFactories();
+ if (fKnownFactories == null) {
+ initializeFactories();
+ }
if (fPreferredTargets == null){
loadPreferredTargets();
}
- String currentKey = (String)fPreferredTargets.get(possibleIDs);
+ String currentKey = fPreferredTargets.get(possibleIDs);
if (currentKey == null || !currentKey.equals(preferredID)){
fPreferredTargets.put(possibleIDs, preferredID);
storePreferredTargets();
@@ -651,11 +674,11 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param possibleTargetIDs The set of possible toggle target IDs
* @return The preferred ID or null
*/
- private String getUserPreferredTarget(Set possibleTargetIDs){
+ private String getUserPreferredTarget(Set<String> possibleTargetIDs) {
if (fPreferredTargets == null){
loadPreferredTargets();
}
- return (String)fPreferredTargets.get(possibleTargetIDs);
+ return fPreferredTargets.get(possibleTargetIDs);
}
/**
@@ -668,7 +691,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
* @param selection The active selection to use with toggle target
* @return The preferred toggle target ID or null
*/
- private String chooseToggleTargetIDInSet(Set possibleTargetIDs, IWorkbenchPart part, ISelection selection){
+ private String chooseToggleTargetIDInSet(Set<String> possibleTargetIDs, IWorkbenchPart part, ISelection selection) {
if (possibleTargetIDs == null || possibleTargetIDs.isEmpty()){
return null;
}
@@ -677,10 +700,9 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
if (preferredID == null){
// If there is no preferred pane already set, check the factories to see there is a default target
- Iterator possibleIDsIterator = possibleTargetIDs.iterator();
+ Iterator<String> possibleIDsIterator = possibleTargetIDs.iterator();
while (preferredID == null && possibleIDsIterator.hasNext()) {
- IToggleBreakpointsTargetFactory factory = (IToggleBreakpointsTargetFactory)
- fFactoriesByTargetID.get(possibleIDsIterator.next());
+ IToggleBreakpointsTargetFactory factory = fFactoriesByTargetID.get(possibleIDsIterator.next());
if (factory != null) {
preferredID = factory.getDefaultToggleTarget(part, selection);
}
@@ -689,7 +711,7 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
// Also make sure that the default is among the available toggle target
// IDs (bug 352502).
if (preferredID == null || !possibleTargetIDs.contains(preferredID)) {
- preferredID= (String)possibleTargetIDs.iterator().next();
+ preferredID= possibleTargetIDs.iterator().next();
}
setPreferredTarget(possibleTargetIDs, preferredID);
}
@@ -716,11 +738,11 @@ public class ToggleBreakpointsTargetManager implements IToggleBreakpointsTargetM
IAnnotationModel annotationModel = provider.getAnnotationModel(input);
if (annotationModel != null) {
IDocument document = provider.getDocument(input);
- Iterator iterator = annotationModel.getAnnotationIterator();
+ Iterator<Annotation> iterator = annotationModel.getAnnotationIterator();
while (iterator.hasNext()) {
- Object object = iterator.next();
- if (object instanceof SimpleMarkerAnnotation) {
- SimpleMarkerAnnotation markerAnnotation = (SimpleMarkerAnnotation) object;
+ Annotation annot = iterator.next();
+ if (annot instanceof SimpleMarkerAnnotation) {
+ SimpleMarkerAnnotation markerAnnotation = (SimpleMarkerAnnotation) annot;
IMarker marker = markerAnnotation.getMarker();
try {
if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
index b2ba81cd0..2257d2553 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ToggleFilterAction.java
@@ -32,6 +32,7 @@ public abstract class ToggleFilterAction extends Action {
*/
private ViewerFilter fViewerFilter;
+ @Override
public void run() {
valueChanged(isChecked());
}
@@ -44,6 +45,7 @@ public abstract class ToggleFilterAction extends Action {
return;
}
BusyIndicator.showWhile(getViewer().getControl().getDisplay(), new Runnable() {
+ @Override
public void run() {
if (on) {
ViewerFilter filter= getViewerFilter();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java
index 7bd91d627..32233132e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ViewManagementAction.java
@@ -24,6 +24,7 @@ public class ViewManagementAction extends ActionDelegate implements IViewActionD
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
SWTFactory.showPreferencePage("org.eclipse.debug.ui.ViewManagementPreferencePage"); //$NON-NLS-1$
}
@@ -31,6 +32,7 @@ public class ViewManagementAction extends ActionDelegate implements IViewActionD
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java
index b396f7922..10df93524 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AbstractBreakpointsViewAction.java
@@ -31,32 +31,37 @@ public abstract class AbstractBreakpointsViewAction implements IViewActionDelega
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
- public void init(IViewPart view) {
+ @Override
+ public void init(IViewPart view) {
fView= (BreakpointsView) view;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
- public void runWithEvent(IAction action, Event event) {
+ @Override
+ public void runWithEvent(IAction action, Event event) {
run(action);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
index 243c140bb..f6fe350d6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/AdvancedGroupBreakpointsByAction.java
@@ -33,6 +33,7 @@ public class AdvancedGroupBreakpointsByAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
if (isChecked()) {
GroupBreakpointsByDialog dialog = new GroupBreakpointsByDialog(fView);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java
index fc6baaa51..40fae5d62 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/BreakpointWorkingSetAction.java
@@ -28,14 +28,16 @@ public abstract class BreakpointWorkingSetAction extends AbstractBreakpointsView
/* (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) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
update();
}
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
- public void init(IViewPart view) {
+ @Override
+ public void init(IViewPart view) {
super.init(view);
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
}
@@ -43,14 +45,16 @@ public abstract class BreakpointWorkingSetAction extends AbstractBreakpointsView
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
super.dispose();
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
fAction = action;
super.init(action);
update();
@@ -59,7 +63,8 @@ public abstract class BreakpointWorkingSetAction extends AbstractBreakpointsView
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME)) {
update();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java
index 70446b413..3e3704a00 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ClearDefaultBreakpointGroupAction.java
@@ -21,11 +21,13 @@ public class ClearDefaultBreakpointGroupAction extends BreakpointWorkingSetActio
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
BreakpointSetOrganizer.setDefaultWorkingSet(null);
}
- protected void update() {
+ @Override
+ protected void update() {
fAction.setEnabled(BreakpointSetOrganizer.getDefaultWorkingSet() != null);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java
index a37a520d9..5f084105c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/CopyBreakpointsActionDelegate.java
@@ -41,6 +41,7 @@ public class CopyBreakpointsActionDelegate extends VirtualCopyToClipboardActionD
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.VirtualCopyToClipboardActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
super.run(action);
LocalSelectionTransfer.getTransfer().setSelection(getSelection());
@@ -60,6 +61,7 @@ public class CopyBreakpointsActionDelegate extends VirtualCopyToClipboardActionD
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
super.init(view);
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
@@ -68,6 +70,7 @@ public class CopyBreakpointsActionDelegate extends VirtualCopyToClipboardActionD
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#dispose()
*/
+ @Override
public void dispose() {
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
super.dispose();
@@ -76,25 +79,27 @@ public class CopyBreakpointsActionDelegate extends VirtualCopyToClipboardActionD
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
*/
+ @Override
public void breakpointsAdded(IBreakpoint[] breakpoints) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
// remove deleted breakpoints from drag/drop clipboard
if (fStamp == LocalSelectionTransfer.getTransfer().getSelectionSetTime()) {
ISelection selection = LocalSelectionTransfer.getTransfer().getSelection();
if (selection instanceof IStructuredSelection) {
- Set removed = new HashSet();
+ Set<IBreakpoint> removed = new HashSet<IBreakpoint>();
for (int i = 0; i < breakpoints.length; i++) {
removed.add(breakpoints[i]);
}
boolean modified = false;
- List remain = new ArrayList();
+ List<Object> remain = new ArrayList<Object>();
IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while (iterator.hasNext()) {
Object bp = iterator.next();
if (removed.contains(bp)) {
@@ -115,6 +120,7 @@ public class CopyBreakpointsActionDelegate extends VirtualCopyToClipboardActionD
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java
index 6bcce2775..8303511e3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/EditBreakpointGroupAction.java
@@ -36,6 +36,7 @@ public class EditBreakpointGroupAction extends AbstractBreakpointsViewAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IWorkingSetEditWizard editWizard = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetEditWizard(fSet);
WizardDialog dialog = new WizardDialog(DebugUIPlugin.getShell(), editWizard);
@@ -45,6 +46,7 @@ public class EditBreakpointGroupAction extends AbstractBreakpointsViewAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection sel) {
fSet = null;
if (sel instanceof IStructuredSelection) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
index 40bd2a9ae..647fc0276 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsAction.java
@@ -42,7 +42,8 @@ public class GroupBreakpointsAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
- public void run() {
+ @Override
+ public void run() {
if (isChecked()) {
if (fOrganzier == null) {
fView.setBreakpointOrganizers(null);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java
index 6f5a29e2b..717ff3d54 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -43,19 +43,22 @@ public class GroupBreakpointsByAction extends AbstractBreakpointsViewAction impl
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
*/
- public Menu getMenu(Control parent) {
+ @Override
+ public Menu getMenu(Control parent) {
// Never called
return null;
}
@@ -63,9 +66,11 @@ public class GroupBreakpointsByAction extends AbstractBreakpointsViewAction impl
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
- public Menu getMenu(Menu parent) {
+ @Override
+ public Menu getMenu(Menu parent) {
Menu menu = new Menu(parent);
menu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
@@ -107,9 +112,9 @@ public class GroupBreakpointsByAction extends AbstractBreakpointsViewAction impl
item.fill(menu, -1);
// Add actions for each contributed organizer
- List actions = getActions(accel);
+ List<IAction> actions = getActions(accel);
accel = accel + actions.size();
- Iterator actionIter = actions.iterator();
+ Iterator<IAction> actionIter = actions.iterator();
while (actionIter.hasNext()) {
GroupBreakpointsAction bpAction = (GroupBreakpointsAction) actionIter.next();
bpAction.setChecked(bpAction.getOrganizer().equals(organizer));
@@ -126,8 +131,8 @@ public class GroupBreakpointsByAction extends AbstractBreakpointsViewAction impl
item.fill(menu, -1);
}
- public List getActions(int accel) {
- List actions= new ArrayList();
+ public List<IAction> getActions(int accel) {
+ List<IAction> actions = new ArrayList<IAction>();
IBreakpointOrganizer[] organizers = BreakpointOrganizerManager.getDefault().getOrganizers();
for (int i = 0; i < organizers.length; i++) {
IBreakpointOrganizer organizer = organizers[i];
@@ -160,6 +165,7 @@ public class GroupBreakpointsByAction extends AbstractBreakpointsViewAction impl
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (action != fAction) {
action.setMenuCreator(this);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
index 49c776dd6..19adea573 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/GroupBreakpointsByDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -67,7 +67,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
private TreeViewer fSelectedViewer;
private SelectedOrganizerProvider fSelectedOrganizersProvider= new SelectedOrganizerProvider();
- private List fResult= new ArrayList();
+ private List<Object> fResult = new ArrayList<Object>();
private Button fAddButton;
private Button fRemoveButton;
@@ -79,6 +79,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
* dialog.
*/
private SelectionAdapter fSelectionListener= new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Object source= e.getSource();
if (source == fAddButton) {
@@ -102,6 +103,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
ILabelProvider labelProvider= new BreakpointOrganzierLabelProvider();
@@ -135,6 +137,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Control contents = super.createContents(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getDialogArea(), IDebugHelpContextIds.GROUP_BREAKPOINTS_DIALOG);
@@ -186,11 +189,13 @@ public class GroupBreakpointsByDialog extends TrayDialog {
table.setLayoutData(new GridData(GridData.FILL_BOTH));
table.setFont(parent.getFont());
fAvailableViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
handleAddPressed();
}
});
fAvailableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
updateAddButton();
}
@@ -227,11 +232,13 @@ public class GroupBreakpointsByDialog extends TrayDialog {
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
tree.setFont(parent.getFont());
fSelectedViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
+ @Override
+ public void doubleClick(DoubleClickEvent event) {
handleRemovePressed();
}
});
fSelectedViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
updateSelectedButtons();
}
@@ -265,12 +272,13 @@ public class GroupBreakpointsByDialog extends TrayDialog {
* @return the breakpoint organizers chosen by the user
*/
public IBreakpointOrganizer[] getOrganizers() {
- return (IBreakpointOrganizer[]) fResult.toArray(new IBreakpointOrganizer[fResult.size()]);
+ return fResult.toArray(new IBreakpointOrganizer[fResult.size()]);
}
/**
* When the user presses OK, convert the tree selection into a list.
*/
+ @Override
protected void okPressed() {
Object[] factories= fSelectedOrganizersProvider.getElements(null);
while (factories.length > 0) {
@@ -290,7 +298,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
if (selection.size() < 1) {
return;
}
- Iterator iter= selection.iterator();
+ Iterator<?> iter = selection.iterator();
while (iter.hasNext()) {
fSelectedOrganizersProvider.addSelected((IBreakpointOrganizer) iter.next());
}
@@ -306,7 +314,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
if (selection.size() < 1) {
return;
}
- Iterator iter= selection.iterator();
+ Iterator<?> iter = selection.iterator();
while (iter.hasNext()) {
fAvailableOrganizersProvider.addAvailable((IBreakpointOrganizer) iter.next());
}
@@ -318,7 +326,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
*/
public void handleMoveUpPressed() {
IStructuredSelection selection = (IStructuredSelection) fSelectedViewer.getSelection();
- Iterator iter = selection.iterator();
+ Iterator<?> iter = selection.iterator();
while (iter.hasNext()) {
fSelectedOrganizersProvider.moveUp(iter.next());
}
@@ -402,19 +410,22 @@ public class GroupBreakpointsByDialog extends TrayDialog {
* that are available but not currently selected.
*/
private class AvailableOrganizersProvider implements IStructuredContentProvider {
- protected List availableOrganziers= new ArrayList();
+ protected List<IBreakpointOrganizer> availableOrganziers = new ArrayList<IBreakpointOrganizer>();
public void addAvailable(IBreakpointOrganizer organizer) {
availableOrganziers.add(organizer);
fSelectedOrganizersProvider.selectedOrganizers.remove(organizer);
}
+ @Override
public Object[] getElements(Object inputElement) {
return availableOrganziers.toArray();
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
@@ -425,7 +436,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
* appear in the breakpoints view.
*/
private class SelectedOrganizerProvider implements ITreeContentProvider {
- protected List selectedOrganizers= new ArrayList();
+ protected List<Object> selectedOrganizers = new ArrayList<Object>();
public void addSelected(IBreakpointOrganizer organizer) {
selectedOrganizers.add(organizer);
@@ -448,6 +459,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
}
}
+ @Override
public Object[] getChildren(Object parentElement) {
// A factory's "child" is the next factory in the list
int index = selectedOrganizers.indexOf(parentElement);
@@ -457,6 +469,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
return new Object[0];
}
+ @Override
public Object getParent(Object element) {
// A factory's "parent" is the factory before it
int index = selectedOrganizers.indexOf(element);
@@ -466,6 +479,7 @@ public class GroupBreakpointsByDialog extends TrayDialog {
return selectedOrganizers.get(index - 1);
}
+ @Override
public boolean hasChildren(Object element) {
// A factory has "children" if there are more
// factories after it.
@@ -473,14 +487,17 @@ public class GroupBreakpointsByDialog extends TrayDialog {
return index != -1 && index < selectedOrganizers.size() - 1;
}
+ @Override
public Object[] getElements(Object inputElement) {
if (selectedOrganizers.size() > 0) {
return new Object[] { selectedOrganizers.get(0) };
}
return new Object[0];
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
}
@@ -489,19 +506,21 @@ public class GroupBreakpointsByDialog extends TrayDialog {
* Label provider which provides text and images for breakpoint container factories
*/
private class BreakpointOrganzierLabelProvider extends LabelProvider {
- private HashMap fImageCache= new HashMap();
+ private HashMap<ImageDescriptor, Image> fImageCache = new HashMap<ImageDescriptor, Image>();
+ @Override
public String getText(Object element) {
if (element instanceof IBreakpointOrganizer) {
return ((IBreakpointOrganizer) element).getLabel();
}
return super.getText(element);
}
+ @Override
public Image getImage(Object element) {
if (element instanceof IBreakpointOrganizer) {
ImageDescriptor imageDescriptor = ((IBreakpointOrganizer) element).getImageDescriptor();
if (imageDescriptor != null) {
- Image image = (Image) fImageCache.get(imageDescriptor);
+ Image image = fImageCache.get(imageDescriptor);
if (image == null) {
image= imageDescriptor.createImage();
if (image != null) {
@@ -513,10 +532,10 @@ public class GroupBreakpointsByDialog extends TrayDialog {
}
return super.getImage(element);
}
+ @Override
public void dispose() {
- Iterator imageIter = fImageCache.values().iterator();
- while (imageIter.hasNext()) {
- ((Image) imageIter.next()).dispose();
+ for (Image image : fImageCache.values()) {
+ image.dispose();
}
super.dispose();
}
@@ -527,7 +546,8 @@ public class GroupBreakpointsByDialog extends TrayDialog {
*
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
- protected void configureShell(Shell shell) {
+ @Override
+ protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(BreakpointGroupMessages.GroupBreakpointsByDialog_7);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java
index aca918e3c..be8b4a7ba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/PasteBreakpointsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -48,7 +48,7 @@ public class PasteBreakpointsAction extends BreakpointSelectionAction {
* @return the actual target of the paste action
*/
private Object getTarget() {
- List selectedNonResources = getSelectedNonResources();
+ List<?> selectedNonResources = getSelectedNonResources();
if (selectedNonResources.size() == 1) {
Object target = selectedNonResources.get(0);
if (target instanceof IBreakpointContainer) {
@@ -61,7 +61,8 @@ public class PasteBreakpointsAction extends BreakpointSelectionAction {
/**
* Implementation of method defined on <code>IAction</code>.
*/
- public void run() {
+ @Override
+ public void run() {
if (getBreakpointsView().canPaste(getTarget(), LocalSelectionTransfer.getTransfer().getSelection())) {
getBreakpointsView().performPaste(getTarget(), LocalSelectionTransfer.getTransfer().getSelection());
}
@@ -71,7 +72,8 @@ public class PasteBreakpointsAction extends BreakpointSelectionAction {
* Returns whether this action should be enabled based on the selection
* in the clipboard. Only updates when the breakpoints view has focus.
*/
- protected boolean updateSelection(IStructuredSelection selection) {
+ @Override
+ protected boolean updateSelection(IStructuredSelection selection) {
// can't paste into "Others" (only move)
Object target = getTarget();
if (target instanceof IBreakpointContainer) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java
index a1d94b34c..d47318f68 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/RemoveFromWorkingSetAction.java
@@ -44,7 +44,8 @@ public class RemoveFromWorkingSetAction extends BreakpointSelectionAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
- public void run() {
+ @Override
+ public void run() {
if (fBreakpoints != null) {
for (int i = 0; i < fBreakpoints.length; i++) {
fBreakpoints[i].container.getOrganizer().removeBreakpoint(fBreakpoints[i].breakpoint, fBreakpoints[i].container.getCategory());
@@ -68,7 +69,7 @@ public class RemoveFromWorkingSetAction extends BreakpointSelectionAction {
* @return
*/
protected BreakpointSetElement[] getRemovableBreakpoints(IStructuredSelection selection) {
- List res = new ArrayList();
+ List<BreakpointSetElement> res = new ArrayList<BreakpointSetElement>();
if (selection instanceof ITreeSelection) {
ITreeSelection tSel = (ITreeSelection)selection;
@@ -99,13 +100,14 @@ public class RemoveFromWorkingSetAction extends BreakpointSelectionAction {
}
}
}
- return (BreakpointSetElement[])res.toArray(new BreakpointSetElement[res.size()]);
+ return res.toArray(new BreakpointSetElement[res.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#isEnabled()
*/
- public boolean isEnabled() {
+ @Override
+ public boolean isEnabled() {
if(fBreakpoints != null) {
return fBreakpoints.length > 0;
}
@@ -115,7 +117,8 @@ public class RemoveFromWorkingSetAction extends BreakpointSelectionAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
- protected boolean updateSelection(IStructuredSelection selection) {
+ @Override
+ protected boolean updateSelection(IStructuredSelection selection) {
fBreakpoints = getRemovableBreakpoints(selection);
return fBreakpoints.length > 0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
index a0ea4f275..8f34d4dc9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SelectBreakpointWorkingsetDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -48,10 +48,12 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
+ @Override
protected void addViewerListeners(StructuredViewer viewer) {
CheckboxTableViewer checkViewer = getCheckBoxTableViewer();
if (checkViewer != null){
checkViewer.addCheckStateListener(new ICheckStateListener(){
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
getCheckBoxTableViewer().setCheckedElements(new Object[] {event.getElement()});
getButton(IDialogConstants.OK_ID).setEnabled(true);
@@ -66,18 +68,19 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
*/
private IWorkingSet[] getBreakpointWorkingSets() {
IWorkingSet[] ws = PlatformUI.getWorkbench().getWorkingSetManager().getAllWorkingSets();
- ArrayList list = new ArrayList();
+ ArrayList<IWorkingSet> list = new ArrayList<IWorkingSet>();
for(int i = 0; i < ws.length; i++) {
if(IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(ws[i].getId())) {
list.add(ws[i]);
}
}
- return (IWorkingSet[]) list.toArray(new IWorkingSet[list.size()]);
+ return list.toArray(new IWorkingSet[list.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fWorkingSetList;
}
@@ -85,6 +88,7 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return SETTINGS_ID;
}
@@ -92,6 +96,7 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_DEFAULT_WORKINGSET_DIALOG;
}
@@ -99,6 +104,7 @@ public class SelectBreakpointWorkingsetDialog extends AbstractDebugCheckboxSelec
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return BreakpointGroupMessages.SelectBreakpointWorkingsetDialog_0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java
index f30a8cefb..a1d7400eb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/SetDefaultBreakpointGroupAction.java
@@ -25,7 +25,8 @@ public class SetDefaultBreakpointGroupAction extends AbstractBreakpointsViewActi
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
SelectBreakpointWorkingsetDialog sbwsd = new SelectBreakpointWorkingsetDialog(DebugUIPlugin.getShell());
sbwsd.setTitle(BreakpointGroupMessages.SetDefaultBreakpointGroupAction_0);
IWorkingSet workingSet = BreakpointSetOrganizer.getDefaultWorkingSet();
@@ -40,6 +41,7 @@ public class SetDefaultBreakpointGroupAction extends AbstractBreakpointsViewActi
/* (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) {}
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java
index f236c2e1a..ab11a7580 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/ToggleDefaultGroupAction.java
@@ -29,7 +29,8 @@ public class ToggleDefaultGroupAction extends AbstractBreakpointsViewAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
IWorkingSet defaultWorkingSet = BreakpointSetOrganizer.getDefaultWorkingSet();
IWorkingSet set = null;
if (!fSelectedSet.equals(defaultWorkingSet)) {
@@ -41,7 +42,8 @@ public class ToggleDefaultGroupAction extends AbstractBreakpointsViewAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
- public void selectionChanged(IAction action, ISelection sel) {
+ @Override
+ public void selectionChanged(IAction action, ISelection sel) {
fSelectedSet = null;
if (sel instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection) sel;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java
index 341770534..e9f1b2524 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpointGroups/WorkingSetsAction.java
@@ -24,7 +24,8 @@ public class WorkingSetsAction extends AbstractBreakpointsViewAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
IWorkingSetSelectionDialog selectionDialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(
DebugUIPlugin.getShell(),
false,
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java
index 64b98f929..eaf4a3efc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/AccessWatchpointToggleAction.java
@@ -21,21 +21,24 @@ public class AccessWatchpointToggleAction extends ModifyWatchpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isEnabled(org.eclipse.debug.core.model.IWatchpoint)
*/
- protected boolean isEnabled(IWatchpoint watchpoint) {
+ @Override
+ protected boolean isEnabled(IWatchpoint watchpoint) {
return watchpoint.supportsAccess();
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#toggleWatchpoint(org.eclipse.debug.core.model.IWatchpoint, boolean)
*/
- protected void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException {
+ @Override
+ protected void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException {
watchpoint.setAccess(b);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isChecked(org.eclipse.debug.core.model.IWatchpoint)
*/
- protected boolean isChecked(IWatchpoint watchpoint) {
+ @Override
+ protected boolean isChecked(IWatchpoint watchpoint) {
try {
return watchpoint.isAccess();
} catch (CoreException e) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java
index ebd76f4a3..557f84eff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsCollapseAllAction.java
@@ -41,6 +41,7 @@ public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActio
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView = (AbstractDebugView) view;
IInternalTreeModelViewer viewer = (IInternalTreeModelViewer)fView.getViewer();
@@ -53,6 +54,7 @@ public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActio
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
((TreeViewer) fView.getViewer()).collapseAll();
}
@@ -60,12 +62,14 @@ public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActio
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
ITreeModelViewer viewer = (ITreeModelViewer)fView.getViewer();
if (viewer != null) {
@@ -77,6 +81,7 @@ public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActio
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
action.setActionDefinitionId(CollapseAllHandler.COMMAND_ID);
@@ -85,20 +90,25 @@ public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActio
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
- public void viewerUpdatesBegin() {
+ @Override
+ public void viewerUpdatesBegin() {
}
- public void viewerUpdatesComplete() {
+ @Override
+ public void viewerUpdatesComplete() {
}
- public void updateStarted(IViewerUpdate update) {
+ @Override
+ public void updateStarted(IViewerUpdate update) {
}
- public void updateComplete(IViewerUpdate update) {
+ @Override
+ public void updateComplete(IViewerUpdate update) {
if (!update.isCanceled()) {
if (TreePath.EMPTY.equals(update.getElementPath())) {
update();
@@ -113,7 +123,8 @@ public class BreakpointsCollapseAllAction implements IViewActionDelegate, IActio
}
}
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
+ @Override
+ public void modelChanged(IModelDelta delta, IModelProxy proxy) {
update();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java
index a22be2fa8..ed7834a04 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/BreakpointsExpandAllAction.java
@@ -35,13 +35,15 @@ public class BreakpointsExpandAllAction implements IViewActionDelegate, IActionD
private IAction fAction;
private BreakpointsView fView;
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
fAction = action;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView = (BreakpointsView) view;
IInternalTreeModelViewer viewer = (IInternalTreeModelViewer)fView.getViewer();
@@ -51,13 +53,15 @@ public class BreakpointsExpandAllAction implements IViewActionDelegate, IActionD
}
}
- public void runWithEvent(IAction action, Event event) {
+ @Override
+ public void runWithEvent(IAction action, Event event) {
run(action);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
fView.expandAllElementsInViewer();
}
@@ -65,11 +69,13 @@ public class BreakpointsExpandAllAction implements IViewActionDelegate, IActionD
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
- public void dispose() {
+ @Override
+ public void dispose() {
ITreeModelViewer viewer = (ITreeModelViewer)fView.getViewer();
if (viewer != null) {
viewer.removeViewerUpdateListener(this);
@@ -77,16 +83,20 @@ public class BreakpointsExpandAllAction implements IViewActionDelegate, IActionD
}
}
- public void viewerUpdatesBegin() {
+ @Override
+ public void viewerUpdatesBegin() {
}
- public void viewerUpdatesComplete() {
+ @Override
+ public void viewerUpdatesComplete() {
}
- public void updateStarted(IViewerUpdate update) {
+ @Override
+ public void updateStarted(IViewerUpdate update) {
}
- public void updateComplete(IViewerUpdate update) {
+ @Override
+ public void updateComplete(IViewerUpdate update) {
if (!update.isCanceled()) {
if (TreePath.EMPTY.equals(update.getElementPath())) {
update();
@@ -101,7 +111,8 @@ public class BreakpointsExpandAllAction implements IViewActionDelegate, IActionD
}
}
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
+ @Override
+ public void modelChanged(IModelDelta delta, IModelProxy proxy) {
update();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java
index 90b1748ab..8ba1149f9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DeleteWorkingsetsMessageDialog.java
@@ -62,6 +62,7 @@ public class DeleteWorkingsetsMessageDialog extends MessageDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createCustomArea(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout());
@@ -70,7 +71,9 @@ public class DeleteWorkingsetsMessageDialog extends MessageDialog {
fDeleteWS.setText(ActionMessages.DeleteWorkingsetsMessageDialog_0);
fDeleteWS.setFont(font);
fDeleteWS.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
getButton(0).setEnabled(fDeleteWS.getSelection() || fDeleteBPS.getSelection());
}
@@ -80,7 +83,9 @@ public class DeleteWorkingsetsMessageDialog extends MessageDialog {
fDeleteBPS.setText(ActionMessages.DeleteWorkingsetsMessageDialog_1);
fDeleteBPS.setFont(font);
fDeleteBPS.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
getButton(0).setEnabled(fDeleteWS.getSelection() || fDeleteBPS.getSelection());
}
@@ -94,6 +99,7 @@ public class DeleteWorkingsetsMessageDialog extends MessageDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.MessageDialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(int buttonId) {
if(buttonId == OK) {
fDeleteBreakpoints = fDeleteBPS.getSelection();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java
index 7c6428415..9479fdd85 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/DisableBreakpointsAction.java
@@ -17,6 +17,7 @@ public class DisableBreakpointsAction extends EnableBreakpointsAction {
* If this action can enable breakpoints
* @return always <code>false</code>
*/
+ @Override
protected boolean isEnableAction() {
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
index 250897166..bcd689102 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/EnableBreakpointsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -56,6 +56,7 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/**
* @see IViewActionDelegate#init(IViewPart)
*/
+ @Override
public void init(IViewPart view) {
setView(view);
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
@@ -77,6 +78,7 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IStructuredSelection selection= getSelection();
final int size= selection.size();
@@ -84,9 +86,10 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
return;
}
- final Iterator itr= selection.iterator();
+ final Iterator<?> itr = selection.iterator();
final MultiStatus ms= new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, ActionMessages.EnableBreakpointAction_Enable_breakpoint_s__failed_2, null);
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) {
while (itr.hasNext()) {
Object element= itr.next();
@@ -137,6 +140,7 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
setAction(action);
if (!(selection instanceof IStructuredSelection)) {
@@ -144,7 +148,7 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
}
IStructuredSelection sel= (IStructuredSelection)selection;
- Iterator itr= sel.iterator();
+ Iterator<?> itr = sel.iterator();
boolean allEnabled= true;
boolean allDisabled= true;
while (itr.hasNext()) {
@@ -209,12 +213,14 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/**
* @see IBreakpointsListener#breakpointsAdded(IBreakpoint[])
*/
+ @Override
public void breakpointsAdded(IBreakpoint[] breakpoints) {
}
/**
* @see IBreakpointsListener#breakpointsRemoved(IBreakpoint[], IMarkerDelta[])
*/
+ @Override
public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
asynchUpdate();
}
@@ -222,6 +228,7 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/**
* @see IBreakpointsListener#breakpointsChanged(IBreakpoint[], IMarkerDelta[])
*/
+ @Override
public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
asynchUpdate();
}
@@ -239,6 +246,7 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
return;
}
Runnable r= new Runnable() {
+ @Override
public void run() {
IWorkbenchWindow ww= getView().getViewSite().getPage().getWorkbenchWindow();
if (ww == null) {
@@ -265,18 +273,21 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/**
* @see IPartListener#partActivated(IWorkbenchPart)
*/
+ @Override
public void partActivated(IWorkbenchPart part) {
}
/**
* @see IPartListener#partBroughtToTop(IWorkbenchPart)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPart part) {
}
/**
* @see IPartListener#partClosed(IWorkbenchPart)
*/
+ @Override
public void partClosed(IWorkbenchPart part) {
if (part.equals(getView())) {
dispose();
@@ -286,12 +297,14 @@ public class EnableBreakpointsAction implements IViewActionDelegate, IPartListen
/**
* @see IPartListener#partDeactivated(IWorkbenchPart)
*/
+ @Override
public void partDeactivated(IWorkbenchPart part) {
}
/**
* @see IPartListener#partOpened(IWorkbenchPart)
*/
+ @Override
public void partOpened(IWorkbenchPart part) {
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java
index e7b5454c8..70febda6b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/LinkBreakpointsWithDebugViewAction.java
@@ -31,6 +31,7 @@ public class LinkBreakpointsWithDebugViewAction implements IViewActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView= (BreakpointsView) view;
}
@@ -38,6 +39,7 @@ public class LinkBreakpointsWithDebugViewAction implements IViewActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
fView.setTrackSelection(action.isChecked());
}
@@ -45,6 +47,7 @@ public class LinkBreakpointsWithDebugViewAction implements IViewActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (fAction == null) {
action.setChecked(fView.isTrackingSelection());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java
index 632590e69..2f25ee1d7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModificationWatchpointToggleAction.java
@@ -21,21 +21,24 @@ public class ModificationWatchpointToggleAction extends ModifyWatchpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isEnabled(org.eclipse.debug.core.model.IWatchpoint)
*/
- protected boolean isEnabled(IWatchpoint watchpoint) {
+ @Override
+ protected boolean isEnabled(IWatchpoint watchpoint) {
return watchpoint.supportsModification();
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#toggleWatchpoint(org.eclipse.debug.core.model.IWatchpoint, boolean)
*/
- protected void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException {
+ @Override
+ protected void toggleWatchpoint(IWatchpoint watchpoint, boolean b) throws CoreException {
watchpoint.setModification(b);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ModifyWatchpointAction#isChecked(org.eclipse.debug.core.model.IWatchpoint)
*/
- protected boolean isChecked(IWatchpoint watchpoint) {
+ @Override
+ protected boolean isChecked(IWatchpoint watchpoint) {
try {
return watchpoint.isModification();
} catch (CoreException e) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java
index bb5818f43..0f146617b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ModifyWatchpointAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,10 +34,11 @@ public abstract class ModifyWatchpointAction implements IObjectActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
try {
if (fWatchpoints != null) {
- Iterator iterator = fWatchpoints.iterator();
+ Iterator<?> iterator = fWatchpoints.iterator();
while (iterator.hasNext()) {
IWatchpoint watchpoint = (IWatchpoint)iterator.next();
toggleWatchpoint(watchpoint, action.isChecked());
@@ -61,17 +62,19 @@ public abstract class ModifyWatchpointAction implements IObjectActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ @Override
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
if (selection instanceof IStructuredSelection) {
fWatchpoints = (IStructuredSelection) selection;
if (!selection.isEmpty()) {
- Iterator iterator = fWatchpoints.iterator();
+ Iterator<?> iterator = fWatchpoints.iterator();
while (iterator.hasNext()) {
Object next = iterator.next();
if (next instanceof IWatchpoint) {
@@ -109,20 +112,23 @@ public abstract class ModifyWatchpointAction implements IObjectActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
fWatchpoints = null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
- public void runWithEvent(IAction action, Event event) {
+ @Override
+ public void runWithEvent(IAction action, Event event) {
run(action);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java
index 32f01bf9f..85947e71d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/OpenBreakpointMarkerAction.java
@@ -48,6 +48,7 @@ public class OpenBreakpointMarkerAction extends SelectionProviderAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IWorkbenchWindow dwindow= DebugUIPlugin.getActiveWorkbenchWindow();
if (dwindow == null) {
@@ -83,6 +84,7 @@ public class OpenBreakpointMarkerAction extends SelectionProviderAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void selectionChanged(IStructuredSelection sel) {
if (sel.size() == 1) {
breakpoint = (IBreakpoint)DebugPlugin.getAdapter(sel.getFirstElement(), IBreakpoint.class);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java
index 930aaabdd..ba21d1a6c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveAllBreakpointsAction.java
@@ -51,6 +51,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
*/
+ @Override
protected boolean isEnabled() {
return DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints();
}
@@ -58,6 +59,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
*/
+ @Override
public void breakpointsAdded(IBreakpoint[] breakpoints) {
update();
}
@@ -65,12 +67,14 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
if (getAction() != null) {
update();
@@ -80,6 +84,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
*/
+ @Override
protected void initialize() {
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
}
@@ -87,6 +92,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
super.dispose();
@@ -95,6 +101,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
final IBreakpointManager breakpointManager= DebugPlugin.getDefault().getBreakpointManager();
final IBreakpoint[] breakpoints = breakpointManager.getBreakpoints();
@@ -120,6 +127,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
}
if (proceed) {
new Job(ActionMessages.RemoveAllBreakpointsAction_2) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
DebugUITools.deleteBreakpoints(breakpoints, fShell, monitor);
@@ -137,6 +145,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
* @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#init(org.eclipse.ui.IViewPart)
* @since 3.7
*/
+ @Override
public void init(IViewPart view) {
super.init(view);
fShell= view.getSite().getShell();
@@ -146,6 +155,7 @@ public class RemoveAllBreakpointsAction extends AbstractRemoveAllActionDelegate
* @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
* @since 3.7
*/
+ @Override
public void init(IWorkbenchWindow window) {
super.init(window);
fShell= window.getShell();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
index 1bd6031bd..ca66a268c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RemoveBreakpointAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -49,17 +49,19 @@ public class RemoveBreakpointAction extends AbstractSelectionActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IStructuredSelection selection = getSelection();
if (selection.isEmpty()) {
return;
}
- final Iterator itr= selection.iterator();
+ final Iterator<?> itr = selection.iterator();
final CoreException[] exception= new CoreException[1];
IWorkspaceRunnable runnable= new IWorkspaceRunnable() {
+ @Override
public void run(IProgressMonitor monitor) {
- ArrayList breakpointsToDelete = new ArrayList();
- ArrayList groupsToDelete = new ArrayList();
+ ArrayList<IBreakpoint> breakpointsToDelete = new ArrayList<IBreakpoint>();
+ ArrayList<IWorkingSet> groupsToDelete = new ArrayList<IWorkingSet>();
boolean deleteAll = false;
boolean deleteContainer = false;
boolean prompted = false;
@@ -120,13 +122,14 @@ public class RemoveBreakpointAction extends AbstractSelectionActionDelegate {
}
}
}
- final IBreakpoint[] breakpoints = (IBreakpoint[]) breakpointsToDelete.toArray(new IBreakpoint[0]);
- final IWorkingSet[] sets = (IWorkingSet[])groupsToDelete.toArray(new IWorkingSet[groupsToDelete.size()]);
+ final IBreakpoint[] breakpoints = breakpointsToDelete.toArray(new IBreakpoint[0]);
+ final IWorkingSet[] sets = groupsToDelete.toArray(new IWorkingSet[groupsToDelete.size()]);
if(breakpoints.length > 0) {
((BreakpointsView)getView()).preserveSelection(getSelection());
}
new Job(ActionMessages.RemoveBreakpointAction_2) {
- protected IStatus run(IProgressMonitor pmonitor) {
+ @Override
+ protected IStatus run(IProgressMonitor pmonitor) {
try {
Shell shell= getView() != null ? getView().getSite().getShell() : null;
DebugUITools.deleteBreakpoints(breakpoints, shell, pmonitor);
@@ -161,6 +164,7 @@ public class RemoveBreakpointAction extends AbstractSelectionActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractSelectionActionDelegate#isEnabledFor(java.lang.Object)
*/
+ @Override
protected boolean isEnabledFor(Object element) {
if (element instanceof IBreakpointContainer) {
if(((IBreakpointContainer)element).getCategory() instanceof WorkingSetCategory) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java
index be62a45ae..ef20e9e9d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetBreakpointAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,11 +36,13 @@ public abstract class RetargetBreakpointAction extends RetargetAction implements
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getAdapterClass()
*/
- protected Class getAdapterClass() {
+ @Override
+ protected Class<?> getAdapterClass() {
return IToggleBreakpointsTarget.class;
}
- protected Object getAdapter(IAdaptable adaptable) {
+ @Override
+ protected Object getAdapter(IAdaptable adaptable) {
IToggleBreakpointsTargetManager manager = DebugUITools.getToggleBreakpointsTargetManager();
IWorkbenchPart activePart = getActivePart();
if (activePart != null) {
@@ -49,27 +51,32 @@ public abstract class RetargetBreakpointAction extends RetargetAction implements
return null;
}
- public void init(IWorkbenchWindow window) {
+ @Override
+ public void init(IWorkbenchWindow window) {
super.init(window);
DebugUITools.getToggleBreakpointsTargetManager().addChangedListener(this);
}
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
super.init(action);
DebugUITools.getToggleBreakpointsTargetManager().addChangedListener(this);
}
- public void dispose() {
+ @Override
+ public void dispose() {
DebugUITools.getToggleBreakpointsTargetManager().removeChangedListener(this);
super.dispose();
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
fAction = action;
super.selectionChanged(action, selection);
}
- public void preferredTargetsChanged() {
+ @Override
+ public void preferredTargetsChanged() {
if (fAction != null) {
IWorkbenchPart activePart = getActivePart();
if (activePart != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java
index 9c2e6ce8d..c9a01b9e7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetMethodBreakpointAction.java
@@ -26,18 +26,21 @@ public class RetargetMethodBreakpointAction extends RetargetBreakpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
((IToggleBreakpointsTarget)target).toggleMethodBreakpoints(part, selection);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
return ((IToggleBreakpointsTarget)target).canToggleMethodBreakpoints(part, selection);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
*/
+ @Override
protected String getOperationUnavailableMessage() {
return Messages.RetargetMethodBreakpointAction_0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
index 201b1c86b..22a018e26 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleBreakpointAction.java
@@ -27,6 +27,7 @@ public class RetargetToggleBreakpointAction extends RetargetBreakpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
if (target instanceof IToggleBreakpointsTargetExtension) {
IToggleBreakpointsTargetExtension ext = (IToggleBreakpointsTargetExtension) target;
@@ -38,6 +39,7 @@ public class RetargetToggleBreakpointAction extends RetargetBreakpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
if (target instanceof IToggleBreakpointsTargetExtension) {
IToggleBreakpointsTargetExtension ext = (IToggleBreakpointsTargetExtension) target;
@@ -49,6 +51,7 @@ public class RetargetToggleBreakpointAction extends RetargetBreakpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
*/
+ @Override
protected String getOperationUnavailableMessage() {
return Messages.RetargetToggleBreakpointAction_0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java
index a117419ed..58d5ed5c0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetToggleLineBreakpointAction.java
@@ -26,18 +26,21 @@ public class RetargetToggleLineBreakpointAction extends RetargetBreakpointAction
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
((IToggleBreakpointsTarget)target).toggleLineBreakpoints(part, selection);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
return ((IToggleBreakpointsTarget)target).canToggleLineBreakpoints(part, selection);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
*/
+ @Override
protected String getOperationUnavailableMessage() {
return Messages.RetargetToggleLineBreakpointAction_0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java
index 38466f41b..49fdb0a81 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RetargetWatchpointAction.java
@@ -26,18 +26,21 @@ public class RetargetWatchpointAction extends RetargetBreakpointAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#performAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected void performAction(Object target, ISelection selection, IWorkbenchPart part) throws CoreException {
((IToggleBreakpointsTarget)target).toggleWatchpoints(part, selection);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetBreakpointAction#canPerformAction(java.lang.Object, org.eclipse.jface.viewers.ISelection, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected boolean canPerformAction(Object target, ISelection selection, IWorkbenchPart part) {
return ((IToggleBreakpointsTarget)target).canToggleWatchpoints(part, selection);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.RetargetAction#getOperationUnavailableMessage()
*/
+ @Override
protected String getOperationUnavailableMessage() {
return Messages.RetargetWatchpointAction_0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
index a37f31e09..777f08a49 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/RulerEnableDisableBreakpointAction.java
@@ -35,6 +35,7 @@ public class RulerEnableDisableBreakpointAction extends RulerBreakpointAction im
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
if (fBreakpoint != null) {
try {
@@ -48,6 +49,7 @@ public class RulerEnableDisableBreakpointAction extends RulerBreakpointAction im
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
fBreakpoint = getBreakpoint();
setEnabled(fBreakpoint != null);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java
index f68b4fe17..34f7b05c8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SelectAllBreakpointsAction.java
@@ -27,10 +27,12 @@ public class SelectAllBreakpointsAction extends SelectAllAction implements IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
*/
+ @Override
protected boolean isEnabled() {
return DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints();
}
+ @Override
public void run(IAction action) {
Viewer viewer = ((AbstractDebugView) getView()).getViewer();
((Tree) viewer.getControl()).selectAll();
@@ -41,6 +43,7 @@ public class SelectAllBreakpointsAction extends SelectAllAction implements IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
*/
+ @Override
public void breakpointsAdded(IBreakpoint[] breakpoints) {
if (getAction() != null && !getAction().isEnabled()) {
update();
@@ -50,12 +53,14 @@ public class SelectAllBreakpointsAction extends SelectAllAction implements IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsRemoved(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
if (getAction() != null) {
update();
@@ -65,6 +70,7 @@ public class SelectAllBreakpointsAction extends SelectAllAction implements IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
*/
+ @Override
protected void initialize() {
DebugPlugin.getDefault().getBreakpointManager().addBreakpointListener(this);
}
@@ -72,6 +78,7 @@ public class SelectAllBreakpointsAction extends SelectAllAction implements IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#dispose()
*/
+ @Override
public void dispose() {
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointListener(this);
super.dispose();
@@ -80,6 +87,7 @@ public class SelectAllBreakpointsAction extends SelectAllAction implements IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.SelectAllAction#getActionId()
*/
+ @Override
protected String getActionId() {
return IDebugView.SELECT_ALL_ACTION;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
index b12fb49e0..29697f14c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowSupportedBreakpointsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -58,7 +58,7 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
/**
* The list of identifiers for the current state
*/
- private List fDebugTargets= new ArrayList(2);
+ private List<IDebugTarget> fDebugTargets= new ArrayList<IDebugTarget>(2);
/**
* A viewer filter that selects breakpoints that have
@@ -69,6 +69,7 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
/**
* @see ViewerFilter#select(Viewer, Object, Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if (element instanceof IBreakpointContainer) {
// Breakpoint containers are visible if any of their children are visible.
@@ -84,9 +85,7 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
if (fDebugTargets.isEmpty()) {
return true;
}
- Iterator iterator= fDebugTargets.iterator();
- while (iterator.hasNext()) {
- IDebugTarget target = (IDebugTarget) iterator.next();
+ for (IDebugTarget target : fDebugTargets) {
if (target.supportsBreakpoint(breakpoint)) {
return true;
}
@@ -125,10 +124,11 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
/**
* @see ISelectionListener#selectionChanged(IWorkbenchPart, ISelection)
*/
+ @Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss= (IStructuredSelection)selection;
- List debugTargets= getDebugTargets(ss);
+ List<IDebugTarget> debugTargets= getDebugTargets(ss);
if (!isChecked()) {
fDebugTargets= debugTargets;
return;
@@ -146,13 +146,11 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
}
if (debugTargets.size() == fDebugTargets.size()) {
- List copy= new ArrayList(debugTargets.size());
- Iterator iter= fDebugTargets.iterator();
- while (iter.hasNext()) {
- IDebugTarget target = (IDebugTarget) iter.next();
- Iterator newDebugTargets= debugTargets.iterator();
+ List<IDebugTarget> copy= new ArrayList<IDebugTarget>(debugTargets.size());
+ for (IDebugTarget target : fDebugTargets) {
+ Iterator<IDebugTarget> newDebugTargets= debugTargets.iterator();
while (newDebugTargets.hasNext()) {
- IDebugTarget newTarget= (IDebugTarget)newDebugTargets.next();
+ IDebugTarget newTarget= newDebugTargets.next();
copy.add(newTarget);
if (target.equals(newTarget)) {
newDebugTargets.remove();
@@ -174,7 +172,7 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
* need to re-apply the filters.
* @param debugTargets the new set of {@link IDebugTarget}s
*/
- protected void reapplyFilters(List debugTargets) {
+ protected void reapplyFilters(List<IDebugTarget> debugTargets) {
fDebugTargets= debugTargets;
getViewer().refresh();
}
@@ -187,9 +185,9 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
fView = (AbstractDebugView) view;
}
- protected List getDebugTargets(IStructuredSelection ss) {
- List debugTargets= new ArrayList(2);
- Iterator i= ss.iterator();
+ protected List<IDebugTarget> getDebugTargets(IStructuredSelection ss) {
+ List<IDebugTarget> debugTargets= new ArrayList<IDebugTarget>(2);
+ Iterator<?> i= ss.iterator();
while (i.hasNext()) {
Object next= i.next();
if (next instanceof IDebugElement) {
@@ -214,6 +212,7 @@ public class ShowSupportedBreakpointsAction extends ToggleFilterAction implement
* on the value of the parameter.
* @param on flag to indicate if viewer filtering should be added or removed
*/
+ @Override
protected void valueChanged(boolean on) {
if (getViewer().getControl().isDisposed()) {
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowTargetBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowTargetBreakpointsAction.java
index c9f0bff4e..c043a359f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowTargetBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ShowTargetBreakpointsAction.java
@@ -54,6 +54,7 @@ public class ShowTargetBreakpointsAction extends Action {
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
if (fView.getViewer().getControl().isDisposed()) {
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
index 0abe3797c..16ca3786a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/SkipAllBreakpointsAction.java
@@ -77,6 +77,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run(){
IWorkbenchSiteProgressService progressService = null;
if (fPart != null) {
@@ -85,6 +86,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
}
final boolean enabled = !getBreakpointManager().isEnabled();
Job job = new Job(getText()) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
IBreakpointManager bm = getBreakpointManager();
@@ -124,6 +126,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
getBreakpointManager().removeBreakpointManagerListener(this);
}
@@ -131,6 +134,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
updateActionCheckedState();
getBreakpointManager().addBreakpointManagerListener(this);
@@ -139,6 +143,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
setChecked(action.isChecked());
run();
@@ -151,6 +156,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
fAction = action;
}
@@ -158,6 +164,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
*/
+ @Override
public void breakpointManagerEnablementChanged(boolean enabled) {
if (fAction != null) {
fAction.setChecked(!enabled);
@@ -167,6 +174,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
updateActionCheckedState();
@@ -175,6 +183,7 @@ public class SkipAllBreakpointsAction extends Action implements IWorkbenchWindow
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java
index 920cc6593..67c176de8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/breakpoints/ToggleBreakpointObjectActionDelegate.java
@@ -39,12 +39,14 @@ public abstract class ToggleBreakpointObjectActionDelegate implements IObjectAct
/* (non-Javadoc)
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
fPart = targetPart;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IToggleBreakpointsTarget target =
DebugUITools.getToggleBreakpointsTargetManager().getToggleBreakpointsTarget(fPart, fSelection);
@@ -70,6 +72,7 @@ public abstract class ToggleBreakpointObjectActionDelegate implements IObjectAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
boolean enabled = false;
if (selection instanceof IStructuredSelection) {
@@ -88,12 +91,14 @@ public abstract class ToggleBreakpointObjectActionDelegate implements IObjectAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
fSelection = null;
fPart = null;
@@ -101,6 +106,7 @@ public abstract class ToggleBreakpointObjectActionDelegate implements IObjectAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java
index a458d9e06..4eb881fd3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/AddWatchExpressionAction.java
@@ -30,12 +30,14 @@ public class AddWatchExpressionAction extends WatchExpressionAction implements I
/**
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
}
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
// create a watch expression
IWatchExpression watchExpression= DebugPlugin.getDefault().getExpressionManager().newWatchExpression(IInternalDebugCoreConstants.EMPTY_STRING);
@@ -50,6 +52,7 @@ public class AddWatchExpressionAction extends WatchExpressionAction implements I
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java
index bfa6c941b..7c72b9ff8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ConvertToWatchExpressionAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,10 +29,11 @@ public class ConvertToWatchExpressionAction extends WatchExpressionAction {
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IStructuredSelection selection= getCurrentSelection();
IExpressionManager expressionManager= DebugPlugin.getDefault().getExpressionManager();
- for (Iterator iter= selection.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
IExpression expression= (IExpression) iter.next();
// create the new watch expression
IWatchExpression watchExpression= expressionManager.newWatchExpression(expression.getExpressionText());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
index 3cd1c2754..084ac1384 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressinInPlaceAction.java
@@ -40,7 +40,8 @@ public class EditWatchExpressinInPlaceAction extends Action implements ISelectio
fEditActionDelegate.selectionChanged(this, selectionProvider.getSelection());
}
- public void selectionChanged(SelectionChangedEvent event) {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = fEditActionDelegate.getCurrentSelection();
setEnabled(selection != null && selection.size() == 1);
}
@@ -49,7 +50,8 @@ public class EditWatchExpressinInPlaceAction extends Action implements ISelectio
fView.getSite().getSelectionProvider().removeSelectionChangedListener(this);
}
- public void run() {
+ @Override
+ public void run() {
IStructuredSelection selelection = fEditActionDelegate.getCurrentSelection();
if (selelection.size() != 1) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java
index c858ca31c..fb21f03c3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EditWatchExpressionAction.java
@@ -26,12 +26,14 @@ public class EditWatchExpressionAction extends WatchExpressionAction {
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IWatchExpression watchExpression= getSelectedExpressions()[0];
// display the watch expression dialog for the currently selected watch expression
new WatchExpressionDialog(DebugUIPlugin.getShell(), watchExpression, true).open();
}
+ @Override
public void selectionChanged(IAction action, ISelection sel) {
action.setEnabled(getSelectedExpressions().length == 1);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
index 096d2a73c..9e2edc535 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/EnableWatchExpressionAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,6 +38,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
DebugPlugin.getDefault().addDebugEventListener(this);
}
@@ -45,9 +46,10 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fSelection instanceof IStructuredSelection) {
- Iterator iter= ((IStructuredSelection) fSelection).iterator();
+ Iterator<?> iter = ((IStructuredSelection) fSelection).iterator();
IWatchExpression expression;
while (iter.hasNext()) {
expression= getWatchExpression(iter.next());
@@ -74,11 +76,12 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
fSelection= selection;
if (fSelection instanceof IStructuredSelection) {
boolean enabled= false;
- Iterator iter= ((IStructuredSelection) selection).iterator();
+ Iterator<?> iter = ((IStructuredSelection) selection).iterator();
while (iter.hasNext()) {
IWatchExpression expression = getWatchExpression(iter.next());
if (expression != null && expression.isEnabled() != fEnable) {
@@ -106,6 +109,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
@@ -113,6 +117,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
}
@@ -120,6 +125,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -127,6 +133,7 @@ public class EnableWatchExpressionAction implements IViewActionDelegate, IAction
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java
index 36e8ad6b5..a474de8dc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/PasteWatchExpressionsAction.java
@@ -31,6 +31,7 @@ public class PasteWatchExpressionsAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run() {
if (fExpressionView.canPaste()) {
fExpressionView.performPaste();
@@ -40,6 +41,7 @@ public class PasteWatchExpressionsAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#isEnabled()
*/
+ @Override
public boolean isEnabled() {
return fExpressionView.canPaste();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java
index 003024845..b20041e7e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/ReevaluateWatchExpressionAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,9 +33,8 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class ReevaluateWatchExpressionAction implements IObjectActionDelegate {
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // TODO Auto-generated method stub
-
+ @Override
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/**
@@ -67,9 +66,10 @@ public class ReevaluateWatchExpressionAction implements IObjectActionDelegate {
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IDebugElement context = getContext();
- for (Iterator iter= getCurrentSelection().iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = getCurrentSelection().iterator(); iter.hasNext();) {
IWatchExpression expression= (IWatchExpression) iter.next();
expression.setExpressionContext(context);
if (!expression.isEnabled()) {
@@ -82,6 +82,7 @@ public class ReevaluateWatchExpressionAction implements IObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
IDebugElement debugElement = getContext();
if (debugElement == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java
index 209de9dac..682411595 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveAllExpressionsAction.java
@@ -33,6 +33,7 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
@@ -60,6 +61,7 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
*/
+ @Override
protected boolean isEnabled() {
return DebugPlugin.getDefault().getExpressionManager().hasExpressions();
}
@@ -67,6 +69,7 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
*/
+ @Override
protected void initialize() {
DebugPlugin.getDefault().getExpressionManager().addExpressionListener(this);
}
@@ -74,6 +77,7 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#dispose()
*/
+ @Override
public void dispose() {
DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
super.dispose();
@@ -82,6 +86,7 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsAdded(IExpression[] expressions) {
update();
}
@@ -89,6 +94,7 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsRemoved(IExpression[] expressions) {
update();
}
@@ -96,5 +102,6 @@ public class RemoveAllExpressionsAction extends AbstractRemoveAllActionDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsChanged(IExpression[] expressions) {}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
index 3eed013bb..a2a00d0ca 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/RemoveExpressionAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,12 +33,12 @@ public class RemoveExpressionAction extends AbstractSelectionActionDelegate {
protected IExpression[] getExpressions() {
TreeSelection selection = (TreeSelection) getSelection();
TreePath[] paths = selection.getPaths();
- List expressions = new ArrayList();
+ List<IExpression> expressions = new ArrayList<IExpression>();
for (int i = paths.length-1; i >=0; i--) {
TreePath path = paths[i];
Object segment = path.getFirstSegment();
if (segment instanceof IExpression) {
- expressions.add(segment);
+ expressions.add((IExpression) segment);
} else if (segment instanceof IAdaptable) {
IExpression expression = (IExpression)((IAdaptable)segment).getAdapter(IExpression.class);
if (expression != null) {
@@ -46,14 +46,16 @@ public class RemoveExpressionAction extends AbstractSelectionActionDelegate {
}
}
}
- return (IExpression[]) expressions.toArray(new IExpression[expressions.size()]);
+ return expressions.toArray(new IExpression[expressions.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
WorkbenchJob job = new WorkbenchJob("remove expression") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IExpressionManager expManager = DebugPlugin.getDefault().getExpressionManager();
IExpression[] exp = getExpressions();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java
index 2e9da1b1e..c777d0684 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/SelectAllExpressionsAction.java
@@ -21,6 +21,7 @@ public class SelectAllExpressionsAction extends SelectAllAction implements IExpr
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
*/
+ @Override
protected boolean isEnabled() {
return DebugPlugin.getDefault().getExpressionManager().hasExpressions();
}
@@ -28,6 +29,7 @@ public class SelectAllExpressionsAction extends SelectAllAction implements IExpr
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.SelectAllAction#getActionId()
*/
+ @Override
protected String getActionId() {
return IDebugView.SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$
}
@@ -35,6 +37,7 @@ public class SelectAllExpressionsAction extends SelectAllAction implements IExpr
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#initialize()
*/
+ @Override
protected void initialize() {
DebugPlugin.getDefault().getExpressionManager().addExpressionListener(this);
}
@@ -42,6 +45,7 @@ public class SelectAllExpressionsAction extends SelectAllAction implements IExpr
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsAdded(IExpression[] expressions) {
update();
}
@@ -49,6 +53,7 @@ public class SelectAllExpressionsAction extends SelectAllAction implements IExpr
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsRemoved(IExpression[] expressions) {
update();
}
@@ -56,13 +61,15 @@ public class SelectAllExpressionsAction extends SelectAllAction implements IExpr
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsChanged(IExpression[] expressions) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractRemoveAllActionDelegate#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
super.dispose();
DebugPlugin.getDefault().getExpressionManager().removeExpressionListener(this);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
index 9b1d796a3..30ae517c4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@ public abstract class WatchExpressionAction implements IViewActionDelegate {
private static IWatchExpression[] EMPTY_EXPRESSION_ARRAY = new IWatchExpression[0];
+ @Override
public void init(IViewPart view) {
fPart = view;
}
@@ -61,13 +62,13 @@ public abstract class WatchExpressionAction implements IViewActionDelegate {
}
protected IWatchExpression[] getSelectedExpressions() {
- List list = new LinkedList();
+ List<Object> list = new LinkedList<Object>();
IStructuredSelection currentSelection = getCurrentSelection();
if (currentSelection == null) {
return EMPTY_EXPRESSION_ARRAY;
}
- for (Iterator iter= currentSelection.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter= currentSelection.iterator(); iter.hasNext();) {
Object element = iter.next();
if (element instanceof IWatchExpression) {
list.add(element);
@@ -83,12 +84,13 @@ public abstract class WatchExpressionAction implements IViewActionDelegate {
}
}
- return (IWatchExpression[])list.toArray(new IWatchExpression[list.size()]);
+ return list.toArray(new IWatchExpression[list.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection sel) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
index 61171c618..e76d08056 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -84,6 +84,7 @@ public class WatchExpressionDialog extends StatusDialog {
*
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Font font = parent.getFont();
@@ -108,8 +109,10 @@ public class WatchExpressionDialog extends StatusDialog {
fSnippetViewer.setEditable(true);
fSnippetViewer.setDocument(document);
document.addDocumentListener(new IDocumentListener() {
+ @Override
public void documentAboutToBeChanged(DocumentEvent event) {
}
+ @Override
public void documentChanged(DocumentEvent event) {
checkValues();
}
@@ -144,6 +147,7 @@ public class WatchExpressionDialog extends StatusDialog {
menuManager.add(copyAction);
menuManager.add(pasteAction);
menuManager.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
cutAction.update();
copyAction.update();
@@ -160,7 +164,7 @@ public class WatchExpressionDialog extends StatusDialog {
fCheckBox.setFont(font);
String tipText = MessageFormat.format(ActionMessages.WatchExpressionDialog_5,
- new String[] { getCtrlReturnText() });
+ new Object[] { getCtrlReturnText() });
fTip= new Label(container, SWT.LEFT);
fTip.setText(tipText);
fTip.setFont(font);
@@ -187,6 +191,7 @@ public class WatchExpressionDialog extends StatusDialog {
/**
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
fWatchExpression.setEnabled(fCheckBox.getSelection());
fWatchExpression.setExpressionText(fSnippetViewer.getDocument().get());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java
index 6f300f4e3..167387bbb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchExpressionFactoryTester.java
@@ -32,6 +32,7 @@ public class WatchExpressionFactoryTester extends PropertyTester {
/* (non-Javadoc)
* @see org.eclipse.core.expressions.PropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
+ @Override
public boolean test(Object element, String property, Object[] args, Object expectedValue) {
if (CAN_CREATE_WATCH_EXPRESSION_PROPERTY.equals(property)){
if (element instanceof IVariable) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
index a71ba6f14..b2d8fd139 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/expressions/WatchHandler.java
@@ -45,10 +45,11 @@ public class WatchHandler extends AbstractHandler {
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- Iterator iter = ((IStructuredSelection)selection).iterator();
+ Iterator<?> iter = ((IStructuredSelection)selection).iterator();
while (iter.hasNext()) {
Object element = iter.next();
createExpression(element);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
index 4da195e81..dd191c286 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,8 +12,8 @@
package org.eclipse.debug.internal.ui.actions.variables;
-import com.ibm.icu.text.MessageFormat;
import java.util.Iterator;
+
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IValueModification;
import org.eclipse.debug.core.model.IVariable;
@@ -34,6 +34,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.SelectionProviderAction;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Action for changing the value of primitives and <code>String</code> variables.
* This action will attempt to delegate the editing operation to a registered
@@ -122,10 +124,11 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
DebugUIPlugin.errorDialog(shell, ActionMessages.ChangeVariableValue_errorDialogTitle,ActionMessages.ChangeVariableValue_errorDialogMessage, exception); //
return;
}
- ChangeVariableValueInputDialog inputDialog= new ChangeVariableValueInputDialog(shell, ActionMessages.ChangeVariableValue_1, MessageFormat.format(ActionMessages.ChangeVariableValue_2, new String[] {name}), value, new IInputValidator() { //
+ ChangeVariableValueInputDialog inputDialog = new ChangeVariableValueInputDialog(shell, ActionMessages.ChangeVariableValue_1, MessageFormat.format(ActionMessages.ChangeVariableValue_2, new Object[] { name }), value, new IInputValidator() { //
/**
* Returns an error string if the input is invalid
*/
+ @Override
public String isValid(String input) {
try {
if (fVariable.verifyValue(input)) {
@@ -158,7 +161,7 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
*/
protected void update(IStructuredSelection sel) {
isApplicable = false;
- Iterator iter= sel.iterator();
+ Iterator<Object> iter = sel.iterator();
if (iter.hasNext()) {
Object object= iter.next();
if (object instanceof IValueModification) {
@@ -178,14 +181,16 @@ public class ChangeVariableValueAction extends SelectionProviderAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
- Iterator iterator= getStructuredSelection().iterator();
+ Iterator<Object> iterator = getStructuredSelection().iterator();
doActionPerformed((IVariable)iterator.next());
}
/**
* @see SelectionProviderAction#selectionChanged(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void selectionChanged(IStructuredSelection sel) {
update(sel);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
index a5aeb7119..285405948 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ChangeVariableValueInputDialog.java
@@ -104,6 +104,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/* (non-Javadoc)
* Method declared on Dialog.
*/
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
value= text.getText();
@@ -115,6 +116,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/* (non-Javadoc)
* Method declared in Window.
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
if (title != null)
@@ -123,6 +125,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/* (non-Javadoc)
* Method declared on Dialog.
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
// create OK and Cancel buttons by default
okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
@@ -138,6 +141,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/* (non-Javadoc)
* Method declared on Dialog.
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Font font = parent.getFont();
// create composite
@@ -165,6 +169,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
text.setFont(font);
text.addModifyListener(
new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
if (okButton.isEnabled()) {
return;
@@ -248,6 +253,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
errorMessageLabel.getParent().update();
}
+ @Override
protected void okPressed() {
validateInput();
if (okButton.isEnabled()) {
@@ -267,7 +273,8 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
@@ -279,6 +286,7 @@ public class ChangeVariableValueInputDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#handleShellCloseEvent()
*/
+ @Override
protected void handleShellCloseEvent() {
value= null;
super.handleShellCloseEvent();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java
index dc228a629..81dbcba7b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/SelectAllVariablesAction.java
@@ -16,6 +16,7 @@ import org.eclipse.debug.ui.IDebugView;
public class SelectAllVariablesAction extends SelectAllAction {
+ @Override
protected String getActionId() {
return IDebugView.SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$
}
@@ -23,12 +24,14 @@ public class SelectAllVariablesAction extends SelectAllAction {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#initialize()
*/
+ @Override
protected void initialize() {
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.selection.AbstractRemoveAllActionDelegate#isEnabled()
*/
+ @Override
protected boolean isEnabled() {
// TODO: only enable when stuff present
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
index 9aaa80473..681bd7a08 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ShowTypesAction.java
@@ -51,6 +51,7 @@ public class ShowTypesAction extends Action {
/**
* @see Action#run()
*/
+ @Override
public void run() {
valueChanged(isChecked());
}
@@ -70,6 +71,7 @@ public class ShowTypesAction extends Action {
treeViewer.getPresentationContext().setProperty(IDebugModelPresentation.DISPLAY_VARIABLE_TYPE_NAMES, typesStatus);
}
BusyIndicator.showWhile(viewer.getControl().getDisplay(), new Runnable() {
+ @Override
public void run() {
viewer.refresh();
}
@@ -88,6 +90,7 @@ public class ShowTypesAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#setEnabled(boolean)
*/
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (enabled) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java
index 572827acf..8f6adc86d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/ToggleDetailPaneAction.java
@@ -78,6 +78,7 @@ public class ToggleDetailPaneAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
getVariablesView().setDetailPaneOrientation(getOrientation());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
index 81eff77e9..b823527d0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneAssignValueAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -77,7 +77,8 @@ public class DetailPaneAssignValueAction extends Action{
variable.setValue(newValueExpression);
} else {
if (shell != null) {
- DebugUIPlugin.errorDialog(shell, ActionMessages.DetailPaneAssignValueAction_2, MessageFormat.format(ActionMessages.DetailPaneAssignValueAction_3, new String[] {newValueExpression, variable.getName()}), new StatusInfo(IStatus.ERROR, ActionMessages.DetailPaneAssignValueAction_4)); //
+ DebugUIPlugin.errorDialog(shell, ActionMessages.DetailPaneAssignValueAction_2, MessageFormat.format(ActionMessages.DetailPaneAssignValueAction_3, new Object[] {
+ newValueExpression, variable.getName() }), new StatusInfo(IStatus.ERROR, ActionMessages.DetailPaneAssignValueAction_4)); //
}
}
} catch (DebugException e) {
@@ -119,6 +120,7 @@ public class DetailPaneAssignValueAction extends Action{
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IVariable variable = (IVariable) fCurrentSelection.getFirstElement();
@@ -144,6 +146,7 @@ public class DetailPaneAssignValueAction extends Action{
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#getActionDefinitionId()
*/
+ @Override
public String getActionDefinitionId() {
return IWorkbenchCommandConstants.FILE_SAVE;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
index 032958bd0..112725210 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthAction.java
@@ -35,6 +35,7 @@ public class DetailPaneMaxLengthAction extends Action {
}
+ @Override
public void run() {
DetailPaneMaxLengthDialog dialog = new DetailPaneMaxLengthDialog(fDialogShell);
dialog.open();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
index e348f02c6..237d26f36 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneMaxLengthDialog.java
@@ -55,6 +55,7 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
setShellStyle(getShellStyle() | SWT.RESIZE);
fValue = Integer.toString(DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugUIConstants.PREF_MAX_DETAIL_LENGTH));
fValidator = new IInputValidator() {
+ @Override
public String isValid(String newText) {
try {
int num = Integer.parseInt(newText);
@@ -73,6 +74,7 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.SelectionDialog#getDialogBoundsSettings()
*/
+ @Override
protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(SETTINGS_ID);
@@ -85,6 +87,7 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
getShell().setText(VariablesViewMessages.DetailPaneMaxLengthDialog_0);
Control contents = super.createContents(parent);
@@ -95,6 +98,7 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
Label label = new Label(composite, SWT.WRAP);
@@ -107,7 +111,8 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
fTextWidget.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
fTextWidget.setText(fValue);
fTextWidget.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
validateInput();
fValue = fTextWidget.getText();
}
@@ -124,6 +129,7 @@ public class DetailPaneMaxLengthDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
String text = getValue();
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
index f8bb07b1b..caa5bd816 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/variables/details/DetailPaneWordWrapAction.java
@@ -46,6 +46,7 @@ public class DetailPaneWordWrapAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fTextViewer.getTextWidget().setWordWrap(isChecked());
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java
index 621109137..bb19279d5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/breakpoints/provisional/OtherBreakpointCategory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,12 +33,12 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
*/
public class OtherBreakpointCategory extends PlatformObject implements IWorkbenchAdapter {
- private static Map fOthers = new HashMap();
+ private static Map<IBreakpointOrganizer, IAdaptable[]> fOthers = new HashMap<IBreakpointOrganizer, IAdaptable[]>();
private IBreakpointOrganizer fOrganizer;
public static IAdaptable[] getCategories(IBreakpointOrganizer organizer) {
- IAdaptable[] others = (IAdaptable[]) fOthers.get(organizer);
+ IAdaptable[] others = fOthers.get(organizer);
if (others == null) {
others = new IAdaptable[]{new OtherBreakpointCategory(organizer)};
fOthers.put(organizer, others);
@@ -58,35 +58,40 @@ public class OtherBreakpointCategory extends PlatformObject implements IWorkbenc
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
- public ImageDescriptor getImageDescriptor(Object object) {
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_VIEW_BREAKPOINTS);
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
- public String getLabel(Object o) {
+ @Override
+ public String getLabel(Object o) {
return fOrganizer.getOthersLabel();
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
- public Object getParent(Object o) {
+ @Override
+ public Object getParent(Object o) {
return null;
}
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
if (obj instanceof OtherBreakpointCategory) {
OtherBreakpointCategory category = (OtherBreakpointCategory) obj;
return fOrganizer.equals(category.fOrganizer);
@@ -97,7 +102,8 @@ public class OtherBreakpointCategory extends PlatformObject implements IWorkbenc
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fOrganizer.hashCode();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
index 2364d5655..ff7ad3b6c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/AbstractRequestMonitor.java
@@ -27,6 +27,7 @@ public abstract class AbstractRequestMonitor implements IStatusMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IStatusMonitor#setStatus(org.eclipse.core.runtime.IStatus)
*/
+ @Override
public void setStatus(IStatus status) {
fStatus = status;
}
@@ -34,18 +35,21 @@ public abstract class AbstractRequestMonitor implements IStatusMonitor {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String, int)
*/
+ @Override
public void beginTask(String name, int totalWork) {
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double)
*/
+ @Override
public void internalWorked(double work) {
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
*/
+ @Override
public boolean isCanceled() {
return fCancelled;
}
@@ -53,6 +57,7 @@ public abstract class AbstractRequestMonitor implements IStatusMonitor {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
*/
+ @Override
public void setCanceled(boolean value) {
fCancelled = value;
}
@@ -60,24 +65,28 @@ public abstract class AbstractRequestMonitor implements IStatusMonitor {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String)
*/
+ @Override
public void setTaskName(String name) {
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String)
*/
+ @Override
public void subTask(String name) {
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#worked(int)
*/
+ @Override
public void worked(int work) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IStatusMonitor#getStatus()
*/
+ @Override
public IStatus getStatus() {
return fStatus;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
index 273f9ecff..0d4316589 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugActionHandler.java
@@ -59,6 +59,7 @@ public abstract class DebugActionHandler implements IHandler2 {
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IHandler2 delegate = getDelegate();
if (delegate != null) {
@@ -70,6 +71,7 @@ public abstract class DebugActionHandler implements IHandler2 {
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#addHandlerListener(org.eclipse.core.commands.IHandlerListener)
*/
+ @Override
public void addHandlerListener(IHandlerListener handlerListener) {
IHandler2 delegate = getDelegate();
if (delegate != null) {
@@ -80,12 +82,14 @@ public abstract class DebugActionHandler implements IHandler2 {
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#isEnabled()
*/
+ @Override
public boolean isEnabled() {
IHandler2 delegate = getDelegate();
if (delegate != null) {
@@ -97,6 +101,7 @@ public abstract class DebugActionHandler implements IHandler2 {
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#isHandled()
*/
+ @Override
public boolean isHandled() {
IHandler2 delegate = getDelegate();
if (delegate != null) {
@@ -108,6 +113,7 @@ public abstract class DebugActionHandler implements IHandler2 {
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#removeHandlerListener(org.eclipse.core.commands.IHandlerListener)
*/
+ @Override
public void removeHandlerListener(IHandlerListener handlerListener) {
IHandler2 delegate = getDelegate();
if (delegate != null) {
@@ -118,6 +124,7 @@ public abstract class DebugActionHandler implements IHandler2 {
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler2#setEnabled(java.lang.Object)
*/
+ @Override
public void setEnabled(Object evaluationContext) {
IHandler2 delegate = getDelegate();
if (delegate != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
index 8f4b1fa07..a66a6b048 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandActionDelegate.java
@@ -39,6 +39,7 @@ public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActi
* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
fDebugAction.dispose();
}
@@ -47,7 +48,8 @@ public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActi
* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
fDebugAction.setActionProxy(action);
}
@@ -55,7 +57,8 @@ public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActi
* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
- public void init(IWorkbenchWindow window) {
+ @Override
+ public void init(IWorkbenchWindow window) {
fDebugAction.init(window);
}
@@ -63,6 +66,7 @@ public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActi
* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
fDebugAction.run();
}
@@ -72,6 +76,7 @@ public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActi
* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -80,7 +85,8 @@ public abstract class DebugCommandActionDelegate implements IWorkbenchWindowActi
* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
- public void selectionChanged(IAction action, ISelection s) {
+ @Override
+ public void selectionChanged(IAction action, ISelection s) {
// do nothing
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
index b65c50c15..25c80f908 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DebugCommandService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.debug.internal.ui.commands.actions;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -40,7 +39,7 @@ public class DebugCommandService implements IDebugContextListener {
/**
* Maps command types to actions to update
*/
- private Map fCommandUpdates = new HashMap();
+ private Map<Class<?>, List<IEnabledTarget>> fCommandUpdates = new HashMap<Class<?>, List<IEnabledTarget>>();
/**
* Window this service is for.
@@ -55,7 +54,7 @@ public class DebugCommandService implements IDebugContextListener {
/**
* Service per window
*/
- private static Map fgServices = new HashMap();
+ private static Map<IWorkbenchWindow, DebugCommandService> fgServices = new HashMap<IWorkbenchWindow, DebugCommandService>();
/**
* Returns the service for a window.
@@ -64,7 +63,7 @@ public class DebugCommandService implements IDebugContextListener {
* @return service
*/
public synchronized static DebugCommandService getService(IWorkbenchWindow window) {
- DebugCommandService service = (DebugCommandService) fgServices.get(window);
+ DebugCommandService service = fgServices.get(window);
if (service == null) {
service = new DebugCommandService(window);
fgServices.put(window, service);
@@ -78,18 +77,22 @@ public class DebugCommandService implements IDebugContextListener {
fContextService.addPostDebugContextListener(this);
PlatformUI.getWorkbench().addWindowListener(new IWindowListener() {
+ @Override
public void windowOpened(IWorkbenchWindow w) {
}
+ @Override
public void windowDeactivated(IWorkbenchWindow w) {
}
+ @Override
public void windowClosed(IWorkbenchWindow w) {
if (fWindow == w) {
dispose();
}
}
+ @Override
public void windowActivated(IWorkbenchWindow w) {
}
@@ -109,12 +112,12 @@ public class DebugCommandService implements IDebugContextListener {
* @param commandType the command class
* @param action the action to add to the update list
*/
- public void postUpdateCommand(Class commandType, IEnabledTarget action) {
+ public void postUpdateCommand(Class<?> commandType, IEnabledTarget action) {
synchronized (fCommandUpdates) {
Job.getJobManager().cancel(commandType);
- List actions = (List) fCommandUpdates.get(commandType);
+ List<IEnabledTarget> actions = fCommandUpdates.get(commandType);
if (actions == null) {
- actions = new ArrayList();
+ actions = new ArrayList<IEnabledTarget>();
fCommandUpdates.put(commandType, actions);
}
actions.add(action);
@@ -127,7 +130,7 @@ public class DebugCommandService implements IDebugContextListener {
* @param commandType the command class
* @param action the action to update
*/
- public void updateCommand(Class commandType, IEnabledTarget action) {
+ public void updateCommand(Class<?> commandType, IEnabledTarget action) {
ISelection context = fContextService.getActiveContext();
if (context instanceof IStructuredSelection && !context.isEmpty()) {
Object[] elements = ((IStructuredSelection)context).toArray();
@@ -138,27 +141,21 @@ public class DebugCommandService implements IDebugContextListener {
}
private void postUpdate(ISelection context) {
- Map commands = null;
+ Map<Class<?>, List<IEnabledTarget>> commands = null;
synchronized (fCommandUpdates) {
commands = fCommandUpdates;
- fCommandUpdates = new HashMap(commands.size());
+ fCommandUpdates = new HashMap<Class<?>, List<IEnabledTarget>>(commands.size());
}
if (context instanceof IStructuredSelection && !context.isEmpty()) {
Object[] elements = ((IStructuredSelection)context).toArray();
- Iterator iterator = commands.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- Class commandType = (Class)entry.getKey();
- List actions = (List) entry.getValue();
- updateCommand(commandType, elements, (IEnabledTarget[]) actions.toArray(new IEnabledTarget[actions.size()]));
+ for (Entry<Class<?>, List<IEnabledTarget>> entry : commands.entrySet()) {
+ List<IEnabledTarget> actions = entry.getValue();
+ updateCommand(entry.getKey(), elements, actions.toArray(new IEnabledTarget[actions.size()]));
}
} else {
- Iterator iterator = commands.values().iterator();
- while (iterator.hasNext()) {
- List actionList = (List) iterator.next();
- Iterator actions = actionList.iterator();
- while (actions.hasNext()) {
- ((IEnabledTarget)actions.next()).setEnabled(false);
+ for (List<IEnabledTarget> actionList : commands.values()) {
+ for (IEnabledTarget target : actionList) {
+ target.setEnabled(false);
}
}
}
@@ -171,7 +168,7 @@ public class DebugCommandService implements IDebugContextListener {
* @param elements elements to update for
* @param actions the actions to update
*/
- private void updateCommand(Class handlerType, Object[] elements, IEnabledTarget[] actions) {
+ private void updateCommand(Class<?> handlerType, Object[] elements, IEnabledTarget[] actions) {
if (elements.length == 1) {
// usual case - one element
Object element = elements[0];
@@ -182,16 +179,12 @@ public class DebugCommandService implements IDebugContextListener {
return;
}
} else {
- Map map = collate(elements, handlerType);
+ Map<IDebugCommandHandler, List<Object>> map = collate(elements, handlerType);
if (map != null) {
ActionsUpdater updater = new ActionsUpdater(actions, map.size());
- Iterator entries = map.entrySet().iterator();
- while (entries.hasNext()) {
- Entry entry = (Entry) entries.next();
- IDebugCommandHandler handler = (IDebugCommandHandler) entry.getKey();
- List list = (List) entry.getValue();
- UpdateHandlerRequest request = new UpdateHandlerRequest(list.toArray(), updater);
- handler.canExecute(request);
+ for (Entry<IDebugCommandHandler, List<Object>> entry : map.entrySet()) {
+ UpdateHandlerRequest request = new UpdateHandlerRequest(entry.getValue().toArray(), updater);
+ entry.getKey().canExecute(request);
}
return;
}
@@ -209,7 +202,7 @@ public class DebugCommandService implements IDebugContextListener {
* @param participant the participant
* @return if the command stays enabled while the command executes
*/
- public boolean executeCommand(Class handlerType, Object[] elements, ICommandParticipant participant) {
+ public boolean executeCommand(Class<?> handlerType, Object[] elements, ICommandParticipant participant) {
if (elements.length == 1) {
// usual case - one element
Object element = elements[0];
@@ -220,18 +213,14 @@ public class DebugCommandService implements IDebugContextListener {
return handler.execute(request);
}
} else {
- Map map = collate(elements, handlerType);
+ Map<IDebugCommandHandler, List<Object>> map = collate(elements, handlerType);
if (map != null) {
boolean enabled = true;
- Iterator entries = map.entrySet().iterator();
- while (entries.hasNext()) {
- Entry entry = (Entry) entries.next();
- IDebugCommandHandler handler = (IDebugCommandHandler) entry.getKey();
- List list = (List) entry.getValue();
- ExecuteActionRequest request = new ExecuteActionRequest(list.toArray());
+ for (Entry<IDebugCommandHandler, List<Object>> entry : map.entrySet()) {
+ ExecuteActionRequest request = new ExecuteActionRequest(entry.getValue().toArray());
request.setCommandParticipant(participant);
// specifically use & so handler is executed
- enabled = enabled & handler.execute(request);
+ enabled = enabled & entry.getKey().execute(request);
}
return enabled;
}
@@ -240,6 +229,7 @@ public class DebugCommandService implements IDebugContextListener {
return false;
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
postUpdate(event.getContext());
}
@@ -252,17 +242,17 @@ public class DebugCommandService implements IDebugContextListener {
* @param handlerType the handler type class
* @return map of command handlers to associated elements or <code>null</code>
*/
- private Map collate(Object[] elements, Class handlerType) {
- Map map = new HashMap();
+ private Map<IDebugCommandHandler, List<Object>> collate(Object[] elements, Class<?> handlerType) {
+ Map<IDebugCommandHandler, List<Object>> map = new HashMap<IDebugCommandHandler, List<Object>>();
for (int i = 0; i < elements.length; i++) {
Object element = elements[i];
IDebugCommandHandler handler = getHandler(element, handlerType);
if (handler == null) {
return null;
} else {
- List list = (List) map.get(handler);
+ List<Object> list = map.get(handler);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<Object>();
map.put(handler, list);
}
list.add(element);
@@ -271,7 +261,7 @@ public class DebugCommandService implements IDebugContextListener {
return map;
}
- private IDebugCommandHandler getHandler(Object element, Class handlerType) {
+ private IDebugCommandHandler getHandler(Object element, Class<?> handlerType) {
return (IDebugCommandHandler)DebugPlugin.getAdapter(element, handlerType);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
index cd5b4edd7..a0495f1fa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,35 +28,43 @@ public class DisconnectCommandAction extends DebugCommandAction{
setActionDefinitionId("org.eclipse.debug.ui.commands.Disconnect"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.DisconnectAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.disconnect_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.disconnect"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.DisconnectAction_3;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DISCONNECT);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DISCONNECT);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IDisconnectHandler> getCommandType() {
return IDisconnectHandler.class;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandHandler.java
index 435e83f33..a30302bd0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DisconnectCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class DisconnectCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IDisconnectHandler> getCommandType() {
return IDisconnectHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
index e4c11f993..581377773 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,35 +28,43 @@ public class DropToFrameCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.DropToFrame"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.DropToFrameAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.drop_to_frame_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.dropToFrame"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.DropToFrameAction_3;
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DROP_TO_FRAME);
}
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return null;
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IDropToFrameHandler> getCommandType() {
return IDropToFrameHandler.class;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandHandler.java
index 788fe1a8c..c5c7bbb8d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/DropToFrameCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class DropToFrameCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IDropToFrameHandler> getCommandType() {
return IDropToFrameHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
index b47715b2b..4c37a86d3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ExecuteActionRequest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,7 +30,8 @@ public class ExecuteActionRequest extends DebugCommandRequest {
super(elements);
}
- public void done() {
+ @Override
+ public void done() {
if (fParticipant != null) {
fParticipant.requestDone(this);
fParticipant = null;
@@ -40,25 +41,30 @@ public class ExecuteActionRequest extends DebugCommandRequest {
switch (status.getSeverity()) {
case IStatus.ERROR:
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
MessageDialog.openError(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
}
});
break;
case IStatus.WARNING:
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
MessageDialog.openWarning(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
}
});
break;
case IStatus.INFO:
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
MessageDialog.openInformation(DebugUIPlugin.getShell(), DebugUIMessages.DebugUITools_Error_1, status.getMessage());
}
});
break;
+ default:
+ break;
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java
index 5661ca927..cc34a4d3c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2010 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -28,35 +29,43 @@ public class RestartCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.Restart"); //$NON-NLS-1$
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IRestartHandler> getCommandType() {
return IRestartHandler.class;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESTART);
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.restart_action_context"; //$NON-NLS-1$
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESTART);
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.actions.Restart"; //$NON-NLS-1$
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESTART);
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.RestartCommandAction__text;
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.RestartCommandAction_tooltip;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
index 961b7cd85..1502c4c71 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandActionDelegate.java
@@ -28,28 +28,34 @@ public class RestartCommandActionDelegate implements IWorkbenchWindowActionDeleg
private DebugCommandAction fDebugAction = new RestartCommandAction();
- public void dispose() {
+ @Override
+ public void dispose() {
fDebugAction.dispose();
}
- public void init(IWorkbenchWindow window) {
+ @Override
+ public void init(IWorkbenchWindow window) {
fDebugAction.init(window);
}
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
fDebugAction.run();
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
// do nothing
}
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
fDebugAction.setActionProxy(action);
}
- public void runWithEvent(IAction action, Event event) {
+ @Override
+ public void runWithEvent(IAction action, Event event) {
run(action);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandHandler.java
index 878dcc779..53b9fd0c4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/RestartCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Wind River Systems and others.
+ * Copyright (c) 2010, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -20,7 +21,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class RestartCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IRestartHandler> getCommandType() {
return IRestartHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
index f7f28abe5..d0a138eb7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,35 +28,43 @@ public class ResumeCommandAction extends DebugCommandAction{
setActionDefinitionId("org.eclipse.debug.ui.commands.Resume"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.ResumeAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.resume_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.resume"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.ResumeAction_3;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESUME);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESUME);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IResumeHandler> getCommandType() {
return IResumeHandler.class;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
index 3a770a612..564d8a8b0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandActionDelegate.java
@@ -28,28 +28,34 @@ public class ResumeCommandActionDelegate implements IWorkbenchWindowActionDelega
private DebugCommandAction fDebugAction = new ResumeCommandAction();
- public void dispose() {
+ @Override
+ public void dispose() {
fDebugAction.dispose();
}
- public void init(IWorkbenchWindow window) {
+ @Override
+ public void init(IWorkbenchWindow window) {
fDebugAction.init(window);
}
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
fDebugAction.run();
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
// do nothing
}
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
fDebugAction.setActionProxy(action);
}
- public void runWithEvent(IAction action, Event event) {
+ @Override
+ public void runWithEvent(IAction action, Event event) {
run(action);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandHandler.java
index af8c669cd..22e23af17 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ResumeCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class ResumeCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IResumeHandler> getCommandType() {
return IResumeHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
index f42a2dd03..f3517eacb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,35 +28,43 @@ public class StepIntoCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.StepInto"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.StepIntoAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.step_into_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.stepInto"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.StepIntoAction_3;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_INTO);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_INTO);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepIntoHandler> getCommandType() {
return IStepIntoHandler.class;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandHandler.java
index 2158b1078..f16b86019 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepIntoCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class StepIntoCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepIntoHandler> getCommandType() {
return IStepIntoHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
index 020e34d95..21e7cda98 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,35 +29,43 @@ public class StepOverCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.StepOver"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.StepOverAction_0;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_OVER);
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.step_over_action_context"; //$NON-NLS-1$
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.stepOver"; //$NON-NLS-1$
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_OVER);
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.StepOverAction_3;
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepOverHandler> getCommandType() {
return IStepOverHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
index 533c0fe9f..65bfe17e4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandActionDelegate.java
@@ -25,7 +25,8 @@ public class StepOverCommandActionDelegate extends DebugCommandActionDelegate {
setAction(new StepOverCommandAction());
}
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
super.init(action);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandHandler.java
index b93551ebf..c0b43f318 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepOverCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -21,7 +21,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class StepOverCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepOverHandler> getCommandType() {
return IStepOverHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
index 73aa93520..6d94acc61 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,35 +29,43 @@ public class StepReturnCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.StepReturn"); //$NON-NLS-1$
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_STEP_RETURN);
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.step_return_action_context"; //$NON-NLS-1$
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN);
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.stepReturn"; //$NON-NLS-1$
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STEP_RETURN);
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.StepReturnAction_2;
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.StepReturnAction_3;
}
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepReturnHandler> getCommandType() {
return IStepReturnHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandHandler.java
index df4274249..dc329b50e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/StepReturnCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class StepReturnCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepReturnHandler> getCommandType() {
return IStepReturnHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
index da1b596ed..ce16e0aee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,35 +28,43 @@ public class SuspendCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.Suspend"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.SuspendAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.suspend_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.commands.Suspend"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.SuspendAction_3;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_SUSPEND);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_SUSPEND);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<ISuspendHandler> getCommandType() {
return ISuspendHandler.class;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandHandler.java
index 2a162df08..78a5233d4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/SuspendCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class SuspendCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<ISuspendHandler> getCommandType() {
return ISuspendHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
index 5634bcd49..f452460c1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAllAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,15 +31,18 @@ import org.eclipse.ui.IWorkbenchPart;
*/
public class TerminateAllAction extends DebugCommandAction implements ILaunchesListener2 {
+ @Override
protected ISelection getContext() {
return new StructuredSelection(getLaunchManager().getLaunches());
}
+ @Override
public void dispose() {
getLaunchManager().removeLaunchListener(this);
super.dispose();
}
+ @Override
public void init(IWorkbenchPart part) {
super.init(part);
ILaunchManager launchManager = getLaunchManager();
@@ -53,50 +56,60 @@ public class TerminateAllAction extends DebugCommandAction implements ILaunchesL
return DebugPlugin.getDefault().getLaunchManager();
}
+ @Override
public String getHelpContextId() {
return "org.eclipse.debug.ui.terminate_all_action_context"; //$NON-NLS-1$
}
+ @Override
public String getId() {
return "org.eclipse.debug.ui.debugview.popupMenu.terminateAll"; //$NON-NLS-1$
}
+ @Override
public String getText() {
return ActionMessages.TerminateAllAction_2;
}
+ @Override
public String getToolTipText() {
return ActionMessages.TerminateAllAction_3;
}
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages
.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_ALL);
}
+ @Override
public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages
.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
}
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugPluginImages
.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_ALL);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<ITerminateHandler> getCommandType() {
return ITerminateHandler.class;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
setEnabled(true);
}
@@ -104,12 +117,14 @@ public class TerminateAllAction extends DebugCommandAction implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
setEnabled(getLaunchManager().getLaunches().length > 0);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
index 940ba8918..e67c7265d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRelaunchAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,10 +36,12 @@ import org.eclipse.jface.viewers.StructuredSelection;
*/
public class TerminateAndRelaunchAction extends DebugCommandAction {
- public void postExecute(IRequest request, final Object[] targets) {
+ @Override
+ public void postExecute(IRequest request, final Object[] targets) {
if (request.getStatus() == null || request.getStatus().isOK()) {
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
// Must be run in the UI thread since the launch can require
// prompting to proceed
for (int i = 0; i < targets.length; i++) {
@@ -53,14 +55,14 @@ public class TerminateAndRelaunchAction extends DebugCommandAction {
}
}
- protected ISelection getContext() {
+ @Override
+ protected ISelection getContext() {
// Convert action context to contain only launch objects (bug 356651).
ISelection context = super.getContext();
if (context instanceof IStructuredSelection && !context.isEmpty()) {
IStructuredSelection ss = (IStructuredSelection)context;
- Set launches = new HashSet(ss.size());
- for (Iterator itr = ss.iterator(); itr.hasNext();) {
-
+ Set<ILaunch> launches = new HashSet<ILaunch>(ss.size());
+ for (Iterator<Object> itr = ss.iterator(); itr.hasNext();) {
ILaunch launch = DebugUIPlugin.getLaunch(itr.next());
if (launch != null) {
launches.add(launch);
@@ -72,10 +74,12 @@ public class TerminateAndRelaunchAction extends DebugCommandAction {
}
- protected Class getCommandType() {
+ @Override
+ protected Class<ITerminateHandler> getCommandType() {
return ITerminateHandler.class;
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
ISelection context = event.getContext();
if (context instanceof IStructuredSelection) {
@@ -101,35 +105,43 @@ public class TerminateAndRelaunchAction extends DebugCommandAction {
return false;
}
- public String getActionDefinitionId() {
+ @Override
+ public String getActionDefinitionId() {
return ActionMessages.TerminateAndRelaunchAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.terminate_and_relaunch_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.popupMenu.TerminateAndRelaunch"; //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.TerminateAndRelaunchAction_3;
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.TerminateAndRelaunchAction_4;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_RELAUNCH);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_RELAUNCH);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
index a2e8f0b7e..6159f5177 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateAndRemoveAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,39 +50,48 @@ public class TerminateAndRemoveAction extends DebugCommandAction {
*/
private IWorkbenchPart fMyPart = null;
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.TerminateAndRemoveAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.terminate_and_remove_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.popupMenu.terminateAndRemove"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.TerminateAndRemoveAction_3;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE_AND_REMOVE);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_REMOVE);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TERMINATE_AND_REMOVE);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<ITerminateHandler> getCommandType() {
return ITerminateHandler.class;
}
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
boolean isAllTerminated = true;
ISelection context = event.getContext();
if (context instanceof IStructuredSelection) {
@@ -113,13 +122,15 @@ public class TerminateAndRemoveAction extends DebugCommandAction {
}
- protected void postExecute(IRequest request, Object[] targets) {
+ @Override
+ protected void postExecute(IRequest request, Object[] targets) {
IStatus status = request.getStatus();
if(status == null || status.isOK()) {
for (int i = 0; i < targets.length; i++) {
ILaunch launch = DebugUIPlugin.getLaunch(targets[i]);
- if (launch != null)
- DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ if (launch != null) {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunch(launch);
+ }
}
}
}
@@ -127,7 +138,8 @@ public class TerminateAndRemoveAction extends DebugCommandAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.DebugCommandAction#runWithEvent(org.eclipse.swt.widgets.Event)
*/
- public void runWithEvent(Event event) {
+ @Override
+ public void runWithEvent(Event event) {
if (fCanTerminate) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
@@ -155,7 +167,8 @@ public class TerminateAndRemoveAction extends DebugCommandAction {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.actions.DebugCommandAction#init(org.eclipse.ui.IWorkbenchPart)
*/
- public void init(IWorkbenchPart part) {
+ @Override
+ public void init(IWorkbenchPart part) {
super.init(part); // TODO: if #getContext() was API, this would not be needed
fMyPart = part;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
index a8de94bdc..7822e95aa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,35 +28,43 @@ public class TerminateCommandAction extends DebugCommandAction {
setActionDefinitionId("org.eclipse.debug.ui.commands.Terminate"); //$NON-NLS-1$
}
- public String getText() {
+ @Override
+ public String getText() {
return ActionMessages.TerminateAction_0;
}
- public String getHelpContextId() {
+ @Override
+ public String getHelpContextId() {
return "org.eclipse.debug.ui.terminate_action_context"; //$NON-NLS-1$
}
- public String getId() {
+ @Override
+ public String getId() {
return "org.eclipse.debug.ui.debugview.toolbar.terminate"; //$NON-NLS-1$
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return ActionMessages.TerminateAction_3;
}
- public ImageDescriptor getDisabledImageDescriptor() {
+ @Override
+ public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TERMINATE);
}
- public ImageDescriptor getHoverImageDescriptor() {
+ @Override
+ public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE);
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_TERMINATE);
}
- protected Class getCommandType() {
+ @Override
+ protected Class<ITerminateHandler> getCommandType() {
return ITerminateHandler.class;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandHandler.java
index 2eeb01889..26ba2c9db 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/TerminateCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class TerminateCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<ITerminateHandler> getCommandType() {
return ITerminateHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
index 181d6ebf4..048a0a65a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersAction.java
@@ -39,6 +39,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getDisabledImageDescriptor()
*/
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_TOGGLE_STEP_FILTERS);
}
@@ -46,6 +47,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getHelpContextId()
*/
+ @Override
public String getHelpContextId() {
return "org.eclipse.debug.ui.step_with_filters_action_context"; //$NON-NLS-1$
}
@@ -53,6 +55,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getHoverImageDescriptor()
*/
+ @Override
public ImageDescriptor getHoverImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
}
@@ -60,6 +63,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getId()
*/
+ @Override
public String getId() {
return "org.eclipse.debug.ui.actions.ToggleStepFilters"; //$NON-NLS-1$
}
@@ -67,6 +71,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_TOGGLE_STEP_FILTERS);
}
@@ -74,6 +79,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getText()
*/
+ @Override
public String getText() {
return ActionMessages.ToggleStepFiltersAction_1;
}
@@ -81,6 +87,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return ActionMessages.ToggleStepFiltersAction_0;
}
@@ -88,6 +95,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getInitialEnablement()
*/
+ @Override
protected boolean getInitialEnablement() {
return true;
}
@@ -95,14 +103,16 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#getCommandType()
*/
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepFiltersHandler> getCommandType() {
return IStepFiltersHandler.class;
}
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#run()
*/
- public void run() {
+ @Override
+ public void run() {
// ignore initial call to run from abstract debug view
// that runs the action to initialize it's state when
// the workbench persisted the action as "on"
@@ -116,13 +126,15 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.jface.action.Action#getStyle()
*/
- public int getStyle() {
+ @Override
+ public int getStyle() {
return AS_CHECK_BOX;
}
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
ISelection context = event.getContext();
if (context.isEmpty()) {
@@ -135,6 +147,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#init(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void init(IWorkbenchPart part) {
super.init(part);
initState();
@@ -143,6 +156,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
super.init(window);
initState();
@@ -161,6 +175,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
/**
* @see org.eclipse.debug.internal.ui.commands.actions.DebugCommandAction#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugPlugin.getUniqueIdentifier());
@@ -169,6 +184,7 @@ public class ToggleStepFiltersAction extends DebugCommandAction implements IPref
}
}
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
if (event.getKey().equals(StepFilterManager.PREF_USE_STEP_FILTERS)) {
boolean checked = DebugUITools.isUseStepFilters();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
index 163927199..a654648da 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandActionDelegate.java
@@ -29,7 +29,8 @@ public class ToggleStepFiltersCommandActionDelegate extends DebugCommandActionDe
setAction(new ToggleStepFiltersAction());
}
- public void init(IAction action) {
+ @Override
+ public void init(IAction action) {
super.init(action);
action.setChecked(DebugUITools.isUseStepFilters());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandHandler.java
index aad7dc919..e1148235f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/ToggleStepFiltersCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.commands.actions;
@@ -21,7 +22,8 @@ import org.eclipse.debug.ui.actions.DebugCommandHandler;
*/
public class ToggleStepFiltersCommandHandler extends DebugCommandHandler {
- protected Class getCommandType() {
+ @Override
+ protected Class<IStepFiltersHandler> getCommandType() {
return IStepFiltersHandler.class;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
index 142dbb22d..30249935b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateActionsRequest.java
@@ -33,6 +33,7 @@ public class UpdateActionsRequest extends DebugCommandRequest implements IEnable
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
*/
+ @Override
public synchronized void setEnabled(boolean result) {
fEnabled = result;
}
@@ -40,6 +41,7 @@ public class UpdateActionsRequest extends DebugCommandRequest implements IEnable
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
+ @Override
public synchronized void done() {
if (!isCanceled()) {
for (int i = 0; i < fActions.length; i++) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
index a0069caee..9e8d3e616 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/commands/actions/UpdateHandlerRequest.java
@@ -34,6 +34,7 @@ public class UpdateHandlerRequest extends DebugCommandRequest implements IEnable
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.provisional.IBooleanRequestMonitor#setResult(boolean)
*/
+ @Override
public synchronized void setEnabled(boolean result) {
fEnabled = result;
}
@@ -41,6 +42,7 @@ public class UpdateHandlerRequest extends DebugCommandRequest implements IEnable
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
+ @Override
public synchronized void done() {
fUpdater.setEnabled(fEnabled);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
index de1866407..fe6b175b2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/ContextRunner.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,7 +46,6 @@ import com.ibm.icu.text.MessageFormat;
* @see org.eclipse.debug.ui.actions.ContextualLaunchAction
*
* @since 3.3
- * CONTEXTLAUNCHING
*/
public final class ContextRunner {
@@ -113,7 +112,7 @@ public final class ContextRunner {
if(group != null) {
LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
String mode = group.getMode();
- List shortcuts = fLRM.getShortcutsForSelection(selection, mode);
+ List<LaunchShortcutExtension> shortcuts = fLRM.getShortcutsForSelection(selection, mode);
// allow the shortcut to translate/provide the resource for the launch
IResource overrideResource = fLRM.getLaunchableResource(shortcuts, selection);
if(overrideResource != null) {
@@ -127,15 +126,15 @@ public final class ContextRunner {
return;
}
//get the configurations from the resource and participants
- List configs = fLRM.getParticipatingLaunchConfigurations(selection, resource, shortcuts, mode);
+ List<ILaunchConfiguration> configs = fLRM.getParticipatingLaunchConfigurations(selection, resource, shortcuts, mode);
int csize = configs.size();
if(csize == 1) {
- launch((ILaunchConfiguration) configs.get(0), mode);
+ launch(configs.get(0), mode);
}
else if(csize < 1) {
int esize = shortcuts.size();
if(esize == 1) {
- launchShortcut(selection, (LaunchShortcutExtension) shortcuts.get(0), mode);
+ launchShortcut(selection, shortcuts.get(0), mode);
}
else if(esize > 1) {
showShortcutSelectionDialog(resource, shortcuts, mode, selection);
@@ -154,7 +153,7 @@ public final class ContextRunner {
else {
String msg = ContextMessages.ContextRunner_7;
if(!resource.isAccessible()) {
- msg = MessageFormat.format(ContextMessages.ContextRunner_13, new String[] {resource.getName()});
+ msg = MessageFormat.format(ContextMessages.ContextRunner_13, new Object[] { resource.getName() });
}
MessageDialog.openInformation(DebugUIPlugin.getShell(), ContextMessages.ContextRunner_0, msg);
}
@@ -229,8 +228,9 @@ public final class ContextRunner {
} else {
String label = launchMode.getLabel();
String modeLabel = DebugUIPlugin.removeAccelerators(label);
- MessageDialog.openInformation(DebugUIPlugin.getShell(), MessageFormat.format(ContextMessages.ContextRunner_1, new String[]{modeLabel}),
- MessageFormat.format(ContextMessages.ContextRunner_3, new String[]{configuration.getName(), modeLabel.toLowerCase()}));
+ MessageDialog.openInformation(DebugUIPlugin.getShell(), MessageFormat.format(ContextMessages.ContextRunner_1, new Object[] { modeLabel }), MessageFormat.format(ContextMessages.ContextRunner_3, new Object[] {
+ configuration.getName(),
+ modeLabel.toLowerCase() }));
}
return false;
}
@@ -249,7 +249,7 @@ public final class ContextRunner {
* @param configurations the listing of applicable configurations to present
* @param mode the mode
*/
- protected void showConfigurationSelectionDialog(List configurations, String mode) {
+ protected void showConfigurationSelectionDialog(List<ILaunchConfiguration> configurations, String mode) {
LaunchConfigurationSelectionDialog lsd = new LaunchConfigurationSelectionDialog(DebugUIPlugin.getShell(), configurations);
if(lsd.open() == IDialogConstants.OK_ID) {
ILaunchConfiguration config = (ILaunchConfiguration) lsd.getResult()[0];
@@ -266,7 +266,7 @@ public final class ContextRunner {
* @param mode the mode
* @param selection the current selection
*/
- protected void showShortcutSelectionDialog(IResource resource, List shortcuts, String mode, IStructuredSelection selection) {
+ protected void showShortcutSelectionDialog(IResource resource, List<LaunchShortcutExtension> shortcuts, String mode, IStructuredSelection selection) {
LaunchShortcutSelectionDialog dialog = new LaunchShortcutSelectionDialog(shortcuts, resource, mode);
if (dialog.open() == Window.OK) {
Object[] result = dialog.getResult();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
index b2a9e557a..3a766774b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java
@@ -11,12 +11,12 @@
package org.eclipse.debug.internal.ui.contextlaunching;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.expressions.IEvaluationContext;
@@ -54,6 +54,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IWindowListener;
@@ -80,6 +81,7 @@ import com.ibm.icu.text.MessageFormat;
*
* @since 3.3
*/
+@SuppressWarnings("restriction")
public class LaunchingResourceManager implements IPropertyChangeListener, IWindowListener, ISelectionListener, ILaunchHistoryChangedListener, ILaunchesListener2 {
/**
@@ -91,12 +93,12 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
* The map of ToolBars that have mouse tracker listeners associated with them:
* stored as Map<IWorkbenchWindow, ToolBar>
*/
- private HashMap fToolbars = new HashMap();
+ private HashMap<IWorkbenchWindow, ToolBar> fToolbars = new HashMap<IWorkbenchWindow, ToolBar>();
/**
* the map of current labels
*/
- private HashMap fCurrentLabels = new HashMap();
+ private HashMap<ILaunchGroup, String> fCurrentLabels = new HashMap<ILaunchGroup, String>();
/**
* The selection has changed and we need to update the labels
@@ -106,19 +108,19 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Set of windows that have been opened and that we have registered selection listeners with
*/
- private HashSet fWindows = new HashSet();
+ private HashSet<IWorkbenchWindow> fWindows = new HashSet<IWorkbenchWindow>();
/**
* Cache of IResource -> ILaunchConfiguration[] used during a tooltip update job.
* The cache is cleared after each tooltip update job is complete.
*/
- private HashMap fConfigCache = new HashMap();
+ private HashMap<IResource, ILaunchConfiguration[]> fConfigCache = new HashMap<IResource, ILaunchConfiguration[]>();
/**
* Cache of IResource -> LaunchShortcutExtension used during a tooltip update job.
* The cache is cleared after each tooltip update job is complete.
*/
- private HashMap fExtCache = new HashMap();
+ private HashMap<IResource, List<LaunchShortcutExtension>> fExtCache = new HashMap<IResource, List<LaunchShortcutExtension>>();
/**
* Constant denoting the empty string;
@@ -129,11 +131,13 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
* Provides a mouse tracker listener for the launching main toolbar
*/
private MouseTrackAdapter fMouseListener = new MouseTrackAdapter() {
+ @Override
public void mouseEnter(MouseEvent e) {
if(fUpdateLabel) {
fUpdateLabel = false;
fCurrentLabels.clear();
Job job = new Job("Compute launch button tooltip") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
computeLabels();
fConfigCache.clear();
@@ -197,7 +201,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
* @return the current resource label;
*/
public String getLaunchLabel(ILaunchGroup group) {
- return (String) fCurrentLabels.get(group);
+ return fCurrentLabels.get(group);
}
/**
@@ -227,7 +231,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
Object[] listeners = fLabelListeners.getListeners();
SelectedResourceManager srm = SelectedResourceManager.getDefault();
IStructuredSelection selection = srm.getCurrentSelection();
- List shortcuts = null;
+ List<LaunchShortcutExtension> shortcuts = null;
IResource resource = srm.getSelectedResource();
for(int i = 0; i < listeners.length; i++) {
group = ((ILaunchLabelChangedListener)listeners[i]).getLaunchGroup();
@@ -282,7 +286,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
}
}
if(launched) {
- return MessageFormat.format(ContextMessages.LaunchingResourceManager_0, new String[] {config.getName()});
+ return MessageFormat.format(ContextMessages.LaunchingResourceManager_0, new Object[] { config.getName() });
}
return config.getName();
}
@@ -310,19 +314,18 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
* @param group the {@link ILaunchGroup} to launch using
* @return the label for the resource or the empty string, never <code>null</code>
*/
- protected String getLabel(IStructuredSelection selection, IResource resource, List shortcuts, ILaunchGroup group) {
- List sc = pruneShortcuts(shortcuts, resource, group.getMode());
+ protected String getLabel(IStructuredSelection selection, IResource resource, List<LaunchShortcutExtension> shortcuts, ILaunchGroup group) {
+ List<LaunchShortcutExtension> sc = pruneShortcuts(shortcuts, resource, group.getMode());
LaunchConfigurationManager lcm = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
//see if the context is a shared configuration
ILaunchConfiguration config = lcm.isSharedConfig(resource);
if(config != null) {
return appendLaunched(config);
}
- //TODO cache the results ?
- List configs = getParticipatingLaunchConfigurations(selection, resource, sc, group.getMode());
+ List<ILaunchConfiguration> configs = getParticipatingLaunchConfigurations(selection, resource, sc, group.getMode());
int csize = configs.size();
if(csize == 1) {
- return appendLaunched((ILaunchConfiguration)configs.get(0));
+ return appendLaunched(configs.get(0));
}
else if(csize > 1) {
config = lcm.getMRUConfiguration(configs, group, resource);
@@ -334,7 +337,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
}
}
else {
- List exts = (List) fExtCache.get(resource);
+ List<LaunchShortcutExtension> exts = fExtCache.get(resource);
if(exts == null && resource != null) {
fExtCache.put(resource, sc);
}
@@ -358,7 +361,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
return resource.getName();
}
else {
- return MessageFormat.format(ContextMessages.LaunchingResourceManager_1, new String[] {((LaunchShortcutExtension) sc.get(0)).getLabel()});
+ return MessageFormat.format(ContextMessages.LaunchingResourceManager_1, new Object[] { sc.get(0).getLabel() });
}
}
else {
@@ -376,12 +379,12 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
*
* @since 3.4
*/
- protected List pruneShortcuts(List shortcuts, IResource resource, String mode) {
- List list = new ArrayList(shortcuts);
+ protected List<LaunchShortcutExtension> pruneShortcuts(List<LaunchShortcutExtension> shortcuts, IResource resource, String mode) {
+ List<LaunchShortcutExtension> list = new ArrayList<LaunchShortcutExtension>(shortcuts);
if(resource == null) {
LaunchShortcutExtension ext = null;
- for(ListIterator iter = list.listIterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
+ for (ListIterator<LaunchShortcutExtension> iter = list.listIterator(); iter.hasNext();) {
+ ext = iter.next();
if(!ext.isParticipant()) {
iter.remove();
}
@@ -402,14 +405,12 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
*
* @since 3.4
*/
- public IResource getLaunchableResource(List shortcuts, IStructuredSelection selection) {
+ public IResource getLaunchableResource(List<LaunchShortcutExtension> shortcuts, IStructuredSelection selection) {
if(selection != null && !selection.isEmpty()) {
- ArrayList resources = new ArrayList();
+ ArrayList<IResource> resources = new ArrayList<IResource>();
IResource resource = null;
Object o = selection.getFirstElement();
- LaunchShortcutExtension ext = null;
- for(Iterator iter = shortcuts.iterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
+ for (LaunchShortcutExtension ext : shortcuts) {
if(o instanceof IEditorPart) {
resource = ext.getLaunchableResource((IEditorPart) o);
}
@@ -422,7 +423,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
}
}
if(resources.size() > 0) {
- return (IResource) resources.get(0);
+ return resources.get(0);
}
}
return null;
@@ -436,10 +437,10 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
*
* @since 3.4
*/
- public List getShortcutsForSelection(IStructuredSelection selection, String mode) {
- ArrayList list = new ArrayList();
- List sc = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchShortcuts();
- List ctxt = new ArrayList();
+ public List<LaunchShortcutExtension> getShortcutsForSelection(IStructuredSelection selection, String mode) {
+ ArrayList<LaunchShortcutExtension> list = new ArrayList<LaunchShortcutExtension>();
+ List<LaunchShortcutExtension> sc = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchShortcuts();
+ List<IEditorInput> ctxt = new ArrayList<IEditorInput>();
// work around to bug in Structured Selection that returns actual underlying array in selection
// @see bug 211646
ctxt.addAll(selection.toList());
@@ -449,9 +450,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
}
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(ctxt);
context.addVariable("selection", ctxt); //$NON-NLS-1$
- LaunchShortcutExtension ext = null;
- for(Iterator iter = sc.iterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
+ for (LaunchShortcutExtension ext : sc) {
try {
if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression()) &&
ext.getModes().contains(mode) && !WorkbenchActivityHelper.filterItem(ext)) {
@@ -476,16 +475,15 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
*
* @since 3.4
*/
- public List getParticipatingLaunchConfigurations(IStructuredSelection selection, IResource resource, List shortcuts, String mode) {
- HashSet configs = new HashSet();
+ public List<ILaunchConfiguration> getParticipatingLaunchConfigurations(IStructuredSelection selection, IResource resource, List<LaunchShortcutExtension> shortcuts, String mode) {
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
int voteDefault = 0;
if(selection != null) {
Object o = selection.getFirstElement();
LaunchShortcutExtension ext = null;
ILaunchConfiguration[] cfgs = null;
- //TODO this falls victim to contributors code performance
for(int i = 0; i < shortcuts.size(); i++) {
- ext = (LaunchShortcutExtension) shortcuts.get(i);
+ ext = shortcuts.get(i);
if(o instanceof IEditorPart) {
cfgs = ext.getLaunchConfigurations((IEditorPart)o);
}
@@ -493,8 +491,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
cfgs = ext.getLaunchConfigurations(selection);
}
if (cfgs == null) {
- Set types = ext.getAssociatedConfigurationTypes();
- addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations((String[]) types.toArray(new String[types.size()]), resource));
+ Set<String> types = ext.getAssociatedConfigurationTypes();
+ addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(types.toArray(new String[types.size()]), resource));
voteDefault++;
} else {
if(cfgs.length > 0) {
@@ -509,11 +507,11 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
// consider default configurations if no configurations were contributed
addAllToList(configs, DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource));
}
- Iterator iterator = configs.iterator();
+ Iterator<ILaunchConfiguration> iterator = configs.iterator();
while (iterator.hasNext()) {
- ILaunchConfiguration config = (ILaunchConfiguration) iterator.next();
+ ILaunchConfiguration config = iterator.next();
try {
- Set modes = config.getModes();
+ Set<String> modes = config.getModes();
modes.add(mode);
if (!config.getType().supportsModeCombination(modes)) {
iterator.remove();
@@ -521,7 +519,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
}
catch (CoreException e) {}
}
- return new ArrayList(configs);
+ return configs;
}
/**
@@ -530,12 +528,14 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
* @param list the {@link List} to append to
* @param values the array of {@link Object}s to add to the list
*/
- private void addAllToList(Collection list, Object[] values) {
- if(list == null || values == null) {
+ private void addAllToList(List<ILaunchConfiguration> list, ILaunchConfiguration[] configs) {
+ if (list == null || configs == null) {
return;
}
- for(int i = 0; i < values.length; i++) {
- list.add(values[i]);
+ for (int i = 0; i < configs.length; i++) {
+ if (!list.contains(configs[i])) {
+ list.add(configs[i]);
+ }
}
}
@@ -570,19 +570,18 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
DebugUIPlugin.getDefault().getLaunchConfigurationManager().removeLaunchHistoryListener(this);
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
- for(Iterator iter = fWindows.iterator(); iter.hasNext();) {
- ((IWorkbenchWindow)iter.next()).getSelectionService().removeSelectionListener(this);
+ for (IWorkbenchWindow window : fWindows) {
+ window.getSelectionService().removeSelectionListener(this);
}
- IWorkbenchWindow window = null;
// set fUpdateLabel to false so that mouse track listener will do nothing if called
// before the asynchronous execution disposes them
fUpdateLabel = false;
- for(Iterator iter = fToolbars.keySet().iterator(); iter.hasNext();) {
- window = (IWorkbenchWindow) iter.next();
- final ToolBar bar = (ToolBar) fToolbars.get(window);
+ for (Entry<IWorkbenchWindow, ToolBar> entry : fToolbars.entrySet()) {
+ final ToolBar bar = entry.getValue();
if(bar != null && !bar.isDisposed()) {
final MouseTrackAdapter listener = fMouseListener;
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
bar.removeMouseTrackListener(listener);
}
@@ -599,6 +598,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowActivated(IWorkbenchWindow window) {
if(!fToolbars.containsKey(window)) {
addMouseListener(window);
@@ -608,8 +608,9 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowClosed(IWorkbenchWindow window) {
- ToolBar bar = (ToolBar) fToolbars.remove(window);
+ ToolBar bar = fToolbars.remove(window);
if(bar != null && !bar.isDisposed()) {
bar.removeMouseTrackListener(fMouseListener);
}
@@ -621,11 +622,13 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowDeactivated(IWorkbenchWindow window) {}
/**
* @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowOpened(IWorkbenchWindow window) {
if(fWindows.add(window)) {
window.getSelectionService().addSelectionListener(this);
@@ -655,6 +658,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if(event.getProperty().equals(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH) ||
event.getProperty().equals(IInternalDebugUIConstants.PREF_LAUNCH_LAST_IF_NOT_LAUNCHABLE)) {
@@ -668,6 +672,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/* (non-Javadoc)
* @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
if(isContextLaunchEnabled()) {
fUpdateLabel = true;
@@ -677,6 +682,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.ILaunchHistoryChangedListener#launchHistoryChanged()
*/
+ @Override
public void launchHistoryChanged() {
//this always must be set to true, because as the history is loaded these events are fired, and we need to
//update on workspace load.
@@ -686,6 +692,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
fUpdateLabel = true;
}
@@ -693,6 +700,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
fUpdateLabel = true;
}
@@ -700,11 +708,13 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
//we want to ensure that even if a launch is removed from the debug view
//when it is not terminated we update the label just in case.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
index 3e0b39fb2..06b4f2db8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,51 +34,68 @@ import org.eclipse.ui.services.IEvaluationService;
public class DebugContextManager implements IDebugContextManager {
private static DebugContextManager fgDefault;
- private Map fServices = new HashMap();
+ private Map<IWorkbenchWindow, DebugWindowContextService> fServices = new HashMap<IWorkbenchWindow, DebugWindowContextService>();
private ListenerList fGlobalListeners = new ListenerList();
/**
* A debug context service that does nothing (used for windows that have been closed)
*/
private static IDebugContextService NULL_SERVICE = new IDebugContextService() {
+ @Override
public void removePostDebugContextListener(IDebugContextListener listener, String partId) {
}
+ @Override
public void removePostDebugContextListener(IDebugContextListener listener) {
}
+ @Override
public void removeDebugContextProvider(IDebugContextProvider provider) {
}
+ @Override
public void removeDebugContextListener(IDebugContextListener listener, String partId) {
}
+ @Override
public void removeDebugContextListener(IDebugContextListener listener) {
}
+ @Override
public ISelection getActiveContext(String partId) {
return null;
}
+ @Override
public ISelection getActiveContext() {
return null;
}
+ @Override
public void addPostDebugContextListener(IDebugContextListener listener, String partId) {
}
+ @Override
public void addPostDebugContextListener(IDebugContextListener listener) {
}
+ @Override
public void addDebugContextProvider(IDebugContextProvider provider) {
}
+ @Override
public void addDebugContextListener(IDebugContextListener listener, String partId) {
}
+ @Override
public void addDebugContextListener(IDebugContextListener listener) {
}
+ @Override
public void addDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
}
+ @Override
public void removeDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
}
+ @Override
public ISelection getActiveContext(String partId, String partSecondaryId) {
return null;
}
+ @Override
public void addPostDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
}
+ @Override
public void removePostDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
}
};
@@ -88,20 +105,23 @@ public class DebugContextManager implements IDebugContextManager {
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowActivated(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowDeactivated(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowClosed(final IWorkbenchWindow window) {
- DebugWindowContextService service = (DebugWindowContextService) fServices.get(window);
+ DebugWindowContextService service = fServices.get(window);
if (service != null) {
fServices.remove(window);
service.dispose();
@@ -111,6 +131,7 @@ public class DebugContextManager implements IDebugContextManager {
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowOpened(IWorkbenchWindow window) {
}
@@ -132,7 +153,7 @@ public class DebugContextManager implements IDebugContextManager {
}
protected IDebugContextService createService(IWorkbenchWindow window) {
- DebugWindowContextService service = (DebugWindowContextService) fServices.get(window);
+ DebugWindowContextService service = fServices.get(window);
if (service == null) {
IEvaluationService evaluationService = (IEvaluationService)window.getService(IEvaluationService.class);
if (window.getShell() == null || evaluationService == null) {
@@ -153,12 +174,13 @@ public class DebugContextManager implements IDebugContextManager {
}
protected IDebugContextService getService(IWorkbenchWindow window) {
- return (DebugWindowContextService) fServices.get(window);
+ return fServices.get(window);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.IDebugContextManager#addDebugContextListener(org.eclipse.debug.internal.ui.contexts.IDebugContextListener)
*/
+ @Override
public void addDebugContextListener(IDebugContextListener listener) {
fGlobalListeners.add(listener);
DebugWindowContextService[] services = getServices();
@@ -171,6 +193,7 @@ public class DebugContextManager implements IDebugContextManager {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.IDebugContextManager#removeDebugContextListener(org.eclipse.debug.internal.ui.contexts.IDebugContextListener)
*/
+ @Override
public void removeDebugContextListener(IDebugContextListener listener) {
fGlobalListeners.remove(listener);
DebugWindowContextService[] services = getServices();
@@ -186,13 +209,14 @@ public class DebugContextManager implements IDebugContextManager {
* @return existing context services
*/
private DebugWindowContextService[] getServices() {
- Collection sevices = fServices.values();
- return (DebugWindowContextService[]) sevices.toArray(new DebugWindowContextService[sevices.size()]);
+ Collection<DebugWindowContextService> sevices = fServices.values();
+ return sevices.toArray(new DebugWindowContextService[sevices.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextManager#getContextService(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public IDebugContextService getContextService(IWorkbenchWindow window) {
return createService(window);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
index 847f24112..f3d20350f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugContextSourceProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 Wind River Systems and others.
+ * Copyright (c) 2006, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.contexts;
@@ -17,6 +18,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.contexts.DebugContextEvent;
import org.eclipse.debug.ui.contexts.IDebugContextListener;
import org.eclipse.debug.ui.contexts.IDebugContextService;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.AbstractSourceProvider;
import org.eclipse.ui.ISources;
import org.eclipse.ui.services.IEvaluationService;
@@ -49,23 +51,27 @@ public class DebugContextSourceProvider extends AbstractSourceProvider implement
fEvaluationService.addSourceProvider(this);
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
- Map values = new HashMap(1);
+ Map<String, ISelection> values = new HashMap<String, ISelection>(1);
values.put(IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME, event.getContext());
fireSourceChanged(ISources.ACTIVE_CURRENT_SELECTION, values);
}
+ @Override
public void dispose() {
fDebugContextService.removeDebugContextListener(this);
fEvaluationService.removeSourceProvider(this);
}
+ @Override
public String[] getProvidedSourceNames() {
return PROVIDED_SOURCE_NAMES;
}
+ @Override
public Map getCurrentState() {
- Map currentState = new HashMap(1);
+ Map<String, ISelection> currentState = new HashMap<String, ISelection>(1);
currentState.put(IDebugUIConstants.DEBUG_CONTEXT_SOURCE_NAME, fDebugContextService.getActiveContext());
return currentState;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
index 38ea299a7..35052121c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugModelContextBindingManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -68,33 +68,33 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
* Map of debug model identifier to associated contexts as defined
* by <code>debugModelContextBindings</code> extensions.
*/
- private Map fModelToContextIds = new HashMap();
+ private Map<String, List<String>> fModelToContextIds = new HashMap<String, List<String>>();
/**
* Map of launch objects to enabled model ids
*/
- private Map fLaunchToModelIds = new HashMap();
+ private Map<ILaunch, Set<String>> fLaunchToModelIds = new HashMap<ILaunch, Set<String>>();
/**
* Map of launch objects to context activations
*/
- private Map fLanuchToContextActivations = new HashMap();
+ private Map<ILaunch, List<IContextActivation>> fLanuchToContextActivations = new HashMap<ILaunch, List<IContextActivation>>();
/**
* A list of activity pattern bindings for debug models.
*/
- private List fModelPatternBindings = new ArrayList();
+ private List<IActivityPatternBinding> fModelPatternBindings = new ArrayList<IActivityPatternBinding>();
/**
- * Map of debug model ids to assocaited activity ids.
+ * Map of debug model ids to associated activity ids.
*/
- private Map fModelToActivities = new HashMap();
+ private Map<String, Set<String>> fModelToActivities = new HashMap<String, Set<String>>();
/**
* A set of debug model ids for which activities have been enabled.
* Cleared when enabled activities change.
*/
- private Set fModelsEnabledForActivities = new HashSet();
+ private Set<String> fModelsEnabledForActivities = new HashSet<String>();
// extension point
public static final String ID_DEBUG_MODEL_CONTEXT_BINDINGS= "debugModelContextBindings"; //$NON-NLS-1$
@@ -143,9 +143,9 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
String contextId = element.getAttribute(ATTR_CONTEXT_ID);
synchronized (this) {
if (modelIdentifier != null && contextId != null) {
- List contextIds = (List) fModelToContextIds.get(modelIdentifier);
+ List<String> contextIds = fModelToContextIds.get(modelIdentifier);
if (contextIds == null) {
- contextIds = new ArrayList();
+ contextIds = new ArrayList<String>();
fModelToContextIds.put(modelIdentifier, contextIds);
}
contextIds.add(contextId);
@@ -161,16 +161,12 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
*/
private void loadDebugModelActivityExtensions() {
IActivityManager activityManager = PlatformUI.getWorkbench().getActivitySupport().getActivityManager();
- Set activityIds = activityManager.getDefinedActivityIds();
- Iterator activityIterator = activityIds.iterator();
- while (activityIterator.hasNext()) {
- String activityId= (String) activityIterator.next();
+ Set<String> activityIds = activityManager.getDefinedActivityIds();
+ for (String activityId : activityIds) {
IActivity activity = activityManager.getActivity(activityId);
if (activity != null) {
- Set patternBindings = activity.getActivityPatternBindings();
- Iterator patternIterator= patternBindings.iterator();
- while (patternIterator.hasNext()) {
- IActivityPatternBinding patternBinding= (IActivityPatternBinding) patternIterator.next();
+ Set<IActivityPatternBinding> patternBindings = activity.getActivityPatternBindings();
+ for (IActivityPatternBinding patternBinding : patternBindings) {
String pattern = patternBinding.getPattern().pattern();
if (pattern.endsWith(DEBUG_MODEL_ACTIVITY_SUFFIX)) {
fModelPatternBindings.add(patternBinding);
@@ -180,12 +176,13 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
}
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
ISelection selection = event.getContext();
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while (iterator.hasNext()) {
activated(iterator.next());
}
@@ -208,11 +205,11 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
if (launch == null || launch.isTerminated()) {
return;
}
- List toEnable = new ArrayList(modelIds.length);
+ List<String> toEnable = new ArrayList<String>(modelIds.length);
synchronized (this) {
- Set alreadyEnabled = (Set) fLaunchToModelIds.get(launch);
+ Set<String> alreadyEnabled = fLaunchToModelIds.get(launch);
if (alreadyEnabled == null) {
- alreadyEnabled = new HashSet();
+ alreadyEnabled = new HashSet<String>();
fLaunchToModelIds.put(launch, alreadyEnabled);
}
for (int i = 0; i < modelIds.length; i++) {
@@ -224,7 +221,7 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
}
}
for (int i = 0; i < toEnable.size(); i++) {
- activateModel((String)toEnable.get(i), launch);
+ activateModel(toEnable.get(i), launch);
}
enableActivitiesFor(modelIds);
@@ -238,22 +235,20 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
* @param launch the launch the model is being enabled for
*/
private void activateModel(String modelId, ILaunch launch) {
- List contextIds = null;
+ List<String> contextIds = null;
synchronized (this) {
- contextIds = (List) fModelToContextIds.get(modelId);
+ contextIds = fModelToContextIds.get(modelId);
if (contextIds == null) {
// if there are no contexts for a model, the base debug context should
// be activated (i.e. a debug model with no org.eclipse.ui.contexts and
// associated org.eclipse.debug.ui.modelContextBindings)
- contextIds = new ArrayList();
+ contextIds = new ArrayList<String>();
contextIds.add(DEBUG_CONTEXT);
fModelToContextIds.put(modelId, contextIds);
}
}
-
- Iterator iterator = contextIds.iterator();
- while (iterator.hasNext()) {
- activateContext((String) iterator.next(), launch);
+ for (String id : contextIds) {
+ activateContext(id, launch);
}
}
@@ -288,9 +283,9 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
* @param activation
*/
private synchronized void addActivation(ILaunch launch, IContextActivation activation) {
- List activations = (List) fLanuchToContextActivations.get(launch);
+ List<IContextActivation> activations = fLanuchToContextActivations.get(launch);
if (activations == null) {
- activations = new ArrayList();
+ activations = new ArrayList<IContextActivation>();
fLanuchToContextActivations.put(launch, activations);
}
activations.add(activation);
@@ -340,22 +335,22 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
// disable activated contexts
for (int i = 0; i < launches.length; i++) {
ILaunch launch = launches[i];
- List activations;
+ List<IContextActivation> activations;
synchronized(this) {
- activations = (List) fLanuchToContextActivations.remove(launch);
+ activations = fLanuchToContextActivations.remove(launch);
fLaunchToModelIds.remove(launch);
}
if (activations != null) {
- final List _activations = activations;
+ final List<IContextActivation> _activations = activations;
UIJob job = new UIJob("Deactivate debug contexts") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
- Iterator iterator = _activations.iterator();
- while (iterator.hasNext()) {
- IContextActivation activation = (IContextActivation) iterator.next();
+ for (IContextActivation activation : _activations) {
activation.getContextService().deactivateContext(activation);
}
return Status.OK_STATUS;
@@ -372,17 +367,20 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
}
@@ -392,18 +390,16 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
* @param target debug context
* @return associated workbench contexts
*/
- public List getWorkbenchContextsForDebugContext(Object target) {
- List workbenchContexts = new ArrayList();
+ public List<String> getWorkbenchContextsForDebugContext(Object target) {
+ List<String> workbenchContexts = new ArrayList<String>();
String[] modelIds = getDebugModelIds(target);
if (modelIds != null) {
for (int i = 0; i < modelIds.length; i++) {
String modelId = modelIds[i];
synchronized (this) {
- List contextIds = (List) fModelToContextIds.get(modelId);
+ List<String> contextIds = fModelToContextIds.get(modelId);
if (contextIds != null) {
- Iterator contextIterator = contextIds.iterator();
- while (contextIterator.hasNext()) {
- String contextId = (String) contextIterator.next();
+ for (String contextId : contextIds) {
if (!workbenchContexts.contains(contextId)) {
workbenchContexts.add(contextId);
}
@@ -422,18 +418,16 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
* @param debug model ids for which to enable activities
*/
private void enableActivitiesFor(String[] modelIds) {
- Set activities = null;
+ Set<String> activities = null;
for (int i = 0; i < modelIds.length; i++) {
String id = modelIds[i];
if (!fModelsEnabledForActivities.contains(id)) {
- Set ids= (Set) fModelToActivities.get(id);
+ Set<String> ids = fModelToActivities.get(id);
if (ids == null) {
// first time the model has been seen, perform pattern matching
- ids = new HashSet();
+ ids = new HashSet<String>();
fModelToActivities.put(id, ids);
- Iterator bindings = fModelPatternBindings.iterator();
- while (bindings.hasNext()) {
- IActivityPatternBinding binding = (IActivityPatternBinding) bindings.next();
+ for (IActivityPatternBinding binding : fModelPatternBindings) {
String regex = binding.getPattern().pattern();
regex = regex.substring(0, regex.length() - DEBUG_MODEL_ACTIVITY_SUFFIX.length());
if (Pattern.matches(regex, id)) {
@@ -443,7 +437,7 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
}
if (!ids.isEmpty()) {
if (activities == null) {
- activities = new HashSet();
+ activities = new HashSet<String>();
}
activities.addAll(ids);
}
@@ -452,9 +446,9 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
}
if (activities != null) {
IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
- Set enabledActivityIds = activitySupport.getActivityManager().getEnabledActivityIds();
+ Set<String> enabledActivityIds = activitySupport.getActivityManager().getEnabledActivityIds();
if (!enabledActivityIds.containsAll(activities)) {
- enabledActivityIds = new HashSet(enabledActivityIds);
+ enabledActivityIds = new HashSet<String>(enabledActivityIds);
enabledActivityIds.addAll(activities);
activitySupport.setEnabledActivityIds(activities);
}
@@ -464,6 +458,7 @@ public class DebugModelContextBindingManager implements IDebugContextListener, I
/* (non-Javadoc)
* @see org.eclipse.ui.activities.IActivityManagerListener#activityManagerChanged(org.eclipse.ui.activities.ActivityManagerEvent)
*/
+ @Override
public void activityManagerChanged(ActivityManagerEvent activityManagerEvent) {
if (activityManagerEvent.haveEnabledActivityIdsChanged()) {
fModelsEnabledForActivities.clear();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
index 9853bf4ab..d0979911d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/DebugWindowContextService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,12 +46,12 @@ import org.eclipse.ui.services.IEvaluationService;
*/
public class DebugWindowContextService implements IDebugContextService, IPartListener2, IDebugContextListener {
- private Map fListenersByPartId = new HashMap();
- private Map fProvidersByPartId = new HashMap();
- private Map fPostListenersByPartId = new HashMap();
+ private Map<String, ListenerList> fListenersByPartId = new HashMap<String, ListenerList>();
+ private Map<String, IDebugContextProvider> fProvidersByPartId = new HashMap<String, IDebugContextProvider>();
+ private Map<String, ListenerList> fPostListenersByPartId = new HashMap<String, ListenerList>();
private IWorkbenchWindow fWindow;
- private List fProviders = new ArrayList();
+ private List<IDebugContextProvider> fProviders = new ArrayList<IDebugContextProvider>();
private DebugContextSourceProvider fSourceProvider;
@@ -68,8 +68,12 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
fWindow = null;
}
+ @Override
public synchronized void addDebugContextProvider(IDebugContextProvider provider) {
- if (fWindow == null) return; // disposed
+ if (fWindow == null)
+ {
+ return; // disposed
+ }
IWorkbenchPart part = provider.getPart();
fProvidersByPartId.put( getCombinedPartId(part), provider );
@@ -99,6 +103,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
provider.addDebugContextListener(this);
}
+ @Override
public synchronized void removeDebugContextProvider(IDebugContextProvider provider) {
int index = fProviders.indexOf(provider);
if (index >= 0) {
@@ -124,12 +129,14 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
*/
+ @Override
public void addDebugContextListener(IDebugContextListener listener) {
addDebugContextListener(listener, null);
}
+ @Override
public void addPostDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fPostListenersByPartId.get(partId);
+ ListenerList list = fPostListenersByPartId.get(partId);
if (list == null) {
list = new ListenerList();
fPostListenersByPartId.put(partId, list);
@@ -137,17 +144,20 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
list.add(listener);
}
+ @Override
public void addPostDebugContextListener(IDebugContextListener listener) {
addPostDebugContextListener(listener, null);
}
+ @Override
public void removePostDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fPostListenersByPartId.get(partId);
+ ListenerList list = fPostListenersByPartId.get(partId);
if (list != null) {
list.remove(listener);
}
}
+ @Override
public void removePostDebugContextListener(IDebugContextListener listener) {
removePostDebugContextListener(listener, null);
}
@@ -155,6 +165,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener)
*/
+ @Override
public void removeDebugContextListener(IDebugContextListener listener) {
removeDebugContextListener(listener, null);
}
@@ -207,9 +218,11 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
for (int i = 0; i < listeners.length; i++) {
final IDebugContextListener listener = (IDebugContextListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
listener.debugContextChanged(event);
}
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
@@ -221,15 +234,15 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
String id = null;
if (part != null) {
id = getCombinedPartId(part);
- ListenerList listenerList = (ListenerList)fListenersByPartId.get(id);
+ ListenerList listenerList = fListenersByPartId.get(id);
return listenerList != null ? listenerList.getListeners() : new Object[0];
} else {
- List retVal = new ArrayList();
- retVal.addAll(Arrays.asList(((ListenerList)fListenersByPartId.get(null)).getListeners()) );
- outer: for (Iterator itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) {
- String listenerPartId = (String)itr.next();
+ List<Object> retVal = new ArrayList<Object>();
+ retVal.addAll(Arrays.asList(fListenersByPartId.get(null).getListeners()) );
+ outer: for (Iterator<String> itr = fListenersByPartId.keySet().iterator(); itr.hasNext();) {
+ String listenerPartId = itr.next();
for (int i = 0; i < fProviders.size(); i++) {
- String providerPartId = getCombinedPartId(((IDebugContextProvider)fProviders.get(i)).getPart());
+ String providerPartId = getCombinedPartId(fProviders.get(i).getPart());
if ((listenerPartId == null && providerPartId == null) ||
(listenerPartId != null && listenerPartId.equals(providerPartId)))
{
@@ -237,10 +250,12 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
}
}
- List toAdd = Arrays.asList(((ListenerList)fListenersByPartId.get(listenerPartId)).getListeners());
- for (Iterator addItr = toAdd.iterator(); addItr.hasNext();) {
+ List<Object> toAdd = Arrays.asList(fListenersByPartId.get(listenerPartId).getListeners());
+ for (Iterator<Object> addItr = toAdd.iterator(); addItr.hasNext();) {
Object element = addItr.next();
- if (!retVal.contains(element)) retVal.add(element);
+ if (!retVal.contains(element)) {
+ retVal.add(element);
+ }
}
}
@@ -252,26 +267,26 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
String id = null;
if (part != null) {
id = getCombinedPartId(part);
- ListenerList listenerList = (ListenerList)fPostListenersByPartId.get(id);
+ ListenerList listenerList = fPostListenersByPartId.get(id);
return listenerList != null ? listenerList.getListeners() : new Object[0];
} else {
- List retVal = new ArrayList();
- ListenerList postListenersList = (ListenerList)fPostListenersByPartId.get(null);
+ List<Object> retVal = new ArrayList<Object>();
+ ListenerList postListenersList = fPostListenersByPartId.get(null);
if (postListenersList != null) {
retVal.addAll( Arrays.asList(postListenersList.getListeners()) );
}
- outer: for (Iterator itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) {
- String listenerPartId = (String)itr.next();
+ outer: for (Iterator<String> itr = fPostListenersByPartId.keySet().iterator(); itr.hasNext();) {
+ String listenerPartId = itr.next();
for (int i = 0; i < fProviders.size(); i++) {
- String providerPartId = getCombinedPartId(((IDebugContextProvider)fProviders.get(i)).getPart());
+ String providerPartId = getCombinedPartId(fProviders.get(i).getPart());
if ((listenerPartId == null && providerPartId == null) ||
(listenerPartId != null && listenerPartId.equals(providerPartId)))
{
continue outer;
}
}
- retVal.addAll( Arrays.asList(((ListenerList)fPostListenersByPartId.get(listenerPartId)).getListeners()) );
+ retVal.addAll( Arrays.asList(fPostListenersByPartId.get(listenerPartId).getListeners()) );
}
return retVal.toArray();
}
@@ -280,8 +295,9 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String)
*/
+ @Override
public synchronized void addDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fListenersByPartId.get(partId);
+ ListenerList list = fListenersByPartId.get(partId);
if (list == null) {
list = new ListenerList();
fListenersByPartId.put(partId, list);
@@ -292,20 +308,23 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String)
*/
+ @Override
public void removeDebugContextListener(IDebugContextListener listener, String partId) {
- ListenerList list = (ListenerList) fListenersByPartId.get(partId);
+ ListenerList list = fListenersByPartId.get(partId);
if (list != null) {
list.remove(listener);
- if (list.size() == 0)
+ if (list.size() == 0) {
fListenersByPartId.remove(partId);
+ }
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#getActiveContext(java.lang.String)
*/
+ @Override
public ISelection getActiveContext(String partId) {
- IDebugContextProvider provider = (IDebugContextProvider) fProvidersByPartId.get(partId);
+ IDebugContextProvider provider = fProvidersByPartId.get(partId);
if (provider != null) {
return provider.getActiveContext();
}
@@ -315,6 +334,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService#getActiveContext()
*/
+ @Override
public ISelection getActiveContext() {
IDebugContextProvider activeProvider = getActiveProvider();
if (activeProvider != null) {
@@ -330,7 +350,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
*/
private IDebugContextProvider getActiveProvider() {
if (!fProviders.isEmpty()) {
- return (IDebugContextProvider)fProviders.get(0);
+ return fProviders.get(0);
}
return null;
}
@@ -338,8 +358,9 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partActivated(IWorkbenchPartReference partRef) {
- IDebugContextProvider provider = (IDebugContextProvider) fProvidersByPartId.get(partRef.getId());
+ IDebugContextProvider provider = fProvidersByPartId.get(partRef.getId());
if (provider != null) {
boolean canSetActive = true;
if (provider instanceof IDebugContextProvider2) {
@@ -361,48 +382,56 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public synchronized void partClosed(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partDeactivated(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partOpened(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partHidden(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partVisible(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partInputChanged(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
notify(event);
}
@@ -426,6 +455,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService2#addDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String, java.lang.String)
*/
+ @Override
public void addDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
addDebugContextListener(listener, getCombinedPartId(partId, partSecondaryId));
}
@@ -433,6 +463,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService2#removeDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String, java.lang.String)
*/
+ @Override
public void removeDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
removeDebugContextListener(listener, getCombinedPartId(partId, partSecondaryId));
}
@@ -440,6 +471,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService2#addPostDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String, java.lang.String)
*/
+ @Override
public void addPostDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
addPostDebugContextListener(listener, getCombinedPartId(partId, partSecondaryId));
}
@@ -447,6 +479,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService2#removePostDebugContextListener(org.eclipse.debug.ui.contexts.IDebugContextListener, java.lang.String, java.lang.String)
*/
+ @Override
public void removePostDebugContextListener(IDebugContextListener listener, String partId, String partSecondaryId) {
removePostDebugContextListener(listener, getCombinedPartId(partId, partSecondaryId));
}
@@ -454,6 +487,7 @@ public class DebugWindowContextService implements IDebugContextService, IPartLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextService2#getActiveContext(java.lang.String, java.lang.String)
*/
+ @Override
public ISelection getActiveContext(String partId, String partSecondaryId) {
return getActiveContext(getCombinedPartId(partId, partSecondaryId));
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
index 08dd1518d..4302aed21 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/LaunchSuspendTrigger.java
@@ -54,6 +54,7 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.ISuspendTrigger#addSuspendTriggerListener(org.eclipse.debug.ui.contexts.ISuspendTriggerListener)
*/
+ @Override
public void addSuspendTriggerListener(ISuspendTriggerListener listener) {
if (fListeners != null) {
fListeners.add(listener);
@@ -63,6 +64,7 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.ISuspendTrigger#removeSuspendTriggerListener(org.eclipse.debug.ui.contexts.ISuspendTriggerListener)
*/
+ @Override
public void removeSuspendTriggerListener(ISuspendTriggerListener listener) {
if (fListeners != null) {
fListeners.remove(listener);
@@ -75,6 +77,7 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
// open the debugger if this is a suspend event and the debug view is not yet open
// and the preferences are set to switch
@@ -119,11 +122,13 @@ public class LaunchSuspendTrigger implements ISuspendTrigger, IDebugEventSetList
for (int i = 0; i < listeners.length; i++) {
final ISuspendTriggerListener listener = (ISuspendTriggerListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
listener.suspended(launch, temp);
}
- public void handleException(Throwable exception) {
+ @Override
+ public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
index 27c026894..d542267b9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contexts/SuspendTriggerAdapterFactory.java
@@ -22,15 +22,16 @@ import org.eclipse.debug.ui.contexts.ISuspendTrigger;
*/
public class SuspendTriggerAdapterFactory implements IAdapterFactory {
- private Map fSuspendTriggers = new HashMap();
+ private Map<Object, LaunchSuspendTrigger> fSuspendTriggers = new HashMap<Object, LaunchSuspendTrigger>();
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @Override
public synchronized Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType.equals(ISuspendTrigger.class)) {
if (adaptableObject instanceof ILaunch) {
- Object trigger = fSuspendTriggers.get(adaptableObject);
+ LaunchSuspendTrigger trigger = fSuspendTriggers.get(adaptableObject);
if (trigger == null) {
trigger = new LaunchSuspendTrigger((ILaunch) adaptableObject, this);
fSuspendTriggers.put(adaptableObject, trigger);
@@ -44,6 +45,7 @@ public class SuspendTriggerAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
+ @Override
public Class[] getAdapterList() {
return new Class[]{ISuspendTrigger.class};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java
index 8547d1c12..3de6db4e1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/AsynchronousDebugLabelAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@
package org.eclipse.debug.internal.ui.elements.adapters;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
@@ -40,6 +39,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#computeLabels(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext, org.eclipse.debug.ui.viewers.ILabelRequestMonitor)
*/
+ @Override
protected void computeLabels(Object element, IPresentationContext context, ILabelRequestMonitor monitor) {
DelegatingModelPresentation presentation = DebugElementHelper.getPresentation();
// Honor view specific settings in a debug view by copying model presentation settings
@@ -48,7 +48,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
if (element instanceof IDebugElement && context.getPart() instanceof IDebugView) {
IDebugView debugView = (IDebugView)context.getPart();
IDebugModelPresentation pres = debugView.getPresentation(((IDebugElement)element).getModelIdentifier());
- Map settings = null;
+ Map<String, Object> settings = null;
synchronized (presentation) {
if (pres instanceof DelegatingModelPresentation) {
settings = ((DelegatingModelPresentation)pres).getAttributes();
@@ -56,10 +56,8 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
settings = ((LazyModelPresentation)pres).getAttributes();
}
if (settings != null) {
- Iterator iterator = settings.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- presentation.setAttribute((String) entry.getKey(), entry.getValue());
+ for (Entry<String, Object> entry : settings.entrySet()) {
+ presentation.setAttribute(entry.getKey(), entry.getValue());
}
super.computeLabels(element, context, monitor);
return;
@@ -72,6 +70,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getLabels(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
protected String[] getLabels(Object element, IPresentationContext context) throws CoreException {
return new String[] {DebugElementHelper.getLabel(element)};
}
@@ -79,6 +78,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getImageDescriptors(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
protected ImageDescriptor[] getImageDescriptors(Object element, IPresentationContext context) throws CoreException {
return new ImageDescriptor[] {DebugElementHelper.getImageDescriptor(element)};
}
@@ -86,6 +86,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getFontDatas(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
protected FontData[] getFontDatas(Object element, IPresentationContext context) throws CoreException {
FontData[] datas = new FontData[getNumElements(context)];
Arrays.fill(datas, DebugElementHelper.getFont(element));
@@ -95,6 +96,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getForegrounds(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
protected RGB[] getForegrounds(Object element, IPresentationContext context) throws CoreException {
RGB[] rgbs = new RGB[getNumElements(context)];
Arrays.fill(rgbs, DebugElementHelper.getForeground(element));
@@ -104,6 +106,7 @@ public class AsynchronousDebugLabelAdapter extends AsynchronousLabelAdapter {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousLabelAdapter#getBackgrounds(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
protected RGB[] getBackgrounds(Object element, IPresentationContext context) throws CoreException {
RGB[] rgbs = new RGB[getNumElements(context)];
Arrays.fill(rgbs, DebugElementHelper.getBackground(element));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultBreakpointsViewInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultBreakpointsViewInput.java
index a525bdf95..b8b34d385 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultBreakpointsViewInput.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultBreakpointsViewInput.java
@@ -48,7 +48,8 @@ public class DefaultBreakpointsViewInput {
* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ @Override
+ public int hashCode() {
if (getContext() != null) {
return getContext().hashCode();
} else {
@@ -60,7 +61,8 @@ public class DefaultBreakpointsViewInput {
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object arg0) {
+ @Override
+ public boolean equals(Object arg0) {
if ( (arg0 != null) && arg0.getClass().equals(this.getClass()) ) {
IPresentationContext context = ((DefaultBreakpointsViewInput) arg0).getContext();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java
index 346efdc21..33b394dea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultVariableCellModifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -21,11 +21,13 @@ import org.eclipse.jface.viewers.ICellModifier;
* @since 3.2
*
*/
+@SuppressWarnings("deprecation")
public class DefaultVariableCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean canModify(Object element, String property) {
if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
if (element instanceof IVariable) {
@@ -38,6 +40,7 @@ public class DefaultVariableCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
*/
+ @Override
public Object getValue(Object element, String property) {
if (VariableColumnPresentation.COLUMN_VARIABLE_VALUE.equals(property)) {
if (element instanceof IVariable) {
@@ -55,6 +58,7 @@ public class DefaultVariableCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
*/
+ @Override
public void modify(Object element, String property, Object value) {
Object oldValue = getValue(element, property);
if (!value.equals(oldValue)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java
index 258cc1ec4..d47277d85 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/DefaultViewerInputProvider.java
@@ -29,6 +29,7 @@ public class DefaultViewerInputProvider extends ViewerInputProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected Object getViewerInput(Object source, IPresentationContext context, IViewerUpdate update) throws CoreException {
if (IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(context.getId())) {
DefaultBreakpointsViewInput input = new DefaultBreakpointsViewInput(context);
@@ -41,6 +42,7 @@ public class DefaultViewerInputProvider extends ViewerInputProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id) ||
IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
index bdcc2f87a..ffa412b99 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockContentAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,6 @@ package org.eclipse.debug.internal.ui.elements.adapters;
import java.math.BigInteger;
import java.util.ArrayList;
-import java.util.Hashtable;
import java.util.Vector;
import org.eclipse.core.runtime.CoreException;
@@ -37,66 +36,57 @@ import org.eclipse.debug.ui.memory.IMemoryRendering;
public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
- // Cache to allow the content provider to comppute change information
- // Cache is taken by copying the lineCache after a suspend event
- // or change event from the the memory block.
- protected Hashtable contentCache;
-
- public MemoryBlockContentAdapter()
- {
- contentCache = new Hashtable();
- }
+ @Override
+ protected Object[] getChildren(Object parent, IPresentationContext context) throws CoreException {
- protected Object[] getChildren(Object parent, IPresentationContext context)
- throws CoreException {
-
- if (!(parent instanceof IMemoryBlock))
+ if (!(parent instanceof IMemoryBlock)) {
return new Object[0];
-
- if (!(context instanceof MemoryViewPresentationContext))
+ }
+
+ if (!(context instanceof MemoryViewPresentationContext)) {
return new Object[0];
-
- MemoryViewPresentationContext memoryViewContext = (MemoryViewPresentationContext)context;
+ }
+
+ MemoryViewPresentationContext memoryViewContext = (MemoryViewPresentationContext) context;
IMemoryRendering rendering = memoryViewContext.getRendering();
-
- if (!(rendering instanceof AbstractAsyncTableRendering))
+
+ if (!(rendering instanceof AbstractAsyncTableRendering)) {
return new Object[0];
-
- try
- {
+ }
+
+ try {
return getMemoryFromMemoryBlock(memoryViewContext);
} catch (DebugException e) {
throw e;
- }
+ }
}
- protected boolean hasChildren(Object element, IPresentationContext context)
- throws CoreException {
-
- if (context instanceof MemoryViewPresentationContext)
- {
- if (((MemoryViewPresentationContext)context).getRendering() != null)
+ @Override
+ protected boolean hasChildren(Object element, IPresentationContext context) throws CoreException {
+
+ if (context instanceof MemoryViewPresentationContext) {
+ if (((MemoryViewPresentationContext) context).getRendering() != null) {
return true;
+ }
}
-
+
return false;
}
+ @Override
protected boolean supportsPartId(String id) {
return true;
}
-
-
+
private Object[] getMemoryFromMemoryBlock(MemoryViewPresentationContext context) throws DebugException {
IMemoryBlock memoryBlock = context.getRendering().getMemoryBlock();
- if (memoryBlock instanceof IMemoryBlockExtension)
- {
+ if (memoryBlock instanceof IMemoryBlockExtension) {
return loadContentForExtendedMemoryBlock(context);
}
return loadContentForSimpleMemoryBlock(context);
-
+
}
/**
@@ -104,14 +94,13 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
*/
public Object[] loadContentForSimpleMemoryBlock(MemoryViewPresentationContext context) throws DebugException {
AbstractAsyncTableRendering rendering = getTableRendering(context);
- if (rendering != null)
- {
+ if (rendering != null) {
IMemoryBlock memoryBlock = rendering.getMemoryBlock();
long startAddress = memoryBlock.getStartAddress();
BigInteger address = BigInteger.valueOf(startAddress);
long length = memoryBlock.getLength();
long numLines = length / rendering.getBytesPerLine();
- return getMemoryToFitTable(address, numLines, context);
+ return getMemoryToFitTable(address, numLines, context);
}
return EMPTY;
}
@@ -120,186 +109,183 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
* @throws DebugException
*/
public Object[] loadContentForExtendedMemoryBlock(MemoryViewPresentationContext context) throws DebugException {
-
+
AbstractAsyncTableRendering rendering = getTableRendering(context);
- if (rendering != null)
- {
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
-
- if (descriptor == null)
+ if (rendering != null) {
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) rendering.getAdapter(TableRenderingContentDescriptor.class);
+
+ if (descriptor == null) {
return new Object[0];
-
- if (descriptor.getNumLines() <= 0)
+ }
+
+ if (descriptor.getNumLines() <= 0) {
return new Object[0];
-
+ }
+
// calculate top buffered address
BigInteger loadAddress = descriptor.getLoadAddress();
- if (loadAddress == null)
- {
+ if (loadAddress == null) {
loadAddress = new BigInteger("0"); //$NON-NLS-1$
}
-
+
BigInteger mbStart = descriptor.getStartAddress();
BigInteger mbEnd = descriptor.getEndAddress();
-
+
// check that the load address is within range
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
+ if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0) {
// default load address to memory block base address
- loadAddress = ((IMemoryBlockExtension)descriptor.getMemoryBlock()).getBigBaseAddress();
+ loadAddress = ((IMemoryBlockExtension) descriptor.getMemoryBlock()).getBigBaseAddress();
descriptor.setLoadAddress(loadAddress);
}
-
+
// if address is still out of range, throw an exception
- if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0)
- {
+ if (loadAddress.compareTo(mbStart) < 0 || loadAddress.compareTo(mbEnd) > 0) {
throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_0 + loadAddress.toString(16), null));
}
-
+
int addressableUnitsPerLine = rendering.getAddressableUnitPerLine();
- BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(descriptor.getPreBuffer()*addressableUnitsPerLine));
- BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(descriptor.getPostBuffer()*addressableUnitsPerLine));
- bufferEnd = bufferEnd.add(BigInteger.valueOf(descriptor.getNumLines()*addressableUnitsPerLine));
-
- // TODO: should rely on input to tell us what to load
+ BigInteger bufferStart = loadAddress.subtract(BigInteger.valueOf(descriptor.getPreBuffer() * addressableUnitsPerLine));
+ BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(descriptor.getPostBuffer() * addressableUnitsPerLine));
+ bufferEnd = bufferEnd.add(BigInteger.valueOf(descriptor.getNumLines() * addressableUnitsPerLine));
+
+ // TODO: should rely on input to tell us what to load
// instead of having the content adapter override the setting
- if (descriptor.isDynamicLoad())
- {
- if (bufferStart.compareTo(mbStart) < 0)
+ if (descriptor.isDynamicLoad()) {
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
-
- if (bufferEnd.compareTo(mbEnd) > 0)
- {
+ }
+
+ if (bufferEnd.compareTo(mbEnd) > 0) {
bufferEnd = mbEnd;
-
+
int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue();
- if (numLines < descriptor.getNumLines())
- {
- // re-calculate buffer start since we may not have enough lines to popoulate the view
- bufferStart = bufferEnd.subtract(BigInteger.valueOf(descriptor.getNumLines()*addressableUnitsPerLine));
- bufferStart = bufferStart.subtract(BigInteger.valueOf(descriptor.getPreBuffer()*addressableUnitsPerLine));
-
- // if after adjusting buffer start, it goes before the memory block start
+ if (numLines < descriptor.getNumLines()) {
+ // re-calculate buffer start since we may not have
+ // enough lines to popoulate the view
+ bufferStart = bufferEnd.subtract(BigInteger.valueOf(descriptor.getNumLines() * addressableUnitsPerLine));
+ bufferStart = bufferStart.subtract(BigInteger.valueOf(descriptor.getPreBuffer() * addressableUnitsPerLine));
+
+ // if after adjusting buffer start, it goes before the
+ // memory block start
// address, adjust it back
- if (bufferStart.compareTo(mbStart) < 0)
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
+ }
}
}
-
+
// buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
+ if (bufferEnd.compareTo(bufferStart) <= 0) {
throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_1, null));
-
- int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
+ }
+
+ int numLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue() + 1;
// get stoarage to fit the memory view tab size
- return getMemoryToFitTable(bufferStart, numLines,context);
- }
- else
- {
- if (bufferStart.compareTo(mbStart) < 0)
+ return getMemoryToFitTable(bufferStart, numLines, context);
+ } else {
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
-
- if (bufferEnd.compareTo(mbEnd) > 0)
- {
- bufferStart = mbEnd.subtract(BigInteger.valueOf((descriptor.getNumLines()-1)*addressableUnitsPerLine));
+ }
+
+ if (bufferEnd.compareTo(mbEnd) > 0) {
+ bufferStart = mbEnd.subtract(BigInteger.valueOf((descriptor.getNumLines() - 1) * addressableUnitsPerLine));
bufferEnd = mbEnd;
-
- // after adjusting buffer start, check if it's smaller than memory block's start address
- if (bufferStart.compareTo(mbStart) < 0)
+
+ // after adjusting buffer start, check if it's smaller than
+ // memory block's start address
+ if (bufferStart.compareTo(mbStart) < 0) {
bufferStart = mbStart;
+ }
}
-
+
// buffer end must be greater than buffer start
- if (bufferEnd.compareTo(bufferStart) <= 0)
+ if (bufferEnd.compareTo(bufferStart) <= 0) {
throw new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.TableRenderingContentProvider_2, null));
-
+ }
+
int numLines = descriptor.getNumLines();
- int bufferNumLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue()+1;
-
- if (bufferNumLines < numLines)
+ int bufferNumLines = bufferEnd.subtract(bufferStart).divide(BigInteger.valueOf(addressableUnitsPerLine)).intValue() + 1;
+
+ if (bufferNumLines < numLines) {
numLines = bufferNumLines;
-
+ }
+
// get stoarage to fit the memory view tab size
- return getMemoryToFitTable(bufferStart, numLines, context);
+ return getMemoryToFitTable(bufferStart, numLines, context);
}
}
return EMPTY;
}
-
+
/**
* Get memory to fit table
+ *
* @param startingAddress
* @param numberOfLines
* @param updateDelta
* @throws DebugException
*/
- public Object[] getMemoryToFitTable(BigInteger startAddress, long numberOfLines, MemoryViewPresentationContext context) throws DebugException
- {
- AbstractAsyncTableRendering tableRendering = getTableRendering(context);
- if (tableRendering == null)
- {
+ public Object[] getMemoryToFitTable(BigInteger startAddress, long numberOfLines, MemoryViewPresentationContext context) throws DebugException {
+ AbstractAsyncTableRendering tableRendering = getTableRendering(context);
+ if (tableRendering == null) {
DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
throw e;
}
-
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)tableRendering.getAdapter(TableRenderingContentDescriptor.class);
- if(descriptor == null)
+
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) tableRendering.getAdapter(TableRenderingContentDescriptor.class);
+ if (descriptor == null) {
return new Object[0];
-
+ }
+
// do not ask for memory from memory block if the debug target
// is already terminated
IDebugTarget target = descriptor.getMemoryBlock().getDebugTarget();
-
- // check for null target to not calculate and retrieve memory for standard debug model
- if (target != null && (target.isDisconnected() || target.isTerminated()))
+
+ // check for null target to not calculate and retrieve memory for
+ // standard debug model
+ if (target != null && (target.isDisconnected() || target.isTerminated())) {
return new Object[0];
-
+ }
+
DebugException dbgEvt = null;
-
+
String adjustedAddress = startAddress.toString(16);
// align to the closest boundary based on addressable size per line
- if (descriptor.isAlignAddressToBoundary() && descriptor.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
+ if (descriptor.isAlignAddressToBoundary() && descriptor.getMemoryBlock() instanceof IMemoryBlockExtension) {
startAddress = MemoryViewUtil.alignToBoundary(startAddress, tableRendering.getAddressableUnitPerLine());
}
IMemoryBlockExtension extMemoryBlock = null;
MemoryByte[] memoryBuffer = null;
-
+
long reqNumBytes = 0;
- try
- {
-
- if (descriptor.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
+ try {
+
+ if (descriptor.getMemoryBlock() instanceof IMemoryBlockExtension) {
reqNumBytes = tableRendering.getBytesPerLine() * numberOfLines;
// get memory from memory block
extMemoryBlock = (IMemoryBlockExtension) descriptor.getMemoryBlock();
-
+
long reqNumberOfUnits = tableRendering.getAddressableUnitPerLine() * numberOfLines;
-
- memoryBuffer = extMemoryBlock.getBytesFromAddress(startAddress, reqNumberOfUnits);
-
- if(memoryBuffer == null)
- {
+
+ memoryBuffer = extMemoryBlock.getBytesFromAddress(startAddress, reqNumberOfUnits);
+
+ if (memoryBuffer == null) {
DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
throw e;
}
- }
- else
- {
+ } else {
// get memory from memory block
byte[] memory = descriptor.getMemoryBlock().getBytes();
-
- if (memory == null)
- {
- DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
- throw e;
+
+ if (memory == null) {
+ DebugException e = new DebugException(DebugUIPlugin.newErrorStatus(DebugUIMessages.MemoryViewContentProvider_Unable_to_retrieve_content, null));
+ throw e;
}
-
+
int prefillNumBytes = 0;
-
+
// number of bytes need to prefill
if (!startAddress.toString(16).endsWith("0")) //$NON-NLS-1$
{
@@ -310,33 +296,30 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
startAddress = adjustedStart;
}
reqNumBytes = descriptor.getMemoryBlock().getLength() + prefillNumBytes;
-
+
// figure out number of dummy bytes to append
- while (reqNumBytes % tableRendering.getBytesPerLine() != 0)
- {
- reqNumBytes ++;
+ while (reqNumBytes % tableRendering.getBytesPerLine() != 0) {
+ reqNumBytes++;
}
-
+
numberOfLines = reqNumBytes / tableRendering.getBytesPerLine();
-
+
// create memory byte for IMemoryBlock
- memoryBuffer = new MemoryByte[(int)reqNumBytes];
-
+ memoryBuffer = new MemoryByte[(int) reqNumBytes];
+
// prefill buffer to ensure double-word alignment
- for (int i=0; i<prefillNumBytes; i++)
- {
+ for (int i = 0; i < prefillNumBytes; i++) {
MemoryByte tmp = new MemoryByte();
- tmp.setValue((byte)0);
+ tmp.setValue((byte) 0);
tmp.setWritable(false);
tmp.setReadable(false);
tmp.setEndianessKnown(false);
memoryBuffer[i] = tmp;
}
-
+
// fill buffer with memory returned by debug adapter
- int j = prefillNumBytes; // counter for memoryBuffer
- for (int i=0; i<memory.length; i++)
- {
+ int j = prefillNumBytes; // counter for memoryBuffer
+ for (int i = 0; i < memory.length; i++) {
MemoryByte tmp = new MemoryByte();
tmp.setValue(memory[i]);
tmp.setReadable(true);
@@ -345,127 +328,112 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
memoryBuffer[j] = tmp;
j++;
}
-
+
// append to buffer to fill up the entire line
- for (int i=j; i<memoryBuffer.length; i++)
- {
+ for (int i = j; i < memoryBuffer.length; i++) {
MemoryByte tmp = new MemoryByte();
- tmp.setValue((byte)0);
+ tmp.setValue((byte) 0);
tmp.setWritable(false);
tmp.setReadable(false);
tmp.setEndianessKnown(false);
memoryBuffer[i] = tmp;
}
}
- }
- catch (DebugException e)
- {
+ } catch (DebugException e) {
memoryBuffer = makeDummyContent(numberOfLines, tableRendering.getBytesPerLine());
-
+
// finish creating the content provider before throwing an event
dbgEvt = e;
- }
- catch (Throwable e)
- {
+ } catch (Throwable e) {
// catch all errors from this process just to be safe
memoryBuffer = makeDummyContent(numberOfLines, tableRendering.getBytesPerLine());
-
+
// finish creating the content provider before throwing an event
dbgEvt = new DebugException(DebugUIPlugin.newErrorStatus(e.getMessage(), e));
}
-
+
// if debug adapter did not return enough memory, create dummy memory
- if (memoryBuffer.length < reqNumBytes)
- {
- ArrayList newBuffer = new ArrayList();
-
- for (int i=0; i<memoryBuffer.length; i++)
- {
+ if (memoryBuffer.length < reqNumBytes) {
+ ArrayList<MemoryByte> newBuffer = new ArrayList<MemoryByte>();
+
+ for (int i = 0; i < memoryBuffer.length; i++) {
newBuffer.add(memoryBuffer[i]);
}
-
- for (int i=memoryBuffer.length; i<reqNumBytes; i++)
- {
+
+ for (int i = memoryBuffer.length; i < reqNumBytes; i++) {
MemoryByte mb = new MemoryByte();
mb.setReadable(false);
mb.setWritable(false);
mb.setEndianessKnown(false);
newBuffer.add(mb);
}
-
- memoryBuffer = (MemoryByte[])newBuffer.toArray(new MemoryByte[newBuffer.size()]);
-
+
+ memoryBuffer = newBuffer.toArray(new MemoryByte[newBuffer.size()]);
+
}
boolean manageDelta = true;
-
+
// If change information is not managed by the memory block
// The view tab will manage it and calculate delta information
// for its content cache.
- if (descriptor.getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- manageDelta = !((IMemoryBlockExtension)descriptor.getMemoryBlock()).supportsChangeManagement();
+ if (descriptor.getMemoryBlock() instanceof IMemoryBlockExtension) {
+ manageDelta = !((IMemoryBlockExtension) descriptor.getMemoryBlock()).supportsChangeManagement();
}
-
- if (dbgEvt != null){
+
+ if (dbgEvt != null) {
throw dbgEvt;
}
-
+
// put memory information into MemoryViewLine
return organizeLines(numberOfLines, memoryBuffer, startAddress, manageDelta, context);
-
}
- private Object[] organizeLines(long numberOfLines, MemoryByte[] memoryBuffer, BigInteger address, boolean manageDelta, MemoryViewPresentationContext context)
- {
- Vector lineCache = new Vector();
+ private Object[] organizeLines(long numberOfLines, MemoryByte[] memoryBuffer, BigInteger address, boolean manageDelta, MemoryViewPresentationContext context) {
+ Vector<MemorySegment> lineCache = new Vector<MemorySegment>();
IMemoryRendering rendering = context.getRendering();
- if (!(rendering instanceof AbstractAsyncTableRendering))
+ if (!(rendering instanceof AbstractAsyncTableRendering)) {
return lineCache.toArray();
-
- AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering)rendering;
- int addressableUnit = tableRendering.getBytesPerLine()/tableRendering.getAddressableSize();
-
- for (int i = 0; i < numberOfLines; i++)
- {
+ }
+
+ AbstractAsyncTableRendering tableRendering = (AbstractAsyncTableRendering) rendering;
+ int addressableUnit = tableRendering.getBytesPerLine() / tableRendering.getAddressableSize();
+
+ for (int i = 0; i < numberOfLines; i++) {
int bytesPerLine = tableRendering.getBytesPerLine();
MemoryByte[] memory = new MemoryByte[bytesPerLine];
-
+
// counter for memory, starts from 0 to number of bytes per line
int k = 0;
// j is the counter for memArray, memory returned by debug adapter
- for (int j = i * bytesPerLine;
- j < i * bytesPerLine + bytesPerLine;
- j++)
- {
-
+ for (int j = i * bytesPerLine; j < i * bytesPerLine + bytesPerLine; j++) {
+
byte changeFlag = memoryBuffer[j].getFlags();
- if (manageDelta)
- {
+ if (manageDelta) {
// turn off both change and known bits to make sure that
// the change bits returned by debug adapters do not take
// any effect
-
+
changeFlag |= MemoryByte.HISTORY_KNOWN;
changeFlag ^= MemoryByte.HISTORY_KNOWN;
-
+
changeFlag |= MemoryByte.CHANGED;
changeFlag ^= MemoryByte.CHANGED;
}
-
+
MemoryByte newByteObj = new MemoryByte(memoryBuffer[j].getValue(), changeFlag);
- memory[k] = newByteObj;
+ memory[k] = newByteObj;
k++;
}
-
+
MemorySegment newLine = new MemorySegment(address, memory, addressableUnit);
lineCache.add(newLine);
address = address.add(BigInteger.valueOf(addressableUnit));
}
return lineCache.toArray();
}
-
+
/**
* @param numberOfLines
* @return an array of dummy MemoryByte
@@ -475,25 +443,23 @@ public class MemoryBlockContentAdapter extends AsynchronousContentAdapter {
// make up dummy memory, needed for recovery in case the debug adapter
// is capable of retrieving memory again
- int numBytes = (int)(bytesPerLine * numberOfLines);
+ int numBytes = (int) (bytesPerLine * numberOfLines);
memoryBuffer = new MemoryByte[numBytes];
-
- for (int i=0; i<memoryBuffer.length; i++){
+
+ for (int i = 0; i < memoryBuffer.length; i++) {
memoryBuffer[i] = new MemoryByte();
- memoryBuffer[i].setValue((byte)0);
+ memoryBuffer[i].setValue((byte) 0);
memoryBuffer[i].setWritable(false);
memoryBuffer[i].setReadable(false);
memoryBuffer[i].setEndianessKnown(false);
}
return memoryBuffer;
}
-
- protected AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context)
- {
+
+ protected AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context) {
IMemoryRendering memRendering = context.getRendering();
- if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
- {
- return (AbstractAsyncTableRendering)memRendering;
+ if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering) {
+ return (AbstractAsyncTableRendering) memRendering;
}
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java
index 6e9c3c116..bde25dd89 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryBlockLabelAdapter.java
@@ -21,6 +21,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
public class MemoryBlockLabelAdapter extends AsynchronousDebugLabelAdapter {
+ @Override
protected ImageDescriptor[] getImageDescriptors(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IMemoryBlock)
return new ImageDescriptor[]{DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_OBJS_VARIABLE)};
@@ -52,6 +53,7 @@ public class MemoryBlockLabelAdapter extends AsynchronousDebugLabelAdapter {
return memoryBlockLabel;
}
+ @Override
protected String[] getLabels(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IMemoryBlock)
return new String[]{getLabel((IMemoryBlock)element)};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java
index eb963920b..9826e37db 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemoryRetrievalContentAdapter.java
@@ -20,6 +20,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
public class MemoryRetrievalContentAdapter extends AsynchronousContentAdapter{
+ @Override
protected Object[] getChildren(Object parent, IPresentationContext context) throws CoreException {
String id = context.getId();
if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
@@ -32,6 +33,7 @@ public class MemoryRetrievalContentAdapter extends AsynchronousContentAdapter{
return EMPTY;
}
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context) throws CoreException {
String id = context.getId();
if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
@@ -45,6 +47,7 @@ public class MemoryRetrievalContentAdapter extends AsynchronousContentAdapter{
return false;
}
+ @Override
protected boolean supportsPartId(String id) {
return id.equals(IDebugUIConstants.ID_MEMORY_VIEW);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
index 5d07d2d1a..9324f12f6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/MemorySegmentLabelAdapter.java
@@ -42,6 +42,7 @@ import org.eclipse.swt.graphics.RGB;
public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
+ @Override
protected String[] getLabels(Object element, IPresentationContext context)
throws CoreException {
@@ -136,6 +137,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
return columnLabel;
}
+ @Override
protected ImageDescriptor[] getImageDescriptors(Object element,
IPresentationContext context) throws CoreException {
if (context instanceof MemoryViewPresentationContext)
@@ -209,6 +211,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
return DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_OBJECT_MEMORY);
}
+ @Override
protected FontData[] getFontDatas(Object element,
IPresentationContext context) throws CoreException {
if (context instanceof MemoryViewPresentationContext)
@@ -254,6 +257,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
return null;
}
+ @Override
protected RGB[] getForegrounds(Object element, IPresentationContext context)
throws CoreException {
@@ -356,6 +360,7 @@ public class MemorySegmentLabelAdapter extends AsynchronousLabelAdapter {
return null;
}
+ @Override
protected RGB[] getBackgrounds(Object element, IPresentationContext context)
throws CoreException {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
index ba69b6ff7..4ef734a77 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/RegisterGroupProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -80,6 +80,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
+ @Override
public Object getElement() {
return fFrame;
}
@@ -87,6 +88,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
+ @Override
public TreePath getElementPath() {
return TreePath.EMPTY;
}
@@ -94,6 +96,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
*/
+ @Override
public IPresentationContext getPresentationContext() {
return fViewerUpdate.getPresentationContext();
}
@@ -101,6 +104,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.Request#done()
*/
+ @Override
public void done() {
fViewerUpdate.setStatus(getStatus());
fViewerUpdate.done();
@@ -109,6 +113,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
*/
+ @Override
public Object getViewerInput() {
return fFrame;
}
@@ -127,6 +132,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate#setChildCount(int)
*/
+ @Override
public void setChildCount(int numChildren) {
fUpdate.setChildCount(numChildren);
}
@@ -145,6 +151,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate#setHasChilren(boolean)
*/
+ @Override
public void setHasChilren(boolean hasChildren) {
fUpdate.setHasChilren(hasChildren);
}
@@ -162,6 +169,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getLength()
*/
+ @Override
public int getLength() {
return fUpdate.getLength();
}
@@ -169,6 +177,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getOffset()
*/
+ @Override
public int getOffset() {
return fUpdate.getOffset();
}
@@ -176,6 +185,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#setChild(java.lang.Object, int)
*/
+ @Override
public void setChild(Object child, int offset) {
fUpdate.setChild(child, offset);
}
@@ -197,12 +207,15 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest#getMemento()
*/
+ @Override
public IMemento getMemento() {
return fUpdate.getMemento();
}
+ @Override
public Object getElement() {
return fUpdate.getElement();
}
+ @Override
public TreePath getElementPath() {
return fUpdate.getElementPath();
}
@@ -219,6 +232,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest#setEqual(boolean)
*/
+ @Override
public void setEqual(boolean equal) {
fRequest.setEqual(equal);
}
@@ -243,6 +257,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
*
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof RegisterGroupProxy) {
return Arrays.equals(fGroups, ((RegisterGroupProxy)obj).fGroups);
@@ -253,6 +268,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
int code = getClass().hashCode();
for (int i = 0; i < fGroups.length; i++) {
@@ -282,6 +298,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (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)
*/
+ @Override
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
IModelProxyFactory factory = ViewerAdapterService.getModelProxyFactory(fFrame);
if (factory != null) {
@@ -293,6 +310,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (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)
*/
+ @Override
public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
IColumnPresentationFactory factory = ViewerAdapterService.getColumnPresentationFactory(fFrame);
if (factory != null) {
@@ -304,6 +322,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (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)
*/
+ @Override
public String getColumnPresentationId(IPresentationContext context, Object element) {
IColumnPresentationFactory factory = ViewerAdapterService.getColumnPresentationFactory(fFrame);
if (factory != null) {
@@ -315,6 +334,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate[])
*/
+ @Override
public void update(IChildrenCountUpdate[] updates) {
IElementContentProvider provider = ViewerAdapterService.getContentProvider(fFrame);
if (provider != null) {
@@ -331,6 +351,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate[])
*/
+ @Override
public void update(IChildrenUpdate[] updates) {
IElementContentProvider provider = ViewerAdapterService.getContentProvider(fFrame);
if (provider != null) {
@@ -348,6 +369,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
*/
+ @Override
public void update(IHasChildrenUpdate[] updates) {
IElementContentProvider provider = ViewerAdapterService.getContentProvider(fFrame);
if (provider != null) {
@@ -376,10 +398,11 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest[])
*/
+ @Override
public void compareElements(IElementCompareRequest[] requests) {
IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(fFrame);
if (provider != null) {
- List others = new ArrayList(requests.length);
+ List<IElementCompareRequest> others = new ArrayList<IElementCompareRequest>(requests.length);
for (int i = 0; i < requests.length; i++) {
IElementCompareRequest request = requests[i];
if (request.getElement().equals(this)) {
@@ -395,7 +418,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
}
}
if (!others.isEmpty()) {
- provider.compareElements((IElementCompareRequest[]) others.toArray(new IElementCompareRequest[others.size()]));
+ provider.compareElements(others.toArray(new IElementCompareRequest[others.size()]));
}
} else {
cancelUpdates(requests);
@@ -405,10 +428,11 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#encodeElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest[])
*/
+ @Override
public void encodeElements(IElementMementoRequest[] requests) {
IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(fFrame);
if (provider != null) {
- List others = new ArrayList(requests.length);
+ List<IElementMementoRequest> others = new ArrayList<IElementMementoRequest>(requests.length);
for (int i = 0; i < requests.length; i++) {
IElementMementoRequest request = requests[i];
if (request.getElement().equals(this)) {
@@ -419,7 +443,7 @@ public class RegisterGroupProxy implements IModelProxyFactory, IColumnPresentati
}
}
if (!others.isEmpty()) {
- provider.encodeElements((IElementMementoRequest[]) others.toArray(new IElementMementoRequest[others.size()]));
+ provider.encodeElements(others.toArray(new IElementMementoRequest[others.size()]));
}
} else {
cancelUpdates(requests);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
index 03a373071..a62505d4b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameSourceDisplayAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,16 +44,18 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
*/
public StackFrameSourceDisplayAdapter() {
DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener() {
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
final DebugEvent event = events[i];
switch (event.getKind()) {
case DebugEvent.TERMINATE:
clearCachedModel(event.getSource());
- // fall through
+ //$FALL-THROUGH$
case DebugEvent.RESUME:
if (!event.isEvaluation()) {
Job uijob = new UIJob("clear source selection"){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(
IProgressMonitor monitor) {
clearSourceSelection(event.getSource());
@@ -73,6 +75,8 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
}
}
break;
+ default:
+ break;
}
}
}
@@ -105,6 +109,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
if (!fTarget.isTerminated()) {
@@ -124,6 +129,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
*/
+ @Override
public boolean belongsTo(Object family) {
// source lookup jobs are a family per workbench page
if (family instanceof SourceLookupJob) {
@@ -152,6 +158,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
/* (non-Javadoc)
* @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!monitor.isCanceled() && fResult != null) {
DebugUITools.displaySource(fResult, fPage);
@@ -170,6 +177,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#belongsTo(java.lang.Object)
*/
+ @Override
public boolean belongsTo(Object family) {
// source display jobs are a family per workbench page
if (family instanceof SourceDisplayJob) {
@@ -184,6 +192,7 @@ public class StackFrameSourceDisplayAdapter implements ISourceDisplay {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
*/
+ @Override
public synchronized void displaySource(Object context, IWorkbenchPage page, boolean force) {
IStackFrame frame = (IStackFrame)context;
if (!force && frame.equals(fPrevFrame)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java
index 885bedd2f..fb3ac0c4f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/StackFrameViewerInputProvider.java
@@ -28,6 +28,7 @@ public class StackFrameViewerInputProvider extends ViewerInputProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#getViewerInput(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate)
*/
+ @Override
protected Object getViewerInput(Object source, IPresentationContext context, IViewerUpdate update) throws CoreException {
if ( IDebugUIConstants.ID_REGISTER_VIEW.equals(context.getId()) ) {
return new RegisterGroupProxy((IStackFrame) source);
@@ -42,6 +43,7 @@ public class StackFrameViewerInputProvider extends ViewerInputProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ViewerInputProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_REGISTER_VIEW.equals(id) ||
IDebugUIConstants.ID_EXPRESSION_VIEW.equals(id) ||
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java
index 0da76888a..9098c00d7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnFactoryAdapter.java
@@ -28,6 +28,7 @@ public class VariableColumnFactoryAdapter implements IColumnPresentationFactory
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#createColumnPresentation(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
*/
+ @Override
public IColumnPresentation createColumnPresentation(IPresentationContext context, Object element) {
String id = context.getId();
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) ||
@@ -44,6 +45,7 @@ public class VariableColumnFactoryAdapter implements IColumnPresentationFactory
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
*/
+ @Override
public String getColumnPresentationId(IPresentationContext context, Object element) {
String id = context.getId();
if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) ||
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java
index 54e92b43a..35489d86b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/VariableColumnPresentation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,24 +24,29 @@ public class VariableColumnPresentation extends AbstractColumnPresentation {
* Constant identifier for the default variable column presentation.
* @deprecated Replaced by {@link IDebugUIConstants#COLUMN_PRESENTATION_ID_VARIABLE}
*/
+ @Deprecated
public final static String DEFAULT_VARIABLE_COLUMN_PRESENTATION = IDebugUIConstants.COLUMN_PRESENTATION_ID_VARIABLE;
/**
* Default column identifiers
* @deprecated Replaced by {@link IDebugUIConstants#COLUMN_ID_VARIABLE_NAME}
*/
+ @Deprecated
public final static String COLUMN_VARIABLE_NAME = IDebugUIConstants.COLUMN_ID_VARIABLE_NAME;
/**
* @deprecated Replaced by {@link IDebugUIConstants#COLUMN_ID_VARIABLE_TYPE}
*/
+ @Deprecated
public final static String COLUMN_VARIABLE_TYPE = IDebugUIConstants.COLUMN_ID_VARIABLE_TYPE;
/**
* @deprecated Replaced by {@link IDebugUIConstants#COLUMN_ID_VARIABLE_VALUE}
*/
+ @Deprecated
public final static String COLUMN_VARIABLE_VALUE = IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE;
/**
* @deprecated Replaced by {@link IDebugUIConstants#COLUMN_ID_VARIABLE_VALUE_TYPE}
*/
+ @Deprecated
public final static String COLUMN_VALUE_TYPE = IDebugUIConstants.COLUMN_ID_VARIABLE_VALUE_TYPE;
private static final String[] ALL_COLUMNS = new String[]{IDebugUIConstants.COLUMN_ID_VARIABLE_NAME,
@@ -52,6 +57,7 @@ public class VariableColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getColumns()
*/
+ @Override
public String[] getAvailableColumns() {
return ALL_COLUMNS;
}
@@ -59,6 +65,7 @@ public class VariableColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getHeader(java.lang.String)
*/
+ @Override
public String getHeader(String id) {
if (IDebugUIConstants.COLUMN_ID_VARIABLE_TYPE.equals(id)) {
return Messages.VariableColumnPresentation_0;
@@ -78,6 +85,7 @@ public class VariableColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getId()
*/
+ @Override
public String getId() {
return IDebugUIConstants.COLUMN_PRESENTATION_ID_VARIABLE;
}
@@ -85,6 +93,7 @@ public class VariableColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getInitialColumns()
*/
+ @Override
public String[] getInitialColumns() {
return INITIAL_COLUMNS;
}
@@ -92,6 +101,7 @@ public class VariableColumnPresentation extends AbstractColumnPresentation {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#isOptional()
*/
+ @Override
public boolean isOptional() {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/WatchExpressionCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/WatchExpressionCellModifier.java
index 954665858..840200f04 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/WatchExpressionCellModifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/elements/adapters/WatchExpressionCellModifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Wind River Systems and others.
+ * Copyright (c) 2010, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.elements.adapters;
@@ -20,11 +21,13 @@ import org.eclipse.jface.viewers.ICellModifier;
*
* @since 3.6
*/
+@SuppressWarnings("deprecation")
public class WatchExpressionCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean canModify(Object element, String property) {
if (VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(property)) {
return element instanceof IWatchExpression;
@@ -35,6 +38,7 @@ public class WatchExpressionCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
*/
+ @Override
public Object getValue(Object element, String property) {
if (VariableColumnPresentation.COLUMN_VARIABLE_NAME.equals(property)) {
return DefaultLabelProvider.escapeSpecialChars( ((IWatchExpression)element).getExpressionText() );
@@ -45,6 +49,7 @@ public class WatchExpressionCellModifier implements ICellModifier {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
*/
+ @Override
public void modify(Object element, String property, Object value) {
Object oldValue = getValue(element, property);
if (!value.equals(oldValue)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointsPathDecorator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointsPathDecorator.java
index 7c864479e..68501ffb9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointsPathDecorator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/BreakpointsPathDecorator.java
@@ -21,10 +21,12 @@ import org.eclipse.swt.graphics.Image;
*/
public class BreakpointsPathDecorator extends BaseLabelProvider implements ILabelDecorator {
+ @Override
public Image decorateImage(Image image, Object element) {
return null;
}
+ @Override
public String decorateText(String text, Object element) {
if (element instanceof IBreakpoint) {
IBreakpoint breakpoint = (IBreakpoint) element;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
index 9072cacc4..9bddcba20 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/EmbeddedBreakpointsViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -60,6 +60,7 @@ public class EmbeddedBreakpointsViewer {
private Tree fTree = null;
private BreakpointsViewer fViewer = null;
private ICheckStateListener fCheckListener = new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateCheckedState(event.getElement(), event.getChecked());
}
@@ -111,7 +112,7 @@ public class EmbeddedBreakpointsViewer {
if(view != null) {
//if we have handle to the view try get the current attributes, that way the
//presentation of the embedded viewer matches the current view
- Map map = null;
+ Map<String, Object> map = null;
IDebugModelPresentation current = (IDebugModelPresentation)view.getAdapter(IDebugModelPresentation.class);
if (current instanceof DelegatingModelPresentation) {
map = ((DelegatingModelPresentation) current).getAttributes();
@@ -119,7 +120,7 @@ public class EmbeddedBreakpointsViewer {
if(map != null) {
Object key = null;
IDebugModelPresentation newpres = labelprovider.getPresentation();
- for(Iterator iter = map.keySet().iterator(); iter.hasNext();) {
+ for (Iterator<String> iter = map.keySet().iterator(); iter.hasNext();) {
key = iter.next();
newpres.setAttribute((String) key, map.get(key));
}
@@ -145,7 +146,7 @@ public class EmbeddedBreakpointsViewer {
Object[] items = fSelection.toArray();
fViewer.setGrayedElements(new Object[] {});
fViewer.setCheckedElements(new Object[] {});
- ArrayList list = new ArrayList();
+ ArrayList<IBreakpoint> list = new ArrayList<IBreakpoint>();
for(int i = 0; i < items.length; i++) {
Object item = items[i];
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(item, IBreakpoint.class);
@@ -166,7 +167,7 @@ public class EmbeddedBreakpointsViewer {
* @param container the container to get breakpoints from
* @param list the list of breakpoints to update state for
*/
- private void getBreakpointsFromContainers(IBreakpointContainer container, ArrayList list) {
+ private void getBreakpointsFromContainers(IBreakpointContainer container, ArrayList<IBreakpoint> list) {
IBreakpoint[] bps = container.getBreakpoints();
list.ensureCapacity(list.size() + bps.length);
for (int j = 0; j < bps.length; j++) {
@@ -180,7 +181,7 @@ public class EmbeddedBreakpointsViewer {
*/
public IStructuredSelection getCheckedElements() {
Object[] list = fViewer.getCheckedElements();
- Vector selected = new Vector();
+ Vector<Object> selected = new Vector<Object>();
for(int i = 0; i < list.length; i++) {
if(!selected.contains(list[i])) {
selected.addElement(list[i]);
@@ -203,12 +204,12 @@ public class EmbeddedBreakpointsViewer {
* @return a list of widget occurrences to update or an empty list
*/
private Widget[] searchItems(Object element) {
- ArrayList list = new ArrayList();
+ ArrayList<TreeItem> list = new ArrayList<TreeItem>();
TreeItem[] items = fTree.getItems();
for (int i = 0; i < items.length; i++) {
findAllOccurrences(items[i], element, list);
}
- return (Widget[]) list.toArray(new Widget[0]);
+ return list.toArray(new Widget[0]);
}
/**
@@ -217,7 +218,7 @@ public class EmbeddedBreakpointsViewer {
* @param item the item in the tree
* @param element the element to compare
*/
- private void findAllOccurrences(TreeItem item, Object element, ArrayList list) {
+ private void findAllOccurrences(TreeItem item, Object element, ArrayList<TreeItem> list) {
if (element.equals(item.getData())) {
list.add(item);
}
@@ -245,7 +246,7 @@ public class EmbeddedBreakpointsViewer {
}
}
else if (obj instanceof BreakpointContainer) {
- ArrayList bps = new ArrayList();
+ ArrayList<IBreakpoint> bps = new ArrayList<IBreakpoint>();
getBreakpointsFromContainers((BreakpointContainer)obj, bps);
for(int j = 0; j < bps.size(); j++) {
updateCheckedState(bps.get(j), enable);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java
index 0ca84788c..95a047422 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ExportBreakpoints.java
@@ -42,6 +42,7 @@ public class ExportBreakpoints extends AbstractDebugActionDelegate {
*
* @param action IAction the action
*/
+ @Override
public void run(IAction action) {
IViewPart fViewpart = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().findView(IDebugUIConstants.ID_BREAKPOINT_VIEW);
WizardExportBreakpoints wiz = new WizardExportBreakpoints();
@@ -54,6 +55,7 @@ public class ExportBreakpoints extends AbstractDebugActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected void update(IAction action, ISelection s) {
getAction().setEnabled(DebugPlugin.getDefault().getBreakpointManager().hasBreakpoints());
}
@@ -61,5 +63,6 @@ public class ExportBreakpoints extends AbstractDebugActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
*/
+ @Override
protected void doAction(Object element) throws DebugException {}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java
index 0cd0a82dc..46753b5d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/ImportBreakpoints.java
@@ -37,6 +37,7 @@ public class ImportBreakpoints extends AbstractDebugActionDelegate {
*
* @param action IAction the action
*/
+ @Override
public void run(IAction action) {
WizardImportBreakpoints wiz = new WizardImportBreakpoints();
wiz.init(DebugUIPlugin.getDefault().getWorkbench(), null);
@@ -48,11 +49,13 @@ public class ImportBreakpoints extends AbstractDebugActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#doAction(java.lang.Object)
*/
+ @Override
protected void doAction(Object element) throws DebugException {}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.AbstractDebugActionDelegate#update(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected void update(IAction action, ISelection s) {
getAction().setEnabled(true);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java
index 882cab6bd..5deb204c0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpoints.java
@@ -72,6 +72,7 @@ public class WizardExportBreakpoints extends Wizard implements IExportWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
+ @Override
public void addPages() {
super.addPages();
fMainPage = new WizardExportBreakpointsPage(ImportExportMessages.WizardExportBreakpoints_0, fSelection);
@@ -81,6 +82,7 @@ public class WizardExportBreakpoints extends Wizard implements IExportWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
fMainPage = null;
@@ -90,6 +92,7 @@ public class WizardExportBreakpoints extends Wizard implements IExportWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
+ @Override
public boolean performFinish() {
return fMainPage.finish();
}
@@ -97,6 +100,7 @@ public class WizardExportBreakpoints extends Wizard implements IExportWizard {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
fSelection = selection;
setWindowTitle(ImportExportMessages.WizardExportBreakpoints_0);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
index 59805e902..986d8b654 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardExportBreakpointsPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -97,6 +97,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
/* (non-Javadoc)
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
Widget source = event.widget;
if (source == fDestinationBrowseButton) {
@@ -170,12 +171,14 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
SWTFactory.createLabel(composite, ImportExportMessages.WizardExportBreakpointsPage_2, 1);
fTView = new EmbeddedBreakpointsViewer(composite, DebugPlugin.getDefault().getBreakpointManager(), fSelection);
fTView.getViewer().addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
setPageComplete(detectPageComplete());
}
@@ -200,6 +203,7 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_BREAKPOINTS);
}
@@ -305,23 +309,23 @@ public class WizardExportBreakpointsPage extends WizardPage implements Listener
}
saveWidgetState();
if(path.toFile().exists() && !fOverwriteExistingFilesCheckbox.getSelection()) {
- if (!MessageDialog.openQuestion(null, ImportExportMessages.WizardBreakpointsPage_12, MessageFormat.format(ImportExportMessages.ImportExportOperations_0, new String[] {path.toPortableString()}))) {
+ if (!MessageDialog.openQuestion(null, ImportExportMessages.WizardBreakpointsPage_12, MessageFormat.format(ImportExportMessages.ImportExportOperations_0, new Object[] { path.toPortableString() }))) {
return false;
}
}
// collect breakpoints
Object[] elements = fTView.getCheckedElements().toArray();
- List breakpoints = new ArrayList();
+ List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>();
for (int i = 0; i < elements.length; i++) {
Object object = elements[i];
if (object instanceof IBreakpoint) {
- breakpoints.add(object);
+ breakpoints.add((IBreakpoint) object);
}
}
getContainer().run(false,
true,
new ExportBreakpointsOperation(
- (IBreakpoint[]) breakpoints.toArray(new IBreakpoint[breakpoints.size()]),
+ breakpoints.toArray(new IBreakpoint[breakpoints.size()]),
path.toOSString()));
}
catch (InterruptedException e) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java
index 335366b41..3bdcfc2bb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpoints.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@ package org.eclipse.debug.internal.ui.importexport.breakpoints;
import java.util.List;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -65,14 +66,16 @@ public class WizardImportBreakpoints extends Wizard implements IImportWizard {
DebugUIPlugin plugin = DebugUIPlugin.getDefault();
IDialogSettings workbenchSettings = plugin.getDialogSettings();
IDialogSettings section = workbenchSettings.getSection(IMPORT_DIALOG_SETTINGS);
- if (section == null)
+ if (section == null) {
section = workbenchSettings.addNewSection(IMPORT_DIALOG_SETTINGS);
+ }
setDialogSettings(section);
}
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#addPages()
*/
+ @Override
public void addPages() {
super.addPages();
fMainPage = new WizardImportBreakpointsPage(ImportExportMessages.WizardImportBreakpoints_0);
@@ -84,6 +87,7 @@ public class WizardImportBreakpoints extends Wizard implements IImportWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
fMainPage = null;
@@ -92,19 +96,22 @@ public class WizardImportBreakpoints extends Wizard implements IImportWizard {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.IWizard#performFinish()
*/
+ @Override
public boolean performFinish() {
- List selectedBreakpoints = fSelectionPage.getSelectedMarkers();
+ List<IMarker> selectedBreakpoints = fSelectionPage.getSelectedMarkers();
return fMainPage.finish(selectedBreakpoints);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle(ImportExportMessages.WizardImportBreakpoints_0);
setNeedsProgressMonitor(true);
}
+ @Override
public boolean needsProgressMonitor() {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
index 95a15abf4..651fdcfb8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -78,6 +78,7 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
/* (non-Javadoc)
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(Event event) {
Widget source = event.widget;
if(source == fBrowseForFileButton) {
@@ -101,6 +102,7 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
@@ -115,6 +117,7 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_BREAKPOINTS);
}
@@ -133,7 +136,7 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
}
File file = new File(fileName);
if (!file.exists() || file.isDirectory()) {
- setMessage(MessageFormat.format(ImportExportMessages.WizardImportBreakpointsPage_1, new String[]{fileName}), ERROR);
+ setMessage(MessageFormat.format(ImportExportMessages.WizardImportBreakpointsPage_1, new Object[] { fileName }), ERROR);
return false;
}
@@ -208,11 +211,12 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
return finish(null);
}
- public boolean finish(final List selectedMarkers) {
+ public boolean finish(final List<IMarker> selectedMarkers) {
try {
saveWidgetState();
getContainer().run(false, true,
new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
ImportBreakpointsOperation operation = new ImportBreakpointsOperation(
fFileNameField.getText().trim(),
@@ -230,8 +234,8 @@ public class WizardImportBreakpointsPage extends WizardPage implements Listener
boolean selected = false;
for(int j = 0; j < selectedMarkers.size(); j++) {
try {
- Map importedMarkerAttributes = importedBreakpoints[i].getMarker().getAttributes();
- Map selectedMarkerAttributes = ((IMarker) selectedMarkers.get(j)).getAttributes();
+ Map<String, Object> importedMarkerAttributes = importedBreakpoints[i].getMarker().getAttributes();
+ Map<String, Object> selectedMarkerAttributes = selectedMarkers.get(j).getAttributes();
if(importedMarkerAttributes.equals(selectedMarkerAttributes)) {
selected = true;
break;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
index cf873f2fb..9374cea50 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/breakpoints/WizardImportBreakpointsSelectionPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Sebastian Schmidt and others.
+ * Copyright (c) 2012, 2013 Sebastian Schmidt and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Sebastian Schmidt - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.importexport.breakpoints;
@@ -14,6 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.internal.core.BreakpointManager;
@@ -50,6 +52,7 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage {
* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
setDescription(ImportExportMessages.WizardImportBreakpointsSelectionPage_1);
Composite composite = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
@@ -61,14 +64,14 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage {
setControl(composite);
}
- public List getSelectedMarkers() {
+ public List<IMarker> getSelectedMarkers() {
if(!fIsVisible) {
return null;
}
- List markers = new ArrayList();
- List breakpoints = fTView.getCheckedElements().toList();
+ List<IMarker> markers = new ArrayList<IMarker>();
+ List<IBreakpoint> breakpoints = fTView.getCheckedElements().toList();
for(int i = 0; i < breakpoints.size(); i++) {
- markers.add(((IBreakpoint) breakpoints.get(i)).getMarker());
+ markers.add(breakpoints.get(i).getMarker());
}
return markers;
}
@@ -77,6 +80,7 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage {
* (non-Javadoc)
* @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
*/
+ @Override
public void setVisible(boolean visible) {
if (visible) {
fIsVisible = true;
@@ -94,6 +98,7 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage {
private void updateBreakpointsPreviewList(final EmbeddedBreakpointsViewer currentTView) throws InvocationTargetException, InterruptedException {
getContainer().run(false, true, new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
WizardImportBreakpointsPage mainPage = (WizardImportBreakpointsPage) getWizard().getPage(
ImportExportMessages.WizardImportBreakpoints_0);
@@ -114,6 +119,7 @@ public class WizardImportBreakpointsSelectionPage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_BREAKPOINTS);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
index cfbbe1fcc..8c826ba0a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizard.java
@@ -44,6 +44,7 @@ public class ExportLaunchConfigurationsWizard extends Wizard implements IExportW
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
+ @Override
public void addPages() {
IWizardPage page = new ExportLaunchConfigurationsWizardPage();
addPage(page);
@@ -52,6 +53,7 @@ public class ExportLaunchConfigurationsWizard extends Wizard implements IExportW
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
return ((ExportLaunchConfigurationsWizardPage)getStartingPage()).finish();
}
@@ -59,6 +61,7 @@ public class ExportLaunchConfigurationsWizard extends Wizard implements IExportW
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle(WizardMessages.ExportLaunchConfigurationsWizard_0);
setNeedsProgressMonitor(true);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
index 80585cc0e..0ac2fea14 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ExportLaunchConfigurationsWizardPage.java
@@ -81,6 +81,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ @Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof ILaunchConfigurationType) {
try {
@@ -92,6 +93,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
}
return null;
}
+ @Override
public Object getParent(Object element) {
if(element instanceof ILaunchConfiguration) {
try {
@@ -102,13 +104,17 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
}
return null;
}
+ @Override
public boolean hasChildren(Object element) {
return element instanceof ILaunchConfigurationType;
}
+ @Override
public Object[] getElements(Object inputElement) {
return lm.getLaunchConfigurationTypes();
}
+ @Override
public void dispose() {lm = null;}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
@@ -129,6 +135,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
//add the check table
@@ -166,6 +173,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
fViewer.expandAll();
fViewer.collapseAll();
fViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateCheckedState(event.getElement());
setPageComplete(isComplete());
@@ -174,6 +182,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
Composite buttoncomp = SWTFactory.createComposite(parent, parent.getFont(), 2, 2, GridData.FILL_HORIZONTAL, 0, 0);
Button button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_8, null);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Object[] items = fContentProvider.getElements(fViewer.getInput());
for (int i = 0; i < items.length; i++) {
@@ -184,6 +193,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
});
button = SWTFactory.createPushButton(buttoncomp, WizardMessages.ExportLaunchConfigurationsWizardPage_9, null);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Object[] items = fContentProvider.getElements(fViewer.getInput());
for (int i = 0; i < items.length; i++) {
@@ -236,12 +246,14 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
String opath = getDialogSettings().get(OLD_PATH);
fFilePath.setText((opath == null ? IInternalDebugCoreConstants.EMPTY_STRING : opath));
fFilePath.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
setPageComplete(isComplete());
}
});
Button button = SWTFactory.createPushButton(comp, WizardMessages.ExportLaunchConfigurationsWizardPage_0, null, GridData.END);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dd = new DirectoryDialog(getContainer().getShell());
dd.setText(WizardMessages.ExportLaunchConfigurationsWizard_0);
@@ -291,6 +303,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_EXPORT_CONFIGS);
}
@@ -307,6 +320,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
final Object[] configs = fViewer.getCheckedElements();
final boolean overwrite = fOverwrite.getSelection();
UIJob exportjob = new UIJob(getContainer().getShell().getDisplay(), WizardMessages.ExportLaunchConfigurationsWizard_0) {
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if(monitor == null) {
monitor = new NullProgressMonitor();
@@ -318,7 +332,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
}
monitor.beginTask(WizardMessages.ExportLaunchConfigurationsWizardPage_10, configs.length);
try {
- List errors = null;
+ List<IStatus> errors = null;
IFileStore file = null;
File newfile = null;
boolean owall = false, nowall = false;
@@ -333,10 +347,10 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
file = launchConfig.getFileStore();
if (file == null) {
if (errors == null) {
- errors = new ArrayList(configs.length);
+ errors = new ArrayList<IStatus>(configs.length);
}
errors.add(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_19, new String[]{launchConfig.getName()}), null));
+ MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_19, new Object[] { launchConfig.getName() }), null));
} else {
newfile = new File(destpath.append(file.getName()).toOSString());
if(newfile.exists() & !overwrite) {
@@ -346,7 +360,7 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
dialog = new MessageDialog(DebugUIPlugin.getShell(),
WizardMessages.ExportLaunchConfigurationsWizardPage_11,
null,
- MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new String[] {file.getName()}),
+ MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new Object[] { file.getName() }),
MessageDialog.QUESTION, new String[] {WizardMessages.ExportLaunchConfigurationsWizardPage_13, WizardMessages.ExportLaunchConfigurationsWizardPage_14, WizardMessages.ExportLaunchConfigurationsWizardPage_15, WizardMessages.ExportLaunchConfigurationsWizardPage_16, WizardMessages.ExportLaunchConfigurationsWizardPage_17}, 0);
if(!owall) {
int ret = dialog.open();
@@ -368,6 +382,8 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
monitor.setCanceled(true);
break;
}
+ default:
+ break;
}
}
else if(!nowall) {
@@ -381,14 +397,14 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
}
catch (IOException e ) {
if (errors == null) {
- errors = new ArrayList(configs.length);
+ errors = new ArrayList<IStatus>(configs.length);
}
errors.add(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
e.getMessage(), e));
}
catch (CoreException e) {
if (errors == null) {
- errors = new ArrayList(configs.length);
+ errors = new ArrayList<IStatus>(configs.length);
}
errors.add(e.getStatus());
}
@@ -401,10 +417,10 @@ public class ExportLaunchConfigurationsWizardPage extends WizardPage {
return Status.OK_STATUS;
} else {
if (errors.size() == 1) {
- return (IStatus)errors.get(0);
+ return errors.get(0);
} else {
return new MultiStatus(DebugUIPlugin.getUniqueIdentifier(), 0,
- (IStatus[])errors.toArray(new IStatus[errors.size()]),
+ errors.toArray(new IStatus[errors.size()]),
WizardMessages.ExportLaunchConfigurationsWizardPage_18, null);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
index 1cefad93b..7d8bc653b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizard.java
@@ -47,6 +47,7 @@ public class ImportLaunchConfigurationsWizard extends Wizard implements IImportW
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#performFinish()
*/
+ @Override
public boolean performFinish() {
return ((ImportLaunchConfigurationsWizardPage)getStartingPage()).finish();
}
@@ -54,6 +55,7 @@ public class ImportLaunchConfigurationsWizard extends Wizard implements IImportW
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
+ @Override
public void addPages() {
addPage(new ImportLaunchConfigurationsWizardPage());
}
@@ -61,6 +63,7 @@ public class ImportLaunchConfigurationsWizard extends Wizard implements IImportW
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
setWindowTitle(WizardMessages.ImportLaunchConfigurationsWizard_0);
setNeedsProgressMonitor(true);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
index 85899ba77..0fb6ca526 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/importexport/launchconfigurations/ImportLaunchConfigurationsWizardPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -81,6 +81,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
return populated;
}
+ @Override
public AdaptableList getFiles() {
if(!populated) {
populateElementChildren();
@@ -88,6 +89,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
return super.getFiles();
}
+ @Override
public AdaptableList getFolders() {
if(!populated) {
populateElementChildren();
@@ -102,12 +104,9 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
*/
private void populateElementChildren() {
FileSystemStructureProvider provider = FileSystemStructureProvider.INSTANCE;
- List allchildren = provider.getChildren(this.getFileSystemObject());
- File child = null;
+ List<File> allchildren = provider.getChildren(this.getFileSystemObject());
DebugFileSystemElement newelement = null;
- Iterator iter = allchildren.iterator();
- while(iter.hasNext()) {
- child = (File) iter.next();
+ for (File child : allchildren) {
if(child.isFile()) {
Path childpath = new Path(child.getAbsolutePath());
String extension = childpath.getFileExtension();
@@ -143,6 +142,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
createRootDirectoryGroup(comp);
@@ -168,12 +168,12 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
settings.put(OVERWRITE, fOverwrite.getSelection());
settings.put(OLD_PATH, fFromDirectory.getText().trim());
boolean overwrite = fOverwrite.getSelection();
- List items = getSelectedResources();
+ List<?> items = getSelectedResources();
File config, newconfig = null;
boolean owall = false, nowall = false;
MessageDialog dialog = null;
- final List filesToImport = new ArrayList();
- for(Iterator iter = items.iterator(); iter.hasNext();) {
+ final List<File> filesToImport = new ArrayList<File>();
+ for (Iterator<?> iter = items.iterator(); iter.hasNext();) {
config = (File) ((DebugFileSystemElement) iter.next()).getFileSystemObject();
newconfig = new File(new Path(LaunchManager.LOCAL_LAUNCH_CONFIGURATION_CONTAINER_PATH.toOSString()).append(config.getName()).toOSString());
if(newconfig.exists() & !overwrite) {
@@ -184,7 +184,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
dialog = new MessageDialog(DebugUIPlugin.getShell(),
WizardMessages.ExportLaunchConfigurationsWizardPage_11,
null,
- MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new String[] {config.getName()}),
+ MessageFormat.format(WizardMessages.ExportLaunchConfigurationsWizardPage_12, new Object[] { config.getName() }),
MessageDialog.QUESTION, new String[] {WizardMessages.ExportLaunchConfigurationsWizardPage_13, WizardMessages.ExportLaunchConfigurationsWizardPage_14, WizardMessages.ExportLaunchConfigurationsWizardPage_15, WizardMessages.ExportLaunchConfigurationsWizardPage_16, WizardMessages.ExportLaunchConfigurationsWizardPage_17}, 0);
int ret = dialog.open();
switch(ret) {
@@ -204,6 +204,8 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
case 4: {
return true;
}
+ default:
+ break;
}
} else if(!nowall) {
filesToImport.add(config);
@@ -215,10 +217,11 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
if (!filesToImport.isEmpty()) {
Job job = new Job(WizardMessages.ExportLaunchConfigurationsWizard_0) {
+ @Override
public IStatus run(IProgressMonitor monitor) {
LaunchManager launchManager = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
try {
- launchManager.importConfigurations((File[]) filesToImport.toArray(new File[filesToImport.size()]), monitor);
+ launchManager.importConfigurations(filesToImport.toArray(new File[filesToImport.size()]), monitor);
} catch (CoreException e) {
return e.getStatus();
}
@@ -234,6 +237,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.WizardPage#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_WIZBAN_IMPORT_CONFIGS);
}
@@ -241,6 +245,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.WizardResourceImportPage#updateWidgetEnablements()
*/
+ @Override
protected void updateWidgetEnablements() {
setPageComplete(determinePageCompletion());
}
@@ -248,6 +253,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.WizardResourceImportPage#determinePageCompletion()
*/
+ @Override
protected boolean determinePageCompletion() {
if(fFromDirectory.getText().trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
setErrorMessage(WizardMessages.ImportLaunchConfigurationsWizardPage_3);
@@ -265,6 +271,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.WizardResourceImportPage#createSourceGroup(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createSourceGroup(Composite parent) {}
/**
@@ -278,6 +285,7 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
// source browse button
Button browse = SWTFactory.createPushButton(comp, WizardMessages.ImportLaunchConfigurationsWizardPage_7, null);
browse.addSelectionListener(new SelectionAdapter () {
+ @Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dd = new DirectoryDialog(getContainer().getShell());
dd.setText(WizardMessages.ImportLaunchConfigurationsWizardPage_0);
@@ -300,6 +308,8 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
*/
protected void resetSelection(final IPath path) {
BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
+ @SuppressWarnings("restriction")
+ @Override
public void run() {
File file = new File(path.toOSString());
DebugFileSystemElement dummyparent = new DebugFileSystemElement(IInternalDebugCoreConstants.EMPTY_STRING, null, true);
@@ -317,9 +327,11 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFileProvider()
*/
+ @Override
protected ITreeContentProvider getFileProvider() {
return new WorkbenchContentProvider() {
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
if (o instanceof DebugFileSystemElement) {
DebugFileSystemElement element = (DebugFileSystemElement) o;
return element.getFiles().getChildren(element);
@@ -332,9 +344,11 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.WizardResourceImportPage#getFolderProvider()
*/
+ @Override
protected ITreeContentProvider getFolderProvider() {
return new WorkbenchContentProvider() {
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
if (o instanceof DebugFileSystemElement) {
DebugFileSystemElement element = (DebugFileSystemElement) o;
return element.getFolders().getChildren();
@@ -342,7 +356,8 @@ public class ImportLaunchConfigurationsWizardPage extends WizardResourceImportPa
return new Object[0];
}
- public boolean hasChildren(Object o) {
+ @Override
+ public boolean hasChildren(Object o) {
if (o instanceof DebugFileSystemElement) {
DebugFileSystemElement element = (DebugFileSystemElement) o;
if (element.isPopulated()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
index 61dee1659..771ca395f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractLaunchConfigurationAction.java
@@ -91,6 +91,7 @@ public abstract class AbstractLaunchConfigurationAction extends SelectionListene
/**
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public final void run() {
if (fConfirmationRequestor != null) {
if (!fConfirmationRequestor.getConfirmation()) {
@@ -101,6 +102,7 @@ public abstract class AbstractLaunchConfigurationAction extends SelectionListene
/**
* @see java.lang.Runnable#run()
*/
+ @Override
public void run() {
performAction();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
index d36c2e406..2a4d66c74 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
@@ -39,6 +39,7 @@ public class ClosedProjectFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parent, Object element) {
//always let through types, we only care about configs
if(element instanceof ILaunchConfigurationType) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java
index a8ab1d7d7..ad47df486 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CollapseAllLaunchConfigurationAction.java
@@ -44,6 +44,7 @@ public class CollapseAllLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_COLLAPSE_ALL);
}
@@ -51,6 +52,7 @@ public class CollapseAllLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getText()
*/
+ @Override
public String getText() {
return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_0;
}
@@ -58,6 +60,7 @@ public class CollapseAllLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_1;
}
@@ -65,6 +68,7 @@ public class CollapseAllLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
*/
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_COLLAPSE_ALL);
}
@@ -72,6 +76,7 @@ public class CollapseAllLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
fViewer.collapseAll();
}
@@ -79,6 +84,7 @@ public class CollapseAllLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDescription()
*/
+ @Override
public String getDescription() {
return LaunchConfigurationsMessages.CollapseAllLaunchConfigurationAction_2;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java
index 3c1d9a950..f8124b2f3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorProjectPromptStatusHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,13 +36,13 @@ public class CompileErrorProjectPromptStatusHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
ILaunchConfiguration config = null;
- List projects = new ArrayList();
-
+ List<Object> projects = new ArrayList<Object>();
if (source instanceof List) {
- List args = (List) source;
- Iterator iterator = args.iterator();
+ List<?> args = (List<?>) source;
+ Iterator<?> iterator = args.iterator();
while (iterator.hasNext()) {
Object arg = iterator.next();
if (arg instanceof ILaunchConfiguration) {
@@ -72,7 +72,7 @@ public class CompileErrorProjectPromptStatusHandler implements IStatusHandler {
projectMessage = projectList.toString();
}
String title = LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_0;
- String message = MessageFormat.format(LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_2, new String[]{projectMessage});
+ String message = MessageFormat.format(LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_2, new Object[] { projectMessage });
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
String pref = store.getString(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java
index ac0805393..5d411606e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CompileErrorPromptStatusHandler.java
@@ -29,6 +29,7 @@ public class CompileErrorPromptStatusHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
if (source instanceof ILaunchConfiguration) {
ILaunchConfiguration config = (ILaunchConfiguration)source;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
index f274f056d..d49e50f23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/CreateLaunchConfigurationAction.java
@@ -48,6 +48,7 @@ public class CreateLaunchConfigurationAction extends AbstractLaunchConfiguration
/**
* @see AbstractLaunchConfigurationAction#performAction()
*/
+ @Override
protected void performAction() {
Object object = getStructuredSelection().getFirstElement();
//double click with Ctrl key mask results in empty selection: bug 156087
@@ -89,6 +90,7 @@ public class CreateLaunchConfigurationAction extends AbstractLaunchConfiguration
/**
* @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
return selection.size() == 1;
}
@@ -96,6 +98,7 @@ public class CreateLaunchConfigurationAction extends AbstractLaunchConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
*/
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_NEW_CONFIG);
}
@@ -103,6 +106,7 @@ public class CreateLaunchConfigurationAction extends AbstractLaunchConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_NEW_CONFIG);
}
@@ -110,6 +114,7 @@ public class CreateLaunchConfigurationAction extends AbstractLaunchConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return LaunchConfigurationsMessages.LaunchConfigurationsDialog_0;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java
index b56132adc..c14731486 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DebugModePromptStatusHandler.java
@@ -29,6 +29,7 @@ public class DebugModePromptStatusHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
if (source instanceof ILaunchConfiguration) {
ILaunchConfiguration config = (ILaunchConfiguration)source;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java
index 7738c162c..a9cc4fefd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeleteLaunchConfigurationAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -55,6 +55,7 @@ public class DeleteLaunchConfigurationAction extends AbstractLaunchConfiguration
/**
* @see AbstractLaunchConfigurationAction#performAction()
*/
+ @Override
protected void performAction() {
if(!shouldDelete()) {
return;
@@ -62,7 +63,7 @@ public class DeleteLaunchConfigurationAction extends AbstractLaunchConfiguration
IStructuredSelection selection = getStructuredSelection();
getViewer().getControl().setRedraw(false);
- Iterator iterator = selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
ILaunchConfiguration configuration = (ILaunchConfiguration)iterator.next();
try {
@@ -77,11 +78,12 @@ public class DeleteLaunchConfigurationAction extends AbstractLaunchConfiguration
/**
* @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if (selection.isEmpty()) {
return false;
}
- Iterator items = selection.iterator();
+ Iterator<?> items = selection.iterator();
while (items.hasNext()) {
if (!(items.next() instanceof ILaunchConfiguration)) {
return false;
@@ -93,6 +95,7 @@ public class DeleteLaunchConfigurationAction extends AbstractLaunchConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
*/
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DELETE_CONFIG);
}
@@ -100,6 +103,7 @@ public class DeleteLaunchConfigurationAction extends AbstractLaunchConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DELETE_CONFIG);
}
@@ -107,6 +111,7 @@ public class DeleteLaunchConfigurationAction extends AbstractLaunchConfiguration
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return LaunchConfigurationsMessages.LaunchConfigurationsDialog_1;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
index fb68746ca..c7496285d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
@@ -38,6 +38,7 @@ public class DeletedProjectFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
//always let through types, we only care about configs
if (element instanceof ILaunchConfigurationType) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java
index fd9a3fbd2..00947544c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchConfigurationAction.java
@@ -42,6 +42,7 @@ public class DuplicateLaunchConfigurationAction extends AbstractLaunchConfigurat
/**
* @see AbstractLaunchConfigurationAction#performAction()
*/
+ @Override
protected void performAction() {
ILaunchConfiguration original = (ILaunchConfiguration)getStructuredSelection().getFirstElement();
String newName = DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(original.getName());
@@ -56,6 +57,7 @@ public class DuplicateLaunchConfigurationAction extends AbstractLaunchConfigurat
/**
* @see org.eclipse.ui.actions.SelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
return selection.size() == 1 && selection.getFirstElement() instanceof ILaunchConfiguration;
}
@@ -63,6 +65,7 @@ public class DuplicateLaunchConfigurationAction extends AbstractLaunchConfigurat
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
*/
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DUPLICATE_CONFIG);
}
@@ -70,6 +73,7 @@ public class DuplicateLaunchConfigurationAction extends AbstractLaunchConfigurat
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DUPLICATE_CONFIG);
}
@@ -77,6 +81,7 @@ public class DuplicateLaunchConfigurationAction extends AbstractLaunchConfigurat
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return LaunchConfigurationsMessages.LaunchConfigurationsDialog_5;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java
index a599a91ce..d2c5ec444 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DuplicateLaunchDelegatesStatusHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ public class DuplicateLaunchDelegatesStatusHandler implements IStatusHandler {
/**
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
if(source instanceof Object[]) {
Object[] infos = (Object[]) source;
@@ -43,7 +44,7 @@ public class DuplicateLaunchDelegatesStatusHandler implements IStatusHandler {
ILaunchConfiguration config = (ILaunchConfiguration) infos[0];
String mode = (String) infos[1];
Shell shell = DebugUIPlugin.getShell();
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
modes.addAll(config.getModes());
SelectLaunchersDialog sldd = new SelectLaunchersDialog(shell,
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java
index c93c3aede..4421aa195 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/EnvironmentVariable.java
@@ -61,6 +61,7 @@ public class EnvironmentVariable
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getName();
}
@@ -69,6 +70,7 @@ public class EnvironmentVariable
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
boolean equal = false;
if (obj instanceof EnvironmentVariable) {
@@ -80,6 +82,7 @@ public class EnvironmentVariable
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return name.hashCode();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
index 7bedac0cd..86780ffa3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FavoritesDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -65,7 +65,7 @@ public class FavoritesDialog extends TrayDialog {
private LaunchHistory fHistory;
// favorites collection under edit
- private List fFavorites;
+ private List<ILaunchConfiguration> fFavorites;
// buttons
protected Button fAddFavoriteButton;
@@ -78,6 +78,7 @@ public class FavoritesDialog extends TrayDialog {
* Listener that delegates when a button is pressed
*/
private SelectionAdapter fButtonListener= new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
Button button = (Button) e.widget;
if (button == fAddFavoriteButton) {
@@ -96,6 +97,7 @@ public class FavoritesDialog extends TrayDialog {
* Listener that delegates when the selection changes in a table
*/
private ISelectionChangedListener fSelectionChangedListener= new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
handleFavoriteSelectionChanged();
}
@@ -105,6 +107,7 @@ public class FavoritesDialog extends TrayDialog {
* Listener that delegates when a key is pressed in a table
*/
private KeyListener fKeyListener= new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
removeSelectedFavorites();
@@ -116,11 +119,14 @@ public class FavoritesDialog extends TrayDialog {
* Content provider for favorites table
*/
protected class FavoritesContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
- ILaunchConfiguration[] favorites= (ILaunchConfiguration[]) getFavorites().toArray(new ILaunchConfiguration[0]);
+ ILaunchConfiguration[] favorites= getFavorites().toArray(new ILaunchConfiguration[0]);
return LaunchConfigurationManager.filterConfigs(favorites);
}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
@@ -145,7 +151,7 @@ public class FavoritesDialog extends TrayDialog {
Object[] selection = sfd.getResult();
if (selection != null) {
for (int i = 0; i < selection.length; i++) {
- getFavorites().add(selection[i]);
+ getFavorites().add((ILaunchConfiguration) selection[i]);
}
updateStatus();
}
@@ -156,7 +162,7 @@ public class FavoritesDialog extends TrayDialog {
*/
protected void removeSelectedFavorites() {
IStructuredSelection sel = (IStructuredSelection)getFavoritesTable().getSelection();
- Iterator iter = sel.iterator();
+ Iterator<?> iter = sel.iterator();
while (iter.hasNext()) {
Object config = iter.next();
getFavorites().remove(config);
@@ -174,6 +180,7 @@ public class FavoritesDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
*/
+ @Override
protected Point getInitialSize() {
return new Point(350, 400);
}
@@ -191,10 +198,10 @@ public class FavoritesDialog extends TrayDialog {
*/
protected void handleMove(int direction) {
IStructuredSelection sel = (IStructuredSelection)getFavoritesTable().getSelection();
- List selList= sel.toList();
+ List<?> selList = sel.toList();
Object[] movedFavs= new Object[getFavorites().size()];
int i;
- for (Iterator favs = selList.iterator(); favs.hasNext();) {
+ for (Iterator<?> favs = selList.iterator(); favs.hasNext();) {
Object config = favs.next();
i= getFavorites().indexOf(config);
movedFavs[i + direction]= config;
@@ -205,7 +212,7 @@ public class FavoritesDialog extends TrayDialog {
for (int j = 0; j < movedFavs.length; j++) {
Object config = movedFavs[j];
if (config != null) {
- getFavorites().add(j, config);
+ getFavorites().add(j, (ILaunchConfiguration) config);
}
}
getFavoritesTable().refresh();
@@ -225,9 +232,10 @@ public class FavoritesDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
- getShell().setText(MessageFormat.format(LaunchConfigurationsMessages.FavoritesDialog_1, new String[]{getModeLabel()}));
+ getShell().setText(MessageFormat.format(LaunchConfigurationsMessages.FavoritesDialog_1, new Object[] { getModeLabel() }));
createFavoritesArea(composite);
handleFavoriteSelectionChanged();
return composite;
@@ -236,6 +244,7 @@ public class FavoritesDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Control contents = super.createContents(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getDialogArea(), IDebugHelpContextIds.ORGANIZE_FAVORITES_DIALOG);
@@ -292,10 +301,10 @@ public class FavoritesDialog extends TrayDialog {
/**
* Returns the current list of favorites.
*/
- protected List getFavorites() {
+ protected List<ILaunchConfiguration> getFavorites() {
if (fFavorites == null) {
ILaunchConfiguration[] favs = getInitialFavorites();
- fFavorites = new ArrayList(favs.length);
+ fFavorites = new ArrayList<ILaunchConfiguration>(favs.length);
addAll(favs, fFavorites);
}
return fFavorites;
@@ -322,7 +331,7 @@ public class FavoritesDialog extends TrayDialog {
/**
* Copies the array into the list
*/
- protected void addAll(Object[] array, List list) {
+ protected void addAll(ILaunchConfiguration[] array, List<ILaunchConfiguration> list) {
for (int i = 0; i < array.length; i++) {
list.add(array[i]);
}
@@ -341,9 +350,9 @@ public class FavoritesDialog extends TrayDialog {
*/
protected void handleFavoriteSelectionChanged() {
IStructuredSelection selection = (IStructuredSelection)getFavoritesTable().getSelection();
- List favs = getFavorites();
+ List<ILaunchConfiguration> favs = getFavorites();
boolean notEmpty = !selection.isEmpty();
- Iterator elements= selection.iterator();
+ Iterator<?> elements = selection.iterator();
boolean first= false;
boolean last= false;
int lastFav= favs.size() - 1;
@@ -369,9 +378,11 @@ public class FavoritesDialog extends TrayDialog {
public void saveFavorites() {
final Job job = new Job(LaunchConfigurationsMessages.FavoritesDialog_8) {
+ @SuppressWarnings("deprecation")
+ @Override
protected IStatus run(IProgressMonitor monitor) {
ILaunchConfiguration[] initial = getInitialFavorites();
- List current = getFavorites();
+ List<ILaunchConfiguration> current = getFavorites();
String groupId = getLaunchHistory().getLaunchGroup().getIdentifier();
int taskSize = Math.abs(initial.length-current.size());//get task size
@@ -386,7 +397,7 @@ public class FavoritesDialog extends TrayDialog {
ILaunchConfigurationWorkingCopy workingCopy = configuration.getWorkingCopy();
workingCopy.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
workingCopy.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- List groups = workingCopy.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
+ List<String> groups = workingCopy.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (groups != null) {
groups.remove(groupId);
if (groups.isEmpty()) {
@@ -404,13 +415,13 @@ public class FavoritesDialog extends TrayDialog {
}
// update added favorites
- Iterator favs = current.iterator();
+ Iterator<ILaunchConfiguration> favs = current.iterator();
while (favs.hasNext()) {
- ILaunchConfiguration configuration = (ILaunchConfiguration)favs.next();
+ ILaunchConfiguration configuration = favs.next();
try {
- List groups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
+ List<String> groups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (groups == null) {
- groups = new ArrayList();
+ groups = new ArrayList<String>();
}
if (!groups.contains(groupId)) {
groups.add(groupId);
@@ -436,13 +447,14 @@ public class FavoritesDialog extends TrayDialog {
}
- protected ILaunchConfiguration[] getArray(List list) {
- return (ILaunchConfiguration[])list.toArray(new ILaunchConfiguration[list.size()]);
+ protected ILaunchConfiguration[] getArray(List<ILaunchConfiguration> list) {
+ return list.toArray(new ILaunchConfiguration[list.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
saveFavorites();
super.okPressed();
@@ -451,7 +463,8 @@ public class FavoritesDialog extends TrayDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java
index 507392032..bfaafe5ff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterDropDownMenuCreator.java
@@ -80,6 +80,7 @@ public class FilterDropDownMenuCreator implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
if(fStore != null) {
fStore.setValue(fKey, isChecked());
@@ -103,6 +104,7 @@ public class FilterDropDownMenuCreator implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
fCreatedMenu = null;
}
@@ -110,6 +112,7 @@ public class FilterDropDownMenuCreator implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
*/
+ @Override
public Menu getMenu(Control parent) {
if(fCreatedMenu != null) {
fCreatedMenu.dispose();
@@ -126,6 +129,7 @@ public class FilterDropDownMenuCreator implements IMenuCreator {
//add pref action
IAction action = new Action(LaunchConfigurationsMessages.FilterDropDownMenuCreator_3) {
+ @Override
public void run() {
SWTFactory.showPreferencePage("org.eclipse.debug.ui.LaunchConfigurations"); //$NON-NLS-1$
}
@@ -137,6 +141,7 @@ public class FilterDropDownMenuCreator implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
return fCreatedMenu;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
index e6fd293d3..2dfc44491 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/FilterLaunchConfigurationAction.java
@@ -50,6 +50,7 @@ public class FilterLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
SWTFactory.showPreferencePage("org.eclipse.debug.ui.LaunchConfigurations"); //$NON-NLS-1$
}
@@ -57,6 +58,7 @@ public class FilterLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDescription()
*/
+ @Override
public String getDescription() {
return LaunchConfigurationsMessages.LaunchConfigurationsDialog_4;
}
@@ -64,6 +66,7 @@ public class FilterLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
*/
+ @Override
public ImageDescriptor getDisabledImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS);
}
@@ -71,6 +74,7 @@ public class FilterLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_FILTER_CONFIGS);
}
@@ -78,6 +82,7 @@ public class FilterLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getMenuCreator()
*/
+ @Override
public IMenuCreator getMenuCreator() {
return fMenuCreator;
}
@@ -85,6 +90,7 @@ public class FilterLaunchConfigurationAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
+ @Override
public String getToolTipText() {
return LaunchConfigurationsMessages.LaunchConfigurationsDialog_4;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
index ae6e65f4b..3abc9efd7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchCategoryFilter.java
@@ -40,6 +40,7 @@ public class LaunchCategoryFilter extends ViewerFilter {
/**
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
ILaunchConfigurationType type = null;
ILaunchConfiguration config = null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
index 0c91d5932..0a683b12e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationComparator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,24 +28,24 @@ import org.eclipse.ui.model.WorkbenchViewerComparator;
* Groups configurations by type.
*
* @since 3.3
- * CONTEXTLAUNCHING
*/
public class LaunchConfigurationComparator extends WorkbenchViewerComparator {
/**
* the map of categories of <code>ILaunchConfigurationType</code>s to <code>Integer</code>s entries
*/
- private static Map fgCategories;
+ private static Map<ILaunchConfigurationType, Integer> fgCategories;
/**
* @see org.eclipse.jface.viewers.ViewerComparator#category(java.lang.Object)
*/
+ @Override
public int category(Object element) {
- Map map = getCategories();
+ Map<ILaunchConfigurationType, Integer> map = getCategories();
if (element instanceof ILaunchConfiguration) {
ILaunchConfiguration configuration = (ILaunchConfiguration) element;
try {
- Integer i = (Integer) map.get(configuration.getType());
+ Integer i = map.get(configuration.getType());
if (i != null) {
return i.intValue();
}
@@ -59,19 +59,20 @@ public class LaunchConfigurationComparator extends WorkbenchViewerComparator {
* Returns the map of categories
* @return the map of categories
*/
- private Map getCategories() {
+ private Map<ILaunchConfigurationType, Integer> getCategories() {
if (fgCategories == null) {
- fgCategories = new HashMap();
- List types = Arrays.asList(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
- Collections.sort(types, new Comparator() {
- public int compare(Object o1, Object o2) {
- ILaunchConfigurationType t1 = (ILaunchConfigurationType) o1;
- ILaunchConfigurationType t2 = (ILaunchConfigurationType) o2;
+ fgCategories = new HashMap<ILaunchConfigurationType, Integer>();
+ List<ILaunchConfigurationType> types = Arrays.asList(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes());
+ Collections.sort(types, new Comparator<ILaunchConfigurationType>() {
+ @Override
+ public int compare(ILaunchConfigurationType o1, ILaunchConfigurationType o2) {
+ ILaunchConfigurationType t1 = o1;
+ ILaunchConfigurationType t2 = o2;
return t1.getName().compareTo(t2.getName());
}
});
- Iterator iterator = types.iterator();
+ Iterator<ILaunchConfigurationType> iterator = types.iterator();
int i = 0;
while (iterator.hasNext()) {
fgCategories.put(iterator.next(), new Integer(i));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
index f544212ea..170414a1c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationDialog.java
@@ -36,6 +36,7 @@ public class LaunchConfigurationDialog extends LaunchConfigurationPropertiesDial
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
createButton(parent, ID_CLOSE_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationDialog_Close_1, false);
@@ -44,6 +45,7 @@ public class LaunchConfigurationDialog extends LaunchConfigurationPropertiesDial
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getTitleAreaTitle()
*/
+ @Override
protected String getTitleAreaTitle() {
return LaunchConfigurationsMessages.LaunchConfigurationDialog_Modify_attributes_and_launch__1;
}
@@ -51,6 +53,7 @@ public class LaunchConfigurationDialog extends LaunchConfigurationPropertiesDial
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SINGLE_LAUNCH_CONFIGURATION_DIALOG;
}
@@ -58,6 +61,7 @@ public class LaunchConfigurationDialog extends LaunchConfigurationPropertiesDial
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#updateButtons()
*/
+ @Override
public void updateButtons() {
// Launch button
getTabViewer().refresh();
@@ -68,6 +72,7 @@ public class LaunchConfigurationDialog extends LaunchConfigurationPropertiesDial
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getDialogSettingsSectionName()
*/
+ @Override
protected String getDialogSettingsSectionName() {
return IDebugUIConstants.PLUGIN_ID + ".SINGLE_LAUNCH_CONFIGURATION_DIALOG_SECTION"; //$NON-NLS-1$
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
index 2882cf0cd..bda318063 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationEditDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getTitleAreaTitle()
*/
+ @Override
protected String getTitleAreaTitle() {
return LaunchConfigurationsMessages.LaunchConfigurationEditDialog_0;
}
@@ -48,6 +49,7 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, ID_LAUNCH_BUTTON, LaunchConfigurationsMessages.LaunchConfigurationEditDialog_1, true);
if(fShowCancel) {
@@ -58,6 +60,7 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#updateButtons()
*/
+ @Override
public void updateButtons() {
getTabViewer().refresh();
getButton(ID_LAUNCH_BUTTON).setEnabled(getTabViewer().canLaunch() & getTabViewer().canLaunchWithModes() & !getTabViewer().hasDuplicateDelegates());
@@ -66,6 +69,7 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog#getDialogSettingsSectionName()
*/
+ @Override
protected String getDialogSettingsSectionName() {
return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATION_EDIT_DIALOG_SECTION"; //$NON-NLS-1$
}
@@ -73,6 +77,7 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(int buttonId) {
switch (buttonId) {
case ID_LAUNCH_BUTTON: {
@@ -90,6 +95,8 @@ public class LaunchConfigurationEditDialog extends LaunchConfigurationDialog {
cancelPressed();
break;
}
+ default:
+ break;
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
index 9d11cc45d..c6cfc5d14 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationFilteredTree.java
@@ -70,6 +70,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
/**
* @see org.eclipse.ui.dialogs.FilteredTree#doCreateTreeViewer(org.eclipse.swt.widgets.Composite, int)
*/
+ @Override
protected TreeViewer doCreateTreeViewer(Composite cparent, int style) {
treeViewer = new LaunchConfigurationViewer(cparent, style);
treeViewer.setLabelProvider(new DecoratingLabelProvider(DebugUITools.newDebugModelPresentation(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
@@ -83,6 +84,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
}
}
treeViewer.getControl().addHelpListener(new HelpListener() {
+ @Override
public void helpRequested(HelpEvent evt) {
handleHelpRequest(evt);
}
@@ -93,6 +95,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
/**
* @see org.eclipse.ui.dialogs.FilteredTree#createControl(org.eclipse.swt.widgets.Composite, int)
*/
+ @Override
protected void createControl(Composite cparent, int treeStyle) {
super.createControl(cparent, treeStyle);
setBackground(cparent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
@@ -102,6 +105,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
* @see org.eclipse.ui.dialogs.FilteredTree#init(int, org.eclipse.ui.dialogs.PatternFilter)
* force it to do nothing so that we can initialize the class properly
*/
+ @Override
protected void init(int treeStyle, PatternFilter filter) {}
/**
@@ -131,6 +135,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.FilteredTree#textChanged()
*/
+ @Override
protected void textChanged() {
LaunchConfigurationsDialog dialog = (LaunchConfigurationsDialog)LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
if(dialog == null) {
@@ -221,6 +226,7 @@ public final class LaunchConfigurationFilteredTree extends FilteredTree {
*
* @see org.eclipse.ui.dialogs.FilteredTree#updateToolbar(boolean)
*/
+ @Override
protected void updateToolbar(boolean visible) {
super.updateToolbar(visible);
// update filter count
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
index 5827ad5a9..d759e4421 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -99,15 +98,16 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* A comparator for the ordering of launch shortcut extensions
* @since 3.3
*/
- class ShortcutComparator implements Comparator {
+ class ShortcutComparator implements Comparator<LaunchShortcutExtension> {
/**
* @see Comparator#compare(Object, Object)
*/
- public int compare(Object a, Object b) {
- LaunchShortcutExtension shorcutA = (LaunchShortcutExtension)a;
+ @Override
+ public int compare(LaunchShortcutExtension a, LaunchShortcutExtension b) {
+ LaunchShortcutExtension shorcutA = a;
String labelA = shorcutA.getLabel();
String pathA = shorcutA.getMenuPath();
- LaunchShortcutExtension shortcutB = (LaunchShortcutExtension)b;
+ LaunchShortcutExtension shortcutB = b;
String labelB = shortcutB.getLabel();
String pathB = shortcutB.getMenuPath();
@@ -148,27 +148,27 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
/**
* Launch group extensions, keyed by launch group identifier.
*/
- protected Map fLaunchGroups;
+ protected Map<String, LaunchGroupExtension> fLaunchGroups;
/**
* Launch histories keyed by launch group identifier
*/
- protected Map fLaunchHistories;
+ protected Map<String, LaunchHistory> fLaunchHistories;
/**
* The list of registered implementors of <code>ILaunchHistoryChangedListener</code>
*/
- protected List fLaunchHistoryChangedListeners = new ArrayList(3);
+ protected List<ILaunchHistoryChangedListener> fLaunchHistoryChangedListeners = new ArrayList<ILaunchHistoryChangedListener>(3);
/**
* Launch shortcuts
*/
- private List fLaunchShortcuts = null;
+ private List<LaunchShortcutExtension> fLaunchShortcuts = null;
/**
* Launch shortcuts, cached by perspective ids
*/
- private Map fLaunchShortcutsByPerspective = null;
+ private Map<String, List<LaunchShortcutExtension>> fLaunchShortcutsByPerspective = null;
/**
* Cache of launch configuration tab images with error overlays
@@ -238,7 +238,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
if (activitySupport == null) {
return configurations;
}
- List filteredConfigs = new ArrayList();
+ List<ILaunchConfiguration> filteredConfigs = new ArrayList<ILaunchConfiguration>();
ILaunchConfigurationType type = null;
LaunchConfigurationTypeContribution contribution = null;
ILaunchConfiguration configuration = null;
@@ -253,7 +253,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
}
catch (CoreException e) {DebugUIPlugin.log(e.getStatus());}
}
- return (ILaunchConfiguration[]) filteredConfigs.toArray(new ILaunchConfiguration[filteredConfigs.size()]);
+ return filteredConfigs.toArray(new ILaunchConfiguration[filteredConfigs.size()]);
}
/**
@@ -264,20 +264,20 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @throws CoreException if an exception occurs
* @since 3.3
*/
- public static ILaunchDelegate[] filterLaunchDelegates(ILaunchConfigurationType type, Set modes) throws CoreException {
+ public static ILaunchDelegate[] filterLaunchDelegates(ILaunchConfigurationType type, Set<String> modes) throws CoreException {
IWorkbenchActivitySupport as = PlatformUI.getWorkbench().getActivitySupport();
ILaunchDelegate[] delegates = type.getDelegates(modes);
if(as == null) {
return delegates;
}
- HashSet set = new HashSet();
+ HashSet<ILaunchDelegate> set = new HashSet<ILaunchDelegate>();
for(int i = 0; i < delegates.length; i++) {
//filter by capabilities
if(!WorkbenchActivityHelper.filterItem(new LaunchDelegateContribution(delegates[i]))) {
set.add(delegates[i]);
}
}
- return (ILaunchDelegate[]) set.toArray(new ILaunchDelegate[set.size()]);
+ return set.toArray(new ILaunchDelegate[set.size()]);
}
/**
@@ -287,9 +287,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
launchManager.removeLaunchListener(this);
if (fLaunchHistories != null) {
- Iterator histories = fLaunchHistories.values().iterator();
- while (histories.hasNext()) {
- LaunchHistory history = (LaunchHistory)histories.next();
+ for (LaunchHistory history : fLaunchHistories.values()) {
history.dispose();
}
}
@@ -299,11 +297,13 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
/**
* @see ILaunchListener#launchRemoved(ILaunch)
*/
+ @Override
public void launchRemoved(ILaunch launch) {}
/**
* @see ILaunchListener#launchChanged(ILaunch)
*/
+ @Override
public void launchChanged(ILaunch launch) {}
/**
@@ -311,6 +311,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
*
* @see ILaunchListener#launchAdded(ILaunch)
*/
+ @Override
public void launchAdded(final ILaunch launch) {
removeTerminatedLaunches(launch);
}
@@ -391,10 +392,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* Notify all launch history listeners that the launch history has changed in some way.
*/
protected void fireLaunchHistoryChanged() {
- Iterator iterator = fLaunchHistoryChangedListeners.iterator();
- ILaunchHistoryChangedListener listener = null;
- while (iterator.hasNext()) {
- listener = (ILaunchHistoryChangedListener) iterator.next();
+ for (ILaunchHistoryChangedListener listener : fLaunchHistoryChangedListeners) {
listener.launchHistoryChanged();
}
}
@@ -409,11 +407,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
Document doc = DebugUIPlugin.getDocument();
Element historyRootElement = doc.createElement(IConfigurationElementConstants.LAUNCH_HISTORY);
doc.appendChild(historyRootElement);
-
- Iterator histories = fLaunchHistories.values().iterator();
- LaunchHistory history = null;
- while (histories.hasNext()) {
- history = (LaunchHistory)histories.next();
+ for (LaunchHistory history : fLaunchHistories.values()) {
Element groupElement = doc.createElement(IConfigurationElementConstants.LAUNCH_GROUP);
groupElement.setAttribute(IConfigurationElementConstants.ID, history.getLaunchGroup().getIdentifier());
historyRootElement.appendChild(groupElement);
@@ -468,8 +462,8 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
}
}
boolean shouldsave = false;
- for(Iterator iter = fLaunchHistories.values().iterator(); iter.hasNext();) {
- shouldsave |= ((LaunchHistory)iter.next()).needsSaving();
+ for (LaunchHistory history : fLaunchHistories.values()) {
+ shouldsave |= history.needsSaving();
}
if(shouldsave) {
IPath historyPath = getHistoryFilePath();
@@ -525,8 +519,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
}
// For each child of the root node, construct a launch config handle and add it to
// the appropriate history, or set the most recent launch
- Collection l = fLaunchHistories.values();
- LaunchHistory[] histories = (LaunchHistory[])l.toArray(new LaunchHistory[l.size()]);
+ LaunchHistory[] histories = fLaunchHistories.values().toArray(new LaunchHistory[fLaunchHistories.size()]);
NodeList list = rootHistoryElement.getChildNodes();
int length = list.getLength();
Node node = null;
@@ -591,7 +584,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @return list of configurations under the element
*/
private ILaunchConfiguration[] getLaunchConfigurations(Element root) {
- List configs = new ArrayList();
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
NodeList nodes = root.getChildNodes();
int length = nodes.getLength();
for (int i = 0; i < length; i++) {
@@ -615,7 +608,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
}
}
}
- return (ILaunchConfiguration[]) configs.toArray(new ILaunchConfiguration[configs.size()]);
+ return configs.toArray(new ILaunchConfiguration[configs.size()]);
}
/**
@@ -656,7 +649,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
// Load the configuration elements into a Map
- fLaunchShortcuts = new ArrayList(infos.length);
+ fLaunchShortcuts = new ArrayList<LaunchShortcutExtension>(infos.length);
for (int i = 0; i < infos.length; i++) {
fLaunchShortcuts.add(new LaunchShortcutExtension(infos[i]));
}
@@ -674,7 +667,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
IConfigurationElement[] infos= extensionPoint.getConfigurationElements();
// Load the configuration elements into a Map
- fLaunchGroups = new HashMap(infos.length);
+ fLaunchGroups = new HashMap<String, LaunchGroupExtension>(infos.length);
LaunchGroupExtension ext = null;
for (int i = 0; i < infos.length; i++) {
ext = new LaunchGroupExtension(infos[i]);
@@ -688,7 +681,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
*
* @return all launch shortcuts
*/
- public List getLaunchShortcuts() {
+ public List<LaunchShortcutExtension> getLaunchShortcuts() {
if (fLaunchShortcuts == null) {
loadLaunchShortcuts();
}
@@ -701,18 +694,16 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @return a listing of applicable launch shortcuts or an empty list, never <code>null</code>
* @since 3.3
*/
- public List getLaunchShortcuts(IResource resource) {
- List list = new ArrayList();
- List sc = getLaunchShortcuts();
- List ctxt = new ArrayList();
+ public List<LaunchShortcutExtension> getLaunchShortcuts(IResource resource) {
+ List<LaunchShortcutExtension> list = new ArrayList<LaunchShortcutExtension>();
+ List<LaunchShortcutExtension> sc = getLaunchShortcuts();
+ List<IResource> ctxt = new ArrayList<IResource>();
if(resource != null) {
ctxt.add(resource);
}
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(ctxt);
context.addVariable("selection", ctxt); //$NON-NLS-1$
- LaunchShortcutExtension ext = null;
- for(Iterator iter = sc.iterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
+ for (LaunchShortcutExtension ext : sc) {
try {
if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression()) && !WorkbenchActivityHelper.filterItem(ext)) {
if(!list.contains(ext)) {
@@ -732,20 +723,18 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @param resource the resource context
* @return an array of applicable <code>ILaunchConfigurationType</code> ids, or an empty array, never <code>null</code>
* @since 3.3
- * CONTEXTLAUNCHING
*/
public String[] getApplicableConfigurationTypes(IResource resource) {
- List types = new ArrayList();
- List exts = getLaunchShortcuts();
- LaunchShortcutExtension ext = null;
- List list = new ArrayList();
+ List<String> types = new ArrayList<String>();
+ List<LaunchShortcutExtension> exts = getLaunchShortcuts();
+ List<IResource> list = new ArrayList<IResource>();
list.add(resource);
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(list);
context.setAllowPluginActivation(true);
context.addVariable("selection", list); //$NON-NLS-1$
- HashSet set = new HashSet();
- for(Iterator iter = exts.listIterator(); iter.hasNext();) {
- ext = (LaunchShortcutExtension) iter.next();
+ HashSet<String> set = new HashSet<String>();
+ for (Iterator<LaunchShortcutExtension> iter = exts.listIterator(); iter.hasNext();) {
+ LaunchShortcutExtension ext = iter.next();
try {
if(ext.evalEnablementExpression(context, ext.getContextualLaunchEnablementExpression())) {
set.addAll(ext.getAssociatedConfigurationTypes());
@@ -759,15 +748,15 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
}
LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType type = null;
- for(Iterator iter = set.iterator(); iter.hasNext();) {
- type = lm.getLaunchConfigurationType((String)iter.next());
+ for (String id : set) {
+ type = lm.getLaunchConfigurationType(id);
if(type != null) {
if(!types.contains(type) && type.isPublic() && !"org.eclipse.ui.externaltools.builder".equals(type.getCategory())) { //$NON-NLS-1$
types.add(type.getIdentifier());
}
}
}
- return (String[]) types.toArray(new String[types.size()]);
+ return types.toArray(new String[types.size()]);
}
/**
@@ -779,7 +768,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @since 3.3
*/
public ILaunchConfiguration[] getApplicableLaunchConfigurations(String[] types, IResource resource) {
- ArrayList list = new ArrayList();
+ ArrayList<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
try {
if(resource != null) {
String[] ctypes = types;
@@ -787,7 +776,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
ctypes = getApplicableConfigurationTypes(resource);
}
//copy into collection for hashcode matching
- HashSet typeset = new HashSet(ctypes.length);
+ HashSet<String> typeset = new HashSet<String>(ctypes.length);
for(int i = 0; i < ctypes.length; i++) {
typeset.add(ctypes[i]);
}
@@ -817,7 +806,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
list.clear();
DebugPlugin.log(e);
}
- return (ILaunchConfiguration[]) list.toArray(new ILaunchConfiguration[list.size()]);
+ return list.toArray(new ILaunchConfiguration[list.size()]);
}
/**
@@ -847,7 +836,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
*
* @return all launch shortcuts
*/
- public List getLaunchShortcuts(String category) {
+ public List<LaunchShortcutExtension> getLaunchShortcuts(String category) {
return filterShortcuts(getLaunchShortcuts(), category);
}
@@ -858,12 +847,9 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @param category the category to filter by
* @return List
*/
- protected List filterShortcuts(List unfiltered, String category) {
- List filtered = new ArrayList(unfiltered.size());
- Iterator iter = unfiltered.iterator();
- LaunchShortcutExtension extension = null;
- while (iter.hasNext()){
- extension = (LaunchShortcutExtension)iter.next();
+ protected List<LaunchShortcutExtension> filterShortcuts(List<LaunchShortcutExtension> unfiltered, String category) {
+ List<LaunchShortcutExtension> filtered = new ArrayList<LaunchShortcutExtension>(unfiltered.size());
+ for (LaunchShortcutExtension extension : unfiltered) {
if (category == null) {
if (extension.getCategory() == null) {
filtered.add(extension);
@@ -886,29 +872,24 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @deprecated the use of perspectives for launch shortcuts has been
* deprecated since 3.1, use a contextualLaunch element instead
*/
- public List getLaunchShortcuts(String perpsective, String category) {
+ @Deprecated
+ public List<LaunchShortcutExtension> getLaunchShortcuts(String perpsective, String category) {
if (fLaunchShortcutsByPerspective == null) {
- Iterator shortcuts = getLaunchShortcuts().iterator();
- fLaunchShortcutsByPerspective = new HashMap(10);
- LaunchShortcutExtension ext = null;
- Iterator perspectives = null;
- while (shortcuts.hasNext()) {
- ext = (LaunchShortcutExtension)shortcuts.next();
- perspectives = ext.getPerspectives().iterator();
- while (perspectives.hasNext()) {
- String id = (String)perspectives.next();
- List list = (List)fLaunchShortcutsByPerspective.get(id);
- if (list == null) {
- list = new ArrayList(4);
- fLaunchShortcutsByPerspective.put(id, list);
- }
- list.add(ext);
+ fLaunchShortcutsByPerspective = new HashMap<String, List<LaunchShortcutExtension>>(10);
+ }
+ for (LaunchShortcutExtension ext : getLaunchShortcuts()) {
+ for (String id : ext.getPerspectives()) {
+ List<LaunchShortcutExtension> list = fLaunchShortcutsByPerspective.get(id);
+ if (list == null) {
+ list = new ArrayList<LaunchShortcutExtension>(4);
+ fLaunchShortcutsByPerspective.put(id, list);
}
+ list.add(ext);
}
}
- List list = (List)fLaunchShortcutsByPerspective.get(perpsective);
+ List<LaunchShortcutExtension> list = fLaunchShortcutsByPerspective.get(perpsective);
if (list == null) {
- return new ArrayList();
+ return Collections.EMPTY_LIST;
}
return filterShortcuts(list, category);
}
@@ -922,9 +903,9 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
* @return the associated launch configuration from the MRU listing or <code>null</code> if there isn't one
* @since 3.3
*/
- public ILaunchConfiguration getMRUConfiguration(List configurations, ILaunchGroup group, IResource resource) {
+ public ILaunchConfiguration getMRUConfiguration(List<ILaunchConfiguration> configurations, ILaunchGroup group, IResource resource) {
if(group != null) {
- ArrayList candidates = new ArrayList();
+ ArrayList<ILaunchConfiguration> candidates = new ArrayList<ILaunchConfiguration>();
LaunchHistory history = getLaunchHistory(group.getIdentifier());
if(history != null) {
ILaunchConfiguration[] configs = history.getCompleteLaunchHistory();
@@ -938,12 +919,10 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
}
}
}
- ILaunchConfiguration config = null;
if(resource != null) {
//first try to find a config that exactly matches the resource mapping, and collect partial matches
IResource[] res = null;
- for(Iterator iter = candidates.iterator(); iter.hasNext();) {
- config = (ILaunchConfiguration) iter.next();
+ for (ILaunchConfiguration config : candidates) {
try {
res = config.getMappedResources();
if(res != null) {
@@ -1038,7 +1017,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
if (fLaunchGroups == null) {
loadLaunchGroups();
}
- return (LaunchGroupExtension)fLaunchGroups.get(id);
+ return fLaunchGroups.get(id);
}
/**
@@ -1050,8 +1029,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
if (fLaunchGroups == null) {
loadLaunchGroups();
}
- Collection groups = fLaunchGroups.values();
- return (ILaunchGroup[])groups.toArray(new ILaunchGroup[groups.size()]);
+ return fLaunchGroups.values().toArray(new ILaunchGroup[fLaunchGroups.size()]);
}
/**
@@ -1061,7 +1039,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
*/
public LaunchHistory getLaunchHistory(String id) {
loadLaunchHistories();
- return (LaunchHistory)fLaunchHistories.get(id);
+ return fLaunchHistories.get(id);
}
/**
@@ -1080,7 +1058,7 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
if (fLaunchHistories == null) {
fRestoring = true;
ILaunchGroup[] groups = getLaunchGroups();
- fLaunchHistories = new HashMap(groups.length);
+ fLaunchHistories = new HashMap<String, LaunchHistory>(groups.length);
ILaunchGroup extension = null;
for (int i = 0; i < groups.length; i++) {
extension = groups[i];
@@ -1146,16 +1124,12 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
*
* @since 3.4.0
*/
- public ILaunchGroup getLaunchGroup(ILaunchConfigurationType type, Set modeset) {
+ public ILaunchGroup getLaunchGroup(ILaunchConfigurationType type, Set<String> modeset) {
StringBuffer buff = new StringBuffer();
- Object item = null;
- for(Iterator iter = modeset.iterator(); iter.hasNext();) {
- item = iter.next();
- if(item instanceof String) {
- buff.append(item);
- if(iter.hasNext()) {
- buff.append(","); //$NON-NLS-1$
- }
+ for (Iterator<String> iter = modeset.iterator(); iter.hasNext();) {
+ buff.append(iter.next());
+ if (iter.hasNext()) {
+ buff.append(","); //$NON-NLS-1$
}
}
return getLaunchGroup(type, buff.toString());
@@ -1200,21 +1174,25 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
/**
* @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void doneSaving(ISaveContext context) {}
/**
* @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void prepareToSave(ISaveContext context) throws CoreException {}
/**
* @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void rollback(ISaveContext context) {}
/**
* @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void saving(ISaveContext context) throws CoreException {
try {
persistLaunchHistory();
@@ -1238,8 +1216,9 @@ public class LaunchConfigurationManager implements ILaunchListener, ISavePartici
for (int i = 0; i < size; i++) {
String id = groups[i].getIdentifier();
LaunchHistory history = getLaunchHistory(id);
- if (history != null)
+ if (history != null) {
history.launchAdded(launch);
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
index 3ca3eb706..8116486ec 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPresentationManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,6 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -64,7 +63,7 @@ public class LaunchConfigurationPresentationManager {
* to <code>LaunchConfigurationTabGroupExtension</code>. "*" is
* used to represent the default tab group (i.e. unspecified mode).
*/
- private Hashtable fTabGroupExtensions;
+ private Hashtable<String, Map<Set<String>, LaunchConfigurationTabGroupExtension>> fTabGroupExtensions;
/**
* contributed tabs are stored by the tab group id that they contribute to.
@@ -74,8 +73,14 @@ public class LaunchConfigurationPresentationManager {
*
* @since 3.3
*/
- private Hashtable fContributedTabs;
+ private Hashtable<String, Hashtable<String, LaunchConfigurationTabExtension>> fContributedTabs;
+ private static Set<String> ALL_MODES = new HashSet<String>(1);
+
+ static {
+ ALL_MODES.add("*"); //$NON-NLS-1$
+ }
+
/**
* Constructs the singleton launch configuration presentation
* manager.
@@ -100,30 +105,27 @@ public class LaunchConfigurationPresentationManager {
*/
private void initializeTabGroupExtensions() {
if(fTabGroupExtensions == null) {
- fTabGroupExtensions = new Hashtable();
+ fTabGroupExtensions = new Hashtable<String, Map<Set<String>, LaunchConfigurationTabGroupExtension>>();
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_CONFIGURATION_TAB_GROUPS);
IConfigurationElement[] groups = extensionPoint.getConfigurationElements();
LaunchConfigurationTabGroupExtension group = null;
String typeId = null;
- Map map = null;
- List modes = null;
+ Map<Set<String>, LaunchConfigurationTabGroupExtension> map = null;
+ List<Set<String>> modes = null;
for (int i = 0; i < groups.length; i++) {
group = new LaunchConfigurationTabGroupExtension(groups[i]);
typeId = group.getTypeIdentifier();
- map = (Map)fTabGroupExtensions.get(typeId);
+ map = fTabGroupExtensions.get(typeId);
if (map == null) {
- map = new Hashtable();
+ map = new Hashtable<Set<String>, LaunchConfigurationTabGroupExtension>();
fTabGroupExtensions.put(typeId, map);
}
modes = group.getModes();
if(modes.isEmpty()) {
- String mode = "*"; //$NON-NLS-1$
- reportReplacement((LaunchConfigurationTabGroupExtension) map.put(mode, group), group, mode);
+ reportReplacement(map.put(ALL_MODES, group), group, ALL_MODES);
}
- Set ms = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- ms = (Set) iter.next();
- reportReplacement((LaunchConfigurationTabGroupExtension) map.put(ms, group), group, ms);
+ for (Set<String> ms : modes) {
+ reportReplacement(map.put(ms, group), group, ms);
}
}
}
@@ -154,16 +156,16 @@ public class LaunchConfigurationPresentationManager {
* @since 3.3
*/
private void initializeContributedTabExtensions() {
- fContributedTabs = new Hashtable();
+ fContributedTabs = new Hashtable<String, Hashtable<String, LaunchConfigurationTabExtension>>();
IExtensionPoint epoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_LAUNCH_TABS);
IConfigurationElement[] elements = epoint.getConfigurationElements();
LaunchConfigurationTabExtension tab = null;
- Hashtable element = null;
+ Hashtable<String, LaunchConfigurationTabExtension> element = null;
for(int i = 0; i < elements.length; i++) {
tab = new LaunchConfigurationTabExtension(elements[i]);
- element = (Hashtable) fContributedTabs.get(tab.getTabGroupId());
+ element = fContributedTabs.get(tab.getTabGroupId());
if(element == null) {
- element = new Hashtable();
+ element = new Hashtable<String, LaunchConfigurationTabExtension>();
element.put(tab.getIdentifier(), tab);
fContributedTabs.put(tab.getTabGroupId(), element);
}
@@ -180,7 +182,7 @@ public class LaunchConfigurationPresentationManager {
* @exception CoreException if an exception occurs creating the group
*/
public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfigurationType type, String mode) throws CoreException {
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
LaunchConfigurationTabGroupExtension ext = getExtension(type.getIdentifier(), modes);
if (ext == null) {
@@ -199,7 +201,7 @@ public class LaunchConfigurationPresentationManager {
* @throws CoreException
*/
public ILaunchConfigurationTabGroup getTabGroup(ILaunchConfiguration config, String mode) throws CoreException {
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
LaunchConfigurationTabGroupExtension ext = getExtension(config.getType().getIdentifier(), modes);
if (ext == null) {
@@ -220,9 +222,9 @@ public class LaunchConfigurationPresentationManager {
*/
protected LaunchConfigurationTabExtension[] getTabExtensions(String groupid, ILaunchConfiguration config, String mode) throws CoreException {
initializeContributedTabExtensions();
- Hashtable tabs = (Hashtable) fContributedTabs.get(groupid);
+ Hashtable<String, LaunchConfigurationTabExtension> tabs = fContributedTabs.get(groupid);
if(tabs != null) {
- return filterLaunchTabExtensions((LaunchConfigurationTabExtension[]) tabs.values().toArray(new LaunchConfigurationTabExtension[tabs.size()]), config, mode);
+ return filterLaunchTabExtensions(tabs.values().toArray(new LaunchConfigurationTabExtension[tabs.size()]), config, mode);
}
return new LaunchConfigurationTabExtension[0];
}
@@ -248,18 +250,18 @@ public class LaunchConfigurationPresentationManager {
if(as == null || config == null) {
return tabs;
}
- HashSet set = new HashSet();
+ HashSet<LaunchConfigurationTabExtension> set = new HashSet<LaunchConfigurationTabExtension>();
for(int i = 0; i < tabs.length; i ++) {
//filter capabilities
if(!WorkbenchActivityHelper.filterItem(new LaunchTabContribution(tabs[i]))) {
//filter to preferred delegate (if there is one)
- HashSet modes = (HashSet) config.getModes();
+ Set<String> modes = config.getModes();
modes.add(mode);
ILaunchDelegate delegate = config.getPreferredDelegate(modes);
if(delegate == null) {
delegate = config.getType().getPreferredDelegate(modes);
}
- Set delegateSet = tabs[i].getDelegateSet();
+ Set<String> delegateSet = tabs[i].getDelegateSet();
if(delegate != null) {
if(delegateSet.isEmpty() || delegateSet.contains(delegate.getId())) {
set.add(tabs[i]);
@@ -277,7 +279,7 @@ public class LaunchConfigurationPresentationManager {
}
}
}
- return (LaunchConfigurationTabExtension[]) set.toArray(new LaunchConfigurationTabExtension[set.size()]);
+ return set.toArray(new LaunchConfigurationTabExtension[set.size()]);
}
/**
@@ -288,16 +290,16 @@ public class LaunchConfigurationPresentationManager {
* @param mode launch mode identifier
* @return launch tab group extension or <code>null</code>
*/
- protected LaunchConfigurationTabGroupExtension getExtension(String type, Set modes) {
+ protected LaunchConfigurationTabGroupExtension getExtension(String type, Set<String> modes) {
initializeTabGroupExtensions();
- Map map = (Map)fTabGroupExtensions.get(type);
+ Map<Set<String>, LaunchConfigurationTabGroupExtension> map = fTabGroupExtensions.get(type);
if (map != null) {
- Object extension = map.get(modes);
+ LaunchConfigurationTabGroupExtension extension = map.get(modes);
if (extension == null) {
// get the default tabs
- extension = map.get("*"); //$NON-NLS-1$
+ extension = map.get(ALL_MODES);
}
- return (LaunchConfigurationTabGroupExtension)extension;
+ return extension;
}
return null;
}
@@ -314,7 +316,7 @@ public class LaunchConfigurationPresentationManager {
* @since 2.1
*/
public String getHelpContext(ILaunchConfigurationType type, String mode) throws CoreException {
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
LaunchConfigurationTabGroupExtension ext = getExtension(type.getIdentifier(), modes);
if (ext == null) {
@@ -333,7 +335,7 @@ public class LaunchConfigurationPresentationManager {
* @return the description of the given configuration type, possible <code>null</code>
*/
public String getDescription(ILaunchConfigurationType configType, String mode) {
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
LaunchConfigurationTabGroupExtension extension = getExtension(configType.getAttribute(IConfigurationElementConstants.ID), modes);
return (extension != null ? extension.getDescription(modes) : null);
@@ -345,12 +347,10 @@ public class LaunchConfigurationPresentationManager {
* @param modes set of launch mode identifiers
* @return sorted list of launch mode names
*/
- public List getLaunchModeNames(Set modes) {
- List names = new ArrayList();
- Iterator iterator = modes.iterator();
+ public List<String> getLaunchModeNames(Set<String> modes) {
+ List<String> names = new ArrayList<String>();
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- while (iterator.hasNext()) {
- String id = (String) iterator.next();
+ for (String id : modes) {
ILaunchMode mode = manager.getLaunchMode(id);
if (mode == null) {
names.add(id);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java
index 437ce2b30..8fcf468ff 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationPropertiesDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -66,7 +66,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
* when configuration names are generated
* @param group launch group
*/
- public LaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group, Set reservednames) {
+ public LaunchConfigurationPropertiesDialog(Shell shell, ILaunchConfiguration launchConfiguration, LaunchGroupExtension group, Set<String> reservednames) {
super(shell, group);
fLaunchConfiguration = launchConfiguration;
DebugPlugin.getDefault().getLaunchManager().addLaunchConfigurationListener(this);
@@ -85,6 +85,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#initializeBounds()
*/
+ @Override
protected void initializeBounds() {
super.initializeBounds();
resize();
@@ -93,6 +94,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#initializeContent()
*/
+ @Override
protected void initializeContent() {
ILaunchConfiguration launchConfiguration = getLaunchConfiguration();
if (shouldSetDefaultsOnOpen() && launchConfiguration instanceof ILaunchConfigurationWorkingCopy) {
@@ -109,6 +111,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#close()
*/
+ @Override
public boolean close() {
if (!isSafeToClose()) {
return false;
@@ -120,6 +123,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#addContent(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addContent(Composite dialogComp) {
GridData gd;
Composite topComp = new Composite(dialogComp, SWT.NONE);
@@ -158,6 +162,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
// create OK and Cancel buttons by default
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
@@ -167,6 +172,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getShellTitle()
*/
+ @Override
protected String getShellTitle() {
return LaunchConfigurationsMessages.LaunchConfigurationPropertiesDialog_Properties_for__0__2;
}
@@ -174,6 +180,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.LAUNCH_CONFIGURATION_PROPERTIES_DIALOG;
}
@@ -181,6 +188,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#updateButtons()
*/
+ @Override
public void updateButtons() {
getTabViewer().refresh();
getButton(IDialogConstants.OK_ID).setEnabled(getTabViewer().canSave());
@@ -190,6 +198,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
getTabViewer().handleApplyPressed();
super.okPressed();
@@ -198,6 +207,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#open()
*/
+ @Override
public int open() {
setOpenMode(-1);
return super.open();
@@ -206,6 +216,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog#getDialogSettingsSectionName()
*/
+ @Override
protected String getDialogSettingsSectionName() {
return IDebugUIConstants.PLUGIN_ID + ".LAUNCH_CONFIGURATION_PROPERTIES_DIALOG_SECTION"; //$NON-NLS-1$
}
@@ -213,6 +224,7 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
if (getLaunchConfiguration().equals(manager.getMovedFrom(configuration))) {
@@ -225,10 +237,12 @@ public class LaunchConfigurationPropertiesDialog extends LaunchConfigurationsDia
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
index 6bc35fa84..949638627 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationSelectionDialog.java
@@ -40,6 +40,7 @@ public class LaunchConfigurationSelectionDialog extends AbstractDebugListSelecti
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return DIALOG_SETTINGS;
}
@@ -47,6 +48,7 @@ public class LaunchConfigurationSelectionDialog extends AbstractDebugListSelecti
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_LAUNCH_CONFIGURATION_DIALOG;
}
@@ -54,6 +56,7 @@ public class LaunchConfigurationSelectionDialog extends AbstractDebugListSelecti
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fInput;
}
@@ -61,6 +64,7 @@ public class LaunchConfigurationSelectionDialog extends AbstractDebugListSelecti
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.LaunchConfigurationSelectionDialog_1;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
index 67cee23ba..dae26a1ee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,18 +40,18 @@ public class LaunchConfigurationTabGroupExtension {
* A list of sets of modes that this tab group supports
* @since 3.3
*/
- private List fModes = null;
+ private List<Set<String>> fModes = null;
/**
* A map of mode sets to descriptions
* @since 3.3
*/
- private Map fDescriptions = null;
+ private Map<Set<String>, String> fDescriptions = null;
/**
* Perspectives for each mode
*/
- private Map fPerspectives = null;
+ private Map<Set<String>, String> fPerspectives = null;
/**
* Constructs a launch configuration tab extension based
@@ -93,19 +93,19 @@ public class LaunchConfigurationTabGroupExtension {
* @return the set of modes specified in the configuration data, or
* <code>null</code>
*/
- protected List getModes() {
+ protected List<Set<String>> getModes() {
if (fModes == null) {
- fModes = new ArrayList();
- fPerspectives = new Hashtable();
+ fModes = new ArrayList<Set<String>>();
+ fPerspectives = new Hashtable<Set<String>, String>();
IConfigurationElement[] modes = fConfig.getChildren(IConfigurationElementConstants.LAUNCH_MODE);
if (modes.length > 0) {
IConfigurationElement element = null;
String perspective = null, mode = null;
- Set mset = null;
+ Set<String> mset = null;
for (int i = 0; i < modes.length; i++) {
element = modes[i];
mode = element.getAttribute(IConfigurationElementConstants.MODE);
- mset = new HashSet();
+ mset = new HashSet<String>();
mset.add(mode);
fModes.add(mset);
perspective = element.getAttribute(IConfigurationElementConstants.PERSPECTIVE);
@@ -125,9 +125,9 @@ public class LaunchConfigurationTabGroupExtension {
* @param modes the set of launch modes
* @return perspective identifier, or <code>null</code>
*/
- protected String getPerspective(Set modes) {
+ protected String getPerspective(Set<String> modes) {
getModes();
- return (String)fPerspectives.get(modes);
+ return fPerspectives.get(modes);
}
/**
@@ -181,19 +181,19 @@ public class LaunchConfigurationTabGroupExtension {
* @return a description of the Launch Mode if available. If not available, attempts to return
* a description of the Launch Configuration. If no appropriate description is found an empty string is returned.
*/
- public String getDescription(Set modes) {
+ public String getDescription(Set<String> modes) {
String description = null;
if(fDescriptions == null) {
- fDescriptions = new HashMap();
+ fDescriptions = new HashMap<Set<String>, String>();
IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.LAUNCH_MODE);
IConfigurationElement child = null;
String mode = null;
- HashSet set = null;
+ HashSet<String> set = null;
for (int i = 0; i < children.length; i++) {
child = children[i];
mode = child.getAttribute(IConfigurationElementConstants.MODE);
if(mode != null) {
- set = new HashSet();
+ set = new HashSet<String>();
set.add(mode);
}
description = child.getAttribute(IConfigurationElementConstants.DESCRIPTION);
@@ -203,7 +203,7 @@ public class LaunchConfigurationTabGroupExtension {
}
}
- description = (String) fDescriptions.get(modes);
+ description = fDescriptions.get(modes);
if(description == null) {
description = fConfig.getAttribute(IConfigurationElementConstants.DESCRIPTION);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
index 7f4b2bb53..25f153593 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -240,7 +240,8 @@ public class LaunchConfigurationTabGroupViewer {
fNameWidget = new Text(fGroupComposite, SWT.SINGLE | SWT.BORDER);
fNameWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fNameWidget.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
+ @Override
+ public void modifyText(ModifyEvent e) {
if(!fInitializingTabs) {
handleNameModified();
}
@@ -264,6 +265,7 @@ public class LaunchConfigurationTabGroupViewer {
gd.grabExcessHorizontalSpace = true;
fOptionsLink.setLayoutData(gd);
fOptionsLink.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
//collect the options available
try {
@@ -274,7 +276,8 @@ public class LaunchConfigurationTabGroupViewer {
//set the options to the config
Object[] res = sld.getResult();
if(res != null) {
- Set modes = (Set) res[0];
+ @SuppressWarnings("unchecked")
+ Set<String> modes = (Set<String>) res[0];
modes.remove(getLaunchConfigurationDialog().getMode());
ILaunchConfigurationWorkingCopy wc = getWorkingCopy();
wc.setModes(modes);
@@ -300,6 +303,7 @@ public class LaunchConfigurationTabGroupViewer {
Composite buttonComp = SWTFactory.createComposite(blComp, 2, 1, GridData.HORIZONTAL_ALIGN_END);
fApplyButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.LaunchConfigurationDialog__Apply_17, null,GridData.HORIZONTAL_ALIGN_END);
fApplyButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleApplyPressed();
}
@@ -307,6 +311,7 @@ public class LaunchConfigurationTabGroupViewer {
fRevertButton = SWTFactory.createPushButton(buttonComp, LaunchConfigurationsMessages.LaunchConfigurationDialog_Revert_2, null, GridData.HORIZONTAL_ALIGN_END);
fRevertButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleRevertPressed();
}
@@ -338,6 +343,7 @@ public class LaunchConfigurationTabGroupViewer {
gd.widthHint = width;
link.setLayoutData(gd);
link.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
SWTFactory.showPreferencePage("org.eclipse.debug.ui.PerspectivePreferencePage"); //$NON-NLS-1$
}
@@ -363,6 +369,7 @@ public class LaunchConfigurationTabGroupViewer {
fTabFolder.setLayoutData(gd);
fTabFolder.setFont(parent.getFont());
fTabFolder.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
if (!fInitializingTabs) {
handleTabSelected();
@@ -493,7 +500,7 @@ public class LaunchConfigurationTabGroupViewer {
text = LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_15;
}
else {
- text = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_16, new String[] {name});
+ text = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_16, new Object[] { name });
}
}
else {
@@ -523,7 +530,7 @@ public class LaunchConfigurationTabGroupViewer {
ILaunchConfigurationWorkingCopy config = getWorkingCopy();
if(config != null) {
try {
- Set modes = getCurrentModeSet();
+ Set<String> modes = getCurrentModeSet();
preferred = config.getPreferredDelegate(modes);
if(preferred == null) {
preferred = config.getType().getPreferredDelegate(modes);
@@ -539,8 +546,8 @@ public class LaunchConfigurationTabGroupViewer {
* @return the listing of modes for the current config
* @since 3.3
*/
- private Set getCurrentModeSet() {
- Set set = new HashSet();
+ private Set<String> getCurrentModeSet() {
+ Set<String> set = new HashSet<String>();
ILaunchConfigurationWorkingCopy config = getWorkingCopy();
if(config != null) {
try {
@@ -582,6 +589,7 @@ public class LaunchConfigurationTabGroupViewer {
}
else {
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
setInput0(input);
}
@@ -615,6 +623,7 @@ public class LaunchConfigurationTabGroupViewer {
protected void inputChanged(Object input) {
final Object finput = input;
Runnable r = new Runnable() {
+ @Override
public void run() {
try {
fViewform.setRedraw(false);
@@ -675,7 +684,7 @@ public class LaunchConfigurationTabGroupViewer {
return false;
}
if (config1.getType().equals(config2.getType())) {
- Set modes = getCurrentModeSet();
+ Set<String> modes = getCurrentModeSet();
ILaunchDelegate d1 = config1.getPreferredDelegate(modes);
if(d1 == null) {
d1 = config1.getType().getPreferredDelegate(modes);
@@ -744,7 +753,7 @@ public class LaunchConfigurationTabGroupViewer {
// Retrieve the current tab group. If there is none, clean up and leave
ILaunchConfigurationTabGroup tabGroup = getTabGroup();
if (tabGroup == null) {
- IStatus status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_No_tabs_defined_for_launch_configuration_type__0__1, new String[]{type.getName()}), null);
+ IStatus status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_No_tabs_defined_for_launch_configuration_type__0__1, new Object[] { type.getName() }), null);
CoreException e = new CoreException(status);
errorDialog(e);
fInitializingTabs = false;
@@ -774,7 +783,7 @@ public class LaunchConfigurationTabGroupViewer {
*/
private void showInstanceTabsFor(ILaunchConfigurationType configType) {
// try to keep on same tab
- Class tabKind = null;
+ Class<? extends ILaunchConfigurationTab> tabKind = null;
if (getActiveTab() != null) {
tabKind = getActiveTab().getClass();
}
@@ -858,6 +867,7 @@ public class LaunchConfigurationTabGroupViewer {
// results from the Runnable
final Object[] finalArray = new Object[2];
Runnable runnable = new Runnable() {
+ @Override
public void run() {
ILaunchConfigurationTabGroup tabGroup = null;
try {
@@ -982,12 +992,14 @@ public class LaunchConfigurationTabGroupViewer {
*/
protected Job createUpdateJob() {
return new WorkbenchJob(getControl().getDisplay(), "Update LCD") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!getControl().isDisposed()) {
refreshStatus();
}
return Status.OK_STATUS;
}
+ @Override
public boolean shouldRun() {
return !getControl().isDisposed();
}
@@ -1149,7 +1161,7 @@ public class LaunchConfigurationTabGroupViewer {
ILaunchConfiguration config = getWorkingCopy();
if(config != null) {
try {
- Set modes = getCurrentModeSet();
+ Set<String> modes = getCurrentModeSet();
ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(config.getType(), modes);
return delegates.length > 1;
}
@@ -1207,9 +1219,9 @@ public class LaunchConfigurationTabGroupViewer {
}
}
if(!canLaunchWithModes()) {
- Set modes = getCurrentModeSet();
- List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
- return MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_14, new String[]{names.toString()});
+ Set<String> modes = getCurrentModeSet();
+ List<String> names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
+ return MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationTabGroupViewer_14, new Object[] { names.toString() });
}
return null;
}
@@ -1293,7 +1305,7 @@ public class LaunchConfigurationTabGroupViewer {
}
// Otherwise, if there's already a config with the same name, complain
if (fOriginal != null && !fOriginal.getName().equals(currentName)) {
- Set reservednames = ((LaunchConfigurationsDialog)getLaunchConfigurationDialog()).getReservedNameSet();
+ Set<String> reservednames = ((LaunchConfigurationsDialog) getLaunchConfigurationDialog()).getReservedNameSet();
if (mgr.isExistingLaunchConfigurationName(currentName) || (reservednames != null ? reservednames.contains(currentName) : false)) {
ILaunchConfiguration config = ((LaunchManager)mgr).findLaunchConfiguration(currentName);
//config cannot be null at this location since the manager knows the name conflicts
@@ -1390,6 +1402,7 @@ public class LaunchConfigurationTabGroupViewer {
if (isDirty()) {
if(!fWorkingCopy.isLocal()) {
IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
saved[0] = ((LaunchConfigurationWorkingCopy)fWorkingCopy).doSave(monitor);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
index 4afaa2150..1d65b3e4f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabGroupWrapper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,16 +41,16 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
*
* @since 3.5
*/
- class TabCollector implements Iterator {
+ class TabCollector implements Iterator<ILaunchConfigurationTab> {
- private HashSet idSet = null;
- private ArrayList tabList = null;
- private ArrayList extList = null;
+ private HashSet<String> idSet = null;
+ private ArrayList<ILaunchConfigurationTab> tabList = null;
+ private ArrayList<LaunchConfigurationTabExtension> extList = null;
- public TabCollector(List tabs, List exts) {
- tabList = new ArrayList(tabs);
- extList = new ArrayList(exts);
- idSet = new HashSet(tabList.size() + extList.size());
+ public TabCollector(List<ILaunchConfigurationTab> tabs, List<LaunchConfigurationTabExtension> exts) {
+ tabList = new ArrayList<ILaunchConfigurationTab>(tabs);
+ extList = new ArrayList<LaunchConfigurationTabExtension>(exts);
+ idSet = new HashSet<String>(tabList.size() + extList.size());
}
/**
@@ -59,8 +59,8 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
* @return the next tab extension tab
*/
private ILaunchConfigurationTab nextExtensionTab() {
- for (Iterator iterator = extList.iterator(); iterator.hasNext();) {
- LaunchConfigurationTabExtension launchConfigurationTabExtension = (LaunchConfigurationTabExtension)iterator.next();
+ for (Iterator<LaunchConfigurationTabExtension> iterator = extList.iterator(); iterator.hasNext();) {
+ LaunchConfigurationTabExtension launchConfigurationTabExtension = iterator.next();
String relativeTab = launchConfigurationTabExtension.getRelativeTabId();
if (relativeTab == null || idSet.contains(relativeTab)) {
iterator.remove();
@@ -73,6 +73,7 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see java.util.Iterator#hasNext()
*/
+ @Override
public boolean hasNext() {
return extList.size() > 0 || tabList.size() > 0;
}
@@ -80,14 +81,15 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see java.util.Iterator#next()
*/
- public Object next() {
+ @Override
+ public ILaunchConfigurationTab next() {
ILaunchConfigurationTab nextTab = nextExtensionTab();
if (nextTab == null) {
if (tabList.size() > 0) {
- nextTab = (ILaunchConfigurationTab)tabList.remove(0);
+ nextTab = tabList.remove(0);
}
else {
- LaunchConfigurationTabExtension launchConfigurationTabExtension = (LaunchConfigurationTabExtension)extList.remove(0);
+ LaunchConfigurationTabExtension launchConfigurationTabExtension = extList.remove(0);
nextTab = launchConfigurationTabExtension.getTab();
}
}
@@ -103,6 +105,7 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see java.util.Iterator#remove()
*/
+ @Override
public void remove() {
throw new UnsupportedOperationException();
}
@@ -113,7 +116,7 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/**
* listing of tab extensions that we have to create
*/
- private List fTabs = null;
+ private List<ILaunchConfigurationTab> fTabs = null;
private String fMode = null;
private ILaunchConfiguration fConfig = null;
@@ -132,6 +135,7 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
*/
+ @Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
if(fGroup != null) {
fGroup.createTabs(dialog, mode);
@@ -142,13 +146,14 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#dispose()
*/
+ @Override
public void dispose() {
fGroup.dispose();
if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
+ List<ILaunchConfigurationTab> tabs = Arrays.asList(fGroup.getTabs());
ILaunchConfigurationTab tab = null;
for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
+ tab = fTabs.get(i);
if(!tabs.contains(tab)) {
tab.dispose();
}
@@ -160,16 +165,17 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#getTabs()
*/
+ @Override
public ILaunchConfigurationTab[] getTabs() {
if(fTabs == null) {
try {
- fTabs = new ArrayList();
+ fTabs = new ArrayList<ILaunchConfigurationTab>();
LaunchConfigurationTabExtension[] ext = LaunchConfigurationPresentationManager.getDefault().getTabExtensions(fGroupId, fConfig, fMode);
//if there are no extensions bypass and do a raw copy into
if(ext.length > 0) {
TabCollector collector = new TabCollector(Arrays.asList(fGroup.getTabs()), Arrays.asList(ext));
while(collector.hasNext()) {
- Object next = collector.next();
+ ILaunchConfigurationTab next = collector.next();
if (next != null) {
fTabs.add(next);
}
@@ -184,19 +190,20 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
}
catch (CoreException ce) {DebugUIPlugin.log(ce);}
}
- return (ILaunchConfigurationTab[]) fTabs.toArray(new ILaunchConfigurationTab[fTabs.size()]);
+ return fTabs.toArray(new ILaunchConfigurationTab[fTabs.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
fGroup.initializeFrom(configuration);
if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
+ List<ILaunchConfigurationTab> tabs = Arrays.asList(fGroup.getTabs());
ILaunchConfigurationTab tab = null;
for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
+ tab = fTabs.get(i);
if(!tabs.contains(tab)) {
tab.initializeFrom(configuration);
}
@@ -207,6 +214,8 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#launched(org.eclipse.debug.core.ILaunch)
*/
+ @SuppressWarnings("deprecation")
+ @Override
public void launched(ILaunch launch) {
if(fGroup != null) {
fGroup.launched(launch);
@@ -216,13 +225,14 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
fGroup.performApply(configuration);
if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
+ List<ILaunchConfigurationTab> tabs = Arrays.asList(fGroup.getTabs());
ILaunchConfigurationTab tab = null;
for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
+ tab = fTabs.get(i);
if(!tabs.contains(tab)) {
tab.performApply(configuration);
}
@@ -233,13 +243,14 @@ public class LaunchConfigurationTabGroupWrapper implements ILaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
fGroup.setDefaults(configuration);
if(fTabs != null) {
- List tabs = Arrays.asList(fGroup.getTabs());
+ List<ILaunchConfigurationTab> tabs = Arrays.asList(fGroup.getTabs());
ILaunchConfigurationTab tab = null;
for(int i = 0; i < fTabs.size(); i++) {
- tab = (ILaunchConfigurationTab)fTabs.get(i);
+ tab = fTabs.get(i);
if(!tabs.contains(tab)) {
tab.setDefaults(configuration);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java
index 1cb7e1674..77baf43bb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTabImageDescriptor.java
@@ -46,6 +46,7 @@ public class LaunchConfigurationTabImageDescriptor extends CompositeImageDescrip
/**
* @see CompositeImageDescriptor#getSize()
*/
+ @Override
protected Point getSize() {
if (fSize == null) {
ImageData data= getBaseImage().getImageData();
@@ -57,6 +58,7 @@ public class LaunchConfigurationTabImageDescriptor extends CompositeImageDescrip
/**
* @see Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
if (!(object instanceof LaunchConfigurationTabImageDescriptor)){
return false;
@@ -69,6 +71,7 @@ public class LaunchConfigurationTabImageDescriptor extends CompositeImageDescrip
/**
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
return getBaseImage().hashCode() | getFlags();
}
@@ -76,6 +79,7 @@ public class LaunchConfigurationTabImageDescriptor extends CompositeImageDescrip
/**
* @see CompositeImageDescriptor#drawCompositeImage(int, int)
*/
+ @Override
protected void drawCompositeImage(int width, int height) {
ImageData bg= getBaseImage().getImageData();
if (bg == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
index 09cdd709b..2d9415b6f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTreeContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.ArrayList;
import java.util.List;
+
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
@@ -71,6 +72,7 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
*
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
if (parentElement instanceof ILaunchConfiguration) {
return EMPTY_ARRAY;
@@ -90,6 +92,7 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
if (element instanceof ILaunchConfiguration) {
if (!((ILaunchConfiguration)element).exists()) {
@@ -109,6 +112,7 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
if (element instanceof ILaunchConfiguration) {
return false;
@@ -122,6 +126,7 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
*
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
ILaunchConfigurationType[] allTypes = getLaunchManager().getLaunchConfigurationTypes();
return filterTypes(allTypes).toArray();
@@ -135,8 +140,8 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
* @param allTypes the types
* @return the given types minus any types that should not be visible.
*/
- private List filterTypes(ILaunchConfigurationType[] allTypes) {
- List filteredTypes= new ArrayList();
+ private List<ILaunchConfigurationType> filterTypes(ILaunchConfigurationType[] allTypes) {
+ List<ILaunchConfigurationType> filteredTypes = new ArrayList<ILaunchConfigurationType>();
String mode = getMode();
LaunchConfigurationTypeContribution contribution;
for (int i = 0; i < allTypes.length; i++) {
@@ -152,12 +157,14 @@ public class LaunchConfigurationTreeContentProvider implements ITreeContentProvi
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java
index 8a7b3c627..155d92e58 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeContribution.java
@@ -34,6 +34,7 @@ class LaunchConfigurationTypeContribution implements IPluginContribution {
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
+ @Override
public String getLocalId() {
return type.getIdentifier();
}
@@ -41,6 +42,7 @@ class LaunchConfigurationTypeContribution implements IPluginContribution {
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
+ @Override
public String getPluginId() {
return type.getPluginIdentifier();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
index 86d5d6035..0d804e5a9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationTypeFilter.java
@@ -36,6 +36,7 @@ public class LaunchConfigurationTypeFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if(element instanceof ILaunchConfiguration) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
index 4aaa18803..5f8866542 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -134,6 +134,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Viewer createViewer(Composite parent) {
fTree = new LaunchConfigurationFilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, new PatternFilter(), fLaunchGroup, fFilters);
fTree.createViewControl();
@@ -146,20 +147,25 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.AbstractDebugView#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class key) {
if (key == IContextProvider.class) {
return new IContextProvider () {
+ @Override
public int getContextChangeMask() {
return SELECTION;
}
+ @Override
public IContext getContext(Object target) {
String id = fTree.computeContextId();
- if (id!=null)
+ if (id!=null) {
return HelpSystem.getContext(id);
+ }
return null;
}
+ @Override
public String getSearchExpression(Object target) {
return null;
}
@@ -182,6 +188,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.AbstractDebugView#createActions()
*/
+ @Override
protected void createActions() {
fCreateAction = new CreateLaunchConfigurationAction(getViewer(), getLaunchGroup().getMode());
setAction(CreateLaunchConfigurationAction.ID_CREATE_ACTION, fCreateAction);
@@ -204,6 +211,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.LAUNCH_CONFIGURATION_VIEW;
}
@@ -211,6 +219,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
protected void fillContextMenu(IMenuManager menu) {
menu.add(fCreateAction);
menu.add(fDuplicateAction);
@@ -221,6 +230,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {}
/**
@@ -235,6 +245,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
fCreateAction.dispose();
fDeleteAction.dispose();
@@ -247,6 +258,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationAdded(final ILaunchConfiguration configuration) {
if(isSupportedConfiguration(configuration)) {
//due to notification and async messages we need to collect the moved from config
@@ -256,7 +268,8 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
// handle asynchronously: @see bug 198428 - Deadlock deleting launch configuration
Display display = DebugUIPlugin.getStandardDisplay();
display.asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if(!fTree.isDisposed()) {
handleConfigurationAdded(configuration, from);
}
@@ -336,11 +349,13 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {}
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationRemoved(final ILaunchConfiguration configuration) {
// if moved, ignore
ILaunchConfiguration to = getLaunchManager().getMovedTo(configuration);
@@ -350,7 +365,8 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
// handle asynchronously: @see bug 198428 - Deadlock deleting launch configuration
Display display = DebugUIPlugin.getStandardDisplay();
display.asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if(!fTree.isDisposed()) {
handleConfigurationRemoved(configuration);
}
@@ -379,6 +395,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
createContextMenu(getViewer().getControl());
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, getHelpContextId());
getViewer().getControl().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
handleKeyPressed(e);
}
@@ -393,6 +410,7 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
/**
* @see org.eclipse.debug.ui.IDebugView#getViewer()
*/
+ @Override
public Viewer getViewer() {
return fTree.getLaunchConfigurationViewer();
}
@@ -403,7 +421,9 @@ public class LaunchConfigurationView extends AbstractDebugView implements ILaunc
*/
public void updateFilterLabel() {
LaunchConfigurationViewer viewer = (LaunchConfigurationViewer) getViewer();
- fFilteredNotice.setText(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationView_0, new String[] {Integer.toString(viewer.getNonFilteredChildCount()), Integer.toString(viewer.getTotalChildCount())}));
+ fFilteredNotice.setText(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationView_0, new Object[] {
+ Integer.toString(viewer.getNonFilteredChildCount()),
+ Integer.toString(viewer.getTotalChildCount()) }));
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
index dd4eba627..5b1d6f937 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,14 +53,15 @@ public class LaunchConfigurationViewer extends TreeViewer {
/**
* @see org.eclipse.jface.viewers.StructuredViewer#preservingSelection(java.lang.Runnable)
*/
+ @Override
protected void preservingSelection(Runnable updateCode) {
IStructuredSelection selection = (IStructuredSelection) getSelection();
if(!selection.isEmpty()) {
int[] indices = collectIndices(selection.getFirstElement());
updateCode.run();
- ArrayList set = new ArrayList();
+ ArrayList<Object> set = new ArrayList<Object>();
Object o = null;
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
o = iter.next();
if(o instanceof ILaunchConfiguration) {
if(!((ILaunchConfiguration)o).exists()) {
@@ -155,6 +156,7 @@ public class LaunchConfigurationViewer extends TreeViewer {
/**
* @see org.eclipse.jface.viewers.AbstractTreeViewer#remove(java.lang.Object)
*/
+ @Override
public void remove(Object elementsOrTreePaths) {
super.remove(elementsOrTreePaths);
fTotalCount--;
@@ -163,6 +165,7 @@ public class LaunchConfigurationViewer extends TreeViewer {
/**
* @see org.eclipse.jface.viewers.TreeViewer#internalAdd(org.eclipse.swt.widgets.Widget, java.lang.Object, java.lang.Object[])
*/
+ @Override
protected void internalAdd(Widget widget, Object parentElement, Object[] childElements) {
super.internalAdd(widget, parentElement, childElements);
fTotalCount++;
@@ -171,6 +174,7 @@ public class LaunchConfigurationViewer extends TreeViewer {
/**
* @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object, java.lang.Object)
*/
+ @Override
protected void inputChanged(Object input, Object oldInput) {
super.inputChanged(input, oldInput);
//calc the total number of items that could be visible in the view
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
index a3d6ee978..e89799379 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -228,7 +228,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/**
* set of reserved names that should not be considered when generating a new name for a launch configuration
*/
- protected Set fReservedNames = null;
+ protected Set<String> fReservedNames = null;
/**
* Whether to set default values when opened
@@ -305,6 +305,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
*
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == ID_LAUNCH_BUTTON) {
handleLaunchPressed();
@@ -336,6 +337,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#close()
*/
+ @Override
public boolean close() {
if (!isSafeToClose()) {
return false;
@@ -358,6 +360,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
*
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell);
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(getShellTitle());
@@ -366,6 +369,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#create()
*/
+ @Override
public void create() {
super.create();
if (fTabViewer.getInput() == null) {
@@ -376,6 +380,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createButtonBar(Composite parent) {
Font font = parent.getFont();
Composite composite = new Composite(parent, SWT.NULL);
@@ -425,6 +430,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
*
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
Button button = createButton(parent, ID_LAUNCH_BUTTON, getLaunchButtonText(), true);
button.setEnabled(false);
@@ -434,6 +440,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Control contents = super.createContents(parent);
initializeContent();
@@ -444,6 +451,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite dialogComp = (Composite)super.createDialogArea(parent);
addContent(dialogComp);
@@ -522,6 +530,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
//the view is created to add them to the toolbar
createToolbarActions(toolBarManager);
fDoubleClickAction = new Action() {
+ @Override
public void run() {
IStructuredSelection selection = (IStructuredSelection)fLaunchConfigurationView.getViewer().getSelection();
Object target = selection.getFirstElement();
@@ -542,6 +551,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
control.setLayoutData(gd);
viewForm.setContent(viewFormContents);
AbstractLaunchConfigurationAction.IConfirmationRequestor requestor = new AbstractLaunchConfigurationAction.IConfirmationRequestor() {
+ @Override
public boolean getConfirmation() {
int status = shouldSaveCurrentConfig();
if(status == IDialogConstants.YES_ID) {
@@ -558,6 +568,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
getDuplicateAction().setConfirmationRequestor(requestor);
getNewAction().setConfirmationRequestor(requestor);
((StructuredViewer) viewer).addPostSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
handleLaunchConfigurationSelectionChanged(event);
getNewAction().setEnabled(getNewAction().isEnabled());
@@ -575,7 +586,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* @since 3.2
*/
private ViewerFilter[] createViewerFilters() {
- ArrayList filters = new ArrayList();
+ ArrayList<ViewerFilter> filters = new ArrayList<ViewerFilter>();
fClosedProjectFilter = new ClosedProjectFilter();
if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED)) {
filters.add(fClosedProjectFilter);
@@ -592,7 +603,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
if(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IInternalDebugUIConstants.PREF_FILTER_WORKING_SETS)) {
filters.add(fWorkingSetsFilter);
}
- return (ViewerFilter[]) filters.toArray(new ViewerFilter[filters.size()]);
+ return filters.toArray(new ViewerFilter[filters.size()]);
}
/**
@@ -605,9 +616,10 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#generateName(java.lang.String)
*/
+ @Override
public String generateName(String name) {
if (name == null) {
- name = IInternalDebugCoreConstants.EMPTY_STRING;
+ return getLaunchManager().generateLaunchConfigurationName(IInternalDebugCoreConstants.EMPTY_STRING);
}
return getLaunchManager().generateLaunchConfigurationName(name);
}
@@ -622,9 +634,9 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
*
* @since 3.3
*/
- public String generateName(String name, Set reservednames) {
+ public String generateName(String name, Set<String> reservednames) {
if(name == null) {
- name = IInternalDebugCoreConstants.EMPTY_STRING;
+ return ((LaunchManager) getLaunchManager()).generateUniqueLaunchConfigurationNameFrom(IInternalDebugCoreConstants.EMPTY_STRING, reservednames);
}
return ((LaunchManager)getLaunchManager()).generateUniqueLaunchConfigurationNameFrom(name, reservednames);
}
@@ -632,6 +644,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#getActiveTab()
*/
+ @Override
public ILaunchConfigurationTab getActiveTab() {
return fTabViewer.getActiveTab();
}
@@ -680,14 +693,16 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
* @since 3.2
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
return getDialogSettings();
}
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsStrategy()
*/
- protected int getDialogBoundsStrategy() {
+ @Override
+ protected int getDialogBoundsStrategy() {
return DIALOG_PERSISTSIZE;
}
@@ -785,7 +800,8 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#getMode()
*/
- public String getMode() {
+ @Override
+ public String getMode() {
return getLaunchGroup().getMode();
}
@@ -804,7 +820,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* @since 3.3
*
*/
- public Set getReservedNameSet() {
+ public Set<String> getReservedNameSet() {
return fReservedNames;
}
@@ -831,7 +847,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
protected String getShellTitle() {
String title = null;
if(getLaunchGroup() != null) {
- title = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationsDialog_configurations, new String[] {DebugUIPlugin.removeAccelerators(getLaunchGroup().getLabel())});
+ title = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationsDialog_configurations, new Object[] { DebugUIPlugin.removeAccelerators(getLaunchGroup().getLabel()) });
}
if (title == null) {
title = LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_Configurations_18;
@@ -854,7 +870,8 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#getTabs()
*/
- public ILaunchConfigurationTab[] getTabs() {
+ @Override
+ public ILaunchConfigurationTab[] getTabs() {
if (getTabGroup() == null) {
return null;
}
@@ -1005,6 +1022,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#initializeBounds()
*/
+ @Override
protected void initializeBounds() {
IDialogSettings settings = getDialogSettings();
if (fSashForm != null) {
@@ -1031,6 +1049,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.TitleAreaDialog#getInitialSize()
*/
+ @Override
protected Point getInitialSize() {
try {
getDialogSettings().getInt("DIALOG_HEIGHT"); //$NON-NLS-1$
@@ -1122,6 +1141,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* @see org.eclipse.jface.window.Window#open()
* @return the int status of opening the dialog
*/
+ @Override
public int open() {
int mode = getOpenMode();
setCurrentlyVisibleLaunchConfigurationDialog(this);
@@ -1146,7 +1166,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
if(value == null) {
value = IInternalDebugCoreConstants.EMPTY_STRING;
}
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
String[] persisted = value.split(DELIMITER);
for(int i = 0; i < persisted.length; i++) {
list.add(persisted[i]);
@@ -1165,7 +1185,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
}
value = IInternalDebugCoreConstants.EMPTY_STRING;
//build the preference string
- for(Iterator iter = list.iterator(); iter.hasNext();) {
+ for (Iterator<String> iter = list.iterator(); iter.hasNext();) {
value += iter.next() + DELIMITER;
}
settings.put(DIALOG_EXPANDED_NODES, value);
@@ -1183,7 +1203,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
if(value != null) {
String[] nodes = value.split(DELIMITER);
TreeItem[] items = fLaunchConfigurationView.getTreeViewer().getTree().getItems();
- HashSet toexpand = new HashSet();
+ HashSet<Object> toexpand = new HashSet<Object>();
// if we have a selection make sure it is expanded
if(fInitialSelection != null && !fInitialSelection.isEmpty()) {
Object obj = fInitialSelection.getFirstElement();
@@ -1251,6 +1271,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableContext#run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
*/
+ @Override
public void run(boolean fork, boolean cancelable, IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException {
if (getShell() != null && getShell().isVisible()) {
// Save focus control
@@ -1314,6 +1335,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#setActiveTab(org.eclipse.debug.ui.ILaunchConfigurationTab)
*/
+ @Override
public void setActiveTab(ILaunchConfigurationTab tab) {
fTabViewer.setActiveTab(tab);
}
@@ -1321,6 +1343,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#setActiveTab(int)
*/
+ @Override
public void setActiveTab(int index) {
fTabViewer.setActiveTab(index);
}
@@ -1384,6 +1407,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#setName(java.lang.String)
*/
+ @Override
public void setName(String name) {
fTabViewer.setName(name);
}
@@ -1431,7 +1455,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* <code>IDialogConstants</code>.
*/
private int showDiscardChangesDialog() {
- StringBuffer buffer = new StringBuffer(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___35, new String[]{fTabViewer.getWorkingCopy().getName()}));
+ StringBuffer buffer = new StringBuffer(MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___35, new Object[] { fTabViewer.getWorkingCopy().getName() }));
buffer.append(fTabViewer.getErrorMesssage());
buffer.append(LaunchConfigurationsMessages.LaunchConfigurationDialog_Do_you_wish_to_discard_changes_37);
MessageDialog dialog = new MessageDialog(getShell(),
@@ -1468,7 +1492,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
* <code>IDialogConstants</code>.
*/
private int showSaveChangesDialog() {
- String message = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___29, new String[]{fTabViewer.getWorkingCopy().getName()});
+ String message = MessageFormat.format(LaunchConfigurationsMessages.LaunchConfigurationDialog_The_configuration___29, new Object[] { fTabViewer.getWorkingCopy().getName() });
MessageDialog dialog = new MessageDialog(getShell(),
LaunchConfigurationsMessages.LaunchConfigurationFilteredTree_save_changes,
null,
@@ -1509,6 +1533,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#updateButtons()
*/
+ @Override
public void updateButtons() {
if (!fSettingInput) {
// New, Delete, & Duplicate toolbar actions
@@ -1525,6 +1550,7 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationDialog#updateMessage()
*/
+ @Override
public void updateMessage() {
if (!fSettingInput) {
setErrorMessage(fTabViewer.getErrorMesssage());
@@ -1548,8 +1574,10 @@ public class LaunchConfigurationsDialog extends TitleAreaDialog implements ILaun
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(final PropertyChangeEvent event) {
WorkbenchJob job = new WorkbenchJob(IInternalDebugCoreConstants.EMPTY_STRING) {
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
TreeViewer viewer = fLaunchConfigurationView.getTreeViewer();
boolean newvalue = Boolean.valueOf(event.getNewValue().toString()).booleanValue();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java
index de7828eb3..9e95ce18a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateContribution.java
@@ -32,6 +32,7 @@ public class LaunchDelegateContribution implements IPluginContribution {
/**
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
+ @Override
public String getLocalId() {
return fDelegate.getId();
}
@@ -39,6 +40,7 @@ public class LaunchDelegateContribution implements IPluginContribution {
/**
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
+ @Override
public String getPluginId() {
return fDelegate.getPluginIdentifier();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
index f81f75084..40beef2de 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchDelegateNotAvailableHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.IStatusHandler;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.swt.widgets.Shell;
/**
@@ -30,6 +31,7 @@ public class LaunchDelegateNotAvailableHandler implements IStatusHandler {
/**
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
if(source instanceof Object[]) {
Object[] infos = (Object[]) source;
@@ -38,8 +40,12 @@ public class LaunchDelegateNotAvailableHandler implements IStatusHandler {
final String mode = (String) infos[1];
final Shell shell = DebugUIPlugin.getShell();
Runnable runnable = new Runnable() {
+ @Override
public void run() {
- DebugUITools.openLaunchConfigurationDialog(shell, config, DebugUITools.getLaunchGroup(config, mode).getIdentifier(), null);
+ ILaunchGroup group = DebugUITools.getLaunchGroup(config, mode);
+ if (group != null) {
+ DebugUITools.openLaunchConfigurationDialog(shell, config, group.getIdentifier(), null);
+ }
}
};
DebugUIPlugin.getStandardDisplay().asyncExec(runnable);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java
index b1e9beb2f..74431b081 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupExtension.java
@@ -75,6 +75,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
*
* @return the image for this launch group, or <code>null</code> if none
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
if (fImageDescriptor == null) {
fImageDescriptor = createImageDescriptor("image"); //$NON-NLS-1$
@@ -89,6 +90,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
* @return the banner image for this launch group, or <code>null</code> if
* none
*/
+ @Override
public ImageDescriptor getBannerImageDescriptor() {
if (fBannerImageDescriptor == null) {
fBannerImageDescriptor = createImageDescriptor("bannerImage"); //$NON-NLS-1$
@@ -101,6 +103,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
*
* @return the label for this launch group
*/
+ @Override
public String getLabel() {
return getConfigurationElement().getAttribute("label"); //$NON-NLS-1$
}
@@ -110,6 +113,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
*
* @return the id for this launch group
*/
+ @Override
public String getIdentifier() {
return getConfigurationElement().getAttribute("id"); //$NON-NLS-1$
}
@@ -119,6 +123,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
*
* @return the category for this launch group, possibly <code>null</code>
*/
+ @Override
public String getCategory() {
return getConfigurationElement().getAttribute("category"); //$NON-NLS-1$
}
@@ -128,6 +133,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
*
* @return the mode for this launch group
*/
+ @Override
public String getMode() {
return getConfigurationElement().getAttribute("mode"); //$NON-NLS-1$
}
@@ -147,6 +153,7 @@ public class LaunchGroupExtension implements ILaunchGroup {
*
* @return boolean
*/
+ @Override
public boolean isPublic() {
String string = getConfigurationElement().getAttribute("public"); //$NON-NLS-1$
if (string == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
index 6fcb9a11a..0ca73482c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchGroupFilter.java
@@ -39,6 +39,7 @@ public class LaunchGroupFilter extends ViewerFilter {
/**
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
ILaunchConfigurationType type = null;
ILaunchConfiguration config = null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
index 307b09126..7ffb4b4a7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchHistory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@ package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Iterator;
import java.util.List;
import java.util.Vector;
@@ -33,12 +32,13 @@ import org.eclipse.ui.activities.WorkbenchActivityHelper;
/**
* A history of launches and favorites for a launch group
*/
+@SuppressWarnings("deprecation")
public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListener {
/**
* Listing of the complete launch history, which includes favorites in the launched ordering
*/
- private Vector fCompleteHistory = new Vector();
+ private Vector<ILaunchConfiguration> fCompleteHistory = new Vector<ILaunchConfiguration>();
/**
* The launch group this history is provided for
@@ -48,7 +48,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* Ordered listing of the favorites of this history
*/
- private Vector fFavorites = new Vector();
+ private Vector<ILaunchConfiguration> fFavorites = new Vector<ILaunchConfiguration>();
/**
* A new saved flag to prevent save participants from serializing unchanged launch histories.
@@ -59,7 +59,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* List of instances of this launch history
*/
- private static List fgLaunchHistoryInstances = new ArrayList();
+ private static List<LaunchHistory> fgLaunchHistoryInstances = new ArrayList<LaunchHistory>();
/**
* Creates a new launch history for the given launch group
@@ -85,6 +85,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchAdded(ILaunch launch) {
ILaunchConfiguration configuration = launch.getLaunchConfiguration();
if (configuration != null && !configuration.isWorkingCopy() && DebugUIPlugin.doLaunchConfigurationFiltering(configuration) && accepts(configuration)) {
@@ -168,11 +169,13 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchChanged(ILaunch launch) {}
/**
* @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchRemoved(ILaunch launch) {}
/**
@@ -197,11 +200,9 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
* @return launch history
*/
public synchronized ILaunchConfiguration[] getHistory() {
- Vector history = new Vector();
+ Vector<ILaunchConfiguration> history = new Vector<ILaunchConfiguration>();
try {
- ILaunchConfiguration config = null;
- for(Iterator iter = fCompleteHistory.iterator(); iter.hasNext();) {
- config = (ILaunchConfiguration) iter.next();
+ for (ILaunchConfiguration config : fCompleteHistory) {
if(config.exists() && !fFavorites.contains(config) &&
DebugUIPlugin.doLaunchConfigurationFiltering(config) &&
!WorkbenchActivityHelper.filterItem(new LaunchConfigurationTypeContribution(config.getType()))) {
@@ -214,7 +215,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
}
}
catch(CoreException ce) {DebugUIPlugin.log(ce);}
- return (ILaunchConfiguration[]) history.toArray(new ILaunchConfiguration[history.size()]);
+ return history.toArray(new ILaunchConfiguration[history.size()]);
}
/**
@@ -226,11 +227,9 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
* @since 3.3
*/
public synchronized ILaunchConfiguration[] getCompleteLaunchHistory() {
- Vector history = new Vector();
+ Vector<ILaunchConfiguration> history = new Vector<ILaunchConfiguration>();
try {
- ILaunchConfiguration config = null;
- for(Iterator iter = fCompleteHistory.listIterator(); iter.hasNext();){
- config = (ILaunchConfiguration) iter.next();
+ for (ILaunchConfiguration config : fCompleteHistory) {
if(config.exists() && DebugUIPlugin.doLaunchConfigurationFiltering(config) &&
!WorkbenchActivityHelper.filterItem(new LaunchConfigurationTypeContribution(config.getType()))) {
history.add(config);
@@ -238,7 +237,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
}
}
catch (CoreException ce) {DebugUIPlugin.log(ce);}
- return (ILaunchConfiguration[]) history.toArray(new ILaunchConfiguration[history.size()]);
+ return history.toArray(new ILaunchConfiguration[history.size()]);
}
/**
@@ -248,7 +247,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
* @return launch favorites
*/
public synchronized ILaunchConfiguration[] getFavorites() {
- return (ILaunchConfiguration[])fFavorites.toArray(new ILaunchConfiguration[fFavorites.size()]);
+ return fFavorites.toArray(new ILaunchConfiguration[fFavorites.size()]);
}
/**
@@ -257,7 +256,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
* @param favorites
*/
public synchronized void setFavorites(ILaunchConfiguration[] favorites) {
- fFavorites = new Vector(Arrays.asList(favorites));
+ fFavorites = new Vector<ILaunchConfiguration>(Arrays.asList(favorites));
setSaved(false);
fireLaunchHistoryChanged();
}
@@ -315,8 +314,8 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
* Notifies all launch histories that the launch history size has changed.
*/
public static void launchHistoryChanged() {
- for(Iterator iter = fgLaunchHistoryInstances.iterator(); iter.hasNext();) {
- ((LaunchHistory) iter.next()).resizeHistory();
+ for (LaunchHistory history : fgLaunchHistoryInstances) {
+ history.resizeHistory();
}
}
@@ -343,6 +342,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationAdded(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationAdded(ILaunchConfiguration configuration) {
ILaunchConfiguration movedFrom = DebugPlugin.getDefault().getLaunchManager().getMovedFrom(configuration);
// if this is a move, the launchConfigurationRemoved(...) method will handle updates
@@ -363,7 +363,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
*/
protected boolean isFavorite(ILaunchConfiguration configuration) throws CoreException {
String groupId = getLaunchGroup().getIdentifier();
- List favoriteGroups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List)null);
+ List<String> favoriteGroups = configuration.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, (List<String>) null);
if (favoriteGroups == null) {
// check deprecated attributes for backwards compatibility
if (groupId.equals(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP)) {
@@ -442,6 +442,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationChanged(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
checkFavorites(configuration);
}
@@ -449,6 +450,7 @@ public class LaunchHistory implements ILaunchListener, ILaunchConfigurationListe
/**
* @see org.eclipse.debug.core.ILaunchConfigurationListener#launchConfigurationRemoved(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
synchronized (this) {
ILaunchConfiguration newConfig = DebugPlugin.getDefault().getLaunchManager().getMovedTo(configuration);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
index 2d3065476..0e1acb39e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutExtension.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,9 +11,9 @@
package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -52,11 +52,11 @@ import org.eclipse.ui.handlers.IHandlerService;
public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContribution {
private ImageDescriptor fImageDescriptor = null;
- private List fPerspectives = null;
+ private List<String> fPerspectives = null;
private ILaunchShortcut fDelegate = null;
- private Set fModes = null;
- private Set fAssociatedTypes = null;
- private Map fDescriptions = null;
+ private Set<String> fModes = null;
+ private Set<String> fAssociatedTypes = null;
+ private Map<String, String> fDescriptions = null;
private IConfigurationElement fContextualLaunchConfigurationElement = null;
private Expression fContextualLaunchExpr = null;
private Expression fStandardLaunchExpr = null;
@@ -82,6 +82,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
LaunchShortcutAction action = new LaunchShortcutAction(fMode, fShortcut);
if (action.isEnabled()) {
@@ -97,7 +98,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
* The configuration element defining this tab.
*/
private IConfigurationElement fConfig;
- private /* <Pair> */ List fContextLabels;
+ private/* <Pair> */List<Pair> fContextLabels;
/**
* Constructs a launch configuration tab extension based
@@ -116,11 +117,9 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
* Registers command handlers for launch shortcut key bindings
*/
private void registerLaunchCommandHandlers() {
- Iterator modes = getModes().iterator();
IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getAdapter(IHandlerService.class);
if(handlerService != null) {
- while (modes.hasNext()) {
- String mode = (String) modes.next();
+ for (String mode : getModes()) {
String id = getId() + "." + mode; //$NON-NLS-1$
IHandler handler = new LaunchCommandHandler(this, mode);
handlerService.activateHandler(id, handler);
@@ -174,21 +173,21 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
}
return fContextualLaunchConfigurationElement;
}
+
/**
* Returns the contextual launch label of this shortcut for the named mode.
- * <p>
- * <samp>
- * <launchShortcut...>
- * <contextualLaunch>
- * <contextLabel mode="run" label="Run Java Application"/>
- * <contextLabel mode="debug" label="Debug Java Application"/>
+ * <pre>
+ * &lt;launchShortcut...&gt;
+ * &lt;contextualLaunch&gt;
+ * &lt;contextLabel mode="run" label="Run Java Application"/&gt;
+ * &lt;contextLabel mode="debug" label="Debug Java Application"/&gt;
* ...
- * </contextualLaunch>
- * </launchShortcut>
- * </samp>
+ * &lt;/contextualLaunch&gt;
+ * &lt;/launchShortcut&gt;
+ * </pre>
*
- * @return the contextual label of this shortcut, or <code>null</code> if not
- * specified
+ * @return the contextual label of this shortcut, or <code>null</code> if
+ * not specified
*/
public String getContextLabel(String mode) {
// remember the list of context labels for this shortcut
@@ -198,16 +197,14 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
return null;
}
IConfigurationElement[] labels = context.getChildren(IConfigurationElementConstants.CONTEXT_LABEL);
- fContextLabels = new ArrayList(labels.length);
+ fContextLabels = new ArrayList<Pair>(labels.length);
for (int i = 0; i < labels.length; i++) {
fContextLabels.add(new Pair(labels[i].getAttribute(IConfigurationElementConstants.MODE),
labels[i].getAttribute(IConfigurationElementConstants.LABEL)));
}
}
// pick out the first occurance of the "name" bound to "mode"
- Iterator iter = fContextLabels.iterator();
- while (iter.hasNext()) {
- Pair p = (Pair) iter.next();
+ for (Pair p : fContextLabels) {
if (p.firstAsString().equals(mode)) {
return p.secondAsString();
}
@@ -221,9 +218,9 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
* @return the set of associated launch configuration type ids
* @since 3.3
*/
- public Set getAssociatedConfigurationTypes() {
+ public Set<String> getAssociatedConfigurationTypes() {
if(fAssociatedTypes == null) {
- fAssociatedTypes = new HashSet();
+ fAssociatedTypes = new HashSet<String>();
IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.CONFIGURATION_TYPES);
String id = null;
for (int i = 0; i < children.length; i++) {
@@ -249,26 +246,23 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
return null;
}
if(fDescriptions == null) {
- fDescriptions = new HashMap();
+ fDescriptions = new HashMap<String, String>();
//get the description for the main element first
String descr = fConfig.getAttribute(IConfigurationElementConstants.DESCRIPTION);
- String lmode = null;
- Set modes = getModes();
if(descr != null) {
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- lmode = (String) iter.next();
+ for (String lmode : getModes()) {
fDescriptions.put(lmode, descr);
}
}
//load descriptions for child description elements
IConfigurationElement[] children = fConfig.getChildren(IConfigurationElementConstants.DESCRIPTION);
for(int i = 0; i < children.length; i++) {
- lmode = children[i].getAttribute(IConfigurationElementConstants.MODE);
+ String lmode = children[i].getAttribute(IConfigurationElementConstants.MODE);
descr = children[i].getAttribute(IConfigurationElementConstants.DESCRIPTION);
fDescriptions.put(lmode, descr);
}
}
- return (String) fDescriptions.get(mode);
+ return fDescriptions.get(mode);
}
/**
@@ -388,10 +382,11 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
* @return list of Strings representing perspective identifiers
* @deprecated The use of the perspectives element has been deprecated since 3.1.
*/
- public List getPerspectives() {
+ @Deprecated
+ public List<String> getPerspectives() {
if (fPerspectives == null) {
IConfigurationElement[] perspectives = getConfigurationElement().getChildren(IConfigurationElementConstants.PERSPECTIVE);
- fPerspectives = new ArrayList(perspectives.length);
+ fPerspectives = new ArrayList<String>(perspectives.length);
for (int i = 0; i < perspectives.length; i++) {
fPerspectives.add(perspectives[i].getAttribute(IConfigurationElementConstants.ID));
}
@@ -418,6 +413,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/**
* @see ILaunchShortcut#launch(IEditorPart, String)
*/
+ @Override
public void launch(IEditorPart editor, String mode) {
ILaunchShortcut shortcut = getDelegate();
if (shortcut != null) {
@@ -428,6 +424,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/**
* @see ILaunchShortcut#launch(ISelection, String)
*/
+ @Override
public void launch(ISelection selection, String mode) {
ILaunchShortcut shortcut = getDelegate();
if (shortcut != null) {
@@ -440,14 +437,14 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
*
* @return the set of modes this shortcut supports
*/
- public Set getModes() {
+ public Set<String> getModes() {
if (fModes == null) {
String modes= getConfigurationElement().getAttribute(IConfigurationElementConstants.MODES);
if (modes == null) {
- return new HashSet(0);
+ return Collections.EMPTY_SET;
}
StringTokenizer tokenizer= new StringTokenizer(modes, ","); //$NON-NLS-1$
- fModes = new HashSet(tokenizer.countTokens());
+ fModes = new HashSet<String>(tokenizer.countTokens());
while (tokenizer.hasMoreTokens()) {
fModes.add(tokenizer.nextToken().trim());
}
@@ -469,6 +466,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
* Only for debugging
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
return getId();
}
@@ -476,6 +474,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
+ @Override
public String getLocalId() {
return getId();
}
@@ -483,6 +482,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
+ @Override
public String getPluginId() {
return fConfig.getContributor().getName();
}
@@ -490,6 +490,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public ILaunchConfiguration[] getLaunchConfigurations(ISelection selection) {
ILaunchShortcut delegate = getDelegate();
if(delegate instanceof ILaunchShortcut2) {
@@ -501,6 +502,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchConfigurations(org.eclipse.ui.IEditorPart)
*/
+ @Override
public ILaunchConfiguration[] getLaunchConfigurations(IEditorPart editorpart) {
ILaunchShortcut delegate = getDelegate();
if(delegate instanceof ILaunchShortcut2) {
@@ -512,6 +514,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public IResource getLaunchableResource(ISelection selection) {
ILaunchShortcut delegate = getDelegate();
if(delegate instanceof ILaunchShortcut2) {
@@ -523,6 +526,7 @@ public class LaunchShortcutExtension implements ILaunchShortcut2, IPluginContrib
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchShortcut2#getLaunchableResource(org.eclipse.ui.IEditorPart)
*/
+ @Override
public IResource getLaunchableResource(IEditorPart editorpart) {
ILaunchShortcut delegate = getDelegate();
if(delegate instanceof ILaunchShortcut2) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
index 0a4b61e00..47f78e24d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchShortcutSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,7 +41,6 @@ import com.ibm.icu.text.MessageFormat;
* @see {@link org.eclipse.debug.internal.ui.actions.ContextLaunchingAction}
*
* @since 3.3
- * CONTEXTLAUNCHING
*/
public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDialog {
@@ -53,7 +52,7 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
private String fModeName = null;
private String fMode = null;
private IResource fResource = null;
- private List fShortcuts = null;
+ private List<LaunchShortcutExtension> fShortcuts = null;
private Text fDescriptionText = null;
/**
@@ -62,7 +61,7 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
* @param resource
* @param mode
*/
- public LaunchShortcutSelectionDialog(List shortcuts, IResource resource, String mode) {
+ public LaunchShortcutSelectionDialog(List<LaunchShortcutExtension> shortcuts, IResource resource, String mode) {
super(DebugUIPlugin.getShell());
setShellStyle(getShellStyle() | SWT.RESIZE);
fShortcuts = shortcuts;
@@ -73,12 +72,13 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
if (lmode != null) {
fModeName = DebugUIPlugin.removeAccelerators(lmode.getLabel());
}
- setTitle(MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_0, new String[] {fModeName}));
+ setTitle(MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_0, new Object[] { fModeName }));
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_LAUNCH_METHOD_DIALOG;
}
@@ -86,6 +86,7 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return DIALOG_SETTINGS;
}
@@ -93,9 +94,11 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugListSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
+ @Override
protected void addViewerListeners(StructuredViewer viewer) {
super.addViewerListeners(viewer);
viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (!selection.isEmpty()) {
@@ -110,6 +113,7 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addCustomFooterControls(Composite parent) {
super.addCustomFooterControls(parent);
Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_2, 1, 1, GridData.FILL_BOTH);
@@ -122,6 +126,7 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fShortcuts;
}
@@ -129,18 +134,21 @@ public class LaunchShortcutSelectionDialog extends AbstractDebugListSelectionDia
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
if(fResource == null) {
- return MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_4, new String[] {fModeName.toLowerCase()});
+ return MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_4, new Object[] { fModeName.toLowerCase() });
}
else {
- return MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_1, new String[] {fModeName.toLowerCase(), fResource.getName()});
+ return MessageFormat.format(LaunchConfigurationsMessages.LaunchShortcutSelectionDialog_1, new Object[] {
+ fModeName.toLowerCase(), fResource.getName() });
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugListSelectionDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
getButton(IDialogConstants.OK_ID).setEnabled(!getViewer().getSelection().isEmpty());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java
index b6bfec2b0..9104e38e1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchTabContribution.java
@@ -30,6 +30,7 @@ public class LaunchTabContribution implements IPluginContribution {
/**
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
+ @Override
public String getLocalId() {
return fTab.getIdentifier();
}
@@ -37,6 +38,7 @@ public class LaunchTabContribution implements IPluginContribution {
/**
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
+ @Override
public String getPluginId() {
return fTab.getPluginIdentifier();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
index 5991d5ea7..1a15ac133 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/OrganizeFavoritesAction.java
@@ -32,6 +32,7 @@ public class OrganizeFavoritesAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
LaunchHistory history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(fGroupId);
FavoritesDialog dialog = new FavoritesDialog(DebugUIPlugin.getShell(), history);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
index 2a743d9f2..8e13a460e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/PerspectiveManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -98,7 +98,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
private ILaunchConfigurationType fType = null;
private ILaunchDelegate fDelegate = null;
- private Map fPerspectives = null;
+ private Map<Set<String>, String> fPerspectives = null;
/**
* Constructor
@@ -106,10 +106,10 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @param delegate
* @param modes
*/
- public PerspectiveContext(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
+ public PerspectiveContext(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes) {
fType = type;
fDelegate = delegate;
- fPerspectives = new HashMap();
+ fPerspectives = new HashMap<Set<String>, String>();
fPerspectives.put(modes, null);
}
@@ -121,6 +121,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* </ol>
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
ILaunchDelegate delegate = null;
ILaunchConfigurationType type = null;
@@ -148,9 +149,24 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
return super.equals(object);
}
+ @Override
+ public int hashCode() {
+ if (fType != null) {
+ int hash = fType.getIdentifier().hashCode();
+ if (fDelegate != null) {
+ hash += fDelegate.hashCode();
+ }
+ return hash;
+ }
+ return super.hashCode();
+ }
+
public ILaunchConfigurationType getLaunchConfigurationType() {return fType;}
public ILaunchDelegate getLaunchDelegate() {return fDelegate;}
- public Map getPersepctiveMap() {return fPerspectives;}
+
+ public Map<Set<String>, String> getPersepctiveMap() {
+ return fPerspectives;
+ }
/**
* Creates a new mapping of the specified perspective id to the specified mode set.
@@ -158,9 +174,9 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @param modes the set of modes
* @param pid the id of the perspective
*/
- public void setPerspective(Set modes, String pid) {
+ public void setPerspective(Set<String> modes, String pid) {
if(fPerspectives == null) {
- fPerspectives = new HashMap();
+ fPerspectives = new HashMap<Set<String>, String>();
}
fPerspectives.put(modes, pid);
}
@@ -171,9 +187,9 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @return the perspective id associated with the given mode set, or
* <code>null</code>, if there isn't one
*/
- public String getPerspective(Set modes) {
+ public String getPerspective(Set<String> modes) {
if(fPerspectives != null) {
- return (String) fPerspectives.get(modes);
+ return fPerspectives.get(modes);
}
return null;
}
@@ -192,6 +208,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
setRule(AsynchronousSchedulingRuleFactory.getDefault().newSerialPerObjectRule(this));
}
+ @Override
protected IStatus run(final IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
@@ -201,7 +218,8 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
return Status.CANCEL_STATUS;
}
asyncDisplay.asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
IStatus result = null;
Throwable throwable = null;
try {
@@ -236,7 +254,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @since 3.3
*/
- private Set fPerspectiveContexts = null;
+ private Set<PerspectiveContext> fPerspectiveContexts = null;
/**
* id for the 'delegate' attribute
@@ -256,7 +274,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* Maps each launch to its perspective context activation. These
* are disabled when a launch terminates.
*/
- private Map fLaunchToContextActivations = new HashMap();
+ private Map<ILaunch, IContextActivation[]> fLaunchToContextActivations = new HashMap<ILaunch, IContextActivation[]>();
/**
* Called by the debug ui plug-in on startup.
@@ -284,14 +302,16 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @see ILaunchListener#launchRemoved(ILaunch)
*/
+ @Override
public synchronized void launchRemoved(final ILaunch launch) {
ISuspendTrigger trigger = (ISuspendTrigger) launch.getAdapter(ISuspendTrigger.class);
if (trigger != null) {
trigger.removeSuspendTriggerListener(this);
}
Runnable r= new Runnable() {
+ @Override
public void run() {
- IContextActivation[] activations = (IContextActivation[]) fLaunchToContextActivations.remove(launch);
+ IContextActivation[] activations = fLaunchToContextActivations.remove(launch);
if (activations != null) {
for (int i = 0; i < activations.length; i++) {
IContextActivation activation = activations[i];
@@ -308,6 +328,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @see ILaunchListener#launchChanged(ILaunch)
*/
+ @Override
public void launchChanged(ILaunch launch) {}
/**
@@ -316,6 +337,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @see ILaunchListener#launchAdded(ILaunch)
*/
+ @Override
public synchronized void launchAdded(ILaunch launch) {
ISuspendTrigger trigger = (ISuspendTrigger) launch.getAdapter(ISuspendTrigger.class);
if (trigger != null) {
@@ -340,6 +362,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
final String id = perspectiveId;
// switch
Job switchJob = new MyUIJob("Perspective Switch Job") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchWindow window = getWindowForPerspective(id);
if (id != null && window != null && shouldSwitchPerspective(window, id, IInternalDebugUIConstants.PREF_SWITCH_TO_PERSPECTIVE)) {
@@ -371,7 +394,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
} catch (WorkbenchException e) {
DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(),
LaunchConfigurationsMessages.PerspectiveManager_Error_1,
- MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_to_perspective___0__2, new String[]{id}),
+ MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_to_perspective___0__2, new Object[] { id }),
e);
}
}
@@ -405,9 +428,10 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*/
protected void switchFailed(final Throwable t, final String launchName) {
sync(new Runnable() {
+ @Override
public void run() {
DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), LaunchConfigurationsMessages.PerspectiveManager_Error_1,
- MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4, new String[] {launchName}),
+ MessageFormat.format(LaunchConfigurationsMessages.PerspectiveManager_Unable_to_switch_perpsectives_as_specified_by_launch___0__4, new Object[] { launchName }),
t);
}});
}
@@ -432,6 +456,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
// window can be accessed
final String targetId = perspectiveId;
Job switchJob = new MyUIJob("Perspective Switch Job") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchWindow window = null;
if (targetId != null) {
@@ -601,7 +626,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
return false;
}
String perspectiveDesc = getPerspectiveDescription(perspectiveId);
- String[] args;
+ Object[] args;
if (perspectiveDesc != null) {
args = new String[] { perspectiveName , perspectiveDesc };
}
@@ -735,7 +760,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
if (config == null) {
return null;
}
- Set modes = launch.getLaunchConfiguration().getModes();
+ Set<String> modes = launch.getLaunchConfiguration().getModes();
modes.add(launch.getLaunchMode());
String perspectiveId = getLaunchPerspective(config.getType(), modes, resolveLaunchDelegate(launch));
if (perspectiveId != null && perspectiveId.equals(IDebugUIConstants.PERSPECTIVE_NONE)) {
@@ -754,7 +779,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @since 3.3
*/
- public String getLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate) {
+ public String getLaunchPerspective(ILaunchConfigurationType type, Set<String> modes, ILaunchDelegate delegate) {
String id = null;
PerspectiveContext context = findContext(new PerspectiveContext(type, delegate, modes));
if(context == null || (context != null && !context.getPersepctiveMap().containsKey(modes))) {
@@ -785,7 +810,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @since 3.0
*/
public String getLaunchPerspective(ILaunchConfigurationType type, String mode) {
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
return getLaunchPerspective(type, modes, null);
}
@@ -807,7 +832,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @since 3.0
*/
public void setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective) {
- HashSet modes = new HashSet();
+ HashSet<String> modes = new HashSet<String>();
modes.add(mode);
setLaunchPerspective(type, modes, null, perspective);
}
@@ -825,7 +850,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @since 3.3
*/
- public void setLaunchPerspective(ILaunchConfigurationType type, Set modes, ILaunchDelegate delegate, String perspectiveid) {
+ public void setLaunchPerspective(ILaunchConfigurationType type, Set<String> modes, ILaunchDelegate delegate, String perspectiveid) {
PerspectiveContext context = new PerspectiveContext(type, delegate, modes);
String id = null;
if(!IDebugUIConstants.PERSPECTIVE_NONE.equals(perspectiveid)) {
@@ -855,16 +880,12 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @since 3.3
*/
private PerspectiveContext findContext(PerspectiveContext context) {
- PerspectiveContext item = null;
- Object o = null;
- for(Iterator iter = fPerspectiveContexts.iterator(); iter.hasNext();) {
- o = iter.next();
- if(context.equals(o)) {
- item = (PerspectiveContext) o;
- return item;
+ for (PerspectiveContext c : fPerspectiveContexts) {
+ if (context.equals(c)) {
+ return c;
}
}
- return item;
+ return null;
}
/**
@@ -879,20 +900,16 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
Document doc = DebugUIPlugin.getDocument();
Element root = doc.createElement(IConfigurationElementConstants.LAUNCH_PERSPECTIVES);
doc.appendChild(root);
- PerspectiveContext context = null;
- Map modesets = null;
+ Map<Set<String>, String> modesets = null;
Element element = null;
- Set modes = null;
String id = null;
ILaunchConfigurationType type = null;
ILaunchDelegate delegate = null;
- for(Iterator iter = fPerspectiveContexts.iterator(); iter.hasNext();) {
- context = (PerspectiveContext) iter.next();
+ for (PerspectiveContext context : fPerspectiveContexts) {
modesets = context.getPersepctiveMap();
type = context.getLaunchConfigurationType();
delegate = context.getLaunchDelegate();
- for(Iterator iter2 = modesets.keySet().iterator(); iter2.hasNext();) {
- modes = (Set) iter2.next();
+ for (Set<String> modes : modesets.keySet()) {
id = context.getPerspective(modes);
String defaultId = getDefaultLaunchPerspective(type, delegate, modes);
if(id == null && defaultId != null) {
@@ -916,25 +933,6 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
}
/**
- * Returns the default perspective to switch to when a configuration of the given
- * type is launched in the given mode, or <code>null</code> if none.
- *
- * <p>
- * Calling this method is equivalent to using the new method <code>getDefaultLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes)</code>
- * with a null delegate and the specified mode comprising a set of one mode
- * </p>
- *
- * @param type launch configuration type
- * @param mode launch mode
- * @return perspective identifier, or <code>null</code>
- */
- public String getDefaultLaunchPerspective(ILaunchConfigurationType type, String mode) {
- HashSet modes = new HashSet();
- modes.add(mode);
- return getDefaultLaunchPerspective(type, null, modes);
- }
-
- /**
* Returns the default perspective to switch to when a configuration of the given type is launched by the specified
* launch delegate in the given mode set, or <code>null</code> if none
* @param type the type
@@ -944,7 +942,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @since 3.3
*/
- public String getDefaultLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
+ public String getDefaultLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes) {
String id = null;
if(delegate != null) {
id = delegate.getPerspectiveId(modes);
@@ -970,7 +968,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
* @throws CoreException
*/
private ILaunchDelegate resolveLaunchDelegate(ILaunch launch) throws CoreException {
- Set modes = launch.getLaunchConfiguration().getModes();
+ Set<String> modes = launch.getLaunchConfiguration().getModes();
modes.add(launch.getLaunchMode());
ILaunchConfigurationType type = launch.getLaunchConfiguration().getType();
ILaunchDelegate[] delegates = LaunchConfigurationManager.filterLaunchDelegates(type, modes);
@@ -992,7 +990,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*/
private void initPerspectives() {
if(fPerspectiveContexts == null) {
- fPerspectiveContexts = new HashSet();
+ fPerspectiveContexts = new HashSet<PerspectiveContext>();
String xml = DebugUIPlugin.getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_LAUNCH_PERSPECTIVES);
if (xml != null && xml.length() > 0) {
try {
@@ -1001,7 +999,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType lctype = null;
ILaunchDelegate ldelegate = null;
- Set modes = null;
+ Set<String> modes = null;
Node node = null;
Element element = null;
for (int i = 0; i < list.getLength(); ++i) {
@@ -1036,8 +1034,8 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
*
* @since 3.3
*/
- private Set parseModes(String modes) {
- HashSet modeset = new HashSet();
+ private Set<String> parseModes(String modes) {
+ HashSet<String> modeset = new HashSet<String>();
String[] ms = modes.split(","); //$NON-NLS-1$
for(int i = 0; i < ms.length; i++) {
modeset.add(ms[i].trim());
@@ -1046,14 +1044,16 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
}
/**
- * Creates a standard comma separated list of the modes from the specified set
+ * Creates a standard comma separated list of the modes from the specified
+ * set
+ *
* @param modes the set to write to string
- * @return the
+ * @return the mode set as a string
*/
- private String createModesetString(Set modes) {
+ private String createModesetString(Set<String> modes) {
String str = IInternalDebugCoreConstants.EMPTY_STRING;
if(modes != null) {
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
+ for (Iterator<String> iter = modes.iterator(); iter.hasNext();) {
str += iter.next();
if(iter.hasNext()) {
str += ","; //$NON-NLS-1$
@@ -1077,6 +1077,7 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.ISuspendTriggerListener#suspended(org.eclipse.debug.core.ILaunch, java.lang.Object)
*/
+ @Override
public void suspended(ILaunch launch, Object context) {
handleBreakpointHit(launch);
}
@@ -1084,21 +1085,25 @@ public class PerspectiveManager implements ILaunchListener, ISuspendTriggerListe
/**
* @see org.eclipse.core.resources.ISaveParticipant#doneSaving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void doneSaving(ISaveContext context) {}
/**
* @see org.eclipse.core.resources.ISaveParticipant#prepareToSave(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void prepareToSave(ISaveContext context) throws CoreException {}
/**
* @see org.eclipse.core.resources.ISaveParticipant#rollback(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void rollback(ISaveContext context) {}
/**
* @see org.eclipse.core.resources.ISaveParticipant#saving(org.eclipse.core.resources.ISaveContext)
*/
+ @Override
public void saving(ISaveContext context) throws CoreException {
try {
DebugUIPlugin.getDefault().getPreferenceStore().putValue(IInternalDebugUIConstants.PREF_LAUNCH_PERSPECTIVES, generatePerspectiveXML());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
index 5e692cc09..e496a1017 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SaveScopeResourcesHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -86,6 +86,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
*/
+ @Override
protected IContentProvider getContentProvider() {
return fContentProvider;
}
@@ -93,6 +94,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
*/
+ @Override
protected IBaseLabelProvider getLabelProvider() {
return fLabelProvider;
}
@@ -100,6 +102,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return SETTINGS_ID;
}
@@ -107,6 +110,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_RESOURCES_TO_SAVE_DIALOG;
}
@@ -114,6 +118,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fInput;
}
@@ -121,6 +126,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.SaveScopeResourcesHandler_2;
}
@@ -128,11 +134,13 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addCustomFooterControls(Composite parent) {
super.addCustomFooterControls(parent);
fSavePref = new Button(parent, SWT.CHECK);
fSavePref.setText(LaunchConfigurationsMessages.SaveScopeResourcesHandler_1);
fSavePref.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
getCheckBoxTableViewer().setAllChecked(fSavePref.getSelection());
}
@@ -142,6 +150,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#okPressed()
*/
+ @Override
protected void okPressed() {
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
String val = (fSavePref.getSelection() ? MessageDialogWithToggle.ALWAYS : MessageDialogWithToggle.PROMPT);
@@ -152,6 +161,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
+ @Override
protected void addViewerListeners(StructuredViewer viewer) {
// Override to remove listener that affects the ok button
}
@@ -159,6 +169,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog#isValid()
*/
+ @Override
protected boolean isValid() {
return true;
}
@@ -175,6 +186,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
*
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
// retrieve config and projects
ILaunchConfiguration config = null;
@@ -202,7 +214,8 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
return Boolean.FALSE;
}
else {
- boolean cancel = DebugUIPlugin.preLaunchSave();
+ @SuppressWarnings("deprecation")
+ boolean cancel = DebugUIPlugin.preLaunchSave();
return Boolean.valueOf(cancel);
}
}
@@ -215,7 +228,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
* @return the list of dirty editors for this launch to save, never null
*/
protected IResource[] getScopedDirtyResources(IProject[] projects) {
- HashSet dirtyres = new HashSet();
+ HashSet<IResource> dirtyres = new HashSet<IResource>();
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for(int l = 0; l < windows.length; l++) {
IWorkbenchPage[] pages = windows[l].getPages();
@@ -233,7 +246,7 @@ public class SaveScopeResourcesHandler implements IStatusHandler {
}
}
}
- return (IResource[])dirtyres.toArray(new IResource[dirtyres.size()]);
+ return dirtyres.toArray(new IResource[dirtyres.size()]);
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
index a01a608b8..b7e23a1a0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectFavoritesDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,6 +40,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
* Content provider for table
*/
protected class LaunchConfigurationContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
ILaunchConfiguration[] all = null;
try {
@@ -48,7 +49,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
DebugUIPlugin.log(e);
return new ILaunchConfiguration[0];
}
- List list = new ArrayList(all.length);
+ List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>(all.length);
ViewerFilter filter = new LaunchGroupFilter(fHistory.getLaunchGroup());
for (int i = 0; i < all.length; i++) {
if (filter.select(null, null, all[i])) {
@@ -61,12 +62,14 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
return objs;
}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
private LaunchHistory fHistory;
- private List fCurrentFavoriteSet;
+ private List<ILaunchConfiguration> fCurrentFavoriteSet;
/**
* Constructor
@@ -74,11 +77,11 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
* @param history
* @param favorites
*/
- public SelectFavoritesDialog(Shell parentShell, LaunchHistory history, List favorites) {
+ public SelectFavoritesDialog(Shell parentShell, LaunchHistory history, List<ILaunchConfiguration> favorites) {
super(parentShell);
fHistory = history;
fCurrentFavoriteSet = favorites;
- setTitle(MessageFormat.format(LaunchConfigurationsMessages.FavoritesDialog_0, new String[]{getModeLabel()}));
+ setTitle(MessageFormat.format(LaunchConfigurationsMessages.FavoritesDialog_0, new Object[] { getModeLabel() }));
setShowSelectAllButtons(true);
}
@@ -94,6 +97,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IDebugUIConstants.PLUGIN_ID + ".SELECT_FAVORITESS_DIALOG"; //$NON-NLS-1$
}
@@ -101,6 +105,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fHistory.getLaunchGroup().getMode();
}
@@ -108,6 +113,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
*/
+ @Override
protected IContentProvider getContentProvider() {
return new LaunchConfigurationContentProvider();
}
@@ -115,6 +121,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_FAVORITES_DIALOG;
}
@@ -122,6 +129,7 @@ public class SelectFavoritesDialog extends AbstractDebugCheckboxSelectionDialog
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.FavoritesDialog_7;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
index d4d63ea9b..6b26abbc1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,7 @@
package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.ArrayList;
-import java.util.Iterator;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -41,19 +41,29 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
* Builds labels for list control
*/
class OptionsLabelProvider implements ILabelProvider {
+ @Override
public Image getImage(Object element) {return null;}
+ @Override
public String getText(Object element) {
- Set modes = (Set) element;
- List names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
+ Set<?> vals = (Set<?>) element;
+ Set<String> modes = new HashSet<String>(vals.size());
+ for (Object o : vals) {
+ modes.add((String) o);
+ }
+ List<String> names = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(modes);
return names.toString();
}
+ @Override
public void addListener(ILabelProviderListener listener) {}
+ @Override
public void dispose() {}
+ @Override
public boolean isLabelProperty(Object element, String property) {return false;}
+ @Override
public void removeListener(ILabelProviderListener listener) {}
}
- private List fValidModes = null;
+ private List<Set<String>> fValidModes = null;
/**
* Constructor
@@ -67,11 +77,9 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
super(parentShell);
super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3);
setShellStyle(getShellStyle() | SWT.RESIZE);
- fValidModes = new ArrayList();
- Set modes = configuration.getType().getSupportedModeCombinations();
- Set modeset = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
+ fValidModes = new ArrayList<Set<String>>();
+ Set<Set<String>> modes = configuration.getType().getSupportedModeCombinations();
+ for (Set<String> modeset : modes) {
if(modeset.contains(mode)) {
fValidModes.add(modeset);
}
@@ -81,6 +89,7 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCH_MODES_DIALOG"; //$NON-NLS-1$
}
@@ -88,6 +97,7 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
*/
+ @Override
protected IBaseLabelProvider getLabelProvider() {
return new OptionsLabelProvider();
}
@@ -95,6 +105,7 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fValidModes.toArray();
}
@@ -102,6 +113,7 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_LAUNCH_MODES_DIALOG;
}
@@ -109,6 +121,7 @@ public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.SelectLaunchOptionsDialog_4;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
index 5f4e403db..8d4826c70 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -58,7 +58,9 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
* Builds labels for table control
*/
class DelegatesLabelProvider implements ILabelProvider {
+ @Override
public Image getImage(Object element) {return null;}
+ @Override
public String getText(Object element) {
if(element instanceof ILaunchDelegate) {
ILaunchDelegate ldp = (ILaunchDelegate) element;
@@ -70,9 +72,13 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
}
return element.toString();
}
+ @Override
public void addListener(ILabelProviderListener listener) {}
+ @Override
public void dispose() {}
+ @Override
public boolean isLabelProperty(Object element, String property) {return false;}
+ @Override
public void removeListener(ILabelProviderListener listener) {}
}
@@ -98,6 +104,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
*/
+ @Override
protected Point getInitialSize() {
IDialogSettings settings = getDialogBoundsSettings();
if(settings != null) {
@@ -118,6 +125,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IDebugUIConstants.PLUGIN_ID + ".SELECT_LAUNCHERS_DIALOG"; //$NON-NLS-1$
}
@@ -125,6 +133,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_LAUNCHERS_DIALOG;
}
@@ -132,6 +141,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
*/
+ @Override
protected IBaseLabelProvider getLabelProvider() {
return new DelegatesLabelProvider();
}
@@ -139,6 +149,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fDelegates;
}
@@ -146,6 +157,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomHeaderControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addCustomHeaderControls(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 2, 1, GridData.FILL_HORIZONTAL, 0, 0);
SWTFactory.createWrapLabel(comp, LaunchConfigurationsMessages.SelectLaunchersDialog_2, 2);
@@ -157,6 +169,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
GridData gd = (GridData) this.configspecific.getLayoutData();
gd.grabExcessHorizontalSpace = true;
this.configspecific.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
boolean checked = ((Button)e.widget).getSelection();
getViewer().getControl().setEnabled(checked);
@@ -168,6 +181,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
link.setText(LaunchConfigurationsMessages.SelectLaunchersDialog_4);
link.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, true, false));
link.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
SWTFactory.showPreferencePage("org.eclipse.debug.ui.LaunchDelegatesPreferencePage"); //$NON-NLS-1$
if(!SelectLaunchersDialog.this.configspecific.getSelection()) {
@@ -189,9 +203,10 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/**
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
ILaunchDelegate delegate = null;
- Set modes = getCurrentModeSet();
+ Set<String> modes = getCurrentModeSet();
if(configspecific.getSelection()) {
delegate = getSelectedDelegate();
if(delegate != null) {
@@ -231,6 +246,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomFooterControls(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void addCustomFooterControls(Composite parent) {
Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.SelectLaunchersDialog_5, 1, 1, GridData.FILL_BOTH);
this.description = SWTFactory.createText(group, SWT.WRAP | SWT.READ_ONLY, 1, GridData.FILL_BOTH);
@@ -240,8 +256,8 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/**
* @return the complete set of modes that the associated launch configuration is concerned with
*/
- protected Set getCurrentModeSet() {
- Set modes = new HashSet();
+ protected Set<String> getCurrentModeSet() {
+ Set<String> modes = new HashSet<String>();
try {
modes = fConfiguration.getModes();
modes.add(fLaunchMode);
@@ -253,9 +269,11 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.AbstractDebugCheckboxSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
*/
+ @Override
protected void addViewerListeners(StructuredViewer viewer) {
// Override super to use custom listeners
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection ss = (IStructuredSelection) event.getSelection();
if(ss != null && !ss.isEmpty()) {
@@ -272,6 +290,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#initializeControls()
*/
+ @Override
protected void initializeControls() {
final Viewer viewer = getViewer();
try {
@@ -291,6 +310,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.SelectLaunchersDialog_launchers;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java
index d1a89c6af..2de39f6b4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetComparator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,14 +19,15 @@ import org.eclipse.ui.IWorkingSet;
* Comparator for refresh scope launch configuration attribute
* <code>ATTR_REFRESH_SCOPE</code>.
*/
-public class WorkingSetComparator implements Comparator {
+public class WorkingSetComparator implements Comparator<String> {
/* (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;
+ @Override
+ public int compare(String o1, String o2) {
+ String one= o1;
+ String two= o2;
if (one == null || two == null) {
if (one == two) {
return 0;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
index 7220e1cfd..d57ce7108 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ public class WorkingSetsFilter extends ViewerFilter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if(element instanceof ILaunchConfigurationType) {
return true;
@@ -60,7 +61,7 @@ public class WorkingSetsFilter extends ViewerFilter {
return true;
}
//remove breakpoint working sets
- ArrayList ws = new ArrayList();
+ ArrayList<IWorkingSet> ws = new ArrayList<IWorkingSet>();
for (int i = 0; i < wsets.length; i++) {
if(!IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(wsets[i].getId())) {
ws.add(wsets[i]);
@@ -70,7 +71,7 @@ public class WorkingSetsFilter extends ViewerFilter {
return true;
}
for (int i = 0; i < resources.length; i++) {
- if(workingSetContains((IWorkingSet[]) ws.toArray(new IWorkingSet[ws.size()]), resources[i])) {
+ if(workingSetContains(ws.toArray(new IWorkingSet[ws.size()]), resources[i])) {
return true;
}
}
@@ -88,7 +89,7 @@ public class WorkingSetsFilter extends ViewerFilter {
* @since 3.2
*/
public static boolean workingSetContains(IWorkingSet[] wsets, IResource res) {
- ArrayList parents = new ArrayList();
+ ArrayList<IResource> parents = new ArrayList<IResource>();
parents.add(res);
while(res != null) {
res = res.getParent();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
index 8590ebb0e..16eb2d14a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,147 +37,166 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingType;
* @since 3.1
*/
public class MemoryRenderingManager extends AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingManager {
-
- // map of rendering type ids to valid rendering types
- private Map fRenderingTypes = new HashMap();
-
- // list of renderingBindings
- private List fBindings = new ArrayList();
-
- // singleton manager
- private static MemoryRenderingManager fgDefault;
-
- // elements in the memory renderings extension point
- public static final String ELEMENT_MEMORY_RENDERING_TYPE = "renderingType"; //$NON-NLS-1$
- public static final String ELEMENT_RENDERING_BINDINGS = "renderingBindings"; //$NON-NLS-1$
-
- /**
- * Returns the memory rendering manager.
- *
- * @return the memory rendering manager
- */
- public static IMemoryRenderingManager getDefault() {
- if (fgDefault == null) {
- fgDefault = new MemoryRenderingManager();
- }
- return fgDefault;
- }
- /**
- * Construts a new memory rendering manager. Only to be called by DebugUIPlugin.
- */
- private MemoryRenderingManager() {
- initializeRenderings();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager#createRendering(java.lang.String)
- */
- public IMemoryRendering createRendering(String id) throws CoreException {
- IMemoryRenderingType type = getRenderingType(id);
- if (type != null) {
- return type.createRendering();
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager#getRenderingTypes()
- */
- public IMemoryRenderingType[] getRenderingTypes() {
- Collection types = fRenderingTypes.values();
- return (IMemoryRenderingType[]) types.toArray(new IMemoryRenderingType[types.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager#getRenderingType(java.lang.String)
- */
- public IMemoryRenderingType getRenderingType(String id) {
- return (IMemoryRenderingType) fRenderingTypes.get(id);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) {
- List allTypes = new ArrayList();
- Iterator iterator = fBindings.iterator();
- while (iterator.hasNext()) {
- RenderingBindings binding = (RenderingBindings)iterator.next();
- IMemoryRenderingType[] renderingTypes = binding.getDefaultRenderingTypes(block);
- for (int i = 0; i < renderingTypes.length; i++) {
- IMemoryRenderingType type = renderingTypes[i];
- if (!allTypes.contains(type)) {
- allTypes.add(type);
- }
- }
- }
- return (IMemoryRenderingType[]) allTypes.toArray(new IMemoryRenderingType[allTypes.size()]);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
- Iterator iterator = fBindings.iterator();
- while (iterator.hasNext()) {
- RenderingBindings binding = (RenderingBindings)iterator.next();
- IMemoryRenderingType renderingType = binding.getPrimaryRenderingType(block);
- if (renderingType != null) {
- return renderingType;
- }
- }
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
- List allTypes = new ArrayList();
- Iterator iterator = fBindings.iterator();
- while (iterator.hasNext()) {
- RenderingBindings binding = (RenderingBindings)iterator.next();
- IMemoryRenderingType[] renderingTypes = binding.getRenderingTypes(block);
- for (int i = 0; i < renderingTypes.length; i++) {
- IMemoryRenderingType type = renderingTypes[i];
- if (!allTypes.contains(type)) {
- allTypes.add(type);
- }
- }
- }
- return (IMemoryRenderingType[]) allTypes.toArray(new IMemoryRenderingType[allTypes.size()]);
- }
-
- /**
- * Processes memory rendering contributions.
- */
- private void initializeRenderings() {
- IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_MEMORY_RENDERINGS);
- IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < configurationElements.length; i++) {
- IConfigurationElement element= configurationElements[i];
- String name = element.getName();
- if (name.equals(ELEMENT_MEMORY_RENDERING_TYPE)) {
- MemoryRenderingType type = new MemoryRenderingType(element);
- try {
- type.validate();
- fRenderingTypes.put(type.getId(), type);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- } else if (name.equals(ELEMENT_RENDERING_BINDINGS)) {
- RenderingBindings bindings = new RenderingBindings(element);
- try {
- bindings.validate();
- fBindings.add(bindings);
+
+ // map of rendering type ids to valid rendering types
+ private Map<String, MemoryRenderingType> fRenderingTypes = new HashMap<String, MemoryRenderingType>();
+
+ // list of renderingBindings
+ private List<RenderingBindings> fBindings = new ArrayList<RenderingBindings>();
+
+ // singleton manager
+ private static MemoryRenderingManager fgDefault;
+
+ // elements in the memory renderings extension point
+ public static final String ELEMENT_MEMORY_RENDERING_TYPE = "renderingType"; //$NON-NLS-1$
+ public static final String ELEMENT_RENDERING_BINDINGS = "renderingBindings"; //$NON-NLS-1$
+
+ /**
+ * Returns the memory rendering manager.
+ *
+ * @return the memory rendering manager
+ */
+ public static IMemoryRenderingManager getDefault() {
+ if (fgDefault == null) {
+ fgDefault = new MemoryRenderingManager();
+ }
+ return fgDefault;
+ }
+
+ /**
+ * Construts a new memory rendering manager. Only to be called by
+ * DebugUIPlugin.
+ */
+ private MemoryRenderingManager() {
+ initializeRenderings();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingManager#createRendering(java
+ * .lang.String)
+ */
+ public IMemoryRendering createRendering(String id) throws CoreException {
+ IMemoryRenderingType type = getRenderingType(id);
+ if (type != null) {
+ return type.createRendering();
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingManager#getRenderingTypes()
+ */
+ @Override
+ public IMemoryRenderingType[] getRenderingTypes() {
+ Collection<MemoryRenderingType> types = fRenderingTypes.values();
+ return types.toArray(new IMemoryRenderingType[types.size()]);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingManager#getRenderingType(
+ * java.lang.String)
+ */
+ @Override
+ public IMemoryRenderingType getRenderingType(String id) {
+ return fRenderingTypes.get(id);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#
+ * getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
+ */
+ @Override
+ public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) {
+ List<IMemoryRenderingType> allTypes = new ArrayList<IMemoryRenderingType>();
+ Iterator<RenderingBindings> iterator = fBindings.iterator();
+ while (iterator.hasNext()) {
+ RenderingBindings binding = iterator.next();
+ IMemoryRenderingType[] renderingTypes = binding.getDefaultRenderingTypes(block);
+ for (int i = 0; i < renderingTypes.length; i++) {
+ IMemoryRenderingType type = renderingTypes[i];
+ if (!allTypes.contains(type)) {
+ allTypes.add(type);
+ }
+ }
+ }
+ return allTypes.toArray(new IMemoryRenderingType[allTypes.size()]);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#
+ * getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock)
+ */
+ @Override
+ public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
+ for (RenderingBindings binding : fBindings) {
+ IMemoryRenderingType renderingType = binding.getPrimaryRenderingType(block);
+ if (renderingType != null) {
+ return renderingType;
+ }
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#
+ * getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
+ */
+ @Override
+ public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
+ List<IMemoryRenderingType> allTypes = new ArrayList<IMemoryRenderingType>();
+ for (RenderingBindings binding : fBindings) {
+ IMemoryRenderingType[] renderingTypes = binding.getRenderingTypes(block);
+ for (int i = 0; i < renderingTypes.length; i++) {
+ IMemoryRenderingType type = renderingTypes[i];
+ if (!allTypes.contains(type)) {
+ allTypes.add(type);
+ }
+ }
+ }
+ return allTypes.toArray(new IMemoryRenderingType[allTypes.size()]);
+ }
+
+ /**
+ * Processes memory rendering contributions.
+ */
+ private void initializeRenderings() {
+ IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_MEMORY_RENDERINGS);
+ IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
+ for (int i = 0; i < configurationElements.length; i++) {
+ IConfigurationElement element = configurationElements[i];
+ String name = element.getName();
+ if (name.equals(ELEMENT_MEMORY_RENDERING_TYPE)) {
+ MemoryRenderingType type = new MemoryRenderingType(element);
+ try {
+ type.validate();
+ fRenderingTypes.put(type.getId(), type);
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ } else if (name.equals(ELEMENT_RENDERING_BINDINGS)) {
+ RenderingBindings bindings = new RenderingBindings(element);
+ try {
+ bindings.validate();
+ fBindings.add(bindings);
bindings.addListener(new IMemoryRenderingBindingsListener() {
+ @Override
public void memoryRenderingBindingsChanged() {
fireBindingsChanged();
- }});
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- }
+ }
+ });
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
index 85a743eed..5ab614a43 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/MemoryRenderingType.java
@@ -45,21 +45,24 @@ class MemoryRenderingType implements IMemoryRenderingType {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingType#getLabel()
*/
- public String getLabel() {
+ @Override
+ public String getLabel() {
return fConfigurationElement.getAttribute(ATTR_MEM_RENDERING_TYPE_NAME);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingType#getId()
*/
- public String getId() {
+ @Override
+ public String getId() {
return fConfigurationElement.getAttribute(ATTR_MEM_RENDERING_TYPE_ID);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingType#createRendering()
*/
- public IMemoryRendering createRendering() throws CoreException {
+ @Override
+ public IMemoryRendering createRendering() throws CoreException {
if (fDelegate == null) {
fDelegate = (IMemoryRenderingTypeDelegate) fConfigurationElement.createExecutableExtension(ATTR_MEM_RENDERING_TYPE_DELEGATE);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
index 9a0f2b514..2d9d4b31f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/RenderingBindings.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,263 +33,269 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingManager;
import org.eclipse.debug.ui.memory.IMemoryRenderingType;
/**
- * Represents a renderingBindings element of a memoryRenderings
- * contribution.
+ * Represents a renderingBindings element of a memoryRenderings contribution.
*
* @since 3.1
*/
class RenderingBindings extends AbstractMemoryRenderingBindingsProvider implements IMemoryRenderingBindingsProvider {
-
- // element
- protected IConfigurationElement fConfigurationElement;
-
- // cached rendering ids
- private IMemoryRenderingType[] fAllTypes;
- private IMemoryRenderingType[] fRenderingTypes;
- private IMemoryRenderingType[] fDefaultTypes;
-
- // rendering type provider, or null (optional)
- private IMemoryRenderingBindingsProvider fProvider;
-
- // optional exprssion
- private Expression fExpression;
-
- // element attribute
- public static final String ATTR_RENDERING_IDS = "renderingIds"; //$NON-NLS-1$
- public static final String ATTR_DEFAULT_IDS = "defaultIds"; //$NON-NLS-1$
- public static final String ATTR_PRIMARY = "primaryId"; //$NON-NLS-1$
- public static final String ATTR_PROVIDER = "class"; //$NON-NLS-1$
-
- // empty bindings
- private static final IMemoryRenderingType[] EMPTY = new IMemoryRenderingType[0];
-
- /**
- * Constructs a bindings element from the given contribution.
- *
- * @param element contribution
- */
- RenderingBindings(IConfigurationElement element) {
- fConfigurationElement = element;
- }
-
- /**
- * Returns the non-default bindings specified by this contribution.
- *
- * @return the non-default bindings specified by this contribution
- */
- private IMemoryRenderingType[] getBindings() {
- if (fRenderingTypes == null) {
- String ids = fConfigurationElement.getAttribute(ATTR_RENDERING_IDS);
- List list = new ArrayList();
- IMemoryRenderingManager manager = getManager();
- if (ids != null) {
- String[] strings = ids.split(","); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- String id = strings[i].trim();
- IMemoryRenderingType type = manager.getRenderingType(id);
- if (type != null) {
- list.add(type);
- }
- }
- }
- // remove any default bindings, in case of duplicate specification
- IMemoryRenderingType[] defaultBindings = getDefaultBindings();
- for (int i = 0; i < defaultBindings.length; i++) {
- list.remove(defaultBindings[i]);
- }
- fRenderingTypes = (IMemoryRenderingType[]) list.toArray(new IMemoryRenderingType[list.size()]);
- }
- return fRenderingTypes;
- }
-
- /**
- * Returns the default bindings specified by this contribution.
- *
- * @return the default bindings specified by this contribution
- */
- private IMemoryRenderingType[] getDefaultBindings() {
- if (fDefaultTypes == null) {
- String ids = fConfigurationElement.getAttribute(ATTR_DEFAULT_IDS);
- List list = new ArrayList();
- IMemoryRenderingManager manager = getManager();
- if (ids != null) {
- String[] strings = ids.split(","); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- String id = strings[i].trim();
- IMemoryRenderingType type = manager.getRenderingType(id);
- if (type != null) {
- list.add(type);
- }
- }
- }
- // the primary is also considered a default rendering
- String primaryId = getPrimaryId();
- if (primaryId != null) {
- IMemoryRenderingType type = manager.getRenderingType(primaryId);
- if (type != null) {
- list.add(type);
- }
- }
- fDefaultTypes = (IMemoryRenderingType[]) list.toArray(new IMemoryRenderingType[list.size()]);
- }
- return fDefaultTypes;
- }
-
- /**
- * Returns the primary id, or <code>null</code> if none.
- *
- * @return the primary id, or <code>null</code> if none
- */
- private String getPrimaryId() {
- return fConfigurationElement.getAttribute(ATTR_PRIMARY);
- }
-
- /**
- * Returns the provider for this binding or <code>null</code> of none.
- *
- * @return the provider for this binding or <code>null</code> of none
- */
- protected IMemoryRenderingBindingsProvider getProvider(IMemoryBlock memoryBlock) {
- if (isBound(memoryBlock))
- {
- if (fProvider == null) {
- String name = fConfigurationElement.getAttribute(ATTR_PROVIDER);
- if (name != null) {
- try {
- fProvider = (IMemoryRenderingBindingsProvider) fConfigurationElement.createExecutableExtension(ATTR_PROVIDER);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
-
- if (fProvider != null)
- {
+
+ // element
+ protected IConfigurationElement fConfigurationElement;
+
+ // cached rendering ids
+ private IMemoryRenderingType[] fAllTypes;
+ private IMemoryRenderingType[] fRenderingTypes;
+ private IMemoryRenderingType[] fDefaultTypes;
+
+ // rendering type provider, or null (optional)
+ private IMemoryRenderingBindingsProvider fProvider;
+
+ // optional exprssion
+ private Expression fExpression;
+
+ // element attribute
+ public static final String ATTR_RENDERING_IDS = "renderingIds"; //$NON-NLS-1$
+ public static final String ATTR_DEFAULT_IDS = "defaultIds"; //$NON-NLS-1$
+ public static final String ATTR_PRIMARY = "primaryId"; //$NON-NLS-1$
+ public static final String ATTR_PROVIDER = "class"; //$NON-NLS-1$
+
+ // empty bindings
+ private static final IMemoryRenderingType[] EMPTY = new IMemoryRenderingType[0];
+
+ /**
+ * Constructs a bindings element from the given contribution.
+ *
+ * @param element contribution
+ */
+ RenderingBindings(IConfigurationElement element) {
+ fConfigurationElement = element;
+ }
+
+ /**
+ * Returns the non-default bindings specified by this contribution.
+ *
+ * @return the non-default bindings specified by this contribution
+ */
+ private IMemoryRenderingType[] getBindings() {
+ if (fRenderingTypes == null) {
+ String ids = fConfigurationElement.getAttribute(ATTR_RENDERING_IDS);
+ List<IMemoryRenderingType> list = new ArrayList<IMemoryRenderingType>();
+ IMemoryRenderingManager manager = getManager();
+ if (ids != null) {
+ String[] strings = ids.split(","); //$NON-NLS-1$
+ for (int i = 0; i < strings.length; i++) {
+ String id = strings[i].trim();
+ IMemoryRenderingType type = manager.getRenderingType(id);
+ if (type != null) {
+ list.add(type);
+ }
+ }
+ }
+ // remove any default bindings, in case of duplicate specification
+ IMemoryRenderingType[] defaultBindings = getDefaultBindings();
+ for (int i = 0; i < defaultBindings.length; i++) {
+ list.remove(defaultBindings[i]);
+ }
+ fRenderingTypes = list.toArray(new IMemoryRenderingType[list.size()]);
+ }
+ return fRenderingTypes;
+ }
+
+ /**
+ * Returns the default bindings specified by this contribution.
+ *
+ * @return the default bindings specified by this contribution
+ */
+ private IMemoryRenderingType[] getDefaultBindings() {
+ if (fDefaultTypes == null) {
+ String ids = fConfigurationElement.getAttribute(ATTR_DEFAULT_IDS);
+ List<IMemoryRenderingType> list = new ArrayList<IMemoryRenderingType>();
+ IMemoryRenderingManager manager = getManager();
+ if (ids != null) {
+ String[] strings = ids.split(","); //$NON-NLS-1$
+ for (int i = 0; i < strings.length; i++) {
+ String id = strings[i].trim();
+ IMemoryRenderingType type = manager.getRenderingType(id);
+ if (type != null) {
+ list.add(type);
+ }
+ }
+ }
+ // the primary is also considered a default rendering
+ String primaryId = getPrimaryId();
+ if (primaryId != null) {
+ IMemoryRenderingType type = manager.getRenderingType(primaryId);
+ if (type != null) {
+ list.add(type);
+ }
+ }
+ fDefaultTypes = list.toArray(new IMemoryRenderingType[list.size()]);
+ }
+ return fDefaultTypes;
+ }
+
+ /**
+ * Returns the primary id, or <code>null</code> if none.
+ *
+ * @return the primary id, or <code>null</code> if none
+ */
+ private String getPrimaryId() {
+ return fConfigurationElement.getAttribute(ATTR_PRIMARY);
+ }
+
+ /**
+ * Returns the provider for this binding or <code>null</code> of none.
+ *
+ * @return the provider for this binding or <code>null</code> of none
+ */
+ protected IMemoryRenderingBindingsProvider getProvider(IMemoryBlock memoryBlock) {
+ if (isBound(memoryBlock)) {
+ if (fProvider == null) {
+ String name = fConfigurationElement.getAttribute(ATTR_PROVIDER);
+ if (name != null) {
+ try {
+ fProvider = (IMemoryRenderingBindingsProvider) fConfigurationElement.createExecutableExtension(ATTR_PROVIDER);
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+
+ if (fProvider != null) {
fProvider.addListener(new IMemoryRenderingBindingsListener() {
+ @Override
public void memoryRenderingBindingsChanged() {
fireBindingsChanged();
- }});
+ }
+ });
}
- }
+ }
}
return fProvider;
- }
-
- /**
- * Returns whether this binding is applies to the given memory block.
- *
- * @param block memory block
- * @return whether this binding is applies to the given memory block
- */
- private boolean isBound(IMemoryBlock block) {
- Expression expression = getExpression();
- if (expression != null) {
- IEvaluationContext context = DebugUIPlugin.createEvaluationContext(block);
- try {
- return expression.evaluate(context) == EvaluationResult.TRUE;
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- return false;
- }
- }
- return true;
- }
-
- /**
- * Validates this contribution.
- *
- * @exception CoreException if invalid
- */
- void validate() throws CoreException {
- if (fConfigurationElement.getAttribute(ATTR_PROVIDER) != null) {
- if (fConfigurationElement.getAttribute(ATTR_RENDERING_IDS) != null ||
- fConfigurationElement.getAttribute(ATTR_DEFAULT_IDS) != null ||
- fConfigurationElement.getAttribute(ATTR_PRIMARY) != null) {
- Status status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR,
- "<renderingBindings> element cannot specify other attributes when " + ATTR_PROVIDER + " is present", null); //$NON-NLS-1$ //$NON-NLS-2$
- throw new CoreException(status);
- }
- }
- }
-
- /**
- * Returns this binding's enablement expression, or <code>null</code> if none.
- *
- * @return enablement expression, or <code>null</code> if none
- */
- private Expression getExpression() {
- if (fExpression == null) {
- IConfigurationElement[] elements = fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
- if (enablement != null) {
- try {
- fExpression = ExpressionConverter.getDefault().perform(enablement);
- } catch (CoreException e) {
- DebugUIPlugin.log(e);
- }
- }
- }
- return fExpression;
- }
+ }
+
+ /**
+ * Returns whether this binding is applies to the given memory block.
+ *
+ * @param block memory block
+ * @return whether this binding is applies to the given memory block
+ */
+ private boolean isBound(IMemoryBlock block) {
+ Expression expression = getExpression();
+ if (expression != null) {
+ IEvaluationContext context = DebugUIPlugin.createEvaluationContext(block);
+ try {
+ return expression.evaluate(context) == EvaluationResult.TRUE;
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * Validates this contribution.
+ *
+ * @exception CoreException if invalid
+ */
+ void validate() throws CoreException {
+ if (fConfigurationElement.getAttribute(ATTR_PROVIDER) != null) {
+ if (fConfigurationElement.getAttribute(ATTR_RENDERING_IDS) != null || fConfigurationElement.getAttribute(ATTR_DEFAULT_IDS) != null || fConfigurationElement.getAttribute(ATTR_PRIMARY) != null) {
+ Status status = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.INTERNAL_ERROR, "<renderingBindings> element cannot specify other attributes when " + ATTR_PROVIDER + " is present", null); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new CoreException(status);
+ }
+ }
+ }
+
+ /**
+ * Returns this binding's enablement expression, or <code>null</code> if
+ * none.
+ *
+ * @return enablement expression, or <code>null</code> if none
+ */
+ private Expression getExpression() {
+ if (fExpression == null) {
+ IConfigurationElement[] elements = fConfigurationElement.getChildren(ExpressionTagNames.ENABLEMENT);
+ IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
+ if (enablement != null) {
+ try {
+ fExpression = ExpressionConverter.getDefault().perform(enablement);
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
+ }
+ }
+ return fExpression;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#
+ * getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
+ */
+ @Override
+ public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
+ if (isBound(block)) {
+ IMemoryRenderingBindingsProvider provider = getProvider(block);
+ if (provider == null) {
+ if (fAllTypes == null) {
+ IMemoryRenderingType[] defaultBindings = getDefaultBindings();
+ IMemoryRenderingType[] bindings = getBindings();
+ fAllTypes = new IMemoryRenderingType[defaultBindings.length + bindings.length];
+ for (int i = 0; i < defaultBindings.length; i++) {
+ fAllTypes[i] = defaultBindings[i];
+ }
+ for (int i = 0, j = defaultBindings.length; i < bindings.length; i++, j++) {
+ fAllTypes[j] = bindings[i];
+ }
+ }
+ return fAllTypes;
+ }
+ return provider.getRenderingTypes(block);
+ }
+ return EMPTY;
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getRenderingTypes(IMemoryBlock block) {
- if (isBound(block)) {
- IMemoryRenderingBindingsProvider provider = getProvider(block);
- if (provider == null) {
- if (fAllTypes == null) {
- IMemoryRenderingType[] defaultBindings = getDefaultBindings();
- IMemoryRenderingType[] bindings = getBindings();
- fAllTypes = new IMemoryRenderingType[defaultBindings.length + bindings.length];
- for (int i = 0; i < defaultBindings.length; i++) {
- fAllTypes[i] = defaultBindings[i];
- }
- for (int i = 0, j = defaultBindings.length; i < bindings.length; i++, j++) {
- fAllTypes[j] = bindings[i];
- }
- }
- return fAllTypes;
- }
- return provider.getRenderingTypes(block);
- }
- return EMPTY;
- }
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#
+ * getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
+ */
+ @Override
+ public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) {
+ if (isBound(block)) {
+ IMemoryRenderingBindingsProvider provider = getProvider(block);
+ if (provider == null) {
+ return getDefaultBindings();
+ }
+ return provider.getDefaultRenderingTypes(block);
+ }
+ return EMPTY;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#
+ * getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock)
+ */
+ @Override
+ public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
+ if (isBound(block)) {
+ IMemoryRenderingBindingsProvider provider = getProvider(block);
+ if (provider == null) {
+ String primaryId = getPrimaryId();
+ if (primaryId != null) {
+ return getManager().getRenderingType(primaryId);
+ }
+ } else {
+ return provider.getPrimaryRenderingType(block);
+ }
+ }
+ return null;
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getDefaultRenderingTypes(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType[] getDefaultRenderingTypes(IMemoryBlock block) {
- if (isBound(block)) {
- IMemoryRenderingBindingsProvider provider = getProvider(block);
- if (provider == null) {
- return getDefaultBindings();
- }
- return provider.getDefaultRenderingTypes(block);
- }
- return EMPTY;
- }
+ private IMemoryRenderingManager getManager() {
+ return DebugUITools.getMemoryRenderingManager();
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#getPrimaryRenderingType(org.eclipse.debug.core.model.IMemoryBlock)
- */
- public IMemoryRenderingType getPrimaryRenderingType(IMemoryBlock block) {
- if (isBound(block)) {
- IMemoryRenderingBindingsProvider provider = getProvider(block);
- if (provider == null) {
- String primaryId = getPrimaryId();
- if (primaryId != null) {
- return getManager().getRenderingType(primaryId);
- }
- } else {
- return provider.getPrimaryRenderingType(block);
- }
- }
- return null;
- }
-
- private IMemoryRenderingManager getManager() {
- return DebugUITools.getMemoryRenderingManager();
- }
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
index b9ef8cb9f..e7bc9874a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTableRendering.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,7 +14,6 @@
package org.eclipse.debug.internal.ui.memory.provisional;
-
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Iterator;
@@ -134,6 +133,7 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.contexts.IContextActivation;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.dialogs.PropertyDialogAction;
import org.eclipse.ui.model.IWorkbenchAdapter;
@@ -143,100 +143,98 @@ import org.eclipse.ui.progress.UIJob;
/**
* Abstract implementation of a table rendering.
* <p>
- * Clients should subclass from this class if they wish to provide a
- * table rendering.
+ * Clients should subclass from this class if they wish to provide a table
+ * rendering.
* </p>
* <p>
- *
+ *
* The label of the rendering is constructed by retrieving the expression from
- * <code>IMemoryBlockExtension</code>. For IMemoryBlock, the label is constructed
- * using the memory block's start address.
+ * <code>IMemoryBlockExtension</code>. For IMemoryBlock, the label is
+ * constructed using the memory block's start address.
*
* This rendering manages the change states of its memory bytes if the memory
- * block does not opt to manage the change states. For IMemoryBlockExtension, if
- * the memory block returns false when #supportsChangeManagement() is called, this
- * rendering will calculate the change state for each byte when its content is updated.
- * Clients may manages the change states of its memory block by returning true when
- * #supportsChangeManagement() is called. This will cause this rendering to stop
- * calculating the change states of the memory block. Instead it would rely on the
- * attributes returned in the MemoryByte array to determine if a byte has changed.
- * For IMemoryBlock, this rendering will manage the change states its content.
+ * block does not opt to manage the change states. For IMemoryBlockExtension, if
+ * the memory block returns false when #supportsChangeManagement() is called,
+ * this rendering will calculate the change state for each byte when its content
+ * is updated. Clients may manages the change states of its memory block by
+ * returning true when #supportsChangeManagement() is called. This will cause
+ * this rendering to stop calculating the change states of the memory block.
+ * Instead it would rely on the attributes returned in the MemoryByte array to
+ * determine if a byte has changed. For IMemoryBlock, this rendering will manage
+ * the change states its content.
+ *
+ * When firing change event, be aware of the following: - whenever a change
+ * event is fired, the content provider for Memory View view checks to see if
+ * memory has actually changed. - If memory has actually changed, a refresh will
+ * commence. Changes to the memory block will be computed and will be shown with
+ * the delta icons. - If memory has not changed, content will not be refreshed.
+ * However, previous delta information will be erased. The screen will be
+ * refreshed to show that no memory has been changed. (All delta icons will be
+ * removed.)
*
- * When firing change event, be aware of the following:
- * - whenever a change event is fired, the content provider for Memory View
- * view checks to see if memory has actually changed.
- * - If memory has actually changed, a refresh will commence. Changes to the memory block
- * will be computed and will be shown with the delta icons.
- * - If memory has not changed, content will not be refreshed. However, previous delta information
- * will be erased. The screen will be refreshed to show that no memory has been changed. (All
- * delta icons will be removed.)
- *
* Please note that these APIs will be called multiple times by the Memory View.
- * To improve performance, debug adapters need to cache the content of its memory block and only
- * retrieve updated data when necessary.
+ * To improve performance, debug adapters need to cache the content of its
+ * memory block and only retrieve updated data when necessary.
* </p>
-
+ *
* @since 3.2
*/
public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRendering implements IPropertyChangeListener, IResettableMemoryRendering {
/**
- * Property identifier for the selected address in a table rendering
- * This property is used for synchronization between renderings.
+ * Property identifier for the selected address in a table rendering This
+ * property is used for synchronization between renderings.
*/
public static final String PROPERTY_SELECTED_ADDRESS = AbstractTableRendering.PROPERTY_SELECTED_ADDRESS;
-
+
/**
- * Property identifier for the column size in a table rendering
- * This property is used for synchronization between renderings.
+ * Property identifier for the column size in a table rendering This
+ * property is used for synchronization between renderings.
*/
public static final String PROPERTY_COL_SIZE = AbstractTableRendering.PROPERTY_COL_SIZE;
-
+
/**
- * Property identifier for the top row address in a table rendering.
- * This property is used for synchronization between renderings.
+ * Property identifier for the top row address in a table rendering. This
+ * property is used for synchronization between renderings.
*/
public static final String PROPERTY_TOP_ADDRESS = AbstractTableRendering.PROPERTY_TOP_ADDRESS;
-
+
private static final String ID_ASYNC_TABLE_RENDERING_CONTEXT = "org.eclipse.debug.ui.memory.abstractasynctablerendering"; //$NON-NLS-1$
private static final String ID_GO_TO_ADDRESS_COMMAND = "org.eclipse.debug.ui.command.gotoaddress"; //$NON-NLS-1$
private static final String ID_NEXT_PAGE_COMMAND = "org.eclipse.debug.ui.command.nextpage"; //$NON-NLS-1$
private static final String ID_PREV_PAGE_COMMAND = "org.eclipse.debug.ui.command.prevpage"; //$NON-NLS-1$
-
+
/**
- * Property identifier for the row size in a table rendering
- * This property is used for synchronization between renderings.
+ * Property identifier for the row size in a table rendering This property
+ * is used for synchronization between renderings.
*/
public static final String PROPERTY_ROW_SIZE = AbstractTableRendering.PROPERTY_ROW_SIZE;
private static final int DEFAULT_BUFFER_THRESHOLD = 1;
-
+
private boolean fActivated = false;
-
-// TODO: review use of MemorySegment, need to be careful to ensure flexible hierarchy
-
+
+ // TODO: review use of MemorySegment, need to be careful to ensure flexible
+ // hierarchy
+
private class ToggleAddressColumnAction extends Action {
public ToggleAddressColumnAction() {
super();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID
- + ".ShowAddressColumnAction_context"); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".ShowAddressColumnAction_context"); //$NON-NLS-1$
updateActionLabel();
}
/*
* (non-Javadoc)
- *
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fIsShowAddressColumn = !fIsShowAddressColumn;
- if (!fIsShowAddressColumn)
- {
+ if (!fIsShowAddressColumn) {
fTableViewer.getTable().getColumn(0).setWidth(0);
- }
- else
- {
+ } else {
fTableViewer.getTable().getColumn(0).pack();
}
updateActionLabel();
@@ -247,56 +245,54 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
*/
private void updateActionLabel() {
if (fIsShowAddressColumn) {
- setText(DebugUIMessages.ShowAddressColumnAction_0);
+ setText(DebugUIMessages.ShowAddressColumnAction_0);
} else {
- setText(DebugUIMessages.ShowAddressColumnAction_1);
+ setText(DebugUIMessages.ShowAddressColumnAction_1);
}
}
}
-
- private class NextPageAction extends Action
- {
- private NextPageAction()
- {
+
+ private class NextPageAction extends Action {
+ private NextPageAction() {
super();
setText(DebugUIMessages.AbstractTableRendering_4);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".NextPageAction_context"); //$NON-NLS-1$
}
+ @Override
public void run() {
BigInteger address = fContentDescriptor.getLoadAddress();
address = address.add(BigInteger.valueOf(getPageSizeInUnits()));
handlePageStartAddressChanged(address);
}
}
-
- private class PrevPageAction extends Action
- {
- private PrevPageAction()
- {
+
+ private class PrevPageAction extends Action {
+ private PrevPageAction() {
super();
setText(DebugUIMessages.AbstractTableRendering_6);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrevPageAction_context"); //$NON-NLS-1$
}
+ @Override
public void run() {
BigInteger address = fContentDescriptor.getLoadAddress();
address = address.subtract(BigInteger.valueOf(getPageSizeInUnits()));
handlePageStartAddressChanged(address);
}
}
-
- private class RenderingGoToAddressAction extends GoToAddressAction
- {
+
+ private class RenderingGoToAddressAction extends GoToAddressAction {
public RenderingGoToAddressAction(IMemoryRenderingContainer container, AbstractBaseTableRendering rendering) {
super(container, rendering);
}
-
+
+ @Override
public void run() {
showGoToAddressComposite();
}
}
-
+
private class SwitchPageJob extends UIJob {
private Object fLock = new Object();
private boolean fShowMessagePage = false;
@@ -308,39 +304,40 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
private void setShowMessagePage(boolean showMsg) {
- synchronized(fLock)
- {
+ synchronized (fLock) {
fShowMessagePage = showMsg;
}
}
private void setMessage(String message) {
- synchronized(fLock)
- {
+ synchronized (fLock) {
fMessage = message;
}
}
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
-
- if (fPageBook.isDisposed())
+
+ if (fPageBook.isDisposed()) {
return Status.OK_STATUS;
-
+ }
+
String msgToShow = null;
boolean showMsgPage = false;
synchronized (fLock) {
msgToShow = fMessage;
showMsgPage = fShowMessagePage;
}
-
+
if (showMsgPage) {
StyledText styleText = null;
fShowMessage = true;
styleText = fTextViewer.getTextWidget();
- if (styleText != null)
+ if (styleText != null) {
styleText.setText(msgToShow);
+ }
fPageBook.showPage(fTextViewer.getControl());
} else {
fShowMessage = false;
@@ -349,26 +346,32 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return Status.OK_STATUS;
}
}
-
-
- private class SerialByObjectRule implements ISchedulingRule
- {
- private Object fObject = null;
-
- public SerialByObjectRule(Object lock) {
- fObject = lock;
- }
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
+ private class SerialByObjectRule implements ISchedulingRule {
+ private Object fObject = null;
+
+ public SerialByObjectRule(Object lock) {
+ fObject = lock;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse
+ * .core.runtime.jobs.ISchedulingRule)
*/
+ @Override
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse
+ * .core.runtime.jobs.ISchedulingRule)
*/
+ @Override
public boolean isConflicting(ISchedulingRule rule) {
if (rule instanceof SerialByObjectRule) {
SerialByObjectRule rRule = (SerialByObjectRule) rule;
@@ -377,7 +380,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
return false;
}
}
-
+
private PageBook fPageBook;
private AsyncTableRenderingViewer fTableViewer;
private TextViewer fTextViewer;
@@ -395,7 +398,7 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private int fPostBufferSize = -1;
private SashForm fSashForm;
private GoToAddressComposite fGoToAddressComposite;
-
+
// actions
private GoToAddressAction fGoToAddressAction;
private PrintTableRenderingAction fPrintViewTabAction;
@@ -407,137 +410,138 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private PropertyDialogAction fPropertiesDialogAction;
private NextPageAction fNextAction;
private PrevPageAction fPrevAction;
-
- private ArrayList fContext = new ArrayList();
+
+ private ArrayList<IContextActivation> fContext = new ArrayList<IContextActivation>();
private AbstractHandler fGoToAddressHandler;
-
+
private AbstractHandler fNextPageHandler;
private AbstractHandler fPrevPageHandler;
-
+
private boolean fIsCreated = false;
private boolean fIsDisposed = false;
private boolean fIsShowAddressColumn = true;
-
+
private SwitchPageJob fSwitchPageJob = new SwitchPageJob();
private boolean fError = false;
-
+
private PendingPropertyChanges fPendingSyncProperties;
-
- // list of menu listeners for popupMenuMgr.
- private ArrayList fMenuListeners;
+
+ // list of menu listeners for popupMenuMgr.
+ private ArrayList<IMenuListener> fMenuListeners;
private MenuManager fMenuMgr;
-
+
private ISchedulingRule serialByRenderingRule = new SerialByObjectRule(this);
-
- /**
- * Identifier for an empty group preceding all context menu actions
- * (value <code>"popUpBegin"</code>).
+
+ /**
+ * Identifier for an empty group preceding all context menu actions (value
+ * <code>"popUpBegin"</code>).
*/
public static final String EMPTY_MEMORY_GROUP = "popUpBegin"; //$NON-NLS-1$
-
+
/**
- * Identifier for an empty group following navigation actions in the rendering
- * (value <code>navigationGroup</code>).
+ * Identifier for an empty group following navigation actions in the
+ * rendering (value <code>navigationGroup</code>).
*/
public static final String EMPTY_NAVIGATION_GROUP = "navigationGroup"; //$NON-NLS-1$
-
+
/**
- * Identifier for an empty group following actions that are only applicable in
- * non-auto loading mode
- * (value <code>nonAutoLoadGroup</code>).
+ * Identifier for an empty group following actions that are only applicable
+ * in non-auto loading mode (value <code>nonAutoLoadGroup</code>).
*/
public static final String EMPTY_NON_AUTO_LOAD_GROUP = "nonAutoLoadGroup"; //$NON-NLS-1$
-
+
/**
- * Identifier for an empty group following properties actions
- * (value <code>propertyGroup</code>).
+ * Identifier for an empty group following properties actions (value
+ * <code>propertyGroup</code>).
*/
public static final String EMPTY_PROPERTY_GROUP = "propertyGroup"; //$NON-NLS-1$
-
+
private ISelectionChangedListener fViewerSelectionChangedListener = new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
updateSyncTopAddress(getTopVisibleAddress());
updateSyncSelectedAddress(getSelectedAddress());
}
};
-
+
private SelectionAdapter fScrollBarSelectionListener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateSyncTopAddress(getTopVisibleAddress());
}
};
-
+
private IModelChangedListener fModelChangedListener = new IModelChangedListener() {
+ @Override
public void modelChanged(IModelDelta delta, IModelProxy proxy) {
- if (delta.getElement() == getMemoryBlock())
- {
+ if (delta.getElement() == getMemoryBlock()) {
showTable();
updateRenderingLabel(isVisible());
}
- }};
-
+ }
+ };
+
private IVirtualContentListener fViewerListener = new IVirtualContentListener() {
-
+
private int startThreshold;
private int endThreshold;
+ @Override
public void handledAtBufferStart() {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- if (isDynamicLoad() && startThreshold != 0)
- {
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ if (isDynamicLoad() && startThreshold != 0) {
BigInteger address = getTopVisibleAddress();
- if (address != null && !isAtTopLimit())
+ if (address != null && !isAtTopLimit()) {
reloadTable(address);
+ }
}
}
}
+ @Override
public void handleAtBufferEnd() {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- if (isDynamicLoad() && endThreshold != 0)
- {
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ if (isDynamicLoad() && endThreshold != 0) {
BigInteger address = getTopVisibleAddress();
- if (address != null && !isAtBottomLimit())
+ if (address != null && !isAtBottomLimit()) {
reloadTable(address);
+ }
}
}
}
+ @Override
public int getThreshold(int bufferEndOrStart) {
-
+
int threshold = DEFAULT_BUFFER_THRESHOLD;
-
- if (bufferEndOrStart == IVirtualContentListener.BUFFER_START)
- {
- if (threshold > getPreBufferSize())
- {
+
+ if (bufferEndOrStart == IVirtualContentListener.BUFFER_START) {
+ if (threshold > getPreBufferSize()) {
threshold = getPreBufferSize();
}
- }
- else
- {
- if (threshold > getPostBufferSize())
- {
+ } else {
+ if (threshold > getPostBufferSize()) {
threshold = getPostBufferSize();
}
}
-
- if (bufferEndOrStart == IVirtualContentListener.BUFFER_START)
+
+ if (bufferEndOrStart == IVirtualContentListener.BUFFER_START) {
startThreshold = threshold;
- else
+ } else {
endThreshold = threshold;
-
+ }
+
return threshold;
- }};
-
+ }
+ };
+
private IPresentationErrorListener fPresentationErrorListener = new IPresentationErrorListener() {
+ @Override
public void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
showMessage(status.getMessage());
- }};
-
-
+ }
+ };
+
/**
* Constructs a new table rendering of the specified type.
*
@@ -547,71 +551,73 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
super(renderingId);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
*/
+ @Override
public void resetRendering() throws DebugException {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
BigInteger baseAddress = fContentDescriptor.getContentBaseAddress();
fTableViewer.setSelection(baseAddress);
reloadTable(baseAddress);
fTableViewer.setTopIndex(baseAddress);
- if (!isDynamicLoad())
- {
+ if (!isDynamicLoad()) {
updateSyncPageStartAddress(baseAddress);
}
-
+
updateSyncSelectedAddress(baseAddress);
- updateSyncTopAddress(baseAddress);
+ updateSyncTopAddress(baseAddress);
}
+ @Override
public Control createControl(Composite parent) {
-
+
fPageBook = new PageBook(parent, SWT.NONE);
createMessagePage(fPageBook);
createTableViewer(fPageBook);
addListeners();
-
+
return fPageBook;
}
-
+
/**
* Create the error page of this rendering
+ *
* @param parent the parent to add the page to
*/
- private void createMessagePage(Composite parent)
- {
- if (fTextViewer == null)
- {
- fTextViewer = new TextViewer(parent, SWT.WRAP);
+ private void createMessagePage(Composite parent) {
+ if (fTextViewer == null) {
+ fTextViewer = new TextViewer(parent, SWT.WRAP);
fTextViewer.setDocument(new Document());
StyledText styleText = fTextViewer.getTextWidget();
styleText.setEditable(false);
styleText.setEnabled(false);
}
}
-
+
/**
* @param parent the parent composite
*/
- private void createTableViewer(final Composite parent)
- {
+ private void createTableViewer(final Composite parent) {
StringBuffer buffer = new StringBuffer();
IMemoryRenderingType type = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId());
buffer.append(type.getLabel());
buffer.append(": "); //$NON-NLS-1$
buffer.append(DebugUIMessages.AbstractAsyncTableRendering_2);
-
+
Job job = new Job(buffer.toString()) {
+ @Override
protected IStatus run(IProgressMonitor monitor) {
-
+
// gather information from memory block
- initAddressableSize();
+ initAddressableSize();
final BigInteger topVisibleAddress = getInitialTopVisibleAddress();
BigInteger mbBaseAddress = null;
try {
@@ -620,205 +626,216 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fError = true;
showMessage(e.getMessage());
}
-
- // if it takes too long to get the base address, and user has canceled
+
+ // if it takes too long to get the base address, and user has
+ // canceled
// remove this rendering.
- if (monitor.isCanceled())
- {
+ if (monitor.isCanceled()) {
getMemoryRenderingContainer().removeMemoryRendering(AbstractAsyncTableRendering.this);
return Status.CANCEL_STATUS;
}
-
+
final BigInteger finalMbBaseAddress = mbBaseAddress;
final BigInteger initialSelectedAddress = getInitialSelectedAddress();
-
- if (monitor.isCanceled())
- {
+
+ if (monitor.isCanceled()) {
getMemoryRenderingContainer().removeMemoryRendering(AbstractAsyncTableRendering.this);
return Status.CANCEL_STATUS;
}
-
+
createContentDescriptor(topVisibleAddress);
-
- // if it takes too long to get other information, and user has canceled
+
+ // if it takes too long to get other information, and user has
+ // canceled
// remove this rendering.
- if (monitor.isCanceled())
- {
+ if (monitor.isCanceled()) {
getMemoryRenderingContainer().removeMemoryRendering(AbstractAsyncTableRendering.this);
return Status.CANCEL_STATUS;
}
-
+
// batch update on UI thread
- UIJob uiJob = new UIJob("Create Table Viewer UI Job"){ //$NON-NLS-1$
+ UIJob uiJob = new UIJob("Create Table Viewer UI Job") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor progressMonitor) {
-
- if (fPageBook.isDisposed())
+
+ if (fPageBook.isDisposed()) {
return Status.OK_STATUS;
-
+ }
+
fSashForm = new SashForm(parent, SWT.VERTICAL);
fTableViewer = new AsyncTableRenderingViewer(AbstractAsyncTableRendering.this, fSashForm, SWT.VIRTUAL | SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.HIDE_SELECTION | SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH);
fTableViewer.getControl().setLayoutData(data);
-
+
createGoToAddressComposite(fSashForm);
hideGotoAddressComposite();
-
+
IMemoryRenderingSite site = getMemoryRenderingContainer().getMemoryRenderingSite();
IMemoryRenderingContainer container = getMemoryRenderingContainer();
fPresentationContext = new MemoryViewPresentationContext(site, container, AbstractAsyncTableRendering.this);
fTableViewer.setContext(fPresentationContext);
-
- // must call this after the context is created as the information is stored in the context
+
+ // must call this after the context is created as the
+ // information is stored in the context
getDynamicLoadFromPreference();
getPageSizeFromPreference();
-
+
int numberOfLines = getNumLinesToLoad();
fContentDescriptor.setNumLines(numberOfLines);
-
- if (numberOfLines == 0)
- {
- // if the table viewer is not initialized yet, add listener
- // and load table when we can get the height of the table
+
+ if (numberOfLines == 0) {
+ // if the table viewer is not initialized yet, add
+ // listener
+ // and load table when we can get the height of the
+ // table
fTableViewer.getTable().addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
fTableViewer.getTable().removePaintListener(this);
fContentDescriptor.setNumLines(getNumLinesToLoad());
refresh();
- }});
+ }
+ });
}
-
+
BigInteger baseAddress = finalMbBaseAddress;
- if (baseAddress == null)
+ if (baseAddress == null) {
baseAddress = BigInteger.ZERO;
-
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension) || !isDynamicLoad())
- {
- // If not extended memory block, do not create any buffer
+ }
+
+ if (!(getMemoryBlock() instanceof IMemoryBlockExtension) || !isDynamicLoad()) {
+ // If not extended memory block, do not create any
+ // buffer
// no scrolling
fContentDescriptor.setPreBuffer(0);
fContentDescriptor.setPostBuffer(0);
- }
-
+ }
+
setupInitialFormat();
fTableViewer.setCellModifier(newInternalCellModifier());
fTableViewer.getTable().setHeaderVisible(true);
- fTableViewer.getTable().setLinesVisible(true);
+ fTableViewer.getTable().setLinesVisible(true);
fTableViewer.addPresentationErrorListener(fPresentationErrorListener);
fTableViewer.setInput(getMemoryBlock());
fTableViewer.resizeColumnsToPreferredSize();
fTableViewer.setTopIndex(topVisibleAddress);
-
+
fTableViewer.setSelection(initialSelectedAddress);
- // SET UP FONT
+ // SET UP FONT
// set to a non-proportional font
fTableViewer.getTable().setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
-
- if (!fError)
+
+ if (!fError) {
showTable();
-
+ }
+
fTableViewer.addVirtualContentListener(fViewerListener);
-
+
// create context menu
// create pop up menu for the rendering
createActions();
IMenuListener menuListener = new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
};
createPopupMenu(fTableViewer.getControl(), menuListener);
createPopupMenu(fTableViewer.getCursor(), menuListener);
-
+
fTableViewer.addSelectionChangedListener(fViewerSelectionChangedListener);
fTableViewer.getTable().getVerticalBar().addSelectionListener(fScrollBarSelectionListener);
-
- // add resize listener to figure out number of visible lines
- // so that the viewer get refreshed with the correct number of lines on the
+
+ // add resize listener to figure out number of visible
+ // lines
+ // so that the viewer get refreshed with the correct
+ // number of lines on the
// next refresh request
fTableViewer.getTable().addListener(SWT.Resize, new Listener() {
+ @Override
public void handleEvent(Event event) {
- if (!fTableViewer.getTable().isDisposed())
+ if (!fTableViewer.getTable().isDisposed()) {
fContentDescriptor.setNumLines(getNumLinesToLoad());
- }});
-
+ }
+ }
+ });
+
createToolTip();
-
- if (isActivated())
- {
+
+ if (isActivated()) {
activatePageActions();
}
-
+
// now the rendering is successfully created
- fIsCreated = true;
-
+ fIsCreated = true;
+
return Status.OK_STATUS;
- }};
+ }
+ };
uiJob.setSystem(true);
uiJob.schedule();
-
+
return Status.OK_STATUS;
- }};
-
+ }
+ };
+
job.schedule();
}
-
+
/**
* Create popup menu for this rendering
+ *
* @param control - control to create the popup menu for
* @param menuListener - listener to notify when popup menu is about to show
*/
- private void createPopupMenu(Control control, IMenuListener menuListener)
- {
+ private void createPopupMenu(Control control, IMenuListener menuListener) {
IMemoryRenderingContainer container = getMemoryRenderingContainer();
- if (fMenuMgr == null)
- {
+ if (fMenuMgr == null) {
fMenuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
fMenuMgr.setRemoveAllWhenShown(true);
IMemoryRenderingSite site = container.getMemoryRenderingSite();
String menuId = container.getId();
-
+
ISelectionProvider selProvider = site.getSite().getSelectionProvider();
-
+
addMenuListener(menuListener);
site.getSite().registerContextMenu(menuId, fMenuMgr, selProvider);
}
-
+
addMenuListener(menuListener);
-
+
Menu popupMenu = fMenuMgr.createContextMenu(control);
control.setMenu(popupMenu);
}
-
private void addMenuListener(IMenuListener menuListener) {
- if (fMenuListeners == null)
- fMenuListeners = new ArrayList();
-
- if (!fMenuListeners.contains(menuListener))
- {
+ if (fMenuListeners == null) {
+ fMenuListeners = new ArrayList<IMenuListener>();
+ }
+
+ if (!fMenuListeners.contains(menuListener)) {
fMenuMgr.addMenuListener(menuListener);
fMenuListeners.add(menuListener);
}
}
private BigInteger getInitialSelectedAddress() {
- // figure out selected address
+ // figure out selected address
BigInteger selectedAddress = (BigInteger) getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS);
- if (selectedAddress == null)
- {
+ if (selectedAddress == null) {
if (getMemoryBlock() instanceof IMemoryBlockExtension) {
try {
selectedAddress = ((IMemoryBlockExtension) getMemoryBlock()).getBigBaseAddress();
} catch (DebugException e) {
selectedAddress = BigInteger.ZERO;
}
-
+
if (selectedAddress == null) {
- selectedAddress =BigInteger.ZERO;
+ selectedAddress = BigInteger.ZERO;
}
} else {
@@ -828,101 +845,92 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
return selectedAddress;
}
-
- private void addListeners()
- {
+
+ private void addListeners() {
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
addRenderingToSyncService();
JFaceResources.getFontRegistry().addListener(this);
}
-
- private void removeListeners()
- {
+
+ private void removeListeners() {
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
removeRenderingFromSyncService();
JFaceResources.getFontRegistry().removeListener(this);
-
- if (fMenuListeners != null)
- {
- Iterator iter = fMenuListeners.iterator();
- while (iter.hasNext())
- {
- fMenuMgr.removeMenuListener((IMenuListener)iter.next());
+
+ if (fMenuListeners != null) {
+ Iterator<IMenuListener> iter = fMenuListeners.iterator();
+ while (iter.hasNext()) {
+ fMenuMgr.removeMenuListener(iter.next());
}
-
+
fMenuListeners.clear();
}
}
-
- private void addRenderingToSyncService()
- {
+
+ private void addRenderingToSyncService() {
IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
+
+ if (syncService == null) {
return;
-
+ }
+
syncService.addPropertyChangeListener(this, null);
}
-
- private void removeRenderingFromSyncService()
- {
+
+ private void removeRenderingFromSyncService() {
IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
+
+ if (syncService == null) {
return;
-
- syncService.removePropertyChangeListener(this);
+ }
+
+ syncService.removePropertyChangeListener(this);
}
-
- private void initAddressableSize()
- {
- // set up addressable size and figure out number of bytes required per line
+
+ private void initAddressableSize() {
+ // set up addressable size and figure out number of bytes required per
+ // line
fAddressableSize = -1;
try {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- fAddressableSize = ((IMemoryBlockExtension)getMemoryBlock()).getAddressableSize();
- else
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ fAddressableSize = ((IMemoryBlockExtension) getMemoryBlock()).getAddressableSize();
+ } else {
fAddressableSize = 1;
+ }
} catch (DebugException e1) {
DebugUIPlugin.log(e1);
// log error and default to 1
fAddressableSize = 1;
return;
-
+
}
- if (fAddressableSize < 1)
- {
+ if (fAddressableSize < 1) {
DebugUIPlugin.logErrorMessage("Invalid addressable size"); //$NON-NLS-1$
fAddressableSize = 1;
}
}
-
+
private BigInteger getInitialTopVisibleAddress() {
BigInteger topVisibleAddress = (BigInteger) getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS);
- if (topVisibleAddress == null)
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
+ if (topVisibleAddress == null) {
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
try {
- topVisibleAddress = ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
+ topVisibleAddress = ((IMemoryBlockExtension) getMemoryBlock()).getBigBaseAddress();
} catch (DebugException e1) {
topVisibleAddress = new BigInteger("0"); //$NON-NLS-1$
}
- }
- else
- {
+ } else {
topVisibleAddress = BigInteger.valueOf(getMemoryBlock().getStartAddress());
}
}
return topVisibleAddress;
}
-
+
private void setupInitialFormat() {
-
+
boolean validated = validateInitialFormat();
-
- if (!validated)
- {
+
+ if (!validated) {
// pop up dialog to ask user for default values
StringBuffer msgBuffer = new StringBuffer(DebugUIMessages.AbstractTableRendering_20);
msgBuffer.append(" "); //$NON-NLS-1$
@@ -932,179 +940,162 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
msgBuffer.append("\n"); //$NON-NLS-1$
msgBuffer.append(DebugUIMessages.AbstractTableRendering_18);
msgBuffer.append("\n\n"); //$NON-NLS-1$
-
+
int bytePerLine = fBytePerLine;
int columnSize = fColumnSize;
-
+
// initialize this value to populate the dialog properly
fBytePerLine = getDefaultRowSize() / getAddressableSize();
fColumnSize = getDefaultColumnSize() / getAddressableSize();
FormatTableRenderingDialog dialog = new FormatTableRenderingDialog(this, DebugUIPlugin.getShell());
dialog.openError(msgBuffer.toString());
-
+
// restore to original value before formatting
fBytePerLine = bytePerLine;
fColumnSize = columnSize;
-
+
bytePerLine = dialog.getRowSize() * getAddressableSize();
columnSize = dialog.getColumnSize() * getAddressableSize();
-
+
format(bytePerLine, columnSize);
- }
- else
- {
- // Row size is stored as number of addressable units in preference store
+ } else {
+ // Row size is stored as number of addressable units in preference
+ // store
int bytePerLine = getDefaultRowSize();
// column size is now stored as number of addressable units
int columnSize = getDefaultColumnSize();
-
- // format memory block with specified "bytesPerLine" and "columnSize"
+
+ // format memory block with specified "bytesPerLine" and
+ // "columnSize"
boolean ok = format(bytePerLine, columnSize);
-
- if (!ok)
- {
- // this is to ensure that the rest of the rendering can be created
+
+ if (!ok) {
+ // this is to ensure that the rest of the rendering can be
+ // created
// and we can recover from a format error
format(bytePerLine, bytePerLine);
}
}
}
-
- private boolean validateInitialFormat()
- {
+
+ private boolean validateInitialFormat() {
int rowSize = getDefaultRowSize();
int columnSize = getDefaultColumnSize();
-
- if (rowSize < columnSize || rowSize % columnSize != 0 || rowSize == 0 || columnSize == 0)
- {
+
+ if (rowSize < columnSize || rowSize % columnSize != 0 || rowSize == 0 || columnSize == 0) {
return false;
}
return true;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#getControl()
*/
+ @Override
public Control getControl() {
return fPageBook;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
+ * .jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
-
+ }
+
// if memory view table font has changed
- if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME))
- {
- if (!fIsDisposed)
- {
+ if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME)) {
+ if (!fIsDisposed) {
Font memoryViewFont = JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME);
- setFont(memoryViewFont);
+ setFont(memoryViewFont);
}
return;
}
-
+
Object evtSrc = event.getSource();
// always update page size, only refresh if the table is visible
if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
getPageSizeFromPreference();
}
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE))
- {
+ if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE)) {
getPreBufferSizeFromPreference();
fContentDescriptor.setPreBuffer(getPreBufferSize());
}
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE))
- {
+ if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE)) {
getPostBufferSizeFromPreference();
- fContentDescriptor.setPostBuffer(getPostBufferSize());
+ fContentDescriptor.setPostBuffer(getPostBufferSize());
}
-
+
// do not handle event if the rendering is displaying an error
// or if it's not visible
- if (isDisplayingError() || !isVisible())
- {
+ if (isDisplayingError() || !isVisible()) {
handlePropertiesChangeWhenHidden(event);
return;
}
-
-
- if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR) ||
- event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR))
- {
- if (!fIsDisposed)
- {
+
+ if (event.getProperty().equals(IDebugUIConstants.PREF_PADDED_STR) || event.getProperty().equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) || event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR) || event.getProperty().equals(IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR)) {
+ if (!fIsDisposed) {
fTableViewer.refresh(false);
}
return;
}
-
- if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE) ||
- event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE))
- {
- if (!fIsDisposed)
- {
+
+ if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE) || event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE)) {
+ if (!fIsDisposed) {
fTableViewer.refresh(true);
}
return;
}
-
+
if (event.getProperty().equals(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM)) {
handleDyanicLoadChanged();
return;
}
-
+
if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
- if (!isDynamicLoad())
- {
+ if (!isDynamicLoad()) {
int pageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
handlePageSizeChanged(pageSize);
}
return;
}
-
- if (evtSrc == this)
+
+ if (evtSrc == this) {
return;
-
- if (evtSrc instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)evtSrc;
+ }
+
+ if (evtSrc instanceof IMemoryRendering) {
+ IMemoryRendering rendering = (IMemoryRendering) evtSrc;
IMemoryBlock memoryBlock = rendering.getMemoryBlock();
-
- // do not handle event from renderings displaying other memory blocks
- if (memoryBlock != getMemoryBlock())
+
+ // do not handle event from renderings displaying other memory
+ // blocks
+ if (memoryBlock != getMemoryBlock()) {
return;
+ }
}
-
+
String propertyName = event.getProperty();
Object value = event.getNewValue();
-
- if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger)
- {
- selectedAddressChanged((BigInteger)value);
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer)
- {
- columnSizeChanged(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer)
- {
- rowSizeChanged(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger)
- {
- topVisibleAddressChanged((BigInteger)value);
- }
- else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger)
- {
- handlePageStartAddressChanged((BigInteger)value);
+
+ if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger) {
+ selectedAddressChanged((BigInteger) value);
+ } else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer) {
+ columnSizeChanged(((Integer) value).intValue());
+ } else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer) {
+ rowSizeChanged(((Integer) value).intValue());
+ } else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger) {
+ topVisibleAddressChanged((BigInteger) value);
+ } else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger) {
+ handlePageStartAddressChanged((BigInteger) value);
}
}
@@ -1116,303 +1107,281 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
// only refresh if in non-auto-load mode
fContentDescriptor.setNumLines(pageSize);
refresh();
- }
-
- private void handlePropertiesChangeWhenHidden(PropertyChangeEvent event)
- {
- if (fPendingSyncProperties == null)
+ }
+
+ private void handlePropertiesChangeWhenHidden(PropertyChangeEvent event) {
+ if (fPendingSyncProperties == null) {
return;
-
+ }
+
String propertyName = event.getProperty();
Object value = event.getNewValue();
-
- if (event.getSource() instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)event.getSource();
- if (rendering == this || rendering.getMemoryBlock() != getMemoryBlock())
- {
+
+ if (event.getSource() instanceof IMemoryRendering) {
+ IMemoryRendering rendering = (IMemoryRendering) event.getSource();
+ if (rendering == this || rendering.getMemoryBlock() != getMemoryBlock()) {
return;
}
}
-
- if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer)
- {
- fPendingSyncProperties.setColumnSize(((Integer)value).intValue());
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer)
- {
- fPendingSyncProperties.setRowSize(((Integer)value).intValue());
- }
-
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger)
- {
- fPendingSyncProperties.setSelectedAddress((BigInteger)value);
- }
- else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger)
- {
- fPendingSyncProperties.setTopVisibleAddress((BigInteger)value);
- }
- else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger)
- {
- fPendingSyncProperties.setPageStartAddress((BigInteger)value);
+
+ if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_COL_SIZE) && value instanceof Integer) {
+ fPendingSyncProperties.setColumnSize(((Integer) value).intValue());
+ } else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE) && value instanceof Integer) {
+ fPendingSyncProperties.setRowSize(((Integer) value).intValue());
}
- else if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
+
+ else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS) && value instanceof BigInteger) {
+ fPendingSyncProperties.setSelectedAddress((BigInteger) value);
+ } else if (propertyName.equals(AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS) && value instanceof BigInteger) {
+ fPendingSyncProperties.setTopVisibleAddress((BigInteger) value);
+ } else if (propertyName.equals(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS) && value instanceof BigInteger) {
+ fPendingSyncProperties.setPageStartAddress((BigInteger) value);
+ } else if (event.getProperty().equals(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE)) {
int pageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
fPendingSyncProperties.setPageSize(pageSize);
}
}
-
- private void topVisibleAddressChanged(final BigInteger address)
- {
+
+ private void topVisibleAddressChanged(final BigInteger address) {
final Runnable runnable = new Runnable() {
+ @Override
public void run() {
- if (fTableViewer.getTable().isDisposed())
+ if (fTableViewer.getTable().isDisposed()) {
return;
-
+ }
+
doTopVisibleAddressChanged(address);
- }};
+ }
+ };
runOnUIThread(runnable);
}
-
+
/**
* @param address the changed address
*/
private void doTopVisibleAddressChanged(final BigInteger address) {
- if (fIsDisposed)
+ if (fIsDisposed) {
return;
-
- if (!isDynamicLoad())
- {
+ }
+
+ if (!isDynamicLoad()) {
fTableViewer.setTopIndex(address);
fTableViewer.topIndexChanged();
return;
}
-
- if (!isAtTopBuffer(address) && !isAtBottomBuffer(address))
- {
+
+ if (!isAtTopBuffer(address) && !isAtBottomBuffer(address)) {
fTableViewer.setTopIndex(address);
fTableViewer.topIndexChanged();
- }
- else
- {
+ } else {
reloadTable(address);
}
}
-
- private boolean isAtBottomBuffer(BigInteger address)
- {
+
+ private boolean isAtBottomBuffer(BigInteger address) {
int idx = fTableViewer.indexOf(address);
- if (idx < 0)
+ if (idx < 0) {
return true;
-
+ }
+
int bottomIdx = idx + getNumberOfVisibleLines();
int elementsCnt = fTableViewer.getVirtualContentModel().getElements().length;
int numLinesLeft = elementsCnt - bottomIdx;
-
- if (numLinesLeft < fViewerListener.getThreshold(IVirtualContentListener.BUFFER_END))
+
+ if (numLinesLeft < fViewerListener.getThreshold(IVirtualContentListener.BUFFER_END)) {
return true;
-
+ }
+
return false;
}
-
- private boolean isAtTopBuffer(BigInteger address)
- {
+
+ private boolean isAtTopBuffer(BigInteger address) {
int topIdx = fTableViewer.indexOf(address);
- if (topIdx < fViewerListener.getThreshold(IVirtualContentListener.BUFFER_START))
+ if (topIdx < fViewerListener.getThreshold(IVirtualContentListener.BUFFER_START)) {
return true;
-
+ }
+
return false;
}
-
- private void runOnUIThread(final Runnable runnable)
- {
- if (Display.getCurrent() != null)
- {
+
+ private void runOnUIThread(final Runnable runnable) {
+ if (Display.getCurrent() != null) {
runnable.run();
- }
- else
- {
- UIJob job = new UIJob("Async Table Rendering UI Job"){ //$NON-NLS-1$
-
+ } else {
+ UIJob job = new UIJob("Async Table Rendering UI Job") { //$NON-NLS-1$
+
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
runnable.run();
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
}
-
- private void selectedAddressChanged(final BigInteger address)
- {
+
+ private void selectedAddressChanged(final BigInteger address) {
Runnable runnable = new Runnable() {
- public void run() {
-
- if (fTableViewer.getTable().isDisposed())
+ @Override
+ public void run() {
+
+ if (fTableViewer.getTable().isDisposed()) {
return;
-
+ }
+
// call this to make the table viewer to reload when needed
int i = fTableViewer.indexOf(address);
- if (i < 0)
- {
+ if (i < 0) {
// the model may not have been populated yet,
// try to predict if the address will be in the buffer
boolean contained = isAddressBufferred(address);
- if (!contained)
+ if (!contained) {
topVisibleAddressChanged(address);
+ }
}
fTableViewer.setSelection(address);
}
};
-
+
runOnUIThread(runnable);
}
-
- private boolean isAddressBufferred(BigInteger address)
- {
+
+ private boolean isAddressBufferred(BigInteger address) {
// figure out the buffer top address
BigInteger loadAddress = fContentDescriptor.getLoadAddress();
loadAddress = MemoryViewUtil.alignToBoundary(loadAddress, getAddressableUnitPerLine());
int unitPerLine = getAddressableUnitPerLine();
-
+
loadAddress = loadAddress.subtract(BigInteger.valueOf(getPreBufferSize() * unitPerLine));
-
+
// figure out the buffer end address
int numLines = fContentDescriptor.getNumLines();
- BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(fContentDescriptor.getPostBuffer()*unitPerLine));
- bufferEnd = bufferEnd.add(BigInteger.valueOf(numLines*unitPerLine + unitPerLine));
-
+ BigInteger bufferEnd = loadAddress.add(BigInteger.valueOf(fContentDescriptor.getPostBuffer() * unitPerLine));
+ bufferEnd = bufferEnd.add(BigInteger.valueOf(numLines * unitPerLine + unitPerLine));
+
// see if the address is contained based on current content descriptor
- if (address.compareTo(loadAddress) >= 0 && address.compareTo(bufferEnd) <= 0)
+ if (address.compareTo(loadAddress) >= 0 && address.compareTo(bufferEnd) <= 0) {
return true;
-
+ }
+
return false;
}
-
- private void setFont(Font font)
- {
+
+ private void setFont(Font font) {
// set font
fTableViewer.getTable().setFont(font);
- fTableViewer.getCursor().setFont(font);
+ fTableViewer.getCursor().setFont(font);
}
-
+
private int getDefaultColumnSize() {
-
+
// default to global preference store
IPreferenceStore prefStore = DebugUITools.getPreferenceStore();
int columnSize = prefStore.getInt(IDebugPreferenceConstants.PREF_COLUMN_SIZE);
- // actual column size is number of addressable units * size of the addressable unit
+ // actual column size is number of addressable units * size of the
+ // addressable unit
columnSize = columnSize * getAddressableSize();
-
+
// check synchronized col size
- Integer colSize = (Integer)getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_COL_SIZE);
- if (colSize != null)
- {
+ Integer colSize = (Integer) getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_COL_SIZE);
+ if (colSize != null) {
// column size is stored as actual number of bytes in synchronizer
- int syncColSize = colSize.intValue();
- if (syncColSize > 0)
- {
+ int syncColSize = colSize.intValue();
+ if (syncColSize > 0) {
columnSize = syncColSize;
- }
- }
- else
- {
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ }
+ } else {
+ IPersistableDebugElement elmt = (IPersistableDebugElement) getMemoryBlock().getAdapter(IPersistableDebugElement.class);
int defaultColSize = -1;
-
- if (elmt != null)
- {
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
+
+ if (elmt != null) {
+ if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL)) {
defaultColSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL);
+ }
}
-
- if (defaultColSize <= 0)
- {
+
+ if (defaultColSize <= 0) {
// if not provided, get default by model
defaultColSize = getDefaultColumnSizeByModel(getMemoryBlock().getModelIdentifier());
}
-
- if (defaultColSize > 0)
+
+ if (defaultColSize > 0) {
columnSize = defaultColSize * getAddressableSize();
+ }
}
return columnSize;
}
private int getDefaultRowSize() {
-
+
int rowSize = DebugUITools.getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_ROW_SIZE);
int bytePerLine = rowSize * getAddressableSize();
-
+
// check synchronized row size
- Integer size = (Integer)getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE);
- if (size != null)
- {
+ Integer size = (Integer) getSynchronizedProperty(AbstractAsyncTableRendering.PROPERTY_ROW_SIZE);
+ if (size != null) {
// row size is stored as actual number of bytes in synchronizer
- int syncRowSize = size.intValue();
- if (syncRowSize > 0)
- {
+ int syncRowSize = size.intValue();
+ if (syncRowSize > 0) {
bytePerLine = syncRowSize;
- }
- }
- else
- {
+ }
+ } else {
int defaultRowSize = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL))
- {
+ IPersistableDebugElement elmt = (IPersistableDebugElement) getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ if (elmt != null) {
+ if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL)) {
defaultRowSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_ROW_SIZE_BY_MODEL);
return defaultRowSize * getAddressableSize();
}
}
-
- if (defaultRowSize <= 0)
+
+ if (defaultRowSize <= 0) {
// no synchronized property, ask preference store by id
defaultRowSize = getDefaultRowSizeByModel(getMemoryBlock().getModelIdentifier());
-
- if (defaultRowSize > 0)
+ }
+
+ if (defaultRowSize > 0) {
bytePerLine = defaultRowSize * getAddressableSize();
+ }
}
return bytePerLine;
}
-
+
/**
* Returns the addressable size of this rendering's memory block in bytes.
*
* @return the addressable size of this rendering's memory block in bytes
*/
+ @Override
public int getAddressableSize() {
return fAddressableSize;
}
-
- private Object getSynchronizedProperty(String propertyId)
- {
+
+ private Object getSynchronizedProperty(String propertyId) {
IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
-
- if (syncService == null)
+
+ if (syncService == null) {
return null;
-
- return syncService.getProperty(getMemoryBlock(), propertyId);
+ }
+
+ return syncService.getProperty(getMemoryBlock(), propertyId);
}
-
+
private int getDefaultFromPersistableElement(String propertyId) {
int defaultValue = -1;
- IPersistableDebugElement elmt = (IPersistableDebugElement)getMemoryBlock().getAdapter(IPersistableDebugElement.class);
- if (elmt != null)
- {
+ IPersistableDebugElement elmt = (IPersistableDebugElement) getMemoryBlock().getAdapter(IPersistableDebugElement.class);
+ if (elmt != null) {
try {
Object valueMB = elmt.getProperty(this, propertyId);
- if (valueMB != null && !(valueMB instanceof Integer))
- {
+ if (valueMB != null && !(valueMB instanceof Integer)) {
IStatus status = DebugUIPlugin.newErrorStatus("Model returned invalid type on " + propertyId, null); //$NON-NLS-1$
DebugUIPlugin.log(status);
}
-
- if (valueMB != null)
- {
- Integer value = (Integer)valueMB;
+
+ if (valueMB != null) {
+ Integer value = (Integer) valueMB;
defaultValue = value.intValue();
}
} catch (CoreException e) {
@@ -1421,41 +1390,36 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
return defaultValue;
}
-
+
/**
* @param modelId the {@link String} model id
* @return default number of addressable units per line for the model
*/
- private int getDefaultRowSizeByModel(String modelId)
- {
+ private int getDefaultRowSizeByModel(String modelId) {
int row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
- if (row == 0)
- {
+ if (row == 0) {
DebugUITools.getPreferenceStore().setValue(getRowPrefId(modelId), IDebugPreferenceConstants.PREF_ROW_SIZE_DEFAULT);
}
-
+
row = DebugUITools.getPreferenceStore().getInt(getRowPrefId(modelId));
return row;
-
+
}
-
+
/**
* @param modelId the {@link String} model id
* @return default number of addressable units per column for the model
*/
- private int getDefaultColumnSizeByModel(String modelId)
- {
+ private int getDefaultColumnSizeByModel(String modelId) {
int col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
- if (col == 0)
- {
+ if (col == 0) {
DebugUITools.getPreferenceStore().setValue(getColumnPrefId(modelId), IDebugPreferenceConstants.PREF_COLUMN_SIZE_DEFAULT);
}
-
+
col = DebugUITools.getPreferenceStore().getInt(getColumnPrefId(modelId));
return col;
}
-
-
+
private String getRowPrefId(String modelId) {
String rowPrefId = IDebugPreferenceConstants.PREF_ROW_SIZE + ":" + modelId; //$NON-NLS-1$
return rowPrefId;
@@ -1465,160 +1429,158 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
String colPrefId = IDebugPreferenceConstants.PREF_COLUMN_SIZE + ":" + modelId; //$NON-NLS-1$
return colPrefId;
}
-
+
/**
* Format view tab based on the bytes per line and column.
*
- * @param bytesPerLine - number of bytes per line, possible values: (1 / 2 / 4 / 8 / 16 / 32 / 64/ 128) * addressableSize
- * @param columnSize - number of bytes per column, possible values: (1 / 2 / 4 / 8 / 16 / 32/ 64 / 128) * addressableSize
+ * @param bytesPerLine - number of bytes per line, possible values: (1 / 2 /
+ * 4 / 8 / 16 / 32 / 64/ 128) * addressableSize
+ * @param columnSize - number of bytes per column, possible values: (1 / 2 /
+ * 4 / 8 / 16 / 32/ 64 / 128) * addressableSize
* @return true if format is successful, false, otherwise
*/
- public boolean format(int bytesPerLine, int columnSize)
- {
-
+ @Override
+ public boolean format(int bytesPerLine, int columnSize) {
+
// bytes per cell must be divisible to bytesPerLine
- if (bytesPerLine % columnSize != 0)
- {
+ if (bytesPerLine % columnSize != 0) {
return false;
}
-
- if (bytesPerLine < columnSize)
- {
+
+ if (bytesPerLine < columnSize) {
return false;
}
-
+
// do not format if the view tab is already in that format
- if(fBytePerLine == bytesPerLine && fColumnSize == columnSize){
+ if (fBytePerLine == bytesPerLine && fColumnSize == columnSize) {
return false;
}
-
+
fBytePerLine = bytesPerLine;
fColumnSize = columnSize;
formatViewer();
updateSyncRowSize();
updateSyncColSize();
-
+
return true;
}
-
-
+
/**
* Returns the number of addressable units per row.
- *
+ *
* @return number of addressable units per row
*/
+ @Override
public int getAddressableUnitPerLine() {
return fBytePerLine / getAddressableSize();
}
-
+
/**
* Returns the number of addressable units per column.
*
* @return number of addressable units per column
*/
+ @Override
public int getAddressableUnitPerColumn() {
return fColumnSize / getAddressableSize();
}
-
-
+
/**
- * This method estimates the number of visible lines in the rendering
- * table.
+ * This method estimates the number of visible lines in the rendering table.
+ *
* @return estimated number of visible lines in the table
*/
- private int getNumberOfVisibleLines()
- {
- if(fTableViewer == null)
+ private int getNumberOfVisibleLines() {
+ if (fTableViewer == null) {
return -1;
-
+ }
+
Table table = fTableViewer.getTable();
int height = fTableViewer.getTable().getSize().y;
-
+
// when table is not yet created, height is zero
- if (height == 0)
- {
+ if (height == 0) {
// make use of the table viewer to estimate table size
height = fTableViewer.getTable().getParent().getSize().y;
}
-
- if (height == 0)
- {
+
+ if (height == 0) {
return 0;
}
-
+
// height of border
int border = fTableViewer.getTable().getHeaderHeight();
-
+
// height of scroll bar
int scroll = fTableViewer.getTable().getHorizontalBar().getSize().y;
- // height of table is table's area minus border and scroll bar height
- height = height-border-scroll;
+ // height of table is table's area minus border and scroll bar height
+ height = height - border - scroll;
// calculate number of visible lines
int lineHeight = getMinTableItemHeight(table);
-
- int numberOfLines = height/lineHeight;
-
- if (numberOfLines <= 0)
+
+ int numberOfLines = height / lineHeight;
+
+ if (numberOfLines <= 0) {
return 0;
-
- return numberOfLines;
+ }
+
+ return numberOfLines;
}
-
- private int getMinTableItemHeight(Table table){
-
+
+ private int getMinTableItemHeight(Table table) {
+
// Hack to get around Linux GTK problem.
// On Linux GTK, table items have variable item height as
- // carriage returns are actually shown in a cell. Some rows will be
- // taller than others. When calculating number of visible lines, we
- // need to find the smallest table item height. Otherwise, the rendering
- // underestimates the number of visible lines. As a result the rendering
+ // carriage returns are actually shown in a cell. Some rows will be
+ // taller than others. When calculating number of visible lines, we
+ // need to find the smallest table item height. Otherwise, the rendering
+ // underestimates the number of visible lines. As a result the rendering
// will not be able to get more memory as needed.
- if (MemoryViewUtil.isLinuxGTK())
- {
+ if (MemoryViewUtil.isLinuxGTK()) {
// check each of the items and find the minimum
TableItem[] items = table.getItems();
int minHeight = table.getItemHeight();
- for (int i=0; i<items.length; i++)
- {
- if (items[i].getData() != null)
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].getData() != null) {
minHeight = Math.min(items[i].getBounds(0).height, minHeight);
+ }
}
-
+
return minHeight;
-
+
}
return table.getItemHeight();
}
-
- private BigInteger getMemoryBlockBaseAddress() throws DebugException
- {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- return ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress();
- else
+
+ private BigInteger getMemoryBlockBaseAddress() throws DebugException {
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ return ((IMemoryBlockExtension) getMemoryBlock()).getBigBaseAddress();
+ } else {
return BigInteger.valueOf(getMemoryBlock().getStartAddress());
+ }
}
-
+
/**
* Displays the given message on the error page
+ *
* @param message - the message to display
*/
- protected void showMessage(final String message)
- {
+ protected void showMessage(final String message) {
fSwitchPageJob.setShowMessagePage(true);
fSwitchPageJob.setMessage(message);
fSwitchPageJob.schedule();
}
-
+
/**
* Returns the number of bytes displayed in a single column cell.
*
* @return the number of bytes displayed in a single column cell
*/
- public int getBytesPerColumn()
- {
+ @Override
+ public int getBytesPerColumn() {
return fColumnSize;
}
@@ -1627,53 +1589,52 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
*
* @return the number of bytes displayed in a row
*/
- public int getBytesPerLine()
- {
+ @Override
+ public int getBytesPerLine() {
return fBytePerLine;
}
-
+
/**
* Returns whether the error page is displayed.
*
* @return whether the error page is displayed
*/
- public boolean isDisplayingError()
- {
+ public boolean isDisplayingError() {
return fShowMessage;
}
-
+
/**
* Displays the content of the table viewer.
*/
- public void showTable()
- {
+ public void showTable() {
fSwitchPageJob.setShowMessagePage(false);
fSwitchPageJob.schedule();
}
-
+
private BigInteger getTopVisibleAddress() {
-
- if (fTableViewer == null)
+
+ if (fTableViewer == null) {
return BigInteger.valueOf(0);
+ }
Table table = fTableViewer.getTable();
int topIndex = table.getTopIndex();
- if (topIndex < 0) { return null; }
+ if (topIndex < 0) {
+ return null;
+ }
- if (table.getItemCount() > topIndex)
- {
- MemorySegment topItem = (MemorySegment)table.getItem(topIndex).getData();
- if (topItem != null)
- {
+ if (table.getItemCount() > topIndex) {
+ MemorySegment topItem = (MemorySegment) table.getItem(topIndex).getData();
+ if (topItem != null) {
return topItem.getAddress();
}
}
return null;
}
-
- private synchronized void reloadTable(final BigInteger topAddress) {
-
+
+ private synchronized void reloadTable(final BigInteger topAddress) {
+
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
DebugUIPlugin.trace(this + " reload at: " + topAddress.toString(16)); //$NON-NLS-1$
}
@@ -1683,82 +1644,80 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fTableViewer.refresh();
}
-
- private boolean isAtTopLimit()
- {
+
+ private boolean isAtTopLimit() {
BigInteger startAddress = fContentDescriptor.getStartAddress();
startAddress = MemoryViewUtil.alignToBoundary(startAddress, getAddressableUnitPerLine());
AbstractVirtualContentTableModel model = fTableViewer.getVirtualContentModel();
-
- if (model != null)
- {
+
+ if (model != null) {
Object key = model.getKey(0);
- if (key instanceof BigInteger)
- {
- BigInteger startBufferAddress = (BigInteger)key;
+ if (key instanceof BigInteger) {
+ BigInteger startBufferAddress = (BigInteger) key;
startBufferAddress = MemoryViewUtil.alignToBoundary(startBufferAddress, getAddressableUnitPerLine());
-
- if (startAddress.compareTo(startBufferAddress) == 0)
+
+ if (startAddress.compareTo(startBufferAddress) == 0) {
return true;
+ }
}
}
return false;
}
-
- private boolean isAtBottomLimit()
- {
+
+ private boolean isAtBottomLimit() {
BigInteger endAddress = fContentDescriptor.getEndAddress();
endAddress = MemoryViewUtil.alignToBoundary(endAddress, getAddressableUnitPerLine());
-
+
AbstractVirtualContentTableModel model = fTableViewer.getVirtualContentModel();
- if (model != null)
- {
+ if (model != null) {
int numElements = model.getElements().length;
- Object key = model.getKey(numElements-1);
- if (key instanceof BigInteger)
- {
- BigInteger endBufferAddress = (BigInteger)key;
+ Object key = model.getKey(numElements - 1);
+ if (key instanceof BigInteger) {
+ BigInteger endBufferAddress = (BigInteger) key;
endBufferAddress = MemoryViewUtil.alignToBoundary(endBufferAddress, getAddressableUnitPerLine());
-
- if (endAddress.compareTo(endBufferAddress) == 0)
+
+ if (endAddress.compareTo(endBufferAddress) == 0) {
return true;
+ }
}
}
-
- return false;
+
+ return false;
}
-
+
private void formatViewer() {
-
+
fTableViewer.disposeColumns();
fTableViewer.disposeCellEditors();
doFormatTable();
fTableViewer.setColumnHeaders(getColumnProperties());
fTableViewer.showColumnHeader(true);
-
+
Table table = fTableViewer.getTable();
int colCnt = table.getColumnCount();
CellEditor[] editors = new CellEditor[fTableViewer.getTable().getColumnCount()];
- for (int i=0; i<colCnt; i++)
- {
+ for (int i = 0; i < colCnt; i++) {
editors[i] = createCellEditor(table, i);
}
-
+
fTableViewer.setCellEditors(editors);
-
+
fTableViewer.formatViewer();
-
+
// This resize needs to happen after the viewer has finished
// getting the labels.
- // This fix is a hack to delay the resize until the viewer has a chance to get
- // the setData event from the UI thread. Otherwise, the columns will be
+ // This fix is a hack to delay the resize until the viewer has a chance
+ // to get
+ // the setData event from the UI thread. Otherwise, the columns will be
// squeezed together.
- UIJob job = new UIJob("resize to fit"){ //$NON-NLS-1$
+ UIJob job = new UIJob("resize to fit") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
resizeColumnsToPreferredSize();
return Status.OK_STATUS;
- }};
-
+ }
+ };
+
job.setSystem(true);
job.schedule();
}
@@ -1766,246 +1725,253 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
private void doFormatTable() {
int bytesPerLine = getBytesPerLine();
int columnSize = getBytesPerColumn();
- int numColumns = bytesPerLine/columnSize;
-
+ int numColumns = bytesPerLine / columnSize;
+
Table table = fTableViewer.getTable();
- TableColumn column0 = new TableColumn(table,SWT.LEFT,0);
- column0.setText(DebugUIMessages.AbstractTableRendering_2);
-
+ TableColumn column0 = new TableColumn(table, SWT.LEFT, 0);
+ column0.setText(DebugUIMessages.AbstractTableRendering_2);
+
// create new byte columns
- TableColumn [] byteColumns = new TableColumn[numColumns];
- for (int i=0;i<byteColumns.length; i++)
- {
- TableColumn column = new TableColumn(table, SWT.LEFT, i+1);
+ TableColumn[] byteColumns = new TableColumn[numColumns];
+ for (int i = 0; i < byteColumns.length; i++) {
+ TableColumn column = new TableColumn(table, SWT.LEFT, i + 1);
byteColumns[i] = column;
}
-
- //Empty column for cursor navigation
- TableColumn emptyCol = new TableColumn(table,SWT.LEFT,byteColumns.length+1);
+
+ // Empty column for cursor navigation
+ TableColumn emptyCol = new TableColumn(table, SWT.LEFT, byteColumns.length + 1);
emptyCol.setText(" "); //$NON-NLS-1$
emptyCol.setWidth(1);
emptyCol.setResizable(false);
- table.setHeaderVisible(true);
-
- // allow clients to override column labels
- setColumnHeadings();
-
- }
-
- private String[] getColumnProperties()
- {
- int numColumns = getAddressableUnitPerLine()/getAddressableUnitPerColumn();
+ table.setHeaderVisible(true);
+
+ // allow clients to override column labels
+ setColumnHeadings();
+
+ }
+
+ private String[] getColumnProperties() {
+ int numColumns = getAddressableUnitPerLine() / getAddressableUnitPerColumn();
// +2 to include properties for address and navigation column
- String[] columnProperties = new String[numColumns+2];
+ String[] columnProperties = new String[numColumns + 2];
columnProperties[0] = TableRenderingLine.P_ADDRESS;
-
+
int addressableUnit = getAddressableUnitPerColumn();
// use column beginning offset to the row address as properties
- for (int i=1; i<columnProperties.length-1; i++)
- {
- // column properties are stored as number of addressable units from the
+ for (int i = 1; i < columnProperties.length - 1; i++) {
+ // column properties are stored as number of addressable units from
+ // the
// the line address
- columnProperties[i] = Integer.toHexString((i-1)*addressableUnit);
+ columnProperties[i] = Integer.toHexString((i - 1) * addressableUnit);
}
-
+
// Empty column for cursor navigation
- columnProperties[columnProperties.length-1] = " "; //$NON-NLS-1$
+ columnProperties[columnProperties.length - 1] = " "; //$NON-NLS-1$
return columnProperties;
}
-
- /**
- * Create a cell editor from the specified composite and column.
- * @param composite parent composite that the cell editor is to be created from.
+
+ /**
+ * Create a cell editor from the specified composite and column.
+ *
+ * @param composite parent composite that the cell editor is to be created
+ * from.
* @param column the column where the cell editor is required
* @return the cell editor for editing memory
*
* @since 3.3
- *
+ *
*/
protected CellEditor createCellEditor(Composite composite, int column) {
-
- return new TextCellEditor(composite);
- }
-
-
- private ICellModifier newInternalCellModifier()
- {
- return new AsyncTableRenderingCellModifier(this, createCellModifier());
- }
-
- /**
- * Create a custom cell modifier for this rendering. Return null
- * if the default cell modifier is to be used.
- * @return the cell modifier for this rendering, or <code>null</code> if the
- * default cell modifier is to be used.
- *
- * @since 3.3
- *
- */
- protected ICellModifier createCellModifier() {
- return null;
- }
-
- /* (non-Javadoc)
+
+ return new TextCellEditor(composite);
+ }
+
+ private ICellModifier newInternalCellModifier() {
+ return new AsyncTableRenderingCellModifier(this, createCellModifier());
+ }
+
+ /**
+ * Create a custom cell modifier for this rendering. Return null if the
+ * default cell modifier is to be used.
+ *
+ * @return the cell modifier for this rendering, or <code>null</code> if the
+ * default cell modifier is to be used.
+ *
+ * @since 3.3
+ *
+ */
+ protected ICellModifier createCellModifier() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.debug.ui.memory.AbstractMemoryRendering#dispose()
*/
+ @Override
public void dispose() {
-
- if (fIsDisposed)
+
+ if (fIsDisposed) {
return;
-
+ }
+
fIsDisposed = true;
-
+
removeListeners();
-
- if (fMenuMgr != null)
- {
+
+ if (fMenuMgr != null) {
fMenuMgr.removeAll();
fMenuMgr.dispose();
fMenuMgr = null;
}
-
- if (fTableViewer != null)
- {
- if (fViewerListener != null)
+
+ if (fTableViewer != null) {
+ if (fViewerListener != null) {
fTableViewer.removeVirtualContentListener(fViewerListener);
-
- if (fPresentationErrorListener != null)
+ }
+
+ if (fPresentationErrorListener != null) {
fTableViewer.removePresentationErrorListener(fPresentationErrorListener);
-
+ }
+
fTableViewer.removeSelectionChangedListener(fViewerSelectionChangedListener);
fTableViewer.getTable().getVerticalBar().removeSelectionListener(fScrollBarSelectionListener);
-
+
fTableViewer.dispose();
}
-
+
if (fPresentationContext != null) {
- fPresentationContext.dispose();
+ fPresentationContext.dispose();
}
-
- if (fToolTipShell != null && !fToolTipShell.isDisposed())
- {
+
+ if (fToolTipShell != null && !fToolTipShell.isDisposed()) {
fToolTipShell.dispose();
fToolTipShell = null;
}
-
+
fIsDisposed = true;
-
+
super.dispose();
}
-
+
/**
- * Updates the label of this rendering, optionally displaying the
- * base address of this rendering's memory block.
+ * Updates the label of this rendering, optionally displaying the base
+ * address of this rendering's memory block.
*
* @param showAddress whether to display the base address of this
- * rendering's memory block in this rendering's label
+ * rendering's memory block in this rendering's label
*/
- protected void updateRenderingLabel(final boolean showAddress)
- {
- Job job = new Job("Update Rendering Label"){ //$NON-NLS-1$
+ protected void updateRenderingLabel(final boolean showAddress) {
+ Job job = new Job("Update Rendering Label") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
- if (fIsDisposed)
+ if (fIsDisposed) {
return Status.OK_STATUS;
+ }
fLabel = buildLabel(showAddress);
firePropertyChangedEvent(new PropertyChangeEvent(AbstractAsyncTableRendering.this, IBasicPropertyConstants.P_TEXT, null, fLabel));
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.setRule(serialByRenderingRule);
job.schedule();
}
-
+
private String buildLabel(boolean showAddress) {
String label = IInternalDebugCoreConstants.EMPTY_STRING;
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- label = ((IMemoryBlockExtension)getMemoryBlock()).getExpression();
-
- if (label == null)
- {
- label = DebugUIMessages.AbstractTableRendering_8;
- }
-
- if (label.startsWith("&")) //$NON-NLS-1$
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ label = ((IMemoryBlockExtension) getMemoryBlock()).getExpression();
+
+ if (label == null) {
+ label = DebugUIMessages.AbstractTableRendering_8;
+ }
+
+ if (label.startsWith("&")) { //$NON-NLS-1$
label = "&" + label; //$NON-NLS-1$
-
+ }
+
try {
- if (showAddress && ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress() != null)
- {
+ if (showAddress && ((IMemoryBlockExtension) getMemoryBlock()).getBigBaseAddress() != null) {
label += " : 0x"; //$NON-NLS-1$
- label += ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress().toString(16).toUpperCase();
+ label += ((IMemoryBlockExtension) getMemoryBlock()).getBigBaseAddress().toString(16).toUpperCase();
}
} catch (DebugException e) {
// do nothing, the label will not show the address
}
- }
- else
- {
+ } else {
long address = getMemoryBlock().getStartAddress();
label = Long.toHexString(address).toUpperCase();
}
-
+
String preName = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId()).getLabel();
-
- if (preName != null)
+
+ if (preName != null) {
label += " <" + preName + ">"; //$NON-NLS-1$ //$NON-NLS-2$
-
+ }
+
return decorateLabel(label);
}
-
- /* Returns the label of this rendering.
- *
+
+ /*
+ * Returns the label of this rendering.
* @return label of this rendering
*/
+ @Override
public String getLabel() {
-
- if (fLabel == null)
- {
+
+ if (fLabel == null) {
fLabel = DebugUIMessages.AbstractAsyncTableRendering_1;
updateRenderingLabel(isVisible());
}
-
+
return fLabel;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
-
- if (adapter == IColorProvider.class)
+
+ if (adapter == IColorProvider.class) {
return getColorProviderAdapter();
-
- if (adapter == ILabelProvider.class)
+ }
+
+ if (adapter == ILabelProvider.class) {
return getLabelProviderAdapter();
-
- if (adapter == IFontProvider.class)
+ }
+
+ if (adapter == IFontProvider.class) {
return getFontProviderAdapter();
-
- if (adapter == IModelChangedListener.class)
- {
+ }
+
+ if (adapter == IModelChangedListener.class) {
return fModelChangedListener;
}
-
- if (adapter == IWorkbenchAdapter.class)
- {
+
+ if (adapter == IWorkbenchAdapter.class) {
// needed workbench adapter to fill the title of property page
if (fWorkbenchAdapter == null) {
fWorkbenchAdapter = new IWorkbenchAdapter() {
+ @Override
public Object[] getChildren(Object o) {
return new Object[0];
}
-
+
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
-
+
+ @Override
public String getLabel(Object o) {
return AbstractAsyncTableRendering.this.getLabel();
}
-
+
+ @Override
public Object getParent(Object o) {
return null;
}
@@ -2013,105 +1979,106 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
return fWorkbenchAdapter;
}
-
- if (adapter == TableRenderingContentDescriptor.class)
+
+ if (adapter == TableRenderingContentDescriptor.class) {
return getContentDescriptor();
-
+ }
+
return super.getAdapter(adapter);
}
-
+
/**
- * Returns the number of characters a byte will convert to
- * or -1 if unknown.
+ * Returns the number of characters a byte will convert to or -1 if unknown.
*
- * @return the number of characters a byte will convert to
- * or -1 if unknown
+ * @return the number of characters a byte will convert to or -1 if unknown
*/
- public int getNumCharsPerByte()
- {
+ @Override
+ public int getNumCharsPerByte() {
return -1;
}
-
+
/**
* Create actions for this rendering
*/
protected void createActions() {
-
+
fCopyToClipboardAction = new AsyncCopyTableRenderingAction(this, fTableViewer);
fGoToAddressAction = new RenderingGoToAddressAction(getMemoryRenderingContainer(), this);
fResetMemoryBlockAction = new ResetToBaseAddressAction(this);
-
+
fPrintViewTabAction = new AsyncPrintTableRenderingAction(this, fTableViewer);
-
- fFormatRenderingAction = new FormatTableRenderingAction(this);
+
+ fFormatRenderingAction = new FormatTableRenderingAction(this);
fReformatAction = new ReformatAction(this);
fToggleAddressColumnAction = new ToggleAddressColumnAction();
-
+
IMemoryRenderingSite site = getMemoryRenderingContainer().getMemoryRenderingSite();
- if (site.getSite().getSelectionProvider() != null)
- {
- fPropertiesDialogAction = new PropertyDialogAction(site.getSite(),site.getSite().getSelectionProvider());
+ if (site.getSite().getSelectionProvider() != null) {
+ fPropertiesDialogAction = new PropertyDialogAction(site.getSite(), site.getSite().getSelectionProvider());
}
-
+
fNextAction = new NextPageAction();
fPrevAction = new PrevPageAction();
}
-
+
/**
* Returns the currently selected address in this rendering.
*
* @return the currently selected address in this rendering
*/
+ @Override
public BigInteger getSelectedAddress() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return null;
-
+ }
+
Object key = fTableViewer.getSelectionKey();
-
- if (key != null && key instanceof BigInteger)
- return (BigInteger)key;
-
+
+ if (key != null && key instanceof BigInteger) {
+ return (BigInteger) key;
+ }
+
return null;
}
/**
* Returns the currently selected content in this rendering as MemoryByte.
*
- * @return the currently selected content in array of MemoryByte.
- * Returns an empty array if the selected address is out of buffered range.
+ * @return the currently selected content in array of MemoryByte. Returns an
+ * empty array if the selected address is out of buffered range.
*/
- public MemoryByte[] getSelectedAsBytes()
- {
- if (getSelectedAddress() == null)
+ @Override
+ public MemoryByte[] getSelectedAsBytes() {
+ if (getSelectedAddress() == null) {
return new MemoryByte[0];
-
+ }
+
Object key = fTableViewer.getSelectionKey();
AbstractVirtualContentTableModel model = fTableViewer.getVirtualContentModel();
-
- if (model != null)
- {
- model = (AbstractVirtualContentTableModel)fTableViewer.getModel();
+
+ if (model != null) {
+ model = (AbstractVirtualContentTableModel) fTableViewer.getModel();
int row = model.indexOfKey(key);
Object element = model.getElement(row);
int col = model.columnOf(element, key);
-
+
// check precondition
- if (col <= 0 || col > getBytesPerLine()/getBytesPerColumn())
- {
+ if (col <= 0 || col > getBytesPerLine() / getBytesPerColumn()) {
return new MemoryByte[0];
}
-
- if (!(element instanceof MemorySegment))
+
+ if (!(element instanceof MemorySegment)) {
return new MemoryByte[0];
-
- MemorySegment line = (MemorySegment)element;
- int offset = (col-1)*(getAddressableUnitPerColumn()*getAddressableSize());
-
+ }
+
+ MemorySegment line = (MemorySegment) element;
+ int offset = (col - 1) * (getAddressableUnitPerColumn() * getAddressableSize());
+
// make a copy of the bytes to ensure that data cannot be changed
// by caller
- MemoryByte[] bytes = line.getBytes(offset, getAddressableUnitPerColumn()*getAddressableSize());
+ MemoryByte[] bytes = line.getBytes(offset, getAddressableUnitPerColumn() * getAddressableSize());
MemoryByte[] retBytes = new MemoryByte[bytes.length];
-
+
System.arraycopy(bytes, 0, retBytes, 0, bytes.length);
return retBytes;
}
@@ -2123,82 +2090,73 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
*
* @return the currently selected content in this rendering
*/
+ @Override
public String getSelectedAsString() {
- if (getSelectedAddress() == null)
+ if (getSelectedAddress() == null) {
return IInternalDebugCoreConstants.EMPTY_STRING;
-
+ }
+
MemoryByte[] bytes = getSelectedAsBytes();
- if (bytes.length > 0)
- {
+ if (bytes.length > 0) {
return getString(this.getRenderingId(), getSelectedAddress(), bytes);
- }
- else
+ } else {
return IInternalDebugCoreConstants.EMPTY_STRING;
-
+ }
+
}
/**
- * Moves the cursor to the specified address.
- * Will load more memory if the address is not currently visible.
+ * Moves the cursor to the specified address. Will load more memory if the
+ * address is not currently visible.
*
* @param address address to position cursor at
* @throws DebugException if an exception occurs
*/
+ @Override
public void goToAddress(final BigInteger address) throws DebugException {
-
- if (!fIsCreated || fTableViewer.getVirtualContentModel() == null)
+
+ if (!fIsCreated || fTableViewer.getVirtualContentModel() == null) {
return;
+ }
final int keyIndex = fTableViewer.getVirtualContentModel().indexOfKey(address);
if (keyIndex < 0) {
// if not extended memory block
// do not allow user to go to an address that's out of range
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- {
- Status stat = new Status(
- IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null
- );
+ if (!(getMemoryBlock() instanceof IMemoryBlockExtension)) {
+ Status stat = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null);
DebugException e = new DebugException(stat);
throw e;
}
-
+
BigInteger startAdd = fContentDescriptor.getStartAddress();
BigInteger endAdd = fContentDescriptor.getEndAddress();
-
- if (address.compareTo(startAdd) < 0 ||
- address.compareTo(endAdd) > 0)
- {
- Status stat = new Status(
- IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(),
- DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null
- );
+
+ if (address.compareTo(startAdd) < 0 || address.compareTo(endAdd) > 0) {
+ Status stat = new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), DebugException.NOT_SUPPORTED, DebugUIMessages.AbstractTableRendering_11, null);
DebugException e = new DebugException(stat);
throw e;
}
}
-
- Runnable runnable = new Runnable(){
+
+ Runnable runnable = new Runnable() {
+ @Override
public void run() {
showTable();
- if (keyIndex >=0)
- {
+ if (keyIndex >= 0) {
// address is within range, set cursor and reveal
fTableViewer.setSelection(address);
updateSyncTopAddress(getTopVisibleAddress());
updateSyncSelectedAddress(address);
- }
- else
- {
+ } else {
// load at the address
fTableViewer.setSelection(address);
reloadTable(address);
updateSyncSelectedAddress(address);
- if (!isDynamicLoad())
- {
+ if (!isDynamicLoad()) {
updateSyncPageStartAddress(address);
}
updateSyncTopAddress(address);
@@ -2206,374 +2164,373 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
}
};
runOnUIThread(runnable);
- }
-
+ }
+
/**
- * Refresh the table viewer with the current top visible address.
- * Update labels in the memory rendering.
+ * Refresh the table viewer with the current top visible address. Update
+ * labels in the memory rendering.
*/
+ @Override
public void refresh() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
fTableViewer.refresh();
}
-
/**
* Resize column to the preferred size.
*/
+ @Override
public void resizeColumnsToPreferredSize() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
fTableViewer.resizeColumnsToPreferredSize();
- if (!fIsShowAddressColumn)
- {
+ if (!fIsShowAddressColumn) {
final TableColumn column = fTableViewer.getTable().getColumn(0);
column.addControlListener(new ControlListener() {
+ @Override
public void controlMoved(ControlEvent e) {
}
+ @Override
public void controlResized(ControlEvent e) {
column.removeControlListener(this);
column.setWidth(0);
- }});
+ }
+ });
}
}
/**
* Updates labels of this rendering.
*/
- public void updateLabels()
- {
- if (!fIsCreated)
+ @Override
+ public void updateLabels() {
+ if (!fIsCreated) {
return;
+ }
- UIJob job = new UIJob("updateLabels"){ //$NON-NLS-1$
+ UIJob job = new UIJob("updateLabels") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
-
+
// do not handle if the rendering is already disposed
- if (fPageBook.isDisposed())
+ if (fPageBook.isDisposed()) {
return Status.OK_STATUS;
-
+ }
+
// update tab labels
updateRenderingLabel(true);
-
- if (fTableViewer != null)
- {
+
+ if (fTableViewer != null) {
// update column labels
setColumnHeadings();
-
+
// rebuild cache and force labels to be refreshed
fTableViewer.formatViewer();
}
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
-
+
/**
* Fills the context menu for this rendering
*
* @param menu menu to fill
*/
- protected void fillContextMenu(IMenuManager menu) {
-
+ protected void fillContextMenu(IMenuManager menu) {
+
menu.add(new Separator(EMPTY_MEMORY_GROUP));
menu.add(new Separator());
menu.add(fResetMemoryBlockAction);
menu.add(fGoToAddressAction);
menu.add(new Separator(EMPTY_NAVIGATION_GROUP));
-
+
menu.add(new Separator());
menu.add(fFormatRenderingAction);
- if (!isDynamicLoad() && getMemoryBlock() instanceof IMemoryBlockExtension)
- {
+ if (!isDynamicLoad() && getMemoryBlock() instanceof IMemoryBlockExtension) {
menu.add(new Separator());
menu.add(fPrevAction);
menu.add(fNextAction);
menu.add(new Separator(EMPTY_NON_AUTO_LOAD_GROUP));
}
-
+
menu.add(new Separator());
menu.add(fReformatAction);
menu.add(fToggleAddressColumnAction);
menu.add(new Separator());
menu.add(fCopyToClipboardAction);
menu.add(fPrintViewTabAction);
- if (fPropertiesDialogAction != null)
- {
+ if (fPropertiesDialogAction != null) {
menu.add(new Separator());
menu.add(fPropertiesDialogAction);
menu.add(new Separator(EMPTY_PROPERTY_GROUP));
}
-
+
menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
-
- private int getPageSizeInUnits()
- {
+
+ private int getPageSizeInUnits() {
return fPageSize * getAddressableUnitPerLine();
}
-
- private void getPageSizeFromPreference()
- {
+
+ private void getPageSizeFromPreference() {
fPageSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PAGE_SIZE);
}
-
- private void getPreBufferSizeFromPreference()
- {
+
+ private void getPreBufferSizeFromPreference() {
fPreBufferSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_PRE_BUFFER_SIZE);
}
-
- private void getPostBufferSizeFromPreference()
- {
+
+ private void getPostBufferSizeFromPreference() {
fPostBufferSize = DebugUIPlugin.getDefault().getPreferenceStore().getInt(IDebugPreferenceConstants.PREF_TABLE_RENDERING_POST_BUFFER_SIZE);
}
-
+
private void updateDynamicLoadProperty() {
-
- boolean value = DebugUIPlugin
- .getDefault()
- .getPreferenceStore()
- .getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
-
- if (value != isDynamicLoad())
- {
+
+ boolean value = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
+
+ if (value != isDynamicLoad()) {
setDynamicLoad(value);
-
+
if (!fIsDisposed) {
if (isDynamicLoad()) {
fContentDescriptor.setPostBuffer(getPostBufferSize());
fContentDescriptor.setPreBuffer(getPreBufferSize());
fContentDescriptor.setNumLines(getNumberOfVisibleLines());
-
+
} else {
fContentDescriptor.setPostBuffer(0);
fContentDescriptor.setPreBuffer(0);
fContentDescriptor.setNumLines(fPageSize);
- }
+ }
}
}
}
-
- private void getDynamicLoadFromPreference()
- {
+
+ private void getDynamicLoadFromPreference() {
setDynamicLoad(DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM));
}
-
- private boolean isDynamicLoad()
- {
+
+ private boolean isDynamicLoad() {
return fContentDescriptor.isDynamicLoad();
}
-
- private int getPageSize()
- {
+
+ private int getPageSize() {
return fPageSize;
}
-
+
private int getNumLinesToLoad() {
int numberOfLines = -1;
-
- if (isDynamicLoad())
+
+ if (isDynamicLoad()) {
numberOfLines = getNumberOfVisibleLines();
- else
+ } else {
numberOfLines = getPageSize();
-
+ }
+
return numberOfLines;
}
-
- private void setDynamicLoad(boolean load)
- {
+
+ private void setDynamicLoad(boolean load) {
fContentDescriptor.setDynamicLoad(load);
}
-
- private void handlePageStartAddressChanged(BigInteger address)
- {
+
+ private void handlePageStartAddressChanged(BigInteger address) {
// do not handle if in dynamic mode
- if (isDynamicLoad())
+ if (isDynamicLoad()) {
return;
-
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
+ }
+
+ if (!(getMemoryBlock() instanceof IMemoryBlockExtension)) {
return;
-
+ }
+
// do not handle event if the base address of the memory
// block has changed, wait for debug event to update to
// new location
- if (isMemoryBlockBaseAddressChanged())
+ if (isMemoryBlockBaseAddressChanged()) {
return;
+ }
Object key = fTableViewer.getKey(0);
- if(key != null) {
- if(key.equals(address))
+ if (key != null) {
+ if (key.equals(address)) {
return;
+ }
}
-
+
BigInteger start = fContentDescriptor.getStartAddress();
BigInteger end = fContentDescriptor.getEndAddress();
-
+
// smaller than start address, load at start address
- if (address.compareTo(start) < 0)
- {
- if (isAtTopLimit())
+ if (address.compareTo(start) < 0) {
+ if (isAtTopLimit()) {
return;
-
+ }
+
address = start;
}
-
+
// bigger than end address, no need to load, already at top
- if (address.compareTo(end) > 0)
- {
- if (isAtBottomLimit())
+ if (address.compareTo(end) > 0) {
+ if (isAtBottomLimit()) {
return;
-
+ }
+
address = end.subtract(BigInteger.valueOf(getPageSizeInUnits()));
}
-
+
fContentDescriptor.setLoadAddress(address);
final BigInteger finaladdress = address;
Runnable runnable = new Runnable() {
+ @Override
public void run() {
- if (fTableViewer.getTable().isDisposed())
+ if (fTableViewer.getTable().isDisposed()) {
return;
-
+ }
+
fTableViewer.setTopIndex(finaladdress);
refresh();
- }};
-
+ }
+ };
+
runOnUIThread(runnable);
updateSyncPageStartAddress(address);
updateSyncTopAddress(address);
}
+
private void handleDyanicLoadChanged() {
-
+
// if currently in dynamic load mode, update page
// start address
BigInteger pageStart = getTopVisibleAddress();
updateSyncPageStartAddress(pageStart);
-
+
updateDynamicLoadProperty();
- if (isDynamicLoad())
- {
+ if (isDynamicLoad()) {
refresh();
fTableViewer.setTopIndex(pageStart);
- }
- else
- {
+ } else {
handlePageStartAddressChanged(pageStart);
}
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
*/
- public void becomesHidden() {
+ @Override
+ public void becomesHidden() {
// creates new object for storing potential changes in sync properties
- fPendingSyncProperties = new PendingPropertyChanges();
+ fPendingSyncProperties = new PendingPropertyChanges();
super.becomesHidden();
-
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- updateRenderingLabel(false);
+
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ updateRenderingLabel(false);
+ }
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesVisible()
*/
+ @Override
public void becomesVisible() {
-
- if (!fIsCreated)
- {
- // label can still be constructed even though the rendering has not finished being
+
+ if (!fIsCreated) {
+ // label can still be constructed even though the rendering has not
+ // finished being
// initialized
updateRenderingLabel(true);
super.becomesVisible();
return;
}
-
+
// do not do anything if already visible
- if (isVisible() == true)
- {
+ if (isVisible() == true) {
// super should always be called
super.becomesVisible();
return;
}
-
+
super.becomesVisible();
-
- if (fPendingSyncProperties != null)
- {
+
+ if (fPendingSyncProperties != null) {
// deal with format
boolean format = false;
int rowSize = getBytesPerLine();
- if (fPendingSyncProperties.getRowSize() > 0)
- {
+ if (fPendingSyncProperties.getRowSize() > 0) {
format = true;
rowSize = fPendingSyncProperties.getRowSize();
}
-
+
int colSize = getBytesPerColumn();
- if (fPendingSyncProperties.getColumnSize() > 0)
- {
+ if (fPendingSyncProperties.getColumnSize() > 0) {
format = true;
colSize = fPendingSyncProperties.getColumnSize();
}
-
- if (format)
+
+ if (format) {
format(rowSize, colSize);
-
+ }
+
BigInteger selectedAddress = fPendingSyncProperties.getSelectedAddress();
- if (selectedAddress != null)
+ if (selectedAddress != null) {
fTableViewer.setSelection(selectedAddress);
-
+ }
+
updateDynamicLoadProperty();
-
- if (isDynamicLoad())
- {
+
+ if (isDynamicLoad()) {
BigInteger topVisibleAddress = fPendingSyncProperties.getTopVisibleAddress();
- if (topVisibleAddress != null)
- {
+ if (topVisibleAddress != null) {
fContentDescriptor.setLoadAddress(topVisibleAddress);
fTableViewer.setTopIndex(topVisibleAddress);
}
- }
- else if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
- {
+ } else if (!(getMemoryBlock() instanceof IMemoryBlockExtension)) {
BigInteger topVisibleAddress = fPendingSyncProperties.getTopVisibleAddress();
- if (topVisibleAddress != null)
+ if (topVisibleAddress != null) {
fTableViewer.setTopIndex(topVisibleAddress);
- }
- else
- {
- if (fPendingSyncProperties.getPageSize() > 0)
- {
+ }
+ } else {
+ if (fPendingSyncProperties.getPageSize() > 0) {
fPageSize = fPendingSyncProperties.getPageSize();
fContentDescriptor.setNumLines(fPageSize);
}
-
+
BigInteger pageStartAddress = fPendingSyncProperties.getPageStartAddress();
- if (pageStartAddress != null)
+ if (pageStartAddress != null) {
fContentDescriptor.setLoadAddress(pageStartAddress);
-
+ }
+
fTableViewer.setTopIndex(pageStartAddress);
}
-
+
showTable();
refresh();
}
updateRenderingLabel(true);
-
+
Job job = new Job("becomesVisible") //$NON-NLS-1$
{
+ @Override
protected IStatus run(IProgressMonitor monitor) {
- if (fIsDisposed)
+ if (fIsDisposed) {
return Status.OK_STATUS;
+ }
try {
fContentDescriptor.updateContentBaseAddress();
} catch (DebugException e) {
@@ -2584,163 +2541,177 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
};
job.setSystem(true);
job.schedule();
-
+
// discard these properties
fPendingSyncProperties = null;
}
-
+
/**
* Handle column size changed event from synchronizer
+ *
* @param newColumnSize the new column size
*/
private void columnSizeChanged(final int newColumnSize) {
// ignore event if rendering is not visible
- if (!isVisible())
+ if (!isVisible()) {
return;
+ }
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
int rowSize = getBytesPerLine();
- if (rowSize < newColumnSize)
+ if (rowSize < newColumnSize) {
rowSize = newColumnSize;
-
+ }
+
format(rowSize, newColumnSize);
}
});
}
-
+
/**
* @param newRowSize - new row size in number of bytes
*/
- private void rowSizeChanged(final int newRowSize)
- {
+ private void rowSizeChanged(final int newRowSize) {
// ignore event if rendering is not visible
- if (!isVisible())
+ if (!isVisible()) {
return;
-
+ }
+
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
int colSize = getBytesPerColumn();
- if (newRowSize < colSize)
+ if (newRowSize < colSize) {
colSize = newRowSize;
-
+ }
+
format(newRowSize, colSize);
}
- });
+ });
}
-
+
/**
* update selected address in synchronizer if update is true.
+ *
* @param address the address to update
*/
private void updateSyncSelectedAddress(BigInteger address) {
-
- if (!fIsCreated)
+
+ if (!fIsCreated) {
return;
+ }
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_SELECTED_ADDRESS, null, address);
firePropertyChangedEvent(event);
}
-
+
/**
* update column size in synchronizer
*/
private void updateSyncColSize() {
-
- if (!fIsCreated)
+
+ if (!fIsCreated) {
return;
-
+ }
+
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_COL_SIZE, null, new Integer(fColumnSize));
firePropertyChangedEvent(event);
}
-
+
/**
* update column size in synchronizer
*/
private void updateSyncRowSize() {
-
- if (!fIsCreated)
+
+ if (!fIsCreated) {
return;
-
+ }
+
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_ROW_SIZE, null, new Integer(fBytePerLine));
firePropertyChangedEvent(event);
}
-
+
/**
* update top visible address in synchronizer
+ *
* @param address the address to update
*/
private void updateSyncTopAddress(BigInteger address) {
-
- if (!fIsCreated)
+
+ if (!fIsCreated) {
return;
+ }
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractAsyncTableRendering.PROPERTY_TOP_ADDRESS, null, address);
firePropertyChangedEvent(event);
}
-
+
private void updateSyncPageStartAddress(BigInteger address) {
-
- if (!fIsCreated)
+
+ if (!fIsCreated) {
return;
-
- if (isMemoryBlockBaseAddressChanged())
+ }
+
+ if (isMemoryBlockBaseAddressChanged()) {
return;
-
+ }
+
PropertyChangeEvent event = new PropertyChangeEvent(this, IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS, null, address);
firePropertyChangedEvent(event);
}
-
+
/**
* Returns the color provider for this rendering's memory block or
* <code>null</code> if none.
* <p>
- * By default a color provider is obtained by asking this rendering's
- * memory block for its {@link IColorProvider} adapter. When the color
- * provider is queried for color information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
+ * By default a color provider is obtained by asking this rendering's memory
+ * block for its {@link IColorProvider} adapter. When the color provider is
+ * queried for color information, it is provided with a
+ * {@link MemoryRenderingElement} as an argument.
* </p>
- * @return the color provider for this rendering's memory block,
- * or <code>null</code>
+ *
+ * @return the color provider for this rendering's memory block, or
+ * <code>null</code>
*/
- protected IColorProvider getColorProviderAdapter()
- {
- return (IColorProvider)getMemoryBlock().getAdapter(IColorProvider.class);
+ protected IColorProvider getColorProviderAdapter() {
+ return (IColorProvider) getMemoryBlock().getAdapter(IColorProvider.class);
}
-
+
/**
* Returns the label provider for this rendering's memory block or
* <code>null</code> if none.
* <p>
- * By default a label provider is obtained by asking this rendering's
- * memory block for its {@link ILabelProvider} adapter. When the label
- * provider is queried for label information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
+ * By default a label provider is obtained by asking this rendering's memory
+ * block for its {@link ILabelProvider} adapter. When the label provider is
+ * queried for label information, it is provided with a
+ * {@link MemoryRenderingElement} as an argument.
* </p>
- * @return the label provider for this rendering's memory block,
- * or <code>null</code>
+ *
+ * @return the label provider for this rendering's memory block, or
+ * <code>null</code>
*/
- protected ILabelProvider getLabelProviderAdapter()
- {
- return (ILabelProvider)getMemoryBlock().getAdapter(ILabelProvider.class);
+ protected ILabelProvider getLabelProviderAdapter() {
+ return (ILabelProvider) getMemoryBlock().getAdapter(ILabelProvider.class);
}
-
+
/**
* Returns the font provider for this rendering's memory block or
* <code>null</code> if none.
* <p>
- * By default a font provider is obtained by asking this rendering's
- * memory block for its {@link IFontProvider} adapter. When the font
- * provider is queried for font information, it is provided with a
- * {@link MemoryRenderingElement} as an argument.
+ * By default a font provider is obtained by asking this rendering's memory
+ * block for its {@link IFontProvider} adapter. When the font provider is
+ * queried for font information, it is provided with a
+ * {@link MemoryRenderingElement} as an argument.
* </p>
- * @return the font provider for this rendering's memory block,
- * or <code>null</code>
+ *
+ * @return the font provider for this rendering's memory block, or
+ * <code>null</code>
*/
- protected IFontProvider getFontProviderAdapter()
- {
- return (IFontProvider)getMemoryBlock().getAdapter(IFontProvider.class);
+ protected IFontProvider getFontProviderAdapter() {
+ return (IFontProvider) getMemoryBlock().getAdapter(IFontProvider.class);
}
-
+
/**
* Returns the table presentation for this rendering's memory block or
* <code>null</code> if none.
@@ -2748,102 +2719,106 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* By default a table presentation is obtained by asking this rendering's
* memory block for its {@link IMemoryBlockTablePresentation} adapter.
* </p>
- * @return the table presentation for this rendering's memory block,
- * or <code>null</code>
+ *
+ * @return the table presentation for this rendering's memory block, or
+ * <code>null</code>
*/
- protected IMemoryBlockTablePresentation getTablePresentationAdapter()
- {
- return (IMemoryBlockTablePresentation)getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
+ protected IMemoryBlockTablePresentation getTablePresentationAdapter() {
+ return (IMemoryBlockTablePresentation) getMemoryBlock().getAdapter(IMemoryBlockTablePresentation.class);
}
-
+
/**
* Setup the viewer so it supports hovers to show the offset of each field
*/
private void createToolTip() {
-
- fToolTipShell = new Shell(DebugUIPlugin.getShell(), SWT.ON_TOP | SWT.RESIZE );
+
+ fToolTipShell = new Shell(DebugUIPlugin.getShell(), SWT.ON_TOP | SWT.RESIZE);
GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 1;
gridLayout.marginWidth = 2;
gridLayout.marginHeight = 0;
fToolTipShell.setLayout(gridLayout);
fToolTipShell.setBackground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
-
+
final Control toolTipControl = createToolTipControl(fToolTipShell);
-
- if (toolTipControl == null)
- {
+
+ if (toolTipControl == null) {
// if client decide not to use tooltip support
fToolTipShell.dispose();
return;
}
-
- MouseTrackAdapter listener = new MouseTrackAdapter(){
-
+
+ MouseTrackAdapter listener = new MouseTrackAdapter() {
+
private TableItem fTooltipItem = null;
private int fCol = -1;
-
- public void mouseExit(MouseEvent e){
-
- if (!fToolTipShell.isDisposed())
+
+ @Override
+ public void mouseExit(MouseEvent e) {
+
+ if (!fToolTipShell.isDisposed()) {
fToolTipShell.setVisible(false);
+ }
fTooltipItem = null;
}
-
- public void mouseHover(MouseEvent e){
-
+
+ @Override
+ public void mouseHover(MouseEvent e) {
+
Point hoverPoint = new Point(e.x, e.y);
Control control = null;
-
- if (e.widget instanceof Control)
- control = (Control)e.widget;
-
- if (control == null)
+
+ if (e.widget instanceof Control) {
+ control = (Control) e.widget;
+ }
+
+ if (control == null) {
return;
-
+ }
+
hoverPoint = control.toDisplay(hoverPoint);
TableItem item = getItem(hoverPoint);
int column = getColumn(hoverPoint);
-
- //Only if there is a change in hover
- if(this.fTooltipItem != item || fCol != column){
-
- //Keep Track of the latest hover
+
+ // Only if there is a change in hover
+ if (this.fTooltipItem != item || fCol != column) {
+
+ // Keep Track of the latest hover
fTooltipItem = item;
fCol = column;
-
- if(item != null){
+
+ if (item != null) {
toolTipAboutToShow(toolTipControl, fTooltipItem, column);
-
- //Setting location of the tooltip
+
+ // Setting location of the tooltip
Rectangle shellBounds = fToolTipShell.getBounds();
shellBounds.x = hoverPoint.x;
shellBounds.y = hoverPoint.y + item.getBounds(0).height;
-
+
fToolTipShell.setBounds(shellBounds);
fToolTipShell.pack();
-
+
fToolTipShell.setVisible(true);
- }
- else {
+ } else {
fToolTipShell.setVisible(false);
}
}
}
};
-
+
fTableViewer.getTable().addMouseTrackListener(listener);
fTableViewer.getCursor().addMouseTrackListener(listener);
}
-
+
/**
- * Creates the control used to display tool tips for cells in this table. By default
- * a label is used to display the address of the cell. Clients may override this
- * method to create custom tooltip controls.
+ * Creates the control used to display tool tips for cells in this table. By
+ * default a label is used to display the address of the cell. Clients may
+ * override this method to create custom tooltip controls.
* <p>
- * Also see the methods <code>getToolTipText(...)</code> and
+ * Also see the methods <code>getToolTipText(...)</code> and
* <code>toolTipAboutToShow(...)</code>.
* </p>
+ *
* @param composite parent for the tooltip control
* @return the tooltip control to be displayed
* @since 3.2
@@ -2852,89 +2827,88 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
Control fToolTipLabel = new Label(composite, SWT.NONE);
fToolTipLabel.setForeground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
fToolTipLabel.setBackground(fTableViewer.getTable().getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
- fToolTipLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL |
- GridData.VERTICAL_ALIGN_CENTER));
+ fToolTipLabel.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER));
return fToolTipLabel;
}
-
+
/**
- * Bug with table widget,BUG 113015, the widget is not able to return the correct
- * table item if SWT.FULL_SELECTION is not on when the table is created.
- * Created the following function to work around the problem.
- * We can remove this method when the bug is fixed.
+ * Bug with table widget,BUG 113015, the widget is not able to return the
+ * correct table item if SWT.FULL_SELECTION is not on when the table is
+ * created. Created the following function to work around the problem. We
+ * can remove this method when the bug is fixed.
+ *
* @param point the given {@link Point} to find the {@link TableItem} for
- * @return the table item where the point is located, return null if the item cannot be located.
+ * @return the table item where the point is located, return null if the
+ * item cannot be located.
*/
- private TableItem getItem(Point point)
- {
+ private TableItem getItem(Point point) {
TableItem[] items = fTableViewer.getTable().getItems();
- for (int i=0; i<items.length; i++)
- {
+ for (int i = 0; i < items.length; i++) {
TableItem item = items[i];
- if (item.getData() != null)
- {
+ if (item.getData() != null) {
Point start = new Point(item.getBounds(0).x, item.getBounds(0).y);
start = fTableViewer.getTable().toDisplay(start);
Point end = new Point(start.x + item.getBounds(0).width, start.y + item.getBounds(0).height);
-
- if (start.y < point.y && point.y < end.y)
+
+ if (start.y < point.y && point.y < end.y) {
return item;
+ }
}
}
return null;
}
-
+
/**
* Method for figuring out which column the point is located.
+ *
* @param point the {@link Point} the get the column number for
- * @return the column index where the point is located, return -1 if column is not found.
+ * @return the column index where the point is located, return -1 if column
+ * is not found.
*/
- private int getColumn(Point point)
- {
+ private int getColumn(Point point) {
int colCnt = fTableViewer.getTable().getColumnCount();
-
+
TableItem item = null;
- for (int i=0; i<fTableViewer.getTable().getItemCount(); i++)
- {
+ for (int i = 0; i < fTableViewer.getTable().getItemCount(); i++) {
item = fTableViewer.getTable().getItem(i);
- if (item.getData() != null)
+ if (item.getData() != null) {
break;
+ }
}
-
- if (item != null)
- {
- for (int i=0; i<colCnt; i++)
- {
+
+ if (item != null) {
+ for (int i = 0; i < colCnt; i++) {
Point start = new Point(item.getBounds(i).x, item.getBounds(i).y);
start = fTableViewer.getTable().toDisplay(start);
Point end = new Point(start.x + item.getBounds(i).width, start.y + item.getBounds(i).height);
-
- if (start.x < point.x && end.x > point.x)
+
+ if (start.x < point.x && end.x > point.x) {
return i;
+ }
}
}
return -1;
}
-
+
/**
- * Called when the tool tip is about to show in this rendering.
- * Clients who overrides <code>createTooltipControl</code> may need to
- * also override this method to ensure that the tooltip shows up properly
- * in their customized control.
+ * Called when the tool tip is about to show in this rendering. Clients who
+ * overrides <code>createTooltipControl</code> may need to also override
+ * this method to ensure that the tooltip shows up properly in their
+ * customized control.
* <p>
* By default a text tooltip is displayed, and the contents for the tooltip
* are generated by the <code>getToolTipText(...)</code> method.
* </p>
+ *
* @param toolTipControl - the control for displaying the tooltip
* @param item - the table item where the mouse is pointing.
* @param col - the column at which the mouse is pointing.
* @since 3.2
*/
- protected void toolTipAboutToShow(Control toolTipControl, TableItem item,
- int col) {
+ protected void toolTipAboutToShow(Control toolTipControl, TableItem item, int col) {
if (toolTipControl instanceof Label) {
Object address = fTableViewer.getKey(fTableViewer.getTable().indexOf(item), col);
- if (address != null && address instanceof BigInteger) {
+ if (address != null && address instanceof BigInteger) {
Object data = item.getData();
if (data instanceof MemorySegment) {
MemorySegment line = (MemorySegment) data;
@@ -2944,110 +2918,101 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
int end = start + getBytesPerColumn();
MemoryByte[] bytes = line.getBytes(start, end);
- String str = getToolTipText((BigInteger)address, bytes);
+ String str = getToolTipText((BigInteger) address, bytes);
- if (str != null)
+ if (str != null) {
((Label) toolTipControl).setText(str);
+ }
} else {
- String str = getToolTipText((BigInteger)address,
- new MemoryByte[] {});
+ String str = getToolTipText((BigInteger) address, new MemoryByte[] {});
- if (str != null)
+ if (str != null) {
((Label) toolTipControl).setText(str);
+ }
}
}
}
}
}
-
+
/**
- * Returns the text to display in a tool tip at the specified address
- * for the specified bytes. By default the address of the bytes is displayed.
+ * Returns the text to display in a tool tip at the specified address for
+ * the specified bytes. By default the address of the bytes is displayed.
* Subclasses may override.
*
- * @param address address of cell that tool tip is displayed for
+ * @param address address of cell that tool tip is displayed for
* @param bytes the bytes in the cell
* @return the tooltip text for the memory bytes located at the specified
* address
* @since 3.2
*/
- protected String getToolTipText(BigInteger address, MemoryByte[] bytes)
- {
+ protected String getToolTipText(BigInteger address, MemoryByte[] bytes) {
StringBuffer buf = new StringBuffer("0x"); //$NON-NLS-1$
buf.append(address.toString(16).toUpperCase());
-
+
return buf.toString();
}
-
- private void setColumnHeadings()
- {
+
+ private void setColumnHeadings() {
String[] columnLabels = new String[0];
-
+
IMemoryBlockTablePresentation presentation = getTablePresentationAdapter();
- if (presentation != null)
- {
- columnLabels = presentation.getColumnLabels(getMemoryBlock(), getBytesPerLine(), getBytesPerLine()/getBytesPerColumn());
+ if (presentation != null) {
+ columnLabels = presentation.getColumnLabels(getMemoryBlock(), getBytesPerLine(), getBytesPerLine() / getBytesPerColumn());
}
-
+
// check that column labels returned are not null
- if (columnLabels == null)
+ if (columnLabels == null) {
columnLabels = new String[0];
-
- int numByteColumns = fBytePerLine/fColumnSize;
-
+ }
+
+ int numByteColumns = fBytePerLine / fColumnSize;
+
TableColumn[] columns = fTableViewer.getTable().getColumns();
-
- int j=0;
- for (int i=1; i<columns.length-1; i++)
- {
+
+ int j = 0;
+ for (int i = 1; i < columns.length - 1; i++) {
// if the number of column labels returned is correct
// use supplied column labels
- if (columnLabels.length == numByteColumns)
- {
+ if (columnLabels.length == numByteColumns) {
columns[i].setText(columnLabels[j]);
j++;
- }
- else
- {
+ } else {
// otherwise, use default
int addressableUnit = getAddressableUnitPerColumn();
- if (addressableUnit >= 4)
- {
- columns[i].setText(Integer.toHexString(j*addressableUnit).toUpperCase() +
- " - " + Integer.toHexString(j*addressableUnit+addressableUnit-1).toUpperCase()); //$NON-NLS-1$
- }
- else
- {
- columns[i].setText(Integer.toHexString(j*addressableUnit).toUpperCase());
+ if (addressableUnit >= 4) {
+ columns[i].setText(Integer.toHexString(j * addressableUnit).toUpperCase() + " - " + Integer.toHexString(j * addressableUnit + addressableUnit - 1).toUpperCase()); //$NON-NLS-1$
+ } else {
+ columns[i].setText(Integer.toHexString(j * addressableUnit).toUpperCase());
}
j++;
}
}
}
-
+
/**
*
* Return this rendering's viewer
+ *
* @return this rendering's viewer
*/
- public StructuredViewer getViewer()
- {
+ public StructuredViewer getViewer() {
return fTableViewer;
}
-
- private boolean isMemoryBlockBaseAddressChanged()
- {
+
+ private boolean isMemoryBlockBaseAddressChanged() {
try {
BigInteger address = getMemoryBlockBaseAddress();
BigInteger oldBaseAddress = fContentDescriptor.getContentBaseAddress();
- if (!oldBaseAddress.equals(address))
+ if (!oldBaseAddress.equals(address)) {
return true;
+ }
} catch (DebugException e) {
// fail silently
}
return false;
}
-
+
/**
* @param topVisibleAddress the address to get the description for
*/
@@ -3058,23 +3023,21 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fContentDescriptor.setLoadAddress(topVisibleAddress);
try {
fContentDescriptor.updateContentBaseAddress();
-
+
} catch (DebugException e) {
fError = true;
showMessage(e.getMessage());
}
-
+
fContentDescriptor.setAddressableSize(getAddressableSize());
-
+
try {
int addressSize = 4;
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
- {
- IMemoryBlockExtension extMb = (IMemoryBlockExtension)getMemoryBlock();
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
+ IMemoryBlockExtension extMb = (IMemoryBlockExtension) getMemoryBlock();
addressSize = extMb.getAddressSize();
-
- if (addressSize <= 0)
- {
+
+ if (addressSize <= 0) {
DebugUIPlugin.logErrorMessage("Invalid address Size: " + addressSize); //$NON-NLS-1$
addressSize = 4;
}
@@ -3085,104 +3048,115 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fError = true;
showMessage(e.getMessage());
} finally {
- if (fContentDescriptor.getAddressSize() <= 0)
+ if (fContentDescriptor.getAddressSize() <= 0) {
fContentDescriptor.setAddressSize(4);
+ }
}
}
-
+
/**
- * Return the number of lines to be bufferred before the top visible line of the memory rendering
- * @return number of lines to be buffered before the top visible line in the memory rendering
+ * Return the number of lines to be bufferred before the top visible line of
+ * the memory rendering
+ *
+ * @return number of lines to be buffered before the top visible line in the
+ * memory rendering
*/
- private int getPreBufferSize()
- {
- if (fPreBufferSize < 0)
+ private int getPreBufferSize() {
+ if (fPreBufferSize < 0) {
getPreBufferSizeFromPreference();
-
+ }
+
return fPreBufferSize;
}
-
+
/**
- * Returns the number of lines to be bufferred after the last visible line in the memory rendering
- * @return the number of lines to be bufferred after the last visible line in the memory rendering
+ * Returns the number of lines to be bufferred after the last visible line
+ * in the memory rendering
+ *
+ * @return the number of lines to be bufferred after the last visible line
+ * in the memory rendering
*/
- private int getPostBufferSize()
- {
- if (fPostBufferSize < 0)
+ private int getPostBufferSize() {
+ if (fPostBufferSize < 0) {
getPostBufferSizeFromPreference();
-
+ }
+
return fPostBufferSize;
}
-
- private TableRenderingContentDescriptor getContentDescriptor()
- {
+
+ private TableRenderingContentDescriptor getContentDescriptor() {
return fContentDescriptor;
}
-
- private void createGoToAddressComposite(Composite parent)
- {
+
+ private void createGoToAddressComposite(Composite parent) {
fGoToAddressComposite = new GoToAddressComposite();
fGoToAddressComposite.createControl(parent);
Button button = fGoToAddressComposite.getButton(IDialogConstants.OK_ID);
- if (button != null)
- {
+ if (button != null) {
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
doGoToAddress();
}
});
-
+
button = fGoToAddressComposite.getButton(IDialogConstants.CANCEL_ID);
- if (button != null)
- {
+ if (button != null) {
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
hideGotoAddressComposite();
- }});
+ }
+ });
}
}
-
+
fGoToAddressComposite.getExpressionWidget().addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
doGoToAddress();
- }});
-
+ }
+ });
+
fGoToAddressComposite.getExpressionWidget().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
- if (e.keyCode == SWT.ESC)
+ if (e.keyCode == SWT.ESC) {
hideGotoAddressComposite();
+ }
super.keyPressed(e);
- }});
+ }
+ });
}
-
+
private void showGoToAddressComposite() {
-
+
String selectedStr = getSelectedAsString();
Text text = fGoToAddressComposite.getExpressionWidget();
text.setText(selectedStr);
text.setSelection(0, text.getCharCount());
-
+
double height = fGoToAddressComposite.getHeight();
double canvasHeight = fSashForm.getParent().getClientArea().height;
double tableHeight = canvasHeight - height;
-
- double tableWeight = (tableHeight/canvasHeight) * 100;
+
+ double tableWeight = (tableHeight / canvasHeight) * 100;
double textWeight = (height / canvasHeight) * 100;
- fSashForm.setWeights(new int[]{(int)tableWeight, (int)textWeight});
+ fSashForm.setWeights(new int[] { (int) tableWeight, (int) textWeight });
fSashForm.setMaximizedControl(null);
-
+
fGoToAddressComposite.getExpressionWidget().setFocus();
}
-
- private void hideGotoAddressComposite()
- {
+
+ private void hideGotoAddressComposite() {
fSashForm.setMaximizedControl(fTableViewer.getControl());
- if (isActivated())
+ if (isActivated()) {
fTableViewer.getControl().setFocus();
+ }
}
-
+
/**
*
*/
@@ -3192,139 +3166,139 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
fGoToAddressAction.doGoToAddress(address.toString(16));
hideGotoAddressComposite();
} catch (DebugException e1) {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Go_to_address_failed, e1);
- } catch (NumberFormatException e1)
- {
- MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed,
- DebugUIMessages.GoToAddressAction_Address_is_invalid, e1);
+ MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, DebugUIMessages.GoToAddressAction_Go_to_address_failed, e1);
+ } catch (NumberFormatException e1) {
+ MemoryViewUtil.openError(DebugUIMessages.GoToAddressAction_Go_to_address_failed, DebugUIMessages.GoToAddressAction_Address_is_invalid, e1);
}
}
-
+
+ @Override
public void activated() {
super.activated();
-
+
fActivated = true;
IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService)workbench.getAdapter(ICommandService.class);
- IContextService contextSupport = (IContextService)workbench.getAdapter(IContextService.class);
-
- if (commandSupport != null && contextSupport != null)
- {
+ ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
+ IContextService contextSupport = (IContextService) workbench.getAdapter(IContextService.class);
+
+ if (commandSupport != null && contextSupport != null) {
fContext.add(contextSupport.activateContext(ID_ASYNC_TABLE_RENDERING_CONTEXT));
Command gotoCommand = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND);
- if (fGoToAddressHandler == null)
- {
+ if (fGoToAddressHandler == null) {
fGoToAddressHandler = new AbstractHandler() {
+ @Override
public Object execute(ExecutionEvent event) throws ExecutionException {
- if (fSashForm.getMaximizedControl() != null)
+ if (fSashForm.getMaximizedControl() != null) {
fGoToAddressAction.run();
- else
+ } else {
hideGotoAddressComposite();
+ }
return null;
- }};
+ }
+ };
}
gotoCommand.setHandler(fGoToAddressHandler);
-
- // The page up and page down actions can only be activated if the rendering
- // is in manual scrolling mode. We are unable to determine the scrolling mode
- // until the content descriptor is created. When the rendering is activated, the content
- // descriptor may not be created yet. In that case, we cannot activate the shortcuts here.
+
+ // The page up and page down actions can only be activated if the
+ // rendering
+ // is in manual scrolling mode. We are unable to determine the
+ // scrolling mode
+ // until the content descriptor is created. When the rendering is
+ // activated, the content
+ // descriptor may not be created yet. In that case, we cannot
+ // activate the shortcuts here.
// We will activate the shortcut after the rendering is created.
- if (fContentDescriptor != null && !isDynamicLoad())
- {
+ if (fContentDescriptor != null && !isDynamicLoad()) {
activatePageActions();
}
- }
+ }
}
private void activatePageActions() {
IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService)workbench.getAdapter(ICommandService.class);
- if (commandSupport != null)
- {
+ ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
+ if (commandSupport != null) {
Command nextPage = commandSupport.getCommand(ID_NEXT_PAGE_COMMAND);
- if (fNextPageHandler == null)
- {
+ if (fNextPageHandler == null) {
fNextPageHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent arg0)
- throws ExecutionException {
+
+ @Override
+ public Object execute(ExecutionEvent arg0) throws ExecutionException {
fNextAction.run();
return null;
- }
+ }
};
}
nextPage.setHandler(fNextPageHandler);
-
+
Command prevPage = commandSupport.getCommand(ID_PREV_PAGE_COMMAND);
- if (fPrevPageHandler == null)
- {
+ if (fPrevPageHandler == null) {
fPrevPageHandler = new AbstractHandler() {
-
- public Object execute(ExecutionEvent arg0)
- throws ExecutionException {
+
+ @Override
+ public Object execute(ExecutionEvent arg0) throws ExecutionException {
fPrevAction.run();
return null;
- }
+ }
};
}
prevPage.setHandler(fPrevPageHandler);
}
}
+ @Override
public void deactivated() {
-
+
fActivated = false;
- IWorkbench workbench = PlatformUI.getWorkbench();
- ICommandService commandSupport = (ICommandService)workbench.getAdapter(ICommandService.class);
- IContextService contextSupport = (IContextService)workbench.getAdapter(IContextService.class);
-
- if (commandSupport != null && contextSupport != null)
- {
- // remove handler
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ ICommandService commandSupport = (ICommandService) workbench.getAdapter(ICommandService.class);
+ IContextService contextSupport = (IContextService) workbench.getAdapter(IContextService.class);
+
+ if (commandSupport != null && contextSupport != null) {
+ // remove handler
Command command = commandSupport.getCommand(ID_GO_TO_ADDRESS_COMMAND);
command.setHandler(null);
-
+
command = commandSupport.getCommand(ID_NEXT_PAGE_COMMAND);
command.setHandler(null);
-
+
command = commandSupport.getCommand(ID_PREV_PAGE_COMMAND);
command.setHandler(null);
- if (fContext != null)
+ if (fContext != null) {
contextSupport.deactivateContexts(fContext);
+ }
}
super.deactivated();
}
-
- private boolean isActivated()
- {
+
+ private boolean isActivated() {
return fActivated;
}
-
+
/**
- * Returns text for the given memory bytes at the specified address for the specified
- * rendering type. This is called by the label provider for.
+ * Returns text for the given memory bytes at the specified address for the
+ * specified rendering type. This is called by the label provider for.
* Subclasses must override.
*
* @param renderingTypeId rendering type identifier
* @param address address where the bytes belong to
* @param data the bytes
- * @return a string to represent the memory. Cannot not return <code>null</code>.
- * Returns a string to pad the cell if the memory cannot be converted
- * successfully.
+ * @return a string to represent the memory. Cannot not return
+ * <code>null</code>. Returns a string to pad the cell if the memory
+ * cannot be converted successfully.
*/
+ @Override
abstract public String getString(String renderingTypeId, BigInteger address, MemoryByte[] data);
-
+
/**
* Returns bytes for the given text corresponding to bytes at the given
- * address for the specified rendering type. This is called by the cell modifier
- * when modifying bytes in a memory block.
- * Subclasses must convert the string value to an array of bytes. The bytes will
- * be passed to the debug adapter for memory block modification.
- * Returns <code>null</code> if the bytes cannot be formatted properly.
+ * address for the specified rendering type. This is called by the cell
+ * modifier when modifying bytes in a memory block. Subclasses must convert
+ * the string value to an array of bytes. The bytes will be passed to the
+ * debug adapter for memory block modification. Returns <code>null</code> if
+ * the bytes cannot be formatted properly.
*
* @param renderingTypeId rendering type identifier
* @param address address the bytes begin at
@@ -3332,5 +3306,6 @@ public abstract class AbstractAsyncTableRendering extends AbstractBaseTableRende
* @param newValue the string to be converted to bytes
* @return the bytes converted from a string
*/
+ @Override
abstract public byte[] getBytes(String renderingTypeId, BigInteger address, MemoryByte[] currentValues, String newValue);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
index bed96d88a..4d9b480b8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/AbstractAsyncTextRendering.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,16 +19,17 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.ui.IDebugUIConstants;
/**
- * Abstract implementation of a rendering that translates memory into
- * text, displayed in a table.
+ * Abstract implementation of a rendering that translates memory into text,
+ * displayed in a table.
* <p>
- * Clients should subclass from this class if they wish to provide a table
- * text rendering with a specific code page.
+ * Clients should subclass from this class if they wish to provide a table text
+ * rendering with a specific code page.
* </p>
+ *
* @since 3.2
*/
-abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRendering {
-
+abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRendering {
+
private String fCodePage;
/**
@@ -36,83 +37,78 @@ abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRende
*
* @param renderingId memory rendering type identifier
*/
- public AbstractAsyncTextRendering(String renderingId)
- {
+ public AbstractAsyncTextRendering(String renderingId) {
super(renderingId);
}
-
+
/**
- * Constructs a text rendering of the specified type on the given
- * code page.
+ * Constructs a text rendering of the specified type on the given code page.
*
* @param renderingId memory rendering type identifier
- * @param codePage the name of a supported
- * {@link java.nio.charset.Charset </code>charset<code>}, for
- * example <code>CP1252</code>
+ * @param codePage the name of a supported {@link java.nio.charset.Charset
+ * </code>charset<code>}, for example <code>CP1252</code>
*/
- public AbstractAsyncTextRendering(String renderingId, String codePage)
- {
+ public AbstractAsyncTextRendering(String renderingId, String codePage) {
super(renderingId);
fCodePage = codePage;
}
-
+
/**
- * Sets the code page for this rendering. This does not cause
- * the rendering to be updated with the new code page. Clients need
- * to update the rendering manually when the code page is changed.
+ * Sets the code page for this rendering. This does not cause the rendering
+ * to be updated with the new code page. Clients need to update the
+ * rendering manually when the code page is changed.
*
- * @param codePage the name of a supported
- * {@link java.nio.charset.Charset </code>charset<code>}, for
- * example <code>CP1252</code>
+ * @param codePage the name of a supported {@link java.nio.charset.Charset
+ * </code>charset<code>}, for example <code>CP1252</code>
*/
- public void setCodePage(String codePage)
- {
+ public void setCodePage(String codePage) {
fCodePage = codePage;
}
-
+
/**
- * Returns the current code page used by this rendering. Returns null
- * if not set.
- * @return Returns the current code page used by this rendering. Returns null
- * if not set.
+ * Returns the current code page used by this rendering. Returns null if not
+ * set.
+ *
+ * @return Returns the current code page used by this rendering. Returns
+ * null if not set.
*/
- public String getCodePage()
- {
+ public String getCodePage() {
return fCodePage;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.provisional.AbstractAsyncTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.provisional.
+ * AbstractAsyncTableRendering#getString(java.lang.String,
+ * java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
*/
- public String getString(String dataType, BigInteger address, MemoryByte[] data) {
+ @Override
+ public String getString(String dataType, BigInteger address, MemoryByte[] data) {
try {
String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
- if(fCodePage == null)
+ if (fCodePage == null) {
return IInternalDebugCoreConstants.EMPTY_STRING;
-
+ }
+
boolean[] invalid = new boolean[data.length];
boolean hasInvalid = false;
byte byteArray[] = new byte[data.length];
- for (int i=0; i<data.length; i++)
- {
- if (!data[i].isReadable())
- {
+ for (int i = 0; i < data.length; i++) {
+ if (!data[i].isReadable()) {
invalid[i] = true;
hasInvalid = true;
}
byteArray[i] = data[i].getValue();
}
-
- if (hasInvalid)
- {
+
+ if (hasInvalid) {
StringBuffer strBuf = new StringBuffer();
- for (int i=0; i<data.length; i++)
- {
- if (invalid[i])
+ for (int i = 0; i < data.length; i++) {
+ if (invalid[i]) {
strBuf.append(paddedStr);
- else
- strBuf.append(new String(new byte[]{byteArray[i]}, fCodePage));
+ } else {
+ strBuf.append(new String(new byte[] { byteArray[i] }, fCodePage));
+ }
}
return strBuf.toString();
}
@@ -123,20 +119,25 @@ abstract public class AbstractAsyncTextRendering extends AbstractAsyncTableRende
return "-- error --"; //$NON-NLS-1$
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.provisional.AbstractAsyncTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.provisional.
+ * AbstractAsyncTableRendering#getBytes(java.lang.String,
+ * java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[],
+ * java.lang.String)
*/
+ @Override
public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
try {
-
- if (fCodePage == null)
+
+ if (fCodePage == null) {
return new byte[0];
-
- byte[] bytes = data.getBytes(fCodePage);
+ }
+
+ byte[] bytes = data.getBytes(fCodePage);
return bytes;
-
+
} catch (UnsupportedEncodingException e) {
return new byte[0];
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
index 2649243bd..42dd16ee0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/memory/provisional/MemoryViewPresentationContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,58 +16,65 @@ import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
/**
- * Presentation context from the Memory View. This presentation provides additional
- * information regarding the originator of the asynchronous request.
+ * Presentation context from the Memory View. This presentation provides
+ * additional information regarding the originator of the asynchronous request.
*
* Clients may reference or subclass from this class.
*
* @since 3.2
- *
+ *
*/
-public class MemoryViewPresentationContext extends PresentationContext {
+public class MemoryViewPresentationContext extends PresentationContext {
- private IMemoryRenderingContainer fContainer;
- private IMemoryRendering fRendering;
+ private IMemoryRenderingContainer fContainer;
+ private IMemoryRendering fRendering;
private IMemoryRenderingSite fMemoryView;
-
+
/**
* Constructs MemoryViewPresentationContext
- * @param site - the memory rendering site that this presentation context is for
- * @param container - the memory rendering container that this presentation context is for, may be <code>null</code>
- * @param rendering - - the memory rendering that this presentation context is for, may be <code>null</code>
+ *
+ * @param site - the memory rendering site that this presentation context is
+ * for
+ * @param container - the memory rendering container that this presentation
+ * context is for, may be <code>null</code>
+ * @param rendering - - the memory rendering that this presentation context
+ * is for, may be <code>null</code>
*/
public MemoryViewPresentationContext(IMemoryRenderingSite site, IMemoryRenderingContainer container, IMemoryRendering rendering) {
super(site.getSite().getPart());
-
+
fMemoryView = site;
fContainer = container;
fRendering = rendering;
}
-
+
/**
* Returns the memory rendering site that this presentation context is for
+ *
* @return the memory rendering site that this presentation context is for
*/
- public IMemoryRenderingSite getMemoryRenderingSite()
- {
+ public IMemoryRenderingSite getMemoryRenderingSite() {
return fMemoryView;
}
-
+
/**
- * Returns the memory rendering container that this presentation context is for
- * @return the memory rendering container that this presentation context is for, <code>null</code> if none.
+ * Returns the memory rendering container that this presentation context is
+ * for
+ *
+ * @return the memory rendering container that this presentation context is
+ * for, <code>null</code> if none.
*/
- public IMemoryRenderingContainer getMemoryRenderingContainer()
- {
+ public IMemoryRenderingContainer getMemoryRenderingContainer() {
return fContainer;
}
-
+
/**
* Returns the memory rendering that this presentation context is for
- * @return the memory rendering that this presentation context is for, <code>null</code> if none.
+ *
+ * @return the memory rendering that this presentation context is for,
+ * <code>null</code> if none.
*/
- public IMemoryRendering getRendering()
- {
+ public IMemoryRendering getRendering() {
return fRendering;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java
index 1bf8cfe5e..3ca3eaf7f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerLabelProvider.java
@@ -35,6 +35,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
ImageDescriptor desc = super.getImageDescriptor(elementPath, presentationContext, columnId);
int flags = computeAdornmentFlags();
@@ -51,6 +52,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
* (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)
*/
+ @Override
public boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException {
Object lastSegment = path.getLastSegment();
if (lastSegment instanceof IBreakpointContainer) {
@@ -70,6 +72,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getGrayed(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
public boolean getGrayed(TreePath path, IPresentationContext presentationContext) throws CoreException {
Object lastSegment = path.getLastSegment();
if (lastSegment instanceof IBreakpointContainer) {
@@ -100,6 +103,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
}
// Forward font data requests to the workbench adapter
+ @Override
protected FontData getFontData(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
FontData fontData = super.getFontData(elementPath, presentationContext, columnId);
@@ -114,6 +118,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
}
// Forward foreground color requests to the workbench adapter
+ @Override
protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
RGB rgb = super.getForeground(elementPath, presentationContext, columnId);
@@ -128,6 +133,7 @@ public class BreakpointContainerLabelProvider extends DebugElementLabelProvider
}
// Forward background color requests to the workbench adapter
+ @Override
protected RGB getBackground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
RGB rgb = super.getBackground(elementPath, presentationContext, columnId);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java
index aaa5a05f3..9f4c8dbb6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContainerMementoProvider.java
@@ -28,6 +28,7 @@ public class BreakpointContainerMementoProvider extends DebugElementMementoProvi
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) element;
@@ -46,6 +47,7 @@ public class BreakpointContainerMementoProvider extends DebugElementMementoProvi
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider#isEqual(java.lang.Object, org.eclipse.ui.IMemento, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java
index c66ac4bac..925489fee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointContentProvider.java
@@ -25,6 +25,7 @@ public class BreakpointContentProvider 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)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return 0;
}
@@ -32,6 +33,7 @@ public class BreakpointContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return null;
}
@@ -39,6 +41,7 @@ public class BreakpointContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_BREAKPOINT_VIEW);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java
index 5e21aada1..59a7c246a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointLabelProvider.java
@@ -28,6 +28,7 @@ public class BreakpointLabelProvider extends DebugElementLabelProvider {
/* (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, int)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException {
if (columnIndex == 0)
return super.getLabel(elementPath, presentationContext, columnId, columnIndex);
@@ -38,6 +39,7 @@ public class BreakpointLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String, int)
*/
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId, int columnIndex) throws CoreException {
if (columnIndex == 0)
return super.getImageDescriptor(elementPath, presentationContext, columnId, columnIndex);
@@ -49,6 +51,7 @@ public class BreakpointLabelProvider extends DebugElementLabelProvider {
* (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)
*/
+ @Override
public boolean getChecked(TreePath path, IPresentationContext presentationContext) throws CoreException {
Object lastSegment = path.getLastSegment();
if (lastSegment instanceof IBreakpoint) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
index 7337ff05e..8d7282b73 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerContentProvider.java
@@ -21,6 +21,7 @@ import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.core.resources.IMarkerDelta;
@@ -86,7 +87,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
/**
* Model proxy of the input
*/
- final private List/*<AbstractModelProxy>*/ fProxies = new ArrayList(1);
+ final private List<BreakpointManagerProxy> fProxies = new ArrayList<BreakpointManagerProxy>(1);
/**
* Element comparator, use to compare the ordering of elements for the model
@@ -109,20 +110,23 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
private IStructuredSelection fDebugContext = StructuredSelection.EMPTY;
private IPropertyChangeListener fOrganizersListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
// For any property changes in breakpoint organizers, refresh the containers.
updateContainers();
}
};
private IPropertyChangeListener fPresentationContextListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
presentationPropertyChanged(event);
}
};
private IDebugContextListener fDebugContextListener = new IDebugContextListener() {
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
InputData.this.debugContextChanged(event);
}
};
@@ -209,7 +213,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
}
synchronized BreakpointManagerProxy[] getProxies() {
- return (BreakpointManagerProxy[])fProxies.toArray(new BreakpointManagerProxy[fProxies.size()]);
+ return fProxies.toArray(new BreakpointManagerProxy[fProxies.size()]);
}
/**
@@ -342,7 +346,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
}
synchronized(this) {
- Set existingBreakpoints = new HashSet(Arrays.asList(fContainer.getBreakpoints()));
+ Set<IBreakpoint> existingBreakpoints = new HashSet<IBreakpoint>(Arrays.asList(fContainer.getBreakpoints()));
// Bug 310879
// Process breakpoints in two passes: first remove breakpoints, then add new ones.
@@ -375,7 +379,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
return;
}
- Iterator iter = selection.iterator();
+ Iterator<?> iter = selection.iterator();
Object firstElement = iter.next();
if (firstElement == null || iter.hasNext()) {
return;
@@ -390,7 +394,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
}
IBreakpoint[] breakpoints = thread.getBreakpoints();
- Set bpsSet = new HashSet(breakpoints.length * 4/3);
+ Set<IBreakpoint> bpsSet = new HashSet<IBreakpoint>(breakpoints.length * 4 / 3);
for (int i = 0; i< breakpoints.length; i++) {
bpsSet.add(breakpoints[i]);
}
@@ -419,7 +423,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @param breakpoints Breakpoint set to be selected.
* @return whether we found a breakpoint to select
*/
- private boolean buildTrackSelectionDelta(ModelDelta delta, BreakpointContainer container, Set breakpoints) {
+ private boolean buildTrackSelectionDelta(ModelDelta delta, BreakpointContainer container, Set<IBreakpoint> breakpoints) {
Object[] children = container.getChildren();
delta.setChildCount(children.length);
for (int i = 0; i < children.length; i++) {
@@ -516,9 +520,9 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
ModelDelta delta = new ModelDelta(fInput, IModelDelta.NO_CHANGE);
// If the change caused a breakpoint to be added (installed) or remove (un-installed) update accordingly.
- List removed = new ArrayList();
- List added = new ArrayList();
- List filteredAsList = Arrays.asList(filteredBreakpoints);
+ List<IBreakpoint> removed = new ArrayList<IBreakpoint>();
+ List<IBreakpoint> added = new ArrayList<IBreakpoint>();
+ List<IBreakpoint> filteredAsList = Arrays.asList(filteredBreakpoints);
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint bp = breakpoints[i];
boolean oldContainedBp = fContainer.contains(bp);
@@ -530,13 +534,15 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
}
}
if (!added.isEmpty()) {
- breakpointsAdded((IBreakpoint[]) added.toArray(new IBreakpoint[added.size()]));
+ breakpointsAdded(added.toArray(new IBreakpoint[added.size()]));
}
if (!removed.isEmpty()) {
- breakpointsRemoved((IBreakpoint[]) removed.toArray(new IBreakpoint[removed.size()]));
+ breakpointsRemoved(removed.toArray(new IBreakpoint[removed.size()]));
}
for (int i = 0; i < filteredBreakpoints.length; ++i)
- appendModelDelta(fContainer, delta, IModelDelta.STATE | IModelDelta.CONTENT, filteredBreakpoints[i]); // content flag triggers detail refresh
+ {
+ appendModelDelta(fContainer, delta, IModelDelta.STATE | IModelDelta.CONTENT, filteredBreakpoints[i]); // content flag triggers detail refresh
+ }
if (DebugUIPlugin.DEBUG_BREAKPOINT_DELTAS) {
DebugUIPlugin.trace("POST BREAKPOINT DELTA (breakpointsChanged)\n"); //$NON-NLS-1$
@@ -594,8 +600,9 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
BreakpointContainer.addChildContainer(container, (BreakpointContainer) refChildren[i], containerDelta);
} else if(refChildren[i] instanceof IBreakpoint) {
BreakpointContainer.addBreakpoint(container, (IBreakpoint) refChildren[i], containerDelta);
- if (newBreakpoint == null)
- newBreakpoint = (IBreakpoint) refChildren[i];
+ if (newBreakpoint == null) {
+ newBreakpoint = (IBreakpoint) refChildren[i];
+ }
}
// if a child exist in container, than recursively search into container. And also update the organizer of
@@ -650,14 +657,17 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @see #deleteRemovedElements
*/
private Object getElement(Object[] collection, Object element) {
- for (int i = 0; i < collection.length; ++i)
- if (collection[i] instanceof BreakpointContainer && element instanceof BreakpointContainer) {
- if (collection[i].equals(element))
- return collection[i];
+ for (int i = 0; i < collection.length; ++i) {
+ if (collection[i] instanceof BreakpointContainer && element instanceof BreakpointContainer) {
+ if (collection[i].equals(element)) {
+ return collection[i];
+ }
} else {
- if (collection[i].equals(element))
- return collection[i];
+ if (collection[i].equals(element)) {
+ return collection[i];
+ }
}
+ }
return null;
}
@@ -693,21 +703,22 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
*/
synchronized private void postModelChanged(final IModelDelta delta, boolean select) {
for (int i = 0; fProxies != null && i < fProxies.size(); i++) {
- ((BreakpointManagerProxy)fProxies.get(i)).postModelChanged(delta, select);
+ fProxies.get(i).postModelChanged(delta, select);
}
}
}
- private class InputDataMap extends LinkedHashMap {
+ private class InputDataMap<K, V> extends LinkedHashMap<K, V> {
private static final long serialVersionUID = 1L;
public InputDataMap() {
super(1, (float)0.75, true);
}
- protected boolean removeEldestEntry(java.util.Map.Entry arg0) {
+ @Override
+ protected boolean removeEldestEntry(java.util.Map.Entry<K, V> arg0) {
InputData data = (InputData)arg0.getValue();
if (size() > getMaxInputsCache() && data.fProxies.isEmpty()) {
data.dispose();
@@ -723,11 +734,13 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
*/
private ISchedulingRule fBreakpointsListenerSchedulingRule = new ISchedulingRule() {
- public boolean isConflicting(ISchedulingRule rule) {
+ @Override
+ public boolean isConflicting(ISchedulingRule rule) {
return rule == this;
}
- public boolean contains(ISchedulingRule rule) {
+ @Override
+ public boolean contains(ISchedulingRule rule) {
return rule == this;
}
};
@@ -735,7 +748,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
/**
* A map of input to info data cache
*/
- final private Map fInputToData = Collections.synchronizedMap(new InputDataMap());
+ final private Map<DefaultBreakpointsViewInput, InputData> fInputToData = Collections.synchronizedMap(new InputDataMap<DefaultBreakpointsViewInput, InputData>());
/**
* Flag indicating whether the content provider is currently a breakpoints listener.
@@ -757,15 +770,16 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
*/
protected IBreakpoint[] filterBreakpoints(DefaultBreakpointsViewInput input, IStructuredSelection selectionFilter, IBreakpoint[] breakpoints) {
if (selectionFilter != null && !selectionFilter.isEmpty()) {
- List targets = getDebugTargets(selectionFilter);
- ArrayList retVal = new ArrayList();
+ List<IDebugTarget> targets = getDebugTargets(selectionFilter);
+ ArrayList<IBreakpoint> retVal = new ArrayList<IBreakpoint>();
if (targets != null) {
for (int i = 0; i < breakpoints.length; ++i) {
- if (supportsBreakpoint(targets, breakpoints[i]))
- retVal.add(breakpoints[i]);
+ if (supportsBreakpoint(targets, breakpoints[i])) {
+ retVal.add(breakpoints[i]);
+ }
}
}
- return (IBreakpoint[]) retVal.toArray(new IBreakpoint[retVal.size()]);
+ return retVal.toArray(new IBreakpoint[retVal.size()]);
} else {
return breakpoints;
}
@@ -789,10 +803,10 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @param breakpoint the breakpoint.
* @return true if breakpoint contains in the list of targets.
*/
- protected boolean supportsBreakpoint(List targets, IBreakpoint breakpoint) {
+ protected boolean supportsBreakpoint(List<IDebugTarget> targets, IBreakpoint breakpoint) {
boolean exist = targets.size() == 0 ? true : false;
for (int i = 0; !exist && i < targets.size(); ++i) {
- IDebugTarget target = (IDebugTarget) targets.get(i);
+ IDebugTarget target = targets.get(i);
exist |= target.supportsBreakpoint(breakpoint);
}
return exist;
@@ -804,10 +818,10 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @param ss the selection.
* @return list of IDebugTarget object.
*/
- protected List getDebugTargets(IStructuredSelection ss) {
- List debugTargets = new ArrayList(2);
+ protected List<IDebugTarget> getDebugTargets(IStructuredSelection ss) {
+ List<IDebugTarget> debugTargets = new ArrayList<IDebugTarget>(2);
if (ss != null) {
- Iterator i = ss.iterator();
+ Iterator<?> i = ss.iterator();
while (i.hasNext()) {
Object next = i.next();
if (next instanceof IDebugElement) {
@@ -855,11 +869,11 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @param context Presentation context that was disposed.
*/
protected void contextDisposed(IPresentationContext context) {
- List removed = new ArrayList(1);
+ List<InputData> removed = new ArrayList<InputData>(1);
synchronized (fInputToData) {
- for (Iterator itr = fInputToData.entrySet().iterator(); itr.hasNext();) {
- Map.Entry entry = (Map.Entry)itr.next();
- IPresentationContext entryContext = ((DefaultBreakpointsViewInput)entry.getKey()).getContext();
+ for (Iterator<Entry<DefaultBreakpointsViewInput, InputData>> itr = fInputToData.entrySet().iterator(); itr.hasNext();) {
+ Map.Entry<DefaultBreakpointsViewInput, InputData> entry = itr.next();
+ IPresentationContext entryContext = entry.getKey().getContext();
if (context.equals(entryContext)) {
removed.add(entry.getValue());
itr.remove();
@@ -869,7 +883,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
// Dispose the removed input data
for (int i = 0; i < removed.size(); i++) {
- ((InputData)removed.get(i)).dispose();
+ removed.get(i).dispose();
}
}
@@ -899,7 +913,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* @param proxy the manager proxy
*/
public void unregisterModelProxy(DefaultBreakpointsViewInput input, BreakpointManagerProxy proxy) {
- InputData inputData = (InputData)fInputToData.get(input);
+ InputData inputData = fInputToData.get(input);
if (inputData != null) {
inputData.proxyDisposed(proxy);
@@ -921,7 +935,7 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
InputData data = null;
synchronized (fInputToData) {
- data = (InputData)fInputToData.get(input);
+ data = fInputToData.get(input);
if (data == null) {
data = new InputData(input);
fInputToData.put(input, data);
@@ -950,14 +964,16 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
- protected boolean supportsContextId(String id) {
+ @Override
+ protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_BREAKPOINT_VIEW);
}
/* (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 {
+ @Override
+ protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
Object input = monitor.getViewerInput();
if (input instanceof DefaultBreakpointsViewInput) {
DefaultBreakpointsViewInput bpManagerInput = (DefaultBreakpointsViewInput)input;
@@ -972,7 +988,8 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
/* (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 {
+ @Override
+ protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
Object input = monitor.getViewerInput();
if (input instanceof DefaultBreakpointsViewInput) {
DefaultBreakpointsViewInput bpManagerInput = (DefaultBreakpointsViewInput)input;
@@ -990,15 +1007,17 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
*/
- public void breakpointsAdded(final IBreakpoint[] breakpoints) {
+ @Override
+ public void breakpointsAdded(final IBreakpoint[] breakpoints) {
new Job("Breakpoints View Update Job") { //$NON-NLS-1$
{
setSystem(true);
setRule(fBreakpointsListenerSchedulingRule);
}
- protected IStatus run(IProgressMonitor monitor) {
- InputData[] datas = (InputData[])fInputToData.values().toArray(new InputData[0]);
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ InputData[] datas = fInputToData.values().toArray(new InputData[0]);
for (int i = 0; i < datas.length; i++) {
datas[i].breakpointsAdded(breakpoints);
}
@@ -1011,15 +1030,17 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
- public void breakpointsRemoved(final IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
+ @Override
+ public void breakpointsRemoved(final IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
new Job("Breakpoints View Update Job") { //$NON-NLS-1$
{
setSystem(true);
setRule(fBreakpointsListenerSchedulingRule);
}
- protected IStatus run(IProgressMonitor monitor) {
- InputData[] datas = (InputData[])fInputToData.values().toArray(new InputData[0]);
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ InputData[] datas = fInputToData.values().toArray(new InputData[0]);
for (int i = 0; i < datas.length; i++) {
datas[i].breakpointsRemoved(breakpoints);
}
@@ -1032,15 +1053,17 @@ public class BreakpointManagerContentProvider extends ElementContentProvider
* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.resources.IMarkerDelta[])
*/
- public void breakpointsChanged(final IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
+ @Override
+ public void breakpointsChanged(final IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
new Job("Breakpoints View Update Job") { //$NON-NLS-1$
{
setSystem(true);
setRule(fBreakpointsListenerSchedulingRule);
}
- protected IStatus run(IProgressMonitor monitor) {
- InputData[] datas = (InputData[])fInputToData.values().toArray(new InputData[0]);
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ InputData[] datas = fInputToData.values().toArray(new InputData[0]);
for (int i = 0; i < datas.length; i++) {
datas[i].breakpointsChanged(breakpoints);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java
index 672a91ea9..ad707d6a2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointManagerInputMementoProvider.java
@@ -24,6 +24,7 @@ public class BreakpointManagerInputMementoProvider extends DebugElementMementoPr
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
return "BreakpointInputMemento"; //$NON-NLS-1$
}
@@ -31,6 +32,7 @@ public class BreakpointManagerInputMementoProvider extends DebugElementMementoPr
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider#isEqual(java.lang.Object, org.eclipse.ui.IMemento, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_BREAKPOINT_VIEW.equals(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java
index ae3cbc083..1b40c721a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/BreakpointMementoProvider.java
@@ -47,6 +47,7 @@ public class BreakpointMementoProvider extends ElementMementoProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider#encodeElement(java.lang.Object, org.eclipse.ui.IMemento, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected boolean encodeElement(Object element, IMemento memento, IPresentationContext context) throws CoreException {
if (element instanceof IBreakpoint) {
@@ -69,6 +70,7 @@ public class BreakpointMementoProvider extends ElementMementoProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementMementoProvider#isEqual(java.lang.Object, org.eclipse.ui.IMemento, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException {
if (element instanceof IBreakpoint) {
IBreakpoint breakpoint =(IBreakpoint)element;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
index 8dd7a59d3..a34f815d7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementLabelProvider.java
@@ -28,6 +28,7 @@ import org.eclipse.swt.graphics.RGB;
*/
public class DebugElementLabelProvider extends ElementLabelProvider {
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (presentationContext instanceof DebugModelPresentationContext) {
@@ -37,6 +38,7 @@ public class DebugElementLabelProvider extends ElementLabelProvider {
return DebugElementHelper.getLabel(element);
}
+ @Override
protected RGB getBackground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (presentationContext instanceof DebugModelPresentationContext) {
@@ -46,6 +48,7 @@ public class DebugElementLabelProvider extends ElementLabelProvider {
return DebugElementHelper.getBackground(element);
}
+ @Override
protected FontData getFontData(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (presentationContext instanceof DebugModelPresentationContext) {
@@ -56,6 +59,7 @@ public class DebugElementLabelProvider extends ElementLabelProvider {
return DebugElementHelper.getFont(element);
}
+ @Override
protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (presentationContext instanceof DebugModelPresentationContext) {
@@ -65,6 +69,7 @@ public class DebugElementLabelProvider extends ElementLabelProvider {
return DebugElementHelper.getForeground(element);
}
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (presentationContext instanceof DebugModelPresentationContext) {
@@ -95,7 +100,8 @@ public class DebugElementLabelProvider extends ElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementLabelProvider#requiresUIJob(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate[])
*/
- protected boolean requiresUIJob(ILabelUpdate[] updates) {
+ @Override
+ protected boolean requiresUIJob(ILabelUpdate[] updates) {
if (updates.length > 0) {
ILabelUpdate update = updates[0];
IPresentationContext context = update.getPresentationContext();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java
index 3340c752b..5f2529c89 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugElementMementoProvider.java
@@ -23,6 +23,7 @@ public abstract class DebugElementMementoProvider extends ElementMementoProvider
protected static final String ELEMENT_NAME = "ELEMENT_NAME"; //$NON-NLS-1$
+ @Override
protected boolean encodeElement(Object element, IMemento memento, IPresentationContext context) throws CoreException {
if (supportsContext(context)) {
String name = getElementName(element, context);
@@ -32,6 +33,7 @@ public abstract class DebugElementMementoProvider extends ElementMementoProvider
return false;
}
+ @Override
protected boolean isEqual(Object element, IMemento memento, IPresentationContext context) throws CoreException {
String mementoName = memento.getString(ELEMENT_NAME);
if (mementoName != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java
index 599594503..9ba0d1c77 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/DebugTargetContentProvider.java
@@ -26,6 +26,7 @@ public class DebugTargetContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
String id = context.getId();
if (id.equals(IDebugUIConstants.ID_DEBUG_VIEW))
@@ -42,6 +43,7 @@ public class DebugTargetContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_DEBUG_VIEW.equals(id) || IDebugUIConstants.ID_MEMORY_VIEW.equals(id);
}
@@ -49,10 +51,12 @@ public class DebugTargetContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(getAllChildren(parent, context, monitor), index, length);
}
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
String id = context.getId();
if (id.equals(IDebugUIConstants.ID_DEBUG_VIEW))
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
index d9c2166ef..115888790 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementContentProvider.java
@@ -33,8 +33,10 @@ public abstract class ElementContentProvider implements IElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#updateChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IElementRequestMonitor)
*/
+ @Override
public void update(final IChildrenUpdate[] updates) {
Job job = new Job("children update") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
for (int i = 0; i < updates.length; i++) {
IChildrenUpdate update = updates[i];
@@ -54,8 +56,10 @@ public abstract class ElementContentProvider implements IElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate)
*/
+ @Override
public void update(final IChildrenCountUpdate[] updates) {
Job job = new Job("child count update") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
for (int i = 0; i < updates.length; i++) {
IChildrenCountUpdate update = updates[i];
@@ -191,8 +195,10 @@ public abstract class ElementContentProvider implements IElementContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
*/
+ @Override
public void update(final IHasChildrenUpdate[] updates) {
Job job = new Job("has children update") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
for (int i = 0; i < updates.length; i++) {
IHasChildrenUpdate update = updates[i];
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
index d35e9219b..35fdefee2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,6 +70,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
fUpdater.run();
return Status.OK_STATUS;
@@ -78,6 +79,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider.ILabelJob#queue(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
+ @Override
public boolean queue(ILabelUpdate[] updates) {
return fUpdater.queue(updates);
}
@@ -85,6 +87,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
+ @Override
public boolean shouldRun() {
return fUpdater.shouldRun();
}
@@ -107,6 +110,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
fUpdater.run();
return Status.OK_STATUS;
@@ -115,6 +119,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider.ILabelJob#queue(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate)
*/
+ @Override
public boolean queue(ILabelUpdate[] updates) {
return fUpdater.queue(updates);
}
@@ -122,6 +127,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
+ @Override
public boolean shouldRun() {
return fUpdater.shouldRun();
}
@@ -131,9 +137,8 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
* Queue of label updates
*/
class LabelUpdater implements Runnable {
-
- LinkedList fQueue = new LinkedList();
-
+ LinkedList<ILabelUpdate> fQueue = new LinkedList<ILabelUpdate>();
+
public synchronized boolean queue(ILabelUpdate[] updates) {
if (fQueue == null) {
return false;
@@ -148,6 +153,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
+ @Override
public void run() {
ILabelUpdate update = getNextUpdate();
while (update != null) {
@@ -182,7 +188,7 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
}
ILabelUpdate update = null;
try {
- update = (ILabelUpdate) fQueue.removeFirst();
+ update = fQueue.removeFirst();
} catch (NoSuchElementException e) {
fQueue = null;
}
@@ -345,7 +351,8 @@ public abstract class ElementLabelProvider implements IElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate[])
*/
- public synchronized void update(ILabelUpdate[] updates) {
+ @Override
+ public synchronized void update(ILabelUpdate[] updates) {
if (fLabelJob == null) {
fLabelJob = newLabelJob(updates);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
index 536fb5b18..592384413 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ElementMementoProvider.java
@@ -30,8 +30,10 @@ public abstract class ElementMementoProvider implements IElementMementoProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#compareElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest[])
*/
+ @Override
public void compareElements(final IElementCompareRequest[] requests) {
Job job = new Job("compare element") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
for (int i = 0; i < requests.length; i++) {
IElementCompareRequest request = requests[i];
@@ -63,8 +65,10 @@ public abstract class ElementMementoProvider implements IElementMementoProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoProvider#encodeElements(org.eclipse.debug.internal.ui.viewers.model.provisional.IElementMementoRequest[])
*/
+ @Override
public void encodeElements(final IElementMementoRequest[] requests) {
Job job = new Job("encode element") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
for (int i = 0; i < requests.length; i++) {
IElementMementoRequest request = requests[i];
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java
index ab6e841d0..6b5730216 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,13 +7,12 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
- * Wind Rvier Systems - added support for columns (bug 235646)
+ * Wind River Systems - added support for columns (bug 235646)
*******************************************************************************/
package org.eclipse.debug.internal.ui.model.elements;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -56,7 +55,8 @@ public class ExpressionContentProvider extends VariableContentProvider {
private final String fMessage;
- public void update(ILabelUpdate[] updates) {
+ @Override
+ public void update(ILabelUpdate[] updates) {
for (int i = 0; i < updates.length; i++) {
String[] columnIds = updates[i].getColumnIds();
if (columnIds == null) {
@@ -86,60 +86,60 @@ public class ExpressionContentProvider extends VariableContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate[])
*/
+ @Override
public void update(IChildrenCountUpdate[] updates) {
// See if we can delegate to a model specific content provider
- Map delegateMap = new HashMap();
- List notDelegated = new ArrayList();
+ Map<IElementContentProvider, List<IViewerUpdate>> delegateMap = new HashMap<IElementContentProvider, List<IViewerUpdate>>();
+ List<IViewerUpdate> notDelegated = new ArrayList<IViewerUpdate>();
findDelegates(delegateMap, notDelegated, updates);
// Batch the updates and send them to the delegates
- for (Iterator iterator = delegateMap.keySet().iterator(); iterator.hasNext();) {
- IElementContentProvider delegate = (IElementContentProvider) iterator.next();
- List updateList = (List)delegateMap.get(delegate);
- delegate.update((IChildrenCountUpdate[])updateList.toArray(new IChildrenCountUpdate[updateList.size()]));
+ for (IElementContentProvider delegate : delegateMap.keySet()) {
+ List<IViewerUpdate> updateList = delegateMap.get(delegate);
+ delegate.update(updateList.toArray(new IChildrenCountUpdate[updateList.size()]));
}
if (notDelegated.size() > 0){
- super.update((IChildrenCountUpdate[])notDelegated.toArray(new IChildrenCountUpdate[notDelegated.size()]));
+ super.update(notDelegated.toArray(new IChildrenCountUpdate[notDelegated.size()]));
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate[])
*/
+ @Override
public void update(IHasChildrenUpdate[] updates) {
// See if we can delegate to a model specific content provider
- Map delegateMap = new HashMap();
- List notDelegated = new ArrayList();
+ Map<IElementContentProvider, List<IViewerUpdate>> delegateMap = new HashMap<IElementContentProvider, List<IViewerUpdate>>();
+ List<IViewerUpdate> notDelegated = new ArrayList<IViewerUpdate>();
findDelegates(delegateMap, notDelegated, updates);
// Batch the updates and send them to the delegates
- for (Iterator iterator = delegateMap.keySet().iterator(); iterator.hasNext();) {
- IElementContentProvider delegate = (IElementContentProvider) iterator.next();
- List updateList = (List)delegateMap.get(delegate);
- delegate.update((IHasChildrenUpdate[])updateList.toArray(new IHasChildrenUpdate[updateList.size()]));
+ for (IElementContentProvider delegate : delegateMap.keySet()) {
+ List<IViewerUpdate> updateList = delegateMap.get(delegate);
+ delegate.update(updateList.toArray(new IHasChildrenUpdate[updateList.size()]));
}
if (notDelegated.size() > 0){
- super.update((IHasChildrenUpdate[])notDelegated.toArray(new IHasChildrenUpdate[notDelegated.size()]));
+ super.update(notDelegated.toArray(new IHasChildrenUpdate[notDelegated.size()]));
}
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#update(org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate[])
*/
+ @Override
public void update(IChildrenUpdate[] updates) {
// See if we can delegate to a model specific content provider
- Map delegateMap = new HashMap();
- List notDelegated = new ArrayList();
+ Map<IElementContentProvider, List<IViewerUpdate>> delegateMap = new HashMap<IElementContentProvider, List<IViewerUpdate>>();
+ List<IViewerUpdate> notDelegated = new ArrayList<IViewerUpdate>();
findDelegates(delegateMap, notDelegated, updates);
// Batch the updates and send them to the delegates
- for (Iterator iterator = delegateMap.keySet().iterator(); iterator.hasNext();) {
- IElementContentProvider delegate = (IElementContentProvider) iterator.next();
- List updateList = (List)delegateMap.get(delegate);
- delegate.update((IChildrenUpdate[])updateList.toArray(new IChildrenUpdate[updateList.size()]));
+ for (IElementContentProvider delegate : delegateMap.keySet()) {
+ List<IViewerUpdate> updateList = delegateMap.get(delegate);
+ delegate.update(updateList.toArray(new IChildrenUpdate[updateList.size()]));
}
if (notDelegated.size() > 0){
- super.update((IChildrenUpdate[])notDelegated.toArray(new IChildrenUpdate[notDelegated.size()]));
+ super.update(notDelegated.toArray(new IChildrenUpdate[notDelegated.size()]));
}
}
@@ -153,14 +153,14 @@ public class ExpressionContentProvider extends VariableContentProvider {
* @param updates array of updates that can be handled by delegates
* @since 3.4
*/
- private void findDelegates(Map delegateMap, List notDelegated, IViewerUpdate[] updates){
+ private void findDelegates(Map<IElementContentProvider, List<IViewerUpdate>> delegateMap, List<IViewerUpdate> notDelegated, IViewerUpdate[] updates) {
for (int i = 0; i < updates.length; i++) {
if (updates[i] instanceof ViewerUpdateMonitor && !((ViewerUpdateMonitor)updates[i]).isDelegated() && updates[i].getElement() instanceof IExpression){
IElementContentProvider delegate = ViewerAdapterService.getContentProvider(((IExpression)updates[i].getElement()).getValue());
if (delegate != null){
- List updateList = (List)delegateMap.get(delegate);
+ List<IViewerUpdate> updateList = delegateMap.get(delegate);
if (updateList == null){
- updateList = new ArrayList();
+ updateList = new ArrayList<IViewerUpdate>();
delegateMap.put(delegate, updateList);
}
((ViewerUpdateMonitor)updates[i]).setDelegated(true);
@@ -173,12 +173,13 @@ public class ExpressionContentProvider extends VariableContentProvider {
}
+ @Override
protected Object[] getAllChildren(Object parent, IPresentationContext context) throws CoreException {
if (parent instanceof IErrorReportingExpression) {
IErrorReportingExpression expression = (IErrorReportingExpression) parent;
if (expression.hasErrors()) {
String[] messages = expression.getErrorMessages();
- LinkedHashSet set = new LinkedHashSet(messages.length);
+ LinkedHashSet<ErrorMessageElement> set = new LinkedHashSet<ErrorMessageElement>(messages.length);
for (int i = 0; i < messages.length; i++) {
set.add(new ErrorMessageElement(messages[i]));
}
@@ -195,6 +196,7 @@ public class ExpressionContentProvider extends VariableContentProvider {
return EMPTY;
}
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (element instanceof IErrorReportingExpression) {
IErrorReportingExpression expression = (IErrorReportingExpression) element;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java
index 9e0a2e748..d0a17e81e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionLabelProvider.java
@@ -30,6 +30,7 @@ public class ExpressionLabelProvider extends VariableLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.VariableLabelProvider#getForeground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (element instanceof IErrorReportingExpression) {
@@ -43,7 +44,8 @@ public class ExpressionLabelProvider extends VariableLabelProvider {
return super.getForeground(elementPath, presentationContext, columnId);
}
- protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
+ @Override
+protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
if (columnId == null) {
return super.getLabel(elementPath, context, columnId);
} else {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
index 629d83ca7..08ad0d331 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerContentProvider.java
@@ -50,7 +50,8 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
*/
private static class AddNewExpressionElement implements IElementLabelProvider, IElementEditor, ICellModifier {
- public void update(ILabelUpdate[] updates) {
+ @Override
+ public void update(ILabelUpdate[] updates) {
for (int i = 0; i < updates.length; i++) {
String[] columnIds = updates[i].getColumnIds();
if (columnIds == null) {
@@ -69,7 +70,8 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
}
}
- private void updateLabel(ILabelUpdate update, int columnIndex) {
+ @SuppressWarnings("deprecation")
+ private void updateLabel(ILabelUpdate update, int columnIndex) {
update.setLabel(DebugUIMessages.ExpressionManagerContentProvider_1, columnIndex);
update.setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_MONITOR_EXPRESSION), columnIndex);
@@ -80,23 +82,28 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
update.setFontData(fontData, columnIndex);
}
- public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
+ @Override
+ public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
return new TextCellEditor(parent);
}
- public ICellModifier getCellModifier(IPresentationContext context, Object element) {
+ @Override
+ public ICellModifier getCellModifier(IPresentationContext context, Object element) {
return this;
}
- public boolean canModify(Object element, String property) {
+ @Override
+ public boolean canModify(Object element, String property) {
return (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(property));
}
- public Object getValue(Object element, String property) {
+ @Override
+ public Object getValue(Object element, String property) {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
- public void modify(Object element, String property, Object value) {
+ @Override
+ public void modify(Object element, String property, Object value) {
// If an expression is entered, add a new watch expression to the
// manager.
if (value instanceof String &&
@@ -128,6 +135,7 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
// Add the "Add new expression" element only if columns are displayed.
return ((IExpressionManager) element).getExpressions().length +
@@ -137,6 +145,7 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
if (context.getColumns() != null) {
return getElements(((IExpressionManager) parent).getExpressions(), ADD_NEW_EXPRESSION_ELEMENT, index, length);
@@ -173,6 +182,7 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_EXPRESSION_VIEW);
}
@@ -180,6 +190,7 @@ public class ExpressionManagerContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java
index 8c4194adc..3130cd85f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionManagerMementoProvider.java
@@ -26,6 +26,7 @@ public class ExpressionManagerMementoProvider extends DebugElementMementoProvide
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IExpressionManager) {
return EXP_MGR;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java
index 6bb4fe271..edb12339e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ExpressionMementoProvider.java
@@ -24,6 +24,7 @@ public class ExpressionMementoProvider extends DebugElementMementoProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IExpression) {
return ((IExpression) element).getExpressionText();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java
index c350078b5..98caaa296 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchContentProvider.java
@@ -24,6 +24,7 @@ public class LaunchContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((ILaunch)element).getChildren().length;
}
@@ -31,6 +32,7 @@ public class LaunchContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
}
@@ -38,10 +40,12 @@ public class LaunchContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(((ILaunch)parent).getChildren(), index, length);
}
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((ILaunch)element).hasChildren();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java
index 81883a39b..d89e4da31 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/LaunchManagerContentProvider.java
@@ -24,6 +24,7 @@ public class LaunchManagerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((ILaunchManager)element).getLaunches().length;
}
@@ -31,6 +32,7 @@ public class LaunchManagerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
}
@@ -38,6 +40,7 @@ public class LaunchManagerContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(((ILaunchManager)parent).getLaunches(),index, length);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java
index bb4008fd5..7c30ea758 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockContentProvider.java
@@ -30,17 +30,20 @@ import org.eclipse.debug.ui.IDebugUIConstants;
*/
public class MemoryBlockContentProvider extends ElementContentProvider {
+ @Override
protected int getChildCount(Object element, IPresentationContext context,
IViewerUpdate monitor) throws CoreException {
return 0;
}
+ @Override
protected Object[] getChildren(Object parent, int index, int length,
IPresentationContext context, IViewerUpdate monitor)
throws CoreException {
return EMPTY;
}
+ @Override
protected boolean supportsContextId(String id) {
if (id.equals(IDebugUIConstants.ID_MEMORY_VIEW))
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java
index 91233a4d4..bd80f6d09 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryBlockLabelProvider.java
@@ -21,6 +21,7 @@ import org.eclipse.jface.viewers.TreePath;
public class MemoryBlockLabelProvider extends DebugElementLabelProvider {
+ @Override
protected String getLabel(TreePath elementPath,
IPresentationContext presentationContext, String columnId)
throws CoreException {
@@ -32,6 +33,7 @@ public class MemoryBlockLabelProvider extends DebugElementLabelProvider {
return super.getLabel(elementPath, presentationContext, columnId);
}
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath,
IPresentationContext presentationContext, String columnId)
throws CoreException {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java
index fc38de376..ab0c12b5e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryRetrievalContentProvider.java
@@ -19,11 +19,13 @@ import org.eclipse.debug.ui.IDebugUIConstants;
public class MemoryRetrievalContentProvider extends ElementContentProvider {
+ @Override
protected int getChildCount(Object element, IPresentationContext context,
IViewerUpdate monitor) throws CoreException {
return getAllChildren(element, context, monitor).length;
}
+ @Override
protected Object[] getChildren(Object parent, int index, int length,
IPresentationContext context, IViewerUpdate monitor)
throws CoreException {
@@ -53,6 +55,7 @@ public class MemoryRetrievalContentProvider extends ElementContentProvider {
return EMPTY;
}
+ @Override
protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_MEMORY_VIEW);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java
index ca4727c53..a71f468d6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/MemoryViewElementMementoProvider.java
@@ -21,6 +21,7 @@ public class MemoryViewElementMementoProvider extends ElementMementoProvider {
private static final String OBJECT_ID = "OBJECT_ID"; //$NON-NLS-1$
+ @Override
protected boolean encodeElement(Object element, IMemento memento,
IPresentationContext context) throws CoreException {
String id = context.getId();
@@ -35,6 +36,7 @@ public class MemoryViewElementMementoProvider extends ElementMementoProvider {
return false;
}
+ @Override
protected boolean isEqual(Object element, IMemento memento,
IPresentationContext context) throws CoreException {
String id = context.getId();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java
index 7b25c8dfd..d8b62d646 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ProcessContentProvider.java
@@ -26,6 +26,7 @@ public class ProcessContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) {
return EMPTY;
}
@@ -33,6 +34,7 @@ public class ProcessContentProvider 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)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) {
return 0;
}
@@ -40,6 +42,7 @@ public class ProcessContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java
index 8d3016462..ede5a6ccf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupContentProvider.java
@@ -23,18 +23,22 @@ import org.eclipse.debug.ui.IDebugUIConstants;
*/
public class RegisterGroupContentProvider extends ElementContentProvider {
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((IRegisterGroup)element).getRegisters().length;
}
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(((IRegisterGroup)parent).getRegisters(), index, length);
}
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((IRegisterGroup)element).hasRegisters();
}
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_REGISTER_VIEW.equals(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java
index c6ec98748..79ffd45b6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupLabelProvider.java
@@ -25,6 +25,7 @@ public class RegisterGroupLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
if (columnId == null || IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(columnId)) {
return super.getImageDescriptor(elementPath, presentationContext, columnId);
@@ -35,6 +36,7 @@ public class RegisterGroupLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
if (columnId == null || IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(columnId)) {
return super.getLabel(elementPath, context, columnId);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java
index 9d2f9401e..31a5bf5ac 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/RegisterGroupMementoProvider.java
@@ -24,6 +24,7 @@ public class RegisterGroupMementoProvider extends DebugElementMementoProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IRegisterGroup) {
return ((IRegisterGroup) element).getName();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java
index 61ce7cef0..d47b283fa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameContentProvider.java
@@ -24,6 +24,7 @@ public class StackFrameContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getAllChildren(element, context, monitor).length;
}
@@ -31,6 +32,7 @@ public class StackFrameContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(getAllChildren(parent, context, monitor), index, length);
}
@@ -61,6 +63,7 @@ public class StackFrameContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_VARIABLE_VIEW) || id.equals(IDebugUIConstants.ID_REGISTER_VIEW);
}
@@ -68,6 +71,7 @@ public class StackFrameContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
String id = context.getId();
IStackFrame frame = (IStackFrame) element;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java
index 450ce046c..0f3c9efd4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/StackFrameMementoProvider.java
@@ -25,6 +25,7 @@ public class StackFrameMementoProvider extends DebugElementMementoProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IStackFrame) {
IStackFrame frame = (IStackFrame) element;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java
index dd99e6650..5aa59f87a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ThreadContentProvider.java
@@ -24,6 +24,7 @@ public class ThreadContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((IThread)element).getStackFrames().length;
}
@@ -31,6 +32,7 @@ public class ThreadContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return IDebugUIConstants.ID_DEBUG_VIEW.equals(id);
}
@@ -38,10 +40,12 @@ public class ThreadContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(((IThread)parent).getStackFrames(), index, length);
}
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((IThread)element).hasStackFrames();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
index 8c050f792..62667824d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,6 +44,7 @@ public class VariableContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getAllChildren(element, context).length;
}
@@ -51,6 +52,7 @@ public class VariableContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(getAllChildren(parent, context), index, length);
}
@@ -58,6 +60,7 @@ public class VariableContentProvider extends ElementContentProvider {
/* (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)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return ((IVariable)element).getValue().hasVariables();
}
@@ -65,6 +68,7 @@ public class VariableContentProvider extends ElementContentProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_EXPRESSION_VIEW) || id.equals(IDebugUIConstants.ID_VARIABLE_VIEW) || id.equals(IDebugUIConstants.ID_REGISTER_VIEW);
}
@@ -117,7 +121,7 @@ public class VariableContentProvider extends ElementContentProvider {
* @return logical value for the raw value
*/
protected IValue getLogicalValue(IValue value, IPresentationContext context) throws CoreException {
- return getLogicalValue(value, new ArrayList(), context);
+ return getLogicalValue(value, new ArrayList<String>(), context);
}
/**
@@ -212,7 +216,7 @@ public class VariableContentProvider extends ElementContentProvider {
* Callers should always pass in a new, empty list.
* @return logical value if one is calculated, otherwise the raw value is returned
*/
- protected IValue getLogicalValue(IValue value, List previousStructureIds, IPresentationContext context) throws CoreException {
+ protected IValue getLogicalValue(IValue value, List<String> previousStructureIds, IPresentationContext context) throws CoreException {
if (isShowLogicalStructure(context)) {
ILogicalStructureType[] types = DebugPlugin.getLogicalStructureTypes(value);
if (types.length > 0) {
@@ -239,6 +243,7 @@ public class VariableContentProvider extends ElementContentProvider {
fgLogicalCache = new LogicalStructureCache();
// Add a listener to clear the cache when resuming, terminating, or suspending
DebugPlugin.getDefault().addDebugEventListener(new IDebugEventSetListener(){
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
if (events[i].getKind() == DebugEvent.TERMINATE){
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java
index b886d20ed..49911d35b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableEditor.java
@@ -26,6 +26,7 @@ public class VariableEditor implements IElementEditor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor#getCellEditor(org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String, java.lang.Object, org.eclipse.swt.widgets.Composite)
*/
+ @Override
public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
return new TextCellEditor(parent);
}
@@ -33,6 +34,7 @@ public class VariableEditor implements IElementEditor {
/* (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)
*/
+ @Override
public ICellModifier getCellModifier(IPresentationContext context, Object element) {
return new DefaultVariableCellModifier();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java
index 98fba8aa8..3e425b4d4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableLabelProvider.java
@@ -33,6 +33,7 @@ public class VariableLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getBackground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected RGB getBackground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (columnId != null) {
@@ -49,6 +50,7 @@ public class VariableLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getForeground(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected RGB getForeground(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
Object element = elementPath.getLastSegment();
if (columnId == null) {
@@ -65,6 +67,7 @@ public class VariableLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getImageDescriptor(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected ImageDescriptor getImageDescriptor(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
if (columnId == null || IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(columnId)) {
return super.getImageDescriptor(elementPath, presentationContext, columnId);
@@ -75,6 +78,7 @@ public class VariableLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getFontData(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected FontData getFontData(TreePath elementPath, IPresentationContext presentationContext, String columnId) throws CoreException {
return JFaceResources.getFontDescriptor(IDebugUIConstants.PREF_VARIABLE_TEXT_FONT).getFontData()[0];
}
@@ -82,6 +86,7 @@ public class VariableLabelProvider extends DebugElementLabelProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementLabelProvider#getLabel(org.eclipse.jface.viewers.TreePath, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext, java.lang.String)
*/
+ @Override
protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId) throws CoreException {
if (columnId == null) {
return super.getLabel(elementPath, context, columnId);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
index f64ff8b7a..42a1b9c95 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/VariableMementoProvider.java
@@ -24,6 +24,7 @@ public class VariableMementoProvider extends DebugElementMementoProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.DebugElementMementoProvider#getElementName(java.lang.Object, org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext)
*/
+ @Override
protected String getElementName(Object element, IPresentationContext context) throws CoreException {
if (element instanceof IVariable) {
return ((IVariable) element).getName();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java
index d974a0fc3..92ce722a4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/ViewerInputProvider.java
@@ -33,8 +33,10 @@ public abstract class ViewerInputProvider implements IViewerInputProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider#updateChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.model.provisional.IElementRequestMonitor)
*/
+ @Override
public void update(final IViewerInputUpdate update) {
Job job = new Job("viewer input resolution") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!update.isCanceled()) {
retrieveInput(update);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/WatchExpressionEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/WatchExpressionEditor.java
index 88c329e71..d54ad21ba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/WatchExpressionEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/model/elements/WatchExpressionEditor.java
@@ -26,6 +26,7 @@ public class WatchExpressionEditor 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)
*/
+ @Override
public CellEditor getCellEditor(IPresentationContext context, String columnId, Object element, Composite parent) {
return new TextCellEditor(parent);
}
@@ -33,6 +34,7 @@ public class WatchExpressionEditor implements IElementEditor {
/* (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)
*/
+ @Override
public ICellModifier getCellModifier(IPresentationContext context, Object element) {
return new WatchExpressionCellModifier();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java
index 91e434280..3e95df02c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/BooleanFieldEditor2.java
@@ -37,6 +37,7 @@ public class BooleanFieldEditor2 extends BooleanFieldEditor {
/**
* @see org.eclipse.jface.preference.BooleanFieldEditor#getChangeControl(Composite)
*/
+ @Override
public Button getChangeControl(Composite parent) {
if (fChangeControl == null) {
fChangeControl = super.getChangeControl(parent);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java
index 5a4b7253b..fb9a87722 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ConsolePreferencePage.java
@@ -48,6 +48,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/**
* @see org.eclipse.jface.preference.FieldEditor#refreshValidState()
*/
+ @Override
protected void refreshValidState() {
super.refreshValidState();
}
@@ -56,6 +57,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
* Clears the error message from the message line if the error
* message is the error message from this field editor.
*/
+ @Override
protected void clearErrorMessage() {
if (canClearErrorMessage()) {
super.clearErrorMessage();
@@ -83,6 +85,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(
@@ -93,6 +96,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/**
* Create all field editors for this page
*/
+ @Override
public void createFieldEditors() {
fWrapEditor = new BooleanFieldEditor2(IDebugPreferenceConstants.CONSOLE_WRAP, DebugPreferencesMessages.ConsolePreferencePage_Wrap_text_1, SWT.NONE, getFieldEditorParent());
@@ -105,6 +109,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
fWrapEditor.getChangeControl(getFieldEditorParent()).addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateWidthEditor();
}
@@ -121,6 +126,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
fUseBufferSize.getChangeControl(getFieldEditorParent()).addSelectionListener(
new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateBufferSizeEditor();
}
@@ -149,12 +155,14 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/**
* @see IWorkbenchPreferencePage#init(IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
boolean ok= super.performOk();
// update high water mark to be (about) 100 lines (100 * 80 chars) greater than low water mark
@@ -168,6 +176,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/**
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#initialize()
*/
+ @Override
protected void initialize() {
super.initialize();
updateWidthEditor();
@@ -196,6 +205,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/**
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
super.performDefaults();
updateWidthEditor();
@@ -212,6 +222,7 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(FieldEditor.IS_VALID)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java
index 9f6ea8800..b338c0a85 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/DebugPreferencePage.java
@@ -41,6 +41,7 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.DEBUG_PREFERENCE_PAGE);
@@ -49,6 +50,7 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
/**
* @see FieldEditorPreferencePage#createFieldEditors
*/
+ @Override
protected void createFieldEditors() {
addField(new BooleanFieldEditor(IDebugUIConstants.PREF_REUSE_EDITOR, DebugPreferencesMessages.DebugPreferencePage_2, SWT.NONE, getFieldEditorParent()));
@@ -78,6 +80,7 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
/**
* @see IWorkbenchPreferencePage#init(IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java
index d829914c4..ee839409b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/IDebugPreferenceConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,11 +40,13 @@ public interface IDebugPreferenceConstants {
/**
* @deprecated use IDebugUIConstants.PREF_MEMORY_HISTORY_UNKNOWN_COLOR instead
*/
+ @Deprecated
public static final String MEMORY_VIEW_UNBUFFERED_LINE_COLOR = IDebugUIConstants.PLUGIN_ID + ".MemoryViewLineColor"; //$NON-NLS-1$
/**
* @deprecated use IDebugUIConstants.PREF_MEMORY_HISTORY_KNOWN_COLOR instead
*/
+ @Deprecated
public static final String MEMORY_VIEW_BUFFERED_LINE_COLOR = IDebugUIConstants.PLUGIN_ID + ".MemoryViewBufferedLineColor"; //$NON-NLS-1$
/**
@@ -104,6 +106,7 @@ public interface IDebugPreferenceConstants {
*
* @deprecated no longer supported
*/
+ @Deprecated
public static final String PREF_LAST_LAUNCH_CONFIGURATION_SELECTION = IDebugUIConstants.PLUGIN_ID + ".lastLaunchConfigSelection"; //$NON-NLS-1$
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
index a40272f01..701022843 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchConfigurationsPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -88,6 +88,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IDebugUIConstants.PLUGIN_ID + ".MIGRATION_SELECTION_DIALOG"; //$NON-NLS-1$
}
@@ -95,6 +96,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_LAUNCH_CONFIGURATION_MIGRATION_DIALOG;
}
@@ -102,6 +104,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fInput;
}
@@ -109,6 +112,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return DebugPreferencesMessages.LaunchingPreferencePage_0;
}
@@ -116,6 +120,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
*/
+ @Override
protected IContentProvider getContentProvider() {
return new WorkbenchContentProvider();
}
@@ -123,6 +128,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
*/
+ @Override
protected IBaseLabelProvider getLabelProvider() {
return DebugUITools.newDebugModelPresentation();
}
@@ -133,12 +139,15 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
*/
class TableContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
return getLaunchConfigurationTypes();
}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
@@ -155,7 +164,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/**
* a list of the field editors
*/
- private List fFieldEditors;
+ private List<FieldEditor> fFieldEditors;
/**
* Boolean editor for debug core plug-in preference
@@ -179,6 +188,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_PREFERENCE_PAGE);
@@ -187,8 +197,9 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
- fFieldEditors = new ArrayList();
+ fFieldEditors = new ArrayList<FieldEditor>();
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
//filtering options
Group group = SWTFactory.createGroup(comp, DebugPreferencesMessages.LaunchingPreferencePage_32, 1, 1, GridData.FILL_HORIZONTAL);
@@ -217,7 +228,9 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
fMigrateNow.setLayoutData(gd);
fMigrateNow.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleMigrateNowSelected();
}
@@ -237,6 +250,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
Composite comp = SWTFactory.createComposite(parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);
BooleanFieldEditor2 editor = new BooleanFieldEditor2(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_TYPES, DebugPreferencesMessages.LaunchConfigurationsPreferencePage_0, SWT.NONE, comp);
editor.setPropertyChangeListener(new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
boolean newvalue = false;
if(event.getNewValue() instanceof Boolean) {
@@ -287,7 +301,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
ILaunchManager lmanager = DebugPlugin.getDefault().getLaunchManager();
ILaunchConfiguration[] configurations = lmanager.getMigrationCandidates();
//separate the private from the public
- List pub = new ArrayList();
+ List<ILaunchConfiguration> pub = new ArrayList<ILaunchConfiguration>();
for(int i = 0; i < configurations.length; i++) {
if(DebugUITools.isPrivate(configurations[i])) {
//auto-migrate private ones
@@ -324,6 +338,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {}
/**
@@ -333,7 +348,7 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
private void initFieldEditors() {
FieldEditor editor;
for(int i = 0; i < fFieldEditors.size(); i++) {
- editor = (FieldEditor)fFieldEditors.get(i);
+ editor = fFieldEditors.get(i);
editor.setPreferenceStore(getPreferenceStore());
editor.load();
}
@@ -357,11 +372,12 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
fDeleteConfigs.setSelection(Preferences.getDefaultBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, true));
FieldEditor editor = null;
for(int i = 0; i < fFieldEditors.size(); i++) {
- editor = (FieldEditor)fFieldEditors.get(i);
+ editor = fFieldEditors.get(i);
editor.loadDefault();
if(editor instanceof BooleanFieldEditor2) {
fTable.setEnabled(((BooleanFieldEditor2)editor).getBooleanValue());
@@ -373,10 +389,11 @@ public class LaunchConfigurationsPreferencePage extends PreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
//save field editors
for(int i = 0; i < fFieldEditors.size(); i++) {
- ((FieldEditor)fFieldEditors.get(i)).store();
+ fFieldEditors.get(i).store();
}
Preferences.setBoolean(DebugPlugin.getUniqueIdentifier(), DebugPlugin.PREF_DELETE_CONFIGS_ON_PROJECT_DELETE, fDeleteConfigs.getSelection(), null);
//save table
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
index 1f342680b..4dc046a18 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java
@@ -11,12 +11,12 @@
package org.eclipse.debug.internal.ui.preferences;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.debug.core.DebugPlugin;
@@ -80,10 +80,10 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
final class PerspectiveChange {
private ILaunchConfigurationType fType = null;
private ILaunchDelegate fDelegate = null;
- private Set fModes = null;
+ private Set<String> fModes = null;
private String fPid = null;
- public PerspectiveChange(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes, String perspectiveid) {
+ public PerspectiveChange(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes, String perspectiveid) {
fType = type;
fDelegate = delegate;
fModes = modes;
@@ -93,7 +93,11 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
public ILaunchConfigurationType getType() {return fType;}
public ILaunchDelegate getDelegate() {return fDelegate;}
public String getPerspectiveId() {return fPid;}
- public Set getModes() {return fModes;}
+
+ public Set<String> getModes() {
+ return fModes;
+ }
+ @Override
public boolean equals(Object o) {
if(o instanceof PerspectiveChange) {
PerspectiveChange change = (PerspectiveChange) o;
@@ -103,6 +107,11 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
}
return super.equals(o);
}
+
+ @Override
+ public int hashCode() {
+ return fDelegate.hashCode() + fType.hashCode() + fModes.hashCode();
+ }
}
/**
@@ -112,6 +121,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
public PerspectivesTreeViewer(Tree tree) {
super(tree);
}
+ @Override
public Object[] getFilteredChildren(Object o) {return super.getFilteredChildren(o);}
}
@@ -119,6 +129,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
* Provides content for the configuration tree viewer
*/
final class PerspectiveContentProvider implements ITreeContentProvider {
+ @Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof ILaunchConfigurationType) {
ILaunchConfigurationType type = (ILaunchConfigurationType) parentElement;
@@ -126,12 +137,17 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
}
return new Object[0];
}
+ @Override
public Object[] getElements(Object inputElement) {
return DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
}
+ @Override
public boolean hasChildren(Object element) {return element instanceof ILaunchConfigurationType;}
+ @Override
public Object getParent(Object element) {return null;}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
@@ -164,7 +180,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
children[i].dispose();
}
if(fgCurrentWorkingContext == null) {
- fgCurrentWorkingContext = new HashSet();
+ fgCurrentWorkingContext = new HashSet<Object>();
}
fgCurrentWorkingContext.clear();
if(!selection.isEmpty()) {
@@ -191,15 +207,19 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
* Caches
*/
private static String[] fgPerspectiveLabels = null;
- private static Map fgPerspectiveIdMap = null;
- private static HashSet fgChangeSet = null;
- private static HashSet fgCurrentWorkingContext = null;
+ private static Map<String, String> fgPerspectiveIdMap = null;
+ private static HashSet<PerspectiveChange> fgChangeSet = null;
+ private static HashSet<Object> fgCurrentWorkingContext = null;
/**
* A default selection listener to be reused by all combo boxes presenting perspective data
*/
private SelectionListener fSelectionListener = new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+
+ @SuppressWarnings("unchecked")
+ @Override
public void widgetSelected(SelectionEvent e) {
Object o = e.getSource();
if(o instanceof Combo) {
@@ -207,8 +227,8 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
LaunchDelegate delegate = null;
ILaunchConfigurationType type = null;
PerspectiveChange change = null;
- Set modes = null;
- for(Iterator iter = fgCurrentWorkingContext.iterator(); iter.hasNext();) {
+ Set<String> modes = null;
+ for (Iterator<Object> iter = fgCurrentWorkingContext.iterator(); iter.hasNext();) {
o = iter.next();
if(o instanceof ILaunchDelegate) {
delegate = (LaunchDelegate) o;
@@ -218,14 +238,14 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
delegate = null;
type = (ILaunchConfigurationType) o;
}
- modes = (Set) combo.getData();
+ modes = (Set<String>) combo.getData();
change = findChange(type, delegate, modes);
if(change == null) {
- change = new PerspectiveChange(type, delegate, modes, (String)fgPerspectiveIdMap.get(combo.getText()));
+ change = new PerspectiveChange(type, delegate, modes, fgPerspectiveIdMap.get(combo.getText()));
fgChangeSet.add(change);
}
else {
- change.fPid = (String)fgPerspectiveIdMap.get(combo.getText());
+ change.fPid = fgPerspectiveIdMap.get(combo.getText());
}
}
}
@@ -240,6 +260,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
/**
* @see org.eclipse.jface.dialogs.DialogPage#dispose()
*/
+ @Override
public void dispose() {
PlatformUI.getWorkbench().getActivitySupport().getActivityManager().removeActivityManagerListener(this);
fgPerspectiveIdMap.clear();
@@ -257,6 +278,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
/**
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.PERSPECTIVE_PREFERENCE_PAGE);
@@ -265,6 +287,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
/**
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
SWTFactory.createWrapLabel(parent, DebugPreferencesMessages.PerspectivePreferencePage_0, 2, 300);
@@ -317,11 +340,13 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
fTree.setLayoutData(gd);
fTreeViewer = new PerspectivesTreeViewer(fTree);
fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
fPerspectivesPanel.refreshPanel((IStructuredSelection) event.getSelection());
}
});
fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
IStructuredSelection ss = (IStructuredSelection) event.getSelection();
if(!ss.isEmpty()) {
@@ -344,17 +369,15 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
* @param selection the selection in the tree viewer
*/
protected void createCombos(Composite parent, Object[] selection) {
- Set modes = collectCommonModeSets(selection);
+ Set<Set<String>> modes = collectCommonModeSets(selection);
if(modes.isEmpty()) {
fPerspectivesPanel.setMessage(DebugPreferencesMessages.LaunchPerspectivePreferencePage_1);
return;
}
fPerspectivesPanel.setMessage(IInternalDebugCoreConstants.EMPTY_STRING);
- List fmodes = null;
+ List<String> fmodes = null;
Combo combo = null;
- Set smodes = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- smodes = (Set) iter.next();
+ for (Set<String> smodes : modes) {
fmodes = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(smodes);
if(!fmodes.isEmpty()) {
//add the mode set and create a combo
@@ -381,17 +404,17 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
* @param modes the set of modes
* @return the text to select in the current combo / current working set context, or "None"
*/
- private String getComboSelection(Set modes) {
+ private String getComboSelection(Set<String> modes) {
String text = DebugPreferencesMessages.PerspectivePreferencePage_4;
IStructuredSelection ss = (IStructuredSelection) fTreeViewer.getSelection();
if(ss != null && !ss.isEmpty()) {
Object o = null;
- Set tmp = new HashSet();
+ Set<String> tmp = new HashSet<String>();
String id = null;
ILaunchConfigurationType type = null;
LaunchDelegate delegate = null;
PerspectiveChange change = null;
- for(Iterator iter = ss.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = ss.iterator(); iter.hasNext();) {
o = iter.next();
if(o instanceof LaunchDelegate) {
delegate = (LaunchDelegate) o;
@@ -413,13 +436,11 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
tmp.add(id);
}
if(tmp.size() == 1) {
- id = (String) tmp.iterator().next();
+ id = tmp.iterator().next();
if(!IDebugUIConstants.PERSPECTIVE_NONE.equals(id)) {
- String label = null;
- for(Iterator iter = fgPerspectiveIdMap.keySet().iterator(); iter.hasNext();) {
- label = (String) iter.next();
- if(id.equals(fgPerspectiveIdMap.get(label))) {
- return label;
+ for (Entry<String, String> entry : fgPerspectiveIdMap.entrySet()) {
+ if (id.equals(entry.getValue())) {
+ return entry.getKey();
}
}
}
@@ -437,56 +458,51 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
* @param modes the current mode set
* @return the existing <code>PerspectiveChange</code> if there is one, <code>null</code> otherwise
*/
- private PerspectiveChange findChange(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
+ private PerspectiveChange findChange(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes) {
PerspectiveChange change = new PerspectiveChange(type, delegate, modes, null);
- Object o = null;
- for(Iterator iter = fgChangeSet.iterator(); iter.hasNext();) {
- o = iter.next();
- if(change.equals(o)) {
- return (PerspectiveChange) o;
+ for (PerspectiveChange ch : fgChangeSet) {
+ if (change.equals(ch)) {
+ return ch;
}
}
return null;
}
/**
- * Collects a list of mode sets that are common to the current selection context. It is possible
- * that there are no mode sets in comomon.
+ * Collects a list of mode sets that are common to the current selection
+ * context. It is possible that there are no mode sets in common.
+ *
* @param selection the current selection context
* @return a list of mode sets or an empty list, never <code>null</code>
*/
- protected Set collectCommonModeSets(Object[] selection) {
- HashSet common = new HashSet();
+ protected Set<Set<String>> collectCommonModeSets(Object[] selection) {
+
//prep selection context, remove types from the equation
- HashSet delegates = new HashSet();
+ HashSet<ILaunchDelegate> delegates = new HashSet<ILaunchDelegate>();
Object o = null;
- Object[] kids = null;
for(int i = 0; i < selection.length; i++) {
o = selection[i];
if(o instanceof ILaunchDelegate) {
- delegates.add(o);
+ delegates.add((ILaunchDelegate) o);
}
else if(o instanceof ILaunchConfigurationType) {
fgCurrentWorkingContext.add(o);
- kids = fTreeViewer.getFilteredChildren(o);
- delegates.addAll(Arrays.asList(kids));
+ Object[] kids = fTreeViewer.getFilteredChildren(o);
+ for (int j = 0; j < kids.length; j++) {
+ delegates.add((ILaunchDelegate) kids[i]);
+ }
}
}
//compare the listing of delegates to find common mode sets
- ILaunchDelegate delegate = null;
- List modes = null;
- HashSet pruned = new HashSet();
- Set fmodes = null;
- if(!delegates.isEmpty()) {
- for(Iterator iter = delegates.iterator(); iter.hasNext();) {
- delegate = (ILaunchDelegate) iter.next();
- modes = delegate.getModes();
- for(Iterator iter2 = modes.iterator(); iter2.hasNext();) {
- fmodes = (Set) iter2.next();
- if(isCommonModeset(fmodes, delegates, pruned)) {
- common.add(fmodes);
- fgCurrentWorkingContext.add(delegate);
- }
+ HashSet<Set<String>> common = new HashSet<Set<String>>();
+ List<Set<String>> modes = null;
+ HashSet<Set<String>> pruned = new HashSet<Set<String>>();
+ for (ILaunchDelegate delegate : delegates) {
+ modes = delegate.getModes();
+ for (Set<String> fmodes : modes) {
+ if (isCommonModeset(fmodes, delegates, pruned)) {
+ common.add(fmodes);
+ fgCurrentWorkingContext.add(delegate);
}
}
}
@@ -501,12 +517,10 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
* @param pruned the monotonic listing of pruned mode sets
* @return true if the specified mode set is common to all members of the specified listing of launch delegates, false otherwise
*/
- private boolean isCommonModeset(Set modeset, Set delegates, Set pruned) {
+ private boolean isCommonModeset(Set<String> modeset, Set<ILaunchDelegate> delegates, Set<Set<String>> pruned) {
if(!pruned.contains(modeset)) {
- ILaunchDelegate delegate = null;
boolean common = true;
- for(Iterator iter = delegates.iterator(); iter.hasNext();) {
- delegate = (ILaunchDelegate) iter.next();
+ for (ILaunchDelegate delegate : delegates) {
common &= delegate.getModes().contains(modeset);
}
if(!common) {
@@ -537,6 +551,7 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
/**
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
fgChangeSet.clear();
fSwitchLaunch.loadDefault();
@@ -545,23 +560,19 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
PerspectiveManager pm = DebugUIPlugin.getDefault().getPerspectiveManager();
TreeItem[] items = fTree.getItems();
ILaunchConfigurationType type = null;
- Set modes = null;
- Set modeset = null;
- Object[] delegates = null;
+ Set<Set<String>> modes = null;
+ ILaunchDelegate[] delegates = null;
for(int i = 0; i < items.length; i++) {
- //reset type
type = (ILaunchConfigurationType) items[i].getData();
modes = type.getSupportedModeCombinations();
- delegates = fTreeViewer.getFilteredChildren(type);
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
+ delegates = (ILaunchDelegate[]) fTreeViewer.getFilteredChildren(type);
+ for (Set<String> modeset : modes) {
fgChangeSet.add(new PerspectiveChange(type, null, modeset, pm.getDefaultLaunchPerspective(type, null, modeset)));
}
for(int j = 0; j < delegates.length; j++) {
- modes = new HashSet(((ILaunchDelegate)delegates[j]).getModes());
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
- fgChangeSet.add(new PerspectiveChange(type, (ILaunchDelegate) delegates[j], modeset, pm.getDefaultLaunchPerspective(type, (ILaunchDelegate) delegates[j], modeset)));
+ modes = new HashSet<Set<String>>(delegates[j].getModes());
+ for (Set<String> modeset : modes) {
+ fgChangeSet.add(new PerspectiveChange(type, delegates[j], modeset, pm.getDefaultLaunchPerspective(type, delegates[j], modeset)));
}
}
}
@@ -576,12 +587,13 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
/**
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {
setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
- fgChangeSet = new HashSet();
+ fgChangeSet = new HashSet<PerspectiveChange>();
//init the labels mapping and the list of labels
- fgPerspectiveIdMap = new HashMap();
- ArrayList labels = new ArrayList();
+ fgPerspectiveIdMap = new HashMap<String, String>();
+ ArrayList<String> labels = new ArrayList<String>();
labels.add(DebugPreferencesMessages.PerspectivePreferencePage_4);
IPerspectiveRegistry registry = PlatformUI.getWorkbench().getPerspectiveRegistry();
IPerspectiveDescriptor[] descriptors = registry.getPerspectives();
@@ -593,12 +605,13 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
fgPerspectiveIdMap.put(label, descriptors[i].getId());
}
}
- fgPerspectiveLabels = (String[]) labels.toArray(new String[labels.size()]);
+ fgPerspectiveLabels = labels.toArray(new String[labels.size()]);
}
/**
* @see org.eclipse.ui.activities.IActivityManagerListener#activityManagerChanged(org.eclipse.ui.activities.ActivityManagerEvent)
*/
+ @Override
public void activityManagerChanged(ActivityManagerEvent activityManagerEvent) {
if(!fTree.isDisposed()) {
fTreeViewer.refresh();
@@ -608,14 +621,13 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I
/**
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
fSwitchLaunch.store();
fSwitchSuspend.store();
if(!fgChangeSet.isEmpty()) {
- PerspectiveChange change = null;
PerspectiveManager mgr = DebugUIPlugin.getDefault().getPerspectiveManager();
- for(Iterator iter = fgChangeSet.iterator(); iter.hasNext();) {
- change = (PerspectiveChange) iter.next();
+ for (PerspectiveChange change : fgChangeSet) {
mgr.setLaunchPerspective(change.getType(), change.getModes(), change.getDelegate(), change.getPerspectiveId());
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
index a22f10830..b45909497 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchersPreferencePage.java
@@ -69,9 +69,9 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
class DuplicateDelegate {
private ILaunchConfigurationType fType = null;
private ILaunchDelegate[] fDelegates = null;
- private Set fModes = null;
+ private Set<String> fModes = null;
- public DuplicateDelegate(ILaunchConfigurationType type, ILaunchDelegate[] delegates, Set modes) {
+ public DuplicateDelegate(ILaunchConfigurationType type, ILaunchDelegate[] delegates, Set<String> modes) {
fModes = modes;
fType = type;
fDelegates = delegates;
@@ -83,7 +83,8 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
public ILaunchDelegate[] getDelegates() {
return fDelegates;
}
- public Set getModeSet() {
+
+ public Set<String> getModeSet() {
return fModes;
}
}
@@ -92,6 +93,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
* label provider to extend the default one, provides labels to both the tree and table of this page
*/
class LabelProvider extends DefaultLabelProvider {
+ @Override
public String getText(Object element) {
if(element instanceof ILaunchConfigurationType) {
return super.getText(element);
@@ -111,10 +113,11 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
* This class is used to provide content to the tree
*/
class TreeProvider implements ITreeContentProvider {
+ @Override
public Object[] getChildren(Object parentElement) {
if(parentElement instanceof ILaunchConfigurationType) {
ILaunchConfigurationType type = (ILaunchConfigurationType) parentElement;
- Set dupes = (Set) fDuplicates.get(type);
+ Set<DuplicateDelegate> dupes = fDuplicates.get(type);
if(dupes != null) {
return dupes.toArray();
}
@@ -122,24 +125,29 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
}
return null;
}
+ @Override
public boolean hasChildren(Object element) {
return element instanceof ILaunchConfigurationType;
}
+ @Override
public Object[] getElements(Object inputElement) {
if(inputElement instanceof Map) {
- return ((Map)inputElement).keySet().toArray();
+ return ((Map<?, ?>) inputElement).keySet().toArray();
}
return null;
}
+ @Override
public Object getParent(Object element) {return null;}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
private TreeViewer fTreeViewer = null;
private CheckboxTableViewer fTableViewer = null;
- private Map fDuplicates = null;
- private Map fDupeSelections = null;
+ private Map<ILaunchConfigurationType, Set<DuplicateDelegate>> fDuplicates = null;
+ private Map<DuplicateDelegate, ILaunchDelegate> fDupeSelections = null;
private boolean fDirty = false;
private Text fDescription = null;
@@ -153,6 +161,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
/**
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_DELEGATES_PREFERENCE_PAGE);
@@ -161,6 +170,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
/**
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
SWTFactory.createWrapLabel(comp, DebugPreferencesMessages.LaunchDelegatesPreferencePage_1, 2, 300);
@@ -188,6 +198,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
fTreeViewer.setInput(fDuplicates);
fTreeViewer.expandToLevel(2);
fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
Object obj = ((IStructuredSelection) event.getSelection()).getFirstElement();
if(obj instanceof DuplicateDelegate) {
@@ -219,6 +230,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
fTableViewer.setLabelProvider(new LabelProvider());
fTableViewer.setContentProvider(new ArrayContentProvider());
fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection ss = (IStructuredSelection) event.getSelection();
if(ss != null && !ss.isEmpty()) {
@@ -231,6 +243,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
}
});
fTableViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
fDirty = true;
Object element = event.getElement();
@@ -247,7 +260,7 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
if(obj instanceof DuplicateDelegate) {
fDupeSelections.remove(obj);
if(checked) {
- fDupeSelections.put(obj, element);
+ fDupeSelections.put((DuplicateDelegate) obj, (ILaunchDelegate) element);
}
}
}
@@ -262,14 +275,15 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
/**
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
if(fDirty && fDupeSelections != null && fDupeSelections.size() > 0) {
fDirty = false;
DuplicateDelegate dd = null;
ILaunchDelegate delegate = null;
- for(Iterator iter = fDupeSelections.keySet().iterator(); iter.hasNext();) {
- dd = (DuplicateDelegate) iter.next();
- delegate = (ILaunchDelegate) fDupeSelections.get(dd);
+ for (Iterator<DuplicateDelegate> iter = fDupeSelections.keySet().iterator(); iter.hasNext();) {
+ dd = iter.next();
+ delegate = fDupeSelections.get(dd);
try {
dd.getType().setPreferredDelegate(dd.getModeSet(), delegate);
}
@@ -282,29 +296,30 @@ public class LaunchersPreferencePage extends PreferencePage implements IWorkbenc
/**
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {
//init a listing of duplicate delegates arranged by type
try {
setPreferenceStore(DebugUIPlugin.getDefault().getPreferenceStore());
LaunchManager lm = (LaunchManager) DebugPlugin.getDefault().getLaunchManager();
ILaunchConfigurationType[] types = lm.getLaunchConfigurationTypes();
- fDuplicates = new HashMap();
- fDupeSelections = new HashMap();
- Set modes = null;
+ fDuplicates = new HashMap<ILaunchConfigurationType, Set<DuplicateDelegate>>();
+ fDupeSelections = new HashMap<DuplicateDelegate, ILaunchDelegate>();
ILaunchDelegate[] delegates = null;
- Set modeset = null;
- Set tmp = null;
+ Set<Set<String>> modes = null;
+ Set<String> modeset = null;
+ Set<DuplicateDelegate> tmp = null;
ILaunchDelegate prefdelegate = null;
DuplicateDelegate dd = null;
for(int i = 0; i < types.length; i++) {
modes = types[i].getSupportedModeCombinations();
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modeset = (Set) iter.next();
+ for (Iterator<Set<String>> iter = modes.iterator(); iter.hasNext();) {
+ modeset = iter.next();
delegates = types[i].getDelegates(modeset);
if(delegates.length > 1) {
- tmp = (Set) fDuplicates.get(types[i]);
+ tmp = fDuplicates.get(types[i]);
if(tmp == null) {
- tmp = new HashSet();
+ tmp = new HashSet<DuplicateDelegate>();
}
dd = new DuplicateDelegate(types[i], delegates, modeset);
tmp.add(dd);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java
index ad0fbbca9..2a2aad765 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchingPreferencePage.java
@@ -60,6 +60,7 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCHING_PREFERENCE_PAGE);
@@ -68,6 +69,7 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite comp = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_HORIZONTAL);
//save dirty editors
@@ -153,7 +155,9 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement
fUseOldLaunching = SWTFactory.createRadioButton(group, DebugPreferencesMessages.LaunchingPreferencePage_37);
fUseContextLaunching = SWTFactory.createRadioButton(group, DebugPreferencesMessages.LaunchingPreferencePage_38);
fUseContextLaunching.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
boolean enabled = ((Button)e.widget).getSelection();
fCheckParent.setEnabled(enabled);
@@ -182,11 +186,13 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
boolean value = getPreferenceStore().getDefaultBoolean(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH);
fUseOldLaunching.setSelection(!value);
@@ -202,6 +208,7 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH, fUseContextLaunching.getSelection());
getPreferenceStore().setValue(IInternalDebugUIConstants.PREF_LAUNCH_PARENT_PROJECT, fCheckParent.getSelection());
@@ -212,6 +219,7 @@ public class LaunchingPreferencePage extends FieldEditorPreferencePage implement
/**
* @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
*/
+ @Override
protected void createFieldEditors() {
//do nothing we overload the create contents method
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
index 1ee78764c..ba3450901 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
@@ -51,6 +51,7 @@ public class ProcessPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite ancestor) {
noDefaultAndApplyButton();
Composite parent = SWTFactory.createComposite(ancestor, ancestor.getFont(), 1, 1, GridData.FILL_BOTH);
@@ -103,6 +104,7 @@ public class ProcessPropertyPage extends PropertyPage {
commandLineText = DebugPlugin.renderArguments(arguments, segments);
styledText.addBidiSegmentListener(new BidiSegmentListener() {
+ @Override
public void lineGetSegments(BidiSegmentEvent event) {
int offset = event.lineOffset;
int end = offset + event.lineText.length();
@@ -279,6 +281,7 @@ public class ProcessPropertyPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.PROCESS_PROPERTY_PAGE);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
index 5c0ebfc88..636736c5f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -78,22 +77,22 @@ public class RunDebugPropertiesPage extends PropertyPage {
/**
* Set of configurations to be deleted
*/
- private Set fDeletedConfigurations = new HashSet();
+ private Set<ILaunchConfigurationWorkingCopy> fDeletedConfigurations = new HashSet<ILaunchConfigurationWorkingCopy>();
/**
* Set of original default candidates for the resource
*/
- private Set fOriginalCandidates;
+ private Set<ILaunchConfiguration> fOriginalCandidates;
/**
* Holds configurations that need to be saved when the page closes
*/
- private Set fChangedConfigurations = new HashSet();
+ private Set<ILaunchConfigurationWorkingCopy> fChangedConfigurations = new HashSet<ILaunchConfigurationWorkingCopy>();
/**
* List of the applicable launch config types for the backing resource
*/
- private List fTypeCandidates = null;
+ private List<ILaunchConfigurationType> fTypeCandidates = null;
//widgets
private TableViewer fViewer;
@@ -105,6 +104,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.RUN_DEBUG_RESOURCE_PROPERTY_PAGE);
collectConfigCandidates(getResource());
@@ -112,7 +112,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
SWTFactory.createWrapLabel(topComposite, DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_0, 2, 300);
SWTFactory.createVerticalSpacer(topComposite, 2);
- SWTFactory.createWrapLabel(topComposite, MessageFormat.format(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_1, new String[]{getResource().getName()}), 2, 300);
+ SWTFactory.createWrapLabel(topComposite, MessageFormat.format(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_1, new Object[] { getResource().getName() }), 2, 300);
fViewer = createViewer(topComposite);
Composite buttonComp = SWTFactory.createComposite(topComposite, 1, 1, GridData.FILL_VERTICAL);
@@ -122,7 +122,9 @@ public class RunDebugPropertiesPage extends PropertyPage {
fNewButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_3);
fNewButton.setEnabled(collectTypeCandidates().length > 0);
fNewButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleNew();
}
@@ -132,7 +134,9 @@ public class RunDebugPropertiesPage extends PropertyPage {
fDuplicateButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_5);
fDuplicateButton.setEnabled(false);
fDuplicateButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleCopy();
}
@@ -141,7 +145,9 @@ public class RunDebugPropertiesPage extends PropertyPage {
fEditButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_7);
fEditButton.setEnabled(false);
fEditButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleEdit();
}
@@ -150,7 +156,9 @@ public class RunDebugPropertiesPage extends PropertyPage {
fDeleteButton.setToolTipText(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_9);
fDeleteButton.setEnabled(false);
fDeleteButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
public void widgetSelected(SelectionEvent e) {
handleDelete();
}
@@ -180,6 +188,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
IResource resource = getResource();
viewer.setInput(collectConfigCandidates(resource));
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection sel = event.getSelection();
if(sel instanceof IStructuredSelection) {
@@ -194,6 +203,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent arg0) {
handleEdit();
}
@@ -204,6 +214,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/**
* @see org.eclipse.jface.dialogs.DialogPage#dispose()
*/
+ @Override
public void dispose() {
if(fOriginalCandidates != null) {
fOriginalCandidates.clear();
@@ -242,20 +253,21 @@ public class RunDebugPropertiesPage extends PropertyPage {
protected ILaunchConfigurationType[] collectTypeCandidates() {
if(fTypeCandidates == null) {
String[] types = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableConfigurationTypes(getResource());
- fTypeCandidates = new ArrayList(types.length);
+ fTypeCandidates = new ArrayList<ILaunchConfigurationType>(types.length);
for(int i = 0; i < types.length; i++) {
fTypeCandidates.add(DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(types[i]));
}
- Collections.sort(fTypeCandidates, new Comparator() {
- public int compare(Object o1, Object o2) {
- ILaunchConfigurationType t1 = (ILaunchConfigurationType) o1;
- ILaunchConfigurationType t2 = (ILaunchConfigurationType) o2;
+ Collections.sort(fTypeCandidates, new Comparator<ILaunchConfigurationType>() {
+ @Override
+ public int compare(ILaunchConfigurationType o1, ILaunchConfigurationType o2) {
+ ILaunchConfigurationType t1 = o1;
+ ILaunchConfigurationType t2 = o2;
return t1.getName().compareTo(t2.getName());
}
});
}
- return (ILaunchConfigurationType[]) fTypeCandidates.toArray(new ILaunchConfigurationType[fTypeCandidates.size()]);
+ return fTypeCandidates.toArray(new ILaunchConfigurationType[fTypeCandidates.size()]);
}
/**
@@ -265,9 +277,9 @@ public class RunDebugPropertiesPage extends PropertyPage {
* @param resource resource
* @return list of default candidates
*/
- protected Set collectConfigCandidates(IResource resource) {
+ protected Set<ILaunchConfiguration> collectConfigCandidates(IResource resource) {
if(fOriginalCandidates == null) {
- fOriginalCandidates = new HashSet();
+ fOriginalCandidates = new HashSet<ILaunchConfiguration>();
try {
ILaunchConfiguration[] configs = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getApplicableLaunchConfigurations(null, resource);
for(int i = 0; i < configs.length; i++) {
@@ -300,11 +312,10 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
//delete
- Iterator iter = fDeletedConfigurations.iterator();
- while (iter.hasNext()) {
- ILaunchConfigurationWorkingCopy currentConfig = (ILaunchConfigurationWorkingCopy) iter.next();
+ for (ILaunchConfigurationWorkingCopy currentConfig : fDeletedConfigurations) {
try{
if (currentConfig.getOriginal() != null){
currentConfig.getOriginal().delete();
@@ -314,9 +325,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
}
}
//add
- iter = fChangedConfigurations.iterator();
- while (iter.hasNext()) {
- ILaunchConfigurationWorkingCopy currentConfig = (ILaunchConfigurationWorkingCopy) iter.next();
+ for (ILaunchConfigurationWorkingCopy currentConfig : fChangedConfigurations) {
try{
currentConfig.doSave();
} catch (CoreException e) {
@@ -330,6 +339,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
setErrorMessage(null);
setValid(true);
@@ -346,15 +356,14 @@ public class RunDebugPropertiesPage extends PropertyPage {
* Returns the names of the launch configurations passed in as original input to the tree viewer
* @return the names of the original launch configurations
*/
- private Set getConfigurationNames() {
- Set names = new HashSet();
- Iterator iter = fOriginalCandidates.iterator();
- while (iter.hasNext()) {
- names.add(((ILaunchConfiguration)iter.next()).getName());
+ private Set<String> getConfigurationNames() {
+ Set<String> names = new HashSet<String>();
+ for(ILaunchConfiguration config : fOriginalCandidates) {
+ names.add(config.getName());
}
- iter = fChangedConfigurations.iterator();
- while (iter.hasNext()) {
- names.add(((ILaunchConfiguration)iter.next()).getName());
+
+ for(ILaunchConfigurationWorkingCopy config : fChangedConfigurations) {
+ names.add(config.getName());
}
return names;
}
@@ -393,7 +402,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
Table table = fViewer.getTable();
int[] indices = table.getSelectionIndices();
Arrays.sort(indices);
- ILaunchConfiguration[] configurations = getSelectedConfigurations();
+ ILaunchConfigurationWorkingCopy[] configurations = getSelectedConfigurations();
for (int i = 0; i < configurations.length; i++) {
fDeletedConfigurations.add(configurations[i]);
fChangedConfigurations.remove(configurations[i]);
@@ -417,7 +426,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
fViewer.refresh(config, true, true);
}
else if(ret == IDialogConstants.ABORT_ID) {
- setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new String[] {config.getName()}));
+ setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new Object[] { config.getName() }));
}
}
@@ -445,9 +454,8 @@ public class RunDebugPropertiesPage extends PropertyPage {
group = lcm.getLaunchGroup(type, ILaunchManager.PROFILE_MODE);
}
else {
- Set modes = type.getSupportedModeCombinations();
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(type, (Set)iter.next());
+ for (Set<String> modes : type.getSupportedModeCombinations()) {
+ group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(type, modes);
if(group != null) {
break;
}
@@ -473,6 +481,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return DebugUIPlugin.getUniqueIdentifier() + ".SELECT_CONFIGURATION_TYPE_DIALOG"; //$NON-NLS-1$
}
@@ -480,6 +489,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return typeCandidates;
}
@@ -487,6 +497,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_CONFIGURATION_TYPE_DIALOG;
}
@@ -494,6 +505,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_12;
}
@@ -516,7 +528,7 @@ public class RunDebugPropertiesPage extends PropertyPage {
fViewer.setSelection(new StructuredSelection(wc));
}
else if(ret == IDialogConstants.ABORT_ID) {
- setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new String[] {wc.getName()}));
+ setErrorMessage(MessageFormat.format(DebugPreferencesMessages.RunDebugPropertiesPage_0, new Object[] { wc.getName() }));
}
} catch (CoreException e) {
setErrorMessage(e.getMessage());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
index ab5d3f77e..b12cfba2b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/StringVariablePreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -112,11 +112,13 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
/**
* @see PreferencePage#createControl(Composite)
*/
+ @Override
public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.SIMPLE_VARIABLE_PREFERENCE_PAGE);
}
+ @Override
protected Control createContents(Composite parent) {
noDefaultAndApplyButton();
Font font= parent.getFont();
@@ -165,6 +167,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
variableTable.setColumnProperties(variableTableColumnProperties);
variableTable.addFilter(new VariableFilter());
variableTable.setComparator(new ViewerComparator() {
+ @Override
public int compare(Viewer iViewer, Object e1, Object e2) {
if (e1 == null) {
return -1;
@@ -177,12 +180,14 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
});
variableTable.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
handleTableSelectionChanged(event);
}
});
variableTable.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
if (!variableTable.getSelection().isEmpty()) {
handleEditButtonPressed();
@@ -190,6 +195,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
});
variableTable.getTable().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent event) {
if (event.character == SWT.DEL && event.stateMask == 0) {
handleRemoveButtonPressed();
@@ -232,6 +238,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
envAddButton = SWTFactory.createPushButton(buttonComposite, DebugPreferencesMessages.SimpleVariablePreferencePage_7, null);
envAddButton.addSelectionListener(new SelectionAdapter()
{
+ @Override
public void widgetSelected(SelectionEvent event) {
handleAddButtonPressed();
}
@@ -239,6 +246,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
envEditButton = SWTFactory.createPushButton(buttonComposite, DebugPreferencesMessages.SimpleVariablePreferencePage_8, null);
envEditButton.addSelectionListener(new SelectionAdapter()
{
+ @Override
public void widgetSelected(SelectionEvent event) {
handleEditButtonPressed();
}
@@ -247,6 +255,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
envRemoveButton = SWTFactory.createPushButton(buttonComposite, DebugPreferencesMessages.SimpleVariablePreferencePage_9, null);
envRemoveButton.addSelectionListener(new SelectionAdapter()
{
+ @Override
public void widgetSelected(SelectionEvent event) {
handleRemoveButtonPressed();
}
@@ -294,19 +303,22 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
MessageDialog.openError(getShell(),DebugPreferencesMessages.StringVariablePreferencePage_21, DebugPreferencesMessages.StringVariablePreferencePage_20);
return false;
}
- List editedVariables= variableContentProvider.getWorkingSetVariables();
- Iterator iter= editedVariables.iterator();
+ List<VariableWrapper> editedVariables = variableContentProvider.getWorkingSetVariables();
+ Iterator<VariableWrapper> iter = editedVariables.iterator();
while (iter.hasNext()) {
- VariableWrapper currentVariable = (VariableWrapper) iter.next();
+ VariableWrapper currentVariable = iter.next();
if (!currentVariable.isRemoved()) {
String currentName = currentVariable.getName();
if (currentName.equals(name)) {
if (currentVariable.isReadOnly()){
- MessageDialog.openError(getShell(),DebugPreferencesMessages.StringVariablePreferencePage_23, MessageFormat.format(DebugPreferencesMessages.StringVariablePreferencePage_22, new String[] {name}));
+ MessageDialog.openError(getShell(), DebugPreferencesMessages.StringVariablePreferencePage_23, MessageFormat.format(DebugPreferencesMessages.StringVariablePreferencePage_22, new Object[] { name }));
return false;
}
else {
- MessageDialog dialog = new MessageDialog(getShell(), DebugPreferencesMessages.SimpleVariablePreferencePage_15, null, MessageFormat.format(DebugPreferencesMessages.SimpleVariablePreferencePage_16, new String[] {name}), MessageDialog.QUESTION, new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL, IDialogConstants.CANCEL_LABEL }, 0);
+ MessageDialog dialog = new MessageDialog(getShell(), DebugPreferencesMessages.SimpleVariablePreferencePage_15, null, MessageFormat.format(DebugPreferencesMessages.SimpleVariablePreferencePage_16, new Object[] { name }), MessageDialog.QUESTION, new String[] {
+ IDialogConstants.YES_LABEL,
+ IDialogConstants.NO_LABEL,
+ IDialogConstants.CANCEL_LABEL }, 0);
int overWrite= dialog.open();
if (overWrite == 0) {
currentVariable.setValue(value);
@@ -337,7 +349,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
String value= variable.getValue();
String description= variable.getDescription();
String name= variable.getName();
- MultipleInputDialog dialog= new MultipleInputDialog(getShell(), MessageFormat.format(DebugPreferencesMessages.SimpleVariablePreferencePage_14, new String[] {name}));
+ MultipleInputDialog dialog = new MultipleInputDialog(getShell(), MessageFormat.format(DebugPreferencesMessages.SimpleVariablePreferencePage_14, new Object[] { name }));
dialog.addBrowseField(VALUE_LABEL, value, true);
dialog.addTextField(DESCRIPTION_LABEL, description, true);
@@ -359,22 +371,22 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
*/
private void handleRemoveButtonPressed() {
IStructuredSelection selection= (IStructuredSelection) variableTable.getSelection();
- List variablesToRemove= selection.toList();
+ List<VariableWrapper> variablesToRemove = selection.toList();
StringBuffer contributedVariablesToRemove= new StringBuffer();
- Iterator iter= variablesToRemove.iterator();
+ Iterator<VariableWrapper> iter = variablesToRemove.iterator();
while (iter.hasNext()) {
- VariableWrapper variable = (VariableWrapper) iter.next();
+ VariableWrapper variable = iter.next();
if (variable.isContributed()) {
contributedVariablesToRemove.append('\t').append(variable.getName()).append('\n');
}
}
if (contributedVariablesToRemove.length() > 0) {
- boolean remove= MessageDialog.openQuestion(getShell(), DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_21, MessageFormat.format(DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_22, new String[] {contributedVariablesToRemove.toString()})); //
+ boolean remove = MessageDialog.openQuestion(getShell(), DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_21, MessageFormat.format(DebugPreferencesMessages.SimpleLaunchVariablePreferencePage_22, new Object[] { contributedVariablesToRemove.toString() })); //
if (!remove) {
return;
}
}
- VariableWrapper[] variables= (VariableWrapper[]) variablesToRemove.toArray(new VariableWrapper[0]);
+ VariableWrapper[] variables= variablesToRemove.toArray(new VariableWrapper[0]);
for (int i = 0; i < variables.length; i++) {
variables[i].setRemoved(true);
}
@@ -398,12 +410,14 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
}
+ @Override
public void init(IWorkbench workbench) {
}
/**
* Clear the variables.
*/
+ @Override
protected void performDefaults() {
variableContentProvider.init();
variableTable.refresh();
@@ -413,6 +427,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
/**
* Sets the saved state for reversion.
*/
+ @Override
public boolean performOk() {
variableContentProvider.saveChanges();
saveColumnWidths();
@@ -468,8 +483,9 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
/**
* The content provider stores variable wrappers for use during editing.
*/
- private List fWorkingSet = new ArrayList();
+ private List<VariableWrapper> fWorkingSet = new ArrayList<VariableWrapper>();
+ @Override
public Object[] getElements(Object inputElement) {
return fWorkingSet.toArray();
}
@@ -483,9 +499,11 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
fWorkingSet.add(variable);
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput == null || !(newInput instanceof IStringVariableManager)){
return;
@@ -498,11 +516,11 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
*/
public void saveChanges() {
IStringVariableManager manager = getVariableManager();
- Iterator iterator = fWorkingSet.iterator();
- List remove = new ArrayList();
- List add = new ArrayList();
+ Iterator<VariableWrapper> iterator = fWorkingSet.iterator();
+ List<IValueVariable> remove = new ArrayList<IValueVariable>();
+ List<IValueVariable> add = new ArrayList<IValueVariable>();
while (iterator.hasNext()) {
- VariableWrapper variable = (VariableWrapper) iterator.next();
+ VariableWrapper variable = iterator.next();
if (!variable.isReadOnly()) {
IValueVariable underlyingVariable = variable.getUnderlyingVariable();
if (variable.isRemoved()) {
@@ -522,12 +540,12 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
// remove
if (!remove.isEmpty()) {
- manager.removeVariables((IValueVariable[]) remove.toArray(new IValueVariable[remove.size()]));
+ manager.removeVariables(remove.toArray(new IValueVariable[remove.size()]));
}
// add
if (!add.isEmpty()) {
try {
- manager.addVariables((IValueVariable[]) add.toArray(new IValueVariable[add.size()]));
+ manager.addVariables(add.toArray(new IValueVariable[add.size()]));
} catch (CoreException e) {
DebugUIPlugin.errorDialog(getShell(), DebugPreferencesMessages.StringVariablePreferencePage_24, DebugPreferencesMessages.StringVariablePreferencePage_25, e.getStatus()); //
}
@@ -551,7 +569,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
*
* @return the working set of variables (not yet saved)
*/
- public List getWorkingSetVariables() {
+ public List<VariableWrapper> getWorkingSetVariables() {
return fWorkingSet;
}
@@ -646,9 +664,11 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
private class SimpleVariableLabelProvider extends LabelProvider implements ITableLabelProvider, IColorProvider {
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
if (element instanceof VariableWrapper) {
VariableWrapper variable= (VariableWrapper) element;
@@ -683,11 +703,14 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
}
return contribution;
+ default:
+ break;
}
}
return null;
}
+ @Override
public Color getForeground(Object element) {
if (element instanceof VariableWrapper) {
if (((VariableWrapper) element).isReadOnly()) {
@@ -697,6 +720,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
}
return null;
}
+ @Override
public Color getBackground(Object element) {
if (element instanceof VariableWrapper) {
if (((VariableWrapper) element).isReadOnly()) {
@@ -713,6 +737,7 @@ public class StringVariablePreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return !((VariableWrapper)element).isRemoved();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
index fb434124e..2e2803cd4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ViewManagementPreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,7 +61,8 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
private PerspectiveLabelProvider fLabelProvider= null;
private SelectionListener fSelectionListener= new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
Object source = e.getSource();
if (source == fResetViewsButton) {
handleResetPressed();
@@ -82,7 +83,8 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createControl(org.eclipse.swt.widgets.Composite)
*/
- public void createControl(Composite parent) {
+ @Override
+ public void createControl(Composite parent) {
super.createControl(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.VIEW_MANAGEMENT_PREFERENCE_PAGE);
}
@@ -90,6 +92,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Composite composite= new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout());
@@ -160,7 +163,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
fPerspectiveViewer.setComparator(new PerspectiveComparator());
fPerspectiveViewer.setInput(this);
- Set perspectives;
+ Set<String> perspectives;
String preference = DebugUIPlugin.getDefault().getPreferenceStore().getString(
IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES);
if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT.equals(preference)) {
@@ -171,12 +174,11 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
checkPerspectives(perspectives);
}
- private void checkPerspectives(Set perspectives) {
+ private void checkPerspectives(Set<String> perspectives) {
fPerspectiveViewer.setAllChecked(false);
IPerspectiveRegistry registry= PlatformUI.getWorkbench().getPerspectiveRegistry();
- Iterator perspectiveIds= perspectives.iterator();
- while (perspectiveIds.hasNext()) {
- IPerspectiveDescriptor descriptor = registry.findPerspectiveWithId((String) perspectiveIds.next());
+ for (String id : perspectives) {
+ IPerspectiveDescriptor descriptor = registry.findPerspectiveWithId(id);
if (descriptor != null) {
fPerspectiveViewer.setChecked(descriptor, true);
}
@@ -186,9 +188,10 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
Object[] descriptors = fPerspectiveViewer.getCheckedElements();
- Set perspectives = new HashSet();
+ Set<String> perspectives = new HashSet<String>();
for (int i = 0; i < descriptors.length; i++) {
perspectives.add( ((IPerspectiveDescriptor)descriptors[i]).getId() );
}
@@ -197,7 +200,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES_DEFAULT);
} else {
StringBuffer buffer= new StringBuffer();
- for (Iterator itr = perspectives.iterator(); itr.hasNext();) {
+ for (Iterator<String> itr = perspectives.iterator(); itr.hasNext();) {
buffer.append(itr.next()).append(',');
}
getPreferenceStore().setValue(IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES, buffer.toString());
@@ -215,6 +218,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
checkPerspectives( ViewContextService.getDefaultEnabledPerspectives() );
fTrackViewsButton.setSelection(getPreferenceStore().getDefaultBoolean(IInternalDebugUIConstants.PREF_TRACK_VIEWS));
@@ -226,6 +230,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {
}
@@ -246,6 +251,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return PlatformUI.getWorkbench().getPerspectiveRegistry().getPerspectives();
}
@@ -253,20 +259,23 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
}
}
private static class PerspectiveComparator extends ViewerComparator {
- public int compare(Viewer viewer, Object e1, Object e2) {
+ @Override
+ public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 instanceof IPerspectiveDescriptor && e2 instanceof IPerspectiveDescriptor) {
return ((IPerspectiveDescriptor) e1).getLabel().compareToIgnoreCase(((IPerspectiveDescriptor) e2).getLabel());
}
@@ -277,6 +286,7 @@ public class ViewManagementPreferencePage extends PreferencePage implements IWor
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.IDialogPage#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if (fLabelProvider != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java
index e3f1ff34a..fa92e692e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddContainerAction.java
@@ -31,6 +31,7 @@ public class AddContainerAction extends SourceContainerAction {
*
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
AddSourceContainerDialog dialog = new AddSourceContainerDialog(getShell(), getViewer(), fDirector);
dialog.open();
@@ -43,6 +44,7 @@ public class AddContainerAction extends SourceContainerAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if(selection == null || selection.isEmpty()) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
index 9066819ed..56b4d9588 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/AddSourceContainerDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -71,6 +71,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
getShell().setText(SourceLookupUIMessages.addSourceLocation_title);
@@ -93,6 +94,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
table.setLayoutData(gd);
fViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
okPressed();
}
@@ -102,6 +104,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
fViewer.setContentProvider(new ArrayContentProvider());
fViewer.setComparator(new ViewerComparator());
fViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
if (!selection.isEmpty()) {
@@ -126,6 +129,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
Table table = fViewer.getTable();
@@ -137,6 +141,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
ISourceContainerType type = (ISourceContainerType) ((IStructuredSelection) fViewer.getSelection()).getFirstElement();
if (type != null) {
@@ -161,7 +166,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
* @return the list of source container types that have browsers
*/
private ISourceContainerType[] filterTypes(ISourceContainerType[] types){
- ArrayList validTypes = new ArrayList();
+ ArrayList<ISourceContainerType> validTypes = new ArrayList<ISourceContainerType>();
for (int i=0; i< types.length; i++) {
ISourceContainerType type = types[i];
if (fDirector.supportsSourceContainerType(type)) {
@@ -171,7 +176,7 @@ public class AddSourceContainerDialog extends TitleAreaDialog {
}
}
}
- return (ISourceContainerType[]) validTypes.toArray(new ISourceContainerType[validTypes.size()]);
+ return validTypes.toArray(new ISourceContainerType[validTypes.size()]);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
index e7fd8079e..d968d4496 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/BasicContainerContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2011 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,20 +34,23 @@ public class BasicContainerContentProvider implements ITreeContentProvider {
* The visual part that is using this content provider is about
* to be disposed. Deallocate all allocated SWT resources.
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object element) {
if (element instanceof IWorkspaceRoot) {
// check if closed projects should be shown
IProject[] allProjects = ((IWorkspaceRoot) element).getProjects();
- if (fShowClosedProjects)
+ if (fShowClosedProjects) {
return allProjects;
+ }
- ArrayList accessibleProjects = new ArrayList();
+ ArrayList<IProject> accessibleProjects = new ArrayList<IProject>();
for (int i = 0; i < allProjects.length; i++) {
if (allProjects[i].isOpen()) {
accessibleProjects.add(allProjects[i]);
@@ -58,6 +61,7 @@ public class BasicContainerContentProvider implements ITreeContentProvider {
return new Object[0];
}
+ @Override
public Object[] getElements(Object element) {
return getChildren(element);
}
@@ -65,15 +69,18 @@ public class BasicContainerContentProvider implements ITreeContentProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
- if (element instanceof IResource)
+ if (element instanceof IResource) {
return ((IResource) element).getParent();
+ }
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
@@ -81,6 +88,7 @@ public class BasicContainerContentProvider implements ITreeContentProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java
index 673b78bd9..ae48e46cc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/DownAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -9,10 +9,13 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.debug.internal.ui.sourcelookup;
-
import java.util.List;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.actions.SelectionListenerAction;
+
/**
* The action for sorting the order of source containers in the dialog.
@@ -26,21 +29,21 @@ public class DownAction extends SourceContainerAction {
/**
* @see IAction#run()
*/
+ @Override
public void run() {
- List targets = getOrderedSelection();
+ List<ISourceContainer> targets = getOrderedSelection();
if (targets.isEmpty()) {
return;
}
- List list = getEntriesAsList();
+ List<ISourceContainer> list = getEntriesAsList();
int bottom = list.size() - 1;
int index = 0;
- for (int i = targets.size() - 1; i >= 0; i--) {
- Object target = targets.get(i);
- index = list.indexOf(target);
+ for (ISourceContainer container : targets) {
+ index = list.indexOf(container);
if (index < bottom) {
bottom = index + 1;
- Object temp = list.get(bottom);
- list.set(bottom, target);
+ ISourceContainer temp = list.get(bottom);
+ list.set(bottom, container);
list.set(index, temp);
}
bottom = index;
@@ -51,6 +54,7 @@ public class DownAction extends SourceContainerAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
return !selection.isEmpty() && !isIndexSelected(selection, getEntriesAsList().size() - 1) && getViewer().getTree().getSelection()[0].getParentItem()==null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java
index 9eadd343b..8fe5f5bf1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditContainerAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,6 +37,7 @@ public class EditContainerAction extends SourceContainerAction {
*
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
ISourceContainer[] replacements = fBrowser.editSourceContainers(getShell(), fDirector, fContainers);
int j = 0;
@@ -59,6 +60,7 @@ public class EditContainerAction extends SourceContainerAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
if(selection == null || selection.isEmpty()) {
return false;
@@ -66,13 +68,13 @@ public class EditContainerAction extends SourceContainerAction {
if (getViewer().getTree().getSelection()[0].getParentItem()==null) {
// can only edit top level items of same type
fContainers = new ISourceContainer[selection.size()];
- Iterator iterator = selection.iterator();
- ISourceContainer container = (ISourceContainer) iterator.next();
+ Iterator<ISourceContainer> iterator = selection.iterator();
+ ISourceContainer container = iterator.next();
ISourceContainerType type = container.getType();
fContainers[0] = container;
int i = 1;
while (iterator.hasNext()) {
- container = (ISourceContainer) iterator.next();
+ container = iterator.next();
fContainers[i] = container;
i++;
if (!container.getType().equals(type)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
index 641b01435..36edc992a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/EditSourceLookupPathAction.java
@@ -49,6 +49,7 @@ public class EditSourceLookupPathAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
director = null;
if (selection.size() == 1) {
@@ -69,6 +70,7 @@ public class EditSourceLookupPathAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
Shell shell = DebugUIPlugin.getShell();
SourceLookupDialog dialog = new SourceLookupDialog(shell, director);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
index 8d13d4e49..eba0af7ed 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/LookupSourceAction.java
@@ -42,6 +42,7 @@ public class LookupSourceAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.ui.actions.BaseSelectionListenerAction#updateSelection(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
director = null;
frame = null;
@@ -61,6 +62,7 @@ public class LookupSourceAction extends SelectionListenerAction {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
ISelection selection = fView.getViewer().getSelection();
if (selection instanceof IStructuredSelection) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
index 6be4e4543..295b139b9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/Prompter.java
@@ -39,6 +39,7 @@ public class Prompter implements IStatusHandler {
* @return result of resolving the given status
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(final IStatus status, final Object source) throws CoreException {
DebugPlugin dp = DebugPlugin.getDefault();
// on shutdown the debug plug-in can be null
@@ -65,6 +66,7 @@ public class Prompter implements IStatusHandler {
final CoreException[] exception = new CoreException[1];
final Object lock = this;
Runnable r = new Runnable() {
+ @Override
public void run() {
try {
result[0] = handler.handleStatus(status, source);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java
index 7d0efb2d7..71070971e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RemoveAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,10 @@ package org.eclipse.debug.internal.ui.sourcelookup;
import java.util.List;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.actions.SelectionListenerAction;
/**
* The action used to remove source containers in the source location dialog/tab.
@@ -27,9 +30,10 @@ public class RemoveAction extends SourceContainerAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
- List targets = getOrderedSelection();
- List list = getEntriesAsList();
+ List<ISourceContainer> targets = getOrderedSelection();
+ List<ISourceContainer> list = getEntriesAsList();
list.removeAll(targets);
setEntries(list);
}
@@ -37,6 +41,7 @@ public class RemoveAction extends SourceContainerAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
//check that something is selected and it is a root tree node.
return !selection.isEmpty() && getViewer().getTree().getSelection()[0].getParentItem()==null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
index 51174e7cc..e794703a2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/ResolveDuplicatesHandler.java
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.sourcelookup;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -23,7 +22,7 @@ import org.eclipse.jface.window.Window;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
/**
- * Status handler to prompt for dupicate source element resolution.
+ * Status handler to prompt for duplicate source element resolution.
*
* @since 3.0
*/
@@ -31,13 +30,14 @@ public class ResolveDuplicatesHandler implements IStatusHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus, java.lang.Object)
*/
+ @Override
public Object handleStatus(IStatus status, Object source) throws CoreException {
Object[] args = (Object[])source;
- List sources = (List) args[1];
+ List<?> sources = (List<?>) args[1];
return resolveSourceElement(sources);
}
- public Object resolveSourceElement(List sources) {
+ public Object resolveSourceElement(List<?> sources) {
Object file = null;
sources = removeSourceNotFoundEditors(sources);
if(sources.size() == 1) {
@@ -64,14 +64,11 @@ public class ResolveDuplicatesHandler implements IStatusHandler {
* @param sources the list to be filtered
* @return the filtered list, may be empty
*/
- private List removeSourceNotFoundEditors(List sources){
- Iterator iterator = sources.iterator();
- List filteredList = new ArrayList();
- Object next;
- while(iterator.hasNext()) {
- next = iterator.next();
- if (!(next instanceof CommonSourceNotFoundEditor)) {
- filteredList.add(next);
+ private List<Object> removeSourceNotFoundEditors(List<?> sources) {
+ List<Object> filteredList = new ArrayList<Object>();
+ for (Object obj : sources) {
+ if (!(obj instanceof CommonSourceNotFoundEditor)) {
+ filteredList.add(obj);
}
}
if (filteredList.isEmpty() && sources.get(0) != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java
index 5020eb698..51b7e9e02 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/RestoreDefaultAction.java
@@ -30,6 +30,7 @@ public class RestoreDefaultAction extends SourceContainerAction {
/**
* @see IAction#run()
*/
+ @Override
public void run() {
ISourceContainer[] containers = new ISourceContainer[1];
containers[0] = new DefaultSourceContainer();
@@ -45,6 +46,7 @@ public class RestoreDefaultAction extends SourceContainerAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
//disable if selection is empty, default already present, or non-root node selected
ISourceContainer[] containers = getViewer().getEntries();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
index e9acaf1b6..29d610443 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,6 +15,7 @@ import java.util.Iterator;
import java.util.List;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -74,10 +75,9 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
*
* @return targets for an action
*/
- protected List getOrderedSelection() {
- List targets = new ArrayList();
- List selection =
- ((IStructuredSelection) getViewer().getSelection()).toList();
+ protected List<ISourceContainer> getOrderedSelection() {
+ List<ISourceContainer> targets = new ArrayList<ISourceContainer>();
+ List<Object> selection = ((IStructuredSelection) getViewer().getSelection()).toList();
ISourceContainer[] entries = getViewer().getEntries();
for (int i = 0; i < entries.length; i++) {
ISourceContainer target = entries[i];
@@ -91,9 +91,9 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
/**
* Returns a list (copy) of the entries in the viewer
*/
- protected List getEntriesAsList() {
+ protected List<ISourceContainer> getEntriesAsList() {
ISourceContainer[] entries = getViewer().getEntries();
- List list = new ArrayList(entries.length);
+ List<ISourceContainer> list = new ArrayList<ISourceContainer>(entries.length);
for (int i = 0; i < entries.length; i++) {
list.add(entries[i]);
}
@@ -103,9 +103,8 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
/**
* Updates the entries to the entries in the given list
*/
- protected void setEntries(List list) {
- getViewer().setEntries(
- (ISourceContainer[]) list.toArray(new ISourceContainer[list.size()]));
+ protected void setEntries(List<ISourceContainer> list) {
+ getViewer().setEntries(list.toArray(new ISourceContainer[list.size()]));
// update all selection listeners
getViewer().setSelection(getViewer().getSelection());
}
@@ -114,14 +113,12 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
* Returns whether the item at the given index in the list
* (visually) is selected.
*/
- protected boolean isIndexSelected(
- IStructuredSelection selection,
- int index) {
+ protected boolean isIndexSelected(IStructuredSelection selection, int index) {
if (selection.isEmpty()) {
return false;
}
- Iterator entries = selection.iterator();
- List list = getEntriesAsList();
+ Iterator<Object> entries = selection.iterator();
+ List<ISourceContainer> list = getEntriesAsList();
while (entries.hasNext()) {
Object next = entries.next();
if (list.indexOf(next) == index) {
@@ -137,6 +134,7 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
public void setButton(Button button) {
fButton = button;
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
run();
}
@@ -146,6 +144,7 @@ public abstract class SourceContainerAction extends SelectionListenerAction {
/**
* @see IAction#setEnabled(boolean)
*/
+ @Override
public void setEnabled(boolean enabled) {
super.setEnabled(enabled);
if (fButton != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
index cc690aa8d..b49bd641f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerAdapterFactory.java
@@ -22,6 +22,7 @@ public class SourceContainerAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType.equals(IWorkbenchAdapter.class)) {
return new SourceContainerWorkbenchAdapter();
@@ -31,6 +32,7 @@ public class SourceContainerAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
+ @Override
public Class[] getAdapterList() {
return new Class[] {IWorkbenchAdapter.class};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java
index 83b09ccb5..35d43203c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerLabelProvider.java
@@ -30,6 +30,7 @@ public class SourceContainerLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
// first allow workbench adapter to provide image
Image image = getWorkbenchLabelProvider().getImage(element);
@@ -54,6 +55,7 @@ public class SourceContainerLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
// first, allo workbench adapter to provide label
String label = getWorkbenchLabelProvider().getText(element);
@@ -79,6 +81,7 @@ public class SourceContainerLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if (fLabelProvider != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
index 001c09cb4..fe1310564 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,8 @@ import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.core.sourcelookup.ISourceLookupDirector;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
@@ -46,13 +48,14 @@ public class SourceContainerViewer extends TreeViewer {
/**
* The source container entries displayed in this viewer
*/
- protected List fEntries = new ArrayList();
+ protected List<ISourceContainer> fEntries = new ArrayList<ISourceContainer>();
class ContentProvider implements ITreeContentProvider {
/**
* @see IStructuredContentProvider#getElements(Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return getEntries();
}
@@ -60,18 +63,21 @@ public class SourceContainerViewer extends TreeViewer {
/**
* @see IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
/**
* @see IContentProvider#inputChanged(Viewer, Object, Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object parentElement) {
try {
return ((ISourceContainer)parentElement).getSourceContainers();
@@ -83,6 +89,7 @@ public class SourceContainerViewer extends TreeViewer {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object element) {
return null;
}
@@ -90,6 +97,7 @@ public class SourceContainerViewer extends TreeViewer {
/**
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
+ @Override
public boolean hasChildren(Object element) {
return ((ISourceContainer)element).isComposite();
}
@@ -118,14 +126,16 @@ public class SourceContainerViewer extends TreeViewer {
public void setEntries(ISourceContainer[] entries) {
fEntries.clear();
for (int i = 0; i < entries.length; i++) {
- if(entries[i] != null)
+ if(entries[i] != null) {
fEntries.add(entries[i]);
+ }
}
if (getInput() == null) {
setInput(fEntries);
//select first item in list
- if(!fEntries.isEmpty() && fEntries.get(0)!=null)
- setSelection(new StructuredSelection(fEntries.get(0)));
+ if(!fEntries.isEmpty() && fEntries.get(0)!=null) {
+ setSelection(new StructuredSelection(fEntries.get(0)));
+ }
} else {
refresh();
}
@@ -139,7 +149,7 @@ public class SourceContainerViewer extends TreeViewer {
* @return the entries in this viewer
*/
public ISourceContainer[] getEntries() {
- return (ISourceContainer[])fEntries.toArray(new ISourceContainer[fEntries.size()]);
+ return fEntries.toArray(new ISourceContainer[fEntries.size()]);
}
/**
@@ -164,8 +174,9 @@ public class SourceContainerViewer extends TreeViewer {
}
refresh();
- if(entries.length > 0)
+ if(entries.length > 0) {
setSelection(new StructuredSelection(entries));
+ }
fPanel.setDirty(true);
fPanel.updateLaunchConfigurationDialog();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java
index 5d81128d8..239ab7c9c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceContainerWorkbenchAdapter.java
@@ -31,18 +31,21 @@ public class SourceContainerWorkbenchAdapter implements IWorkbenchAdapter {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
+ @Override
public String getLabel(Object o) {
if (o instanceof DirectorySourceContainer) {
DirectorySourceContainer container = (DirectorySourceContainer) o;
@@ -68,6 +71,7 @@ public class SourceContainerWorkbenchAdapter implements IWorkbenchAdapter {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object o) {
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
index 6c76f83bd..fba3c1fd0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementAdapterFactory.java
@@ -22,6 +22,7 @@ public class SourceElementAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
+ @Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType.equals(IWorkbenchAdapter.class)) {
return new SourceElementWorkbenchAdapter();
@@ -31,6 +32,7 @@ public class SourceElementAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
+ @Override
public Class[] getAdapterList() {
return new Class[] {IWorkbenchAdapter.class};
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java
index ea9c1054f..e2de14678 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementLabelProvider.java
@@ -37,6 +37,7 @@ public class SourceElementLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
if (fLabelProvider != null) {
@@ -46,12 +47,14 @@ public class SourceElementLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return getWorkbenchLabelProvider().getImage(element);
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof IResource) {
return SourceElementWorkbenchAdapter.getQualifiedName(((IResource)element).getFullPath());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java
index 3e890a44e..f6a32cf24 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceElementWorkbenchAdapter.java
@@ -30,12 +30,14 @@ public class SourceElementWorkbenchAdapter implements IWorkbenchAdapter {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
+ @Override
public ImageDescriptor getImageDescriptor(Object o) {
if (o instanceof LocalFileStorage || o instanceof ZipEntryStorage) {
return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_OBJ_FILE);
@@ -45,6 +47,7 @@ public class SourceElementWorkbenchAdapter implements IWorkbenchAdapter {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
+ @Override
public String getLabel(Object o) {
if (o instanceof LocalFileStorage) {
LocalFileStorage storage = (LocalFileStorage) o;
@@ -64,6 +67,7 @@ public class SourceElementWorkbenchAdapter implements IWorkbenchAdapter {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object o) {
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
index 54f19b48b..f01d3c863 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupFacility.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -75,7 +75,7 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
* Contains a map of the editor to use for each workbench
* page, when the 'reuse editor' preference is on.
*/
- private Map fEditorsByPage;
+ private Map<IWorkbenchPage, IEditorPart> fEditorsByPage;
/**
* Used to generate annotations for stack frames
@@ -111,7 +111,7 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
* Constructs a source lookup facility.
*/
private SourceLookupFacility() {
- fEditorsByPage = new HashMap();
+ fEditorsByPage = new HashMap<IWorkbenchPage, IEditorPart>();
DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this);
}
@@ -330,8 +330,9 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
}
try {
IDocument document= provider.getDocument(input);
- if (document != null)
+ if (document != null) {
return document.getLineInformation(lineNumber);
+ }
} catch (BadLocationException e) {
} finally {
provider.disconnect(input);
@@ -346,6 +347,7 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
private IEditorPart openEditor(final IWorkbenchPage page, final IEditorInput input, final String id) {
final IEditorPart[] editor = new IEditorPart[] {null};
Runnable r = new Runnable() {
+ @Override
public void run() {
if (!page.getWorkbenchWindow().getWorkbench().isClosing()) {
try {
@@ -366,13 +368,15 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage)
*/
- public void pageActivated(IWorkbenchPage page) {
+ @Override
+ public void pageActivated(IWorkbenchPage page) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
*/
- public void pageClosed(IWorkbenchPage page) {
+ @Override
+ public void pageClosed(IWorkbenchPage page) {
fEditorsByPage.remove(page);
page.removePartListener(this);
}
@@ -380,26 +384,30 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage)
*/
- public void pageOpened(IWorkbenchPage page) {
+ @Override
+ public void pageOpened(IWorkbenchPage page) {
page.addPartListener(this);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partActivated(IWorkbenchPartReference partRef) {
+ @Override
+ public void partActivated(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
+ @Override
+ public void partBroughtToTop(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partClosed(IWorkbenchPartReference partRef) {
+ @Override
+ public void partClosed(IWorkbenchPartReference partRef) {
// clear the cached editor for the page if it has been closed
IWorkbenchPage page = partRef.getPage();
IEditorPart editor = getEditor(page);
@@ -412,37 +420,43 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partDeactivated(IWorkbenchPartReference partRef) {
+ @Override
+ public void partDeactivated(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partOpened(IWorkbenchPartReference partRef) {
+ @Override
+ public void partOpened(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partHidden(IWorkbenchPartReference partRef) {
+ @Override
+ public void partHidden(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partVisible(IWorkbenchPartReference partRef) {
+ @Override
+ public void partVisible(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partInputChanged(IWorkbenchPartReference partRef) {
+ @Override
+ public void partInputChanged(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property.equals(IDebugUIConstants.PREF_REUSE_EDITOR)) {
fReuseEditor = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_REUSE_EDITOR);
@@ -458,7 +472,7 @@ public class SourceLookupFacility implements IPageListener, IPartListener2, IPro
* <code>null</code> if a new editor should be opened
*/
protected IEditorPart getEditor(IWorkbenchPage page) {
- return (IEditorPart) fEditorsByPage.get(page);
+ return fEditorsByPage.get(page);
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
index 5a5a594de..6ac161db3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,7 +31,7 @@ public class SourceLookupManager implements IWindowListener {
/**
* Services per window
*/
- private Map fServices = new HashMap();
+ private Map<IWorkbenchWindow, SourceLookupService> fServices = new HashMap<IWorkbenchWindow, SourceLookupService>();
private SourceLookupManager() {
IWorkbench workbench = PlatformUI.getWorkbench();
@@ -58,20 +58,23 @@ public class SourceLookupManager implements IWindowListener {
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowActivated(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowDeactivated(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowClosed(IWorkbenchWindow window) {
- SourceLookupService service = (SourceLookupService) fServices.get(window);
+ SourceLookupService service = fServices.get(window);
if (service != null) {
fServices.remove(window);
service.dispose();
@@ -81,8 +84,9 @@ public class SourceLookupManager implements IWindowListener {
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowOpened(IWorkbenchWindow window) {
- SourceLookupService service = (SourceLookupService) fServices.get(window);
+ SourceLookupService service = fServices.get(window);
if (service == null) {
service = new SourceLookupService(window);
fServices.put(window, service);
@@ -94,7 +98,7 @@ public class SourceLookupManager implements IWindowListener {
*/
public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
IWorkbenchWindow window = page.getWorkbenchWindow();
- SourceLookupService service = (SourceLookupService) fServices.get(window);
+ SourceLookupService service = fServices.get(window);
if (service != null) {
service.displaySource(context, page, forceSourceLookup);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
index 9e5184b1a..72a375f65 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupPanel.java
@@ -12,7 +12,6 @@
package org.eclipse.debug.internal.ui.sourcelookup;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -51,7 +50,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
//the duplicates checkbox
protected Button fDuplicatesButton;
//the source actions - up, down, add, remove, restore
- protected List fActions = new ArrayList(6);
+ protected List<SourceContainerAction> fActions = new ArrayList<SourceContainerAction>(6);
//the director that will be used by the tab to manage/store the containers
protected ISourceLookupDirector fLocator;
@@ -64,6 +63,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
*
* @param parent the parent widget of this control
*/
+ @Override
public void createControl(Composite parent) {
Font font = parent.getFont();
Composite comp = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_BOTH);
@@ -79,6 +79,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
fDuplicatesButton = SWTFactory.createCheckButton(comp, SourceLookupUIMessages.sourceTab_searchDuplicateLabel, null, false, 2);
fDuplicatesButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
setDirty(true);
updateLaunchConfigurationDialog();
@@ -136,9 +137,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
* Re-targets actions to the given viewer
*/
protected void retargetActions(SourceContainerViewer viewer) {
- Iterator actions = fActions.iterator();
- while (actions.hasNext()) {
- SourceContainerAction action = (SourceContainerAction) actions.next();
+ for (SourceContainerAction action : fActions) {
action.setViewer(viewer);
}
}
@@ -147,6 +146,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
* Initializes this control based on the settings in the given
* launch configuration.
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
if (fLocator != null) {
fLocator.dispose();
@@ -233,6 +233,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
* @param workingCopy the working copy of the configuration that these values should be stored in, may be null.
* If null, will be written into a working copy of the configuration referenced by the director.
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
if (isDirty()) {
if (fLocator == null) {
@@ -300,6 +301,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#setDirty(boolean)
*/
+ @Override
public void setDirty(boolean dirty) {
super.setDirty(dirty);
@@ -308,6 +310,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return SourceLookupUIMessages.sourceTab_tabTitle;
}
@@ -315,11 +318,13 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#updateLaunchConfigurationDialog()
*/
+ @Override
protected void updateLaunchConfigurationDialog() {
if (getLaunchConfigurationDialog() != null) {
super.updateLaunchConfigurationDialog();
@@ -333,7 +338,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
* @param affectedWorkingSet - the working set being removed
*/
private void validateWorkingSetSourceContainers(IWorkingSet affectedWorkingSet) {
- List sourceContainers = (List) fPathViewer.getInput();
+ List<?> sourceContainers = (List<?>) fPathViewer.getInput();
if (sourceContainers != null) {
for (int i = 0; i < sourceContainers.size(); i++) {
if (sourceContainers.get(i) instanceof WorkingSetSourceContainer) {
@@ -350,20 +355,23 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
* Listen to working set changes
* @param event
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
//if the PropertyChangeEvent has changeId CHANGE_WORKING_SET_REMOVE,
//validate the list to make sure all working sets are valid
//if the PropertyChangeEvent has changeId CHANGE_WORKING_SET_NAME_CHANGE,
//do nothing because the event only has newValue, since oldValue is not provided
//there is no way to identify which working set does the newValue corresponds to
- if (event.getProperty().equals(IWorkingSetManager.CHANGE_WORKING_SET_REMOVE))
- validateWorkingSetSourceContainers((IWorkingSet) event.getOldValue());
+ if (event.getProperty().equals(IWorkingSetManager.CHANGE_WORKING_SET_REMOVE)) {
+ validateWorkingSetSourceContainers((IWorkingSet) event.getOldValue());
+ }
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
initializeFrom(workingCopy);
}
@@ -382,6 +390,7 @@ public class SourceLookupPanel extends AbstractLaunchConfigurationTab implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
//listen to changes user made to the working sets, if a working set is being removed
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java
index 940dc9253..06d901a60 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupResult.java
@@ -55,14 +55,16 @@ public class SourceLookupResult implements ISourceLookupResult {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getArtifact()
*/
- public Object getArtifact() {
+ @Override
+ public Object getArtifact() {
return fArtifact;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getSourceElement()
*/
- public Object getSourceElement() {
+ @Override
+ public Object getSourceElement() {
return fSourceElement;
}
@@ -80,7 +82,8 @@ public class SourceLookupResult implements ISourceLookupResult {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getEditorId()
*/
- public String getEditorId() {
+ @Override
+ public String getEditorId() {
return fEditorId;
}
@@ -98,7 +101,8 @@ public class SourceLookupResult implements ISourceLookupResult {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.ISourceLookupResult#getEditorInput()
*/
- public IEditorInput getEditorInput() {
+ @Override
+ public IEditorInput getEditorInput() {
return fEditorInput;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
index b4c92f3d5..d21dc2118 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupService.java
@@ -46,6 +46,7 @@ public class SourceLookupService implements IDebugContextListener, ISourceDispla
fWindow = null;
}
+ @Override
public synchronized void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
displaySource(event.getContext(), event.getDebugContextProvider().getPart(), false);
@@ -81,6 +82,7 @@ public class SourceLookupService implements IDebugContextListener, ISourceDispla
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.ISourceDisplayAdapter#displaySource(java.lang.Object, org.eclipse.ui.IWorkbenchPage, boolean)
*/
+ @Override
public void displaySource(Object context, IWorkbenchPage page, boolean forceSourceLookup) {
if (context instanceof IAdaptable) {
IAdaptable adaptable = (IAdaptable) context;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
index 4039d38e7..a52b03d92 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/SourceLookupUIUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,7 +50,7 @@ public class SourceLookupUIUtils {
*/
public static final String CONTAINER_ID_ATTRIBUTE = "containerTypeID"; //$NON-NLS-1$
- private static Hashtable fSourceContainerPresentationHashtable;
+ private static Hashtable<String, IConfigurationElement> fSourceContainerPresentationHashtable;
/**
* Constructor. Reads in Source Container Presentation extension implementations.
@@ -59,7 +59,7 @@ public class SourceLookupUIUtils {
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), CONTAINER_PRESENTATION_EXTENSION);
//read in SourceContainer presentation extensions
IConfigurationElement[] sourceContainerPresentationExtensions =extensionPoint.getConfigurationElements();
- fSourceContainerPresentationHashtable = new Hashtable();
+ fSourceContainerPresentationHashtable = new Hashtable<String, IConfigurationElement>();
for (int i = 0; i < sourceContainerPresentationExtensions.length; i++) {
fSourceContainerPresentationHashtable.put(
sourceContainerPresentationExtensions[i].getAttribute(CONTAINER_ID_ATTRIBUTE),
@@ -75,8 +75,9 @@ public class SourceLookupUIUtils {
* @return the image for the type specified
*/
public static Image getSourceContainerImage(String id){
- if(fSourceContainerPresentationHashtable == null)
+ if(fSourceContainerPresentationHashtable == null) {
new SourceLookupUIUtils();
+ }
return DebugPluginImages.getImage(id);
}
@@ -87,13 +88,15 @@ public class SourceLookupUIUtils {
*/
public static ISourceContainerBrowser getSourceContainerBrowser(String typeID)
{
- if(fSourceContainerPresentationHashtable == null)
+ if(fSourceContainerPresentationHashtable == null) {
new SourceLookupUIUtils();
- IConfigurationElement element = (IConfigurationElement)fSourceContainerPresentationHashtable.get(typeID);
+ }
+ IConfigurationElement element = fSourceContainerPresentationHashtable.get(typeID);
ISourceContainerBrowser browser = null;
try{
- if(element!= null && element.getAttribute(BROWSER_CLASS_ATTRIBUTE) != null)
+ if(element!= null && element.getAttribute(BROWSER_CLASS_ATTRIBUTE) != null) {
browser = (ISourceContainerBrowser) element.createExecutableExtension(BROWSER_CLASS_ATTRIBUTE);
+ }
}catch(CoreException e){}
return browser;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java
index 94110d3c6..ae1a4bd1b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/UpAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,10 +10,12 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.sourcelookup;
-import java.util.Iterator;
import java.util.List;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
+import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.actions.SelectionListenerAction;
/**
* The action used to move source containers up in the list
@@ -28,22 +30,21 @@ public class UpAction extends SourceContainerAction {
*
* @see IAction#run()
*/
+ @Override
public void run() {
- List targets = getOrderedSelection();
+ List<ISourceContainer> targets = getOrderedSelection();
if (targets.isEmpty()) {
return;
}
int top = 0;
int index = 0;
- List list = getEntriesAsList();
- Iterator entries = targets.iterator();
- while (entries.hasNext()) {
- Object target = entries.next();
- index = list.indexOf(target);
+ List<ISourceContainer> list = getEntriesAsList();
+ for (ISourceContainer container : targets) {
+ index = list.indexOf(container);
if (index > top) {
top = index - 1;
- Object temp = list.get(top);
- list.set(top, target);
+ ISourceContainer temp = list.get(top);
+ list.set(top, container);
list.set(index, temp);
}
top = index;
@@ -54,6 +55,7 @@ public class UpAction extends SourceContainerAction {
/**
* @see SelectionListenerAction#updateSelection(IStructuredSelection)
*/
+ @Override
protected boolean updateSelection(IStructuredSelection selection) {
//check that something is selected, it's not first in the list, and it is a root tree node.
return !selection.isEmpty() && !isIndexSelected(selection, 0) && getViewer().getTree().getSelection()[0].getParentItem()==null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
index 2356bd14e..4a255f561 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/WorkingSetSourceContainerType.java
@@ -38,6 +38,7 @@ public class WorkingSetSourceContainerType extends AbstractSourceContainerTypeDe
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerTypeDelegate#getMemento(org.eclipse.debug.internal.core.sourcelookup.ISourceContainer)
*/
+ @Override
public String getMemento(ISourceContainer container) throws CoreException {
WorkingSetSourceContainer workingSet = (WorkingSetSourceContainer) container;
Document doc = newDocument();
@@ -50,6 +51,7 @@ public class WorkingSetSourceContainerType extends AbstractSourceContainerTypeDe
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.sourcelookup.ISourceContainerType#createSourceContainer(java.lang.String)
*/
+ @Override
public ISourceContainer createSourceContainer(String memento)throws CoreException {
IWorkingSet workingSet = null;
Exception ex = null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
index 427221356..65610cdc5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveFilter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.sourcelookup.ISourceContainer;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
@@ -32,16 +33,17 @@ public class ArchiveFilter extends ViewerFilter {
/**
* Collection of archives and containers to display
*/
- private Set fArchives;
+ private Set<IResource> fArchives;
/**
* Collection of already existing archives
*/
- private List fExisting;
+ private List<ISourceContainer> fExisting;
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerFilter#select(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return fArchives.contains(element) && !fExisting.contains(element);
}
@@ -52,7 +54,7 @@ public class ArchiveFilter extends ViewerFilter {
*
* @param objects resources to exclude
*/
- public ArchiveFilter(List objects) {
+ public ArchiveFilter(List<ISourceContainer> objects) {
fExisting = objects;
init();
}
@@ -62,8 +64,9 @@ public class ArchiveFilter extends ViewerFilter {
*/
private void init() {
BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
public void run() {
- fArchives = new HashSet();
+ fArchives = new HashSet<IResource>();
traverse(ResourcesPlugin.getWorkspace().getRoot(), fArchives);
}
});
@@ -76,7 +79,7 @@ public class ArchiveFilter extends ViewerFilter {
* @param set the set to add any found archives to
* @return <code>true</code> if any archives have been added false otherwise
*/
- private boolean traverse(IContainer container, Set set) {
+ private boolean traverse(IContainer container, Set<IResource> set) {
boolean added = false;
try {
IResource[] resources = container.members();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
index 4ae4fc2a9..b8466343f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ArchiveSourceContainerBrowser.java
@@ -42,6 +42,7 @@ import org.eclipse.ui.views.navigator.ResourceComparator;
public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowser {
private ISelectionStatusValidator validator= new ISelectionStatusValidator() {
+ @Override
public IStatus validate(Object[] selection) {
if (selection.length == 0) {
return new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, IInternalDebugCoreConstants.EMPTY_STRING, null);
@@ -62,9 +63,9 @@ public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowse
* @param director source lookup director jars are being added to
* @return the list of any found {@link ArchiveSourceContainer}s
*/
- protected List getSelectedJars(ISourceLookupDirector director) {
+ protected List<ISourceContainer> getSelectedJars(ISourceLookupDirector director) {
ISourceContainer[] containers = director.getSourceContainers();
- List jars = new ArrayList();
+ List<ISourceContainer> jars = new ArrayList<ISourceContainer>();
for (int i = 0; i < containers.length; i++) {
ISourceContainer container = containers[i];
if (container.getType().getId().equals(ArchiveSourceContainer.TYPE_ID)) {
@@ -77,6 +78,7 @@ public class ArchiveSourceContainerBrowser extends AbstractSourceContainerBrowse
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.internal.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
ViewerFilter filter= new ArchiveFilter(getSelectedJars(director));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java
index b3cbbbad8..bd196c1ef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerBrowser.java
@@ -28,6 +28,7 @@ public class DirectorySourceContainerBrowser extends AbstractSourceContainerBrow
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
ISourceContainer[] containers = new ISourceContainer[1];
DirectorySourceContainerDialog dialog = new DirectorySourceContainerDialog(shell);
@@ -44,6 +45,7 @@ public class DirectorySourceContainerBrowser extends AbstractSourceContainerBrow
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
return containers.length == 1 && DirectorySourceContainer.TYPE_ID.equals(containers[0].getType().getId());
}
@@ -51,6 +53,7 @@ public class DirectorySourceContainerBrowser extends AbstractSourceContainerBrow
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
if (containers.length == 1 && DirectorySourceContainer.TYPE_ID.equals(containers[0].getType().getId()) ) {
DirectorySourceContainer c = (DirectorySourceContainer)containers[0];
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
index 942cb37e1..84f32edc9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/DirectorySourceContainerDialog.java
@@ -105,6 +105,7 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Image image = (fNewContainer) ? DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_ADD_SRC_DIR_WIZ) :
DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_EDIT_SRC_DIR_WIZ);
@@ -142,6 +143,7 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
fDirText.setLayoutData(data);
fDirText.setFont(font);
fDirText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText( ModifyEvent e ) {
validate();
}
@@ -156,7 +158,8 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
button.setLayoutData(data);
button.setFont(JFaceResources.getDialogFont());
button.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
browse();
}
});
@@ -170,6 +173,7 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
String title = null;
if (fNewContainer) {
@@ -184,6 +188,7 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.TitleAreaDialog#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Control c = super.createContents(parent);
fDirText.setText(fDirectory);
@@ -196,6 +201,7 @@ public class DirectorySourceContainerDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
fDirectory = fDirText.getText().trim();
fSearchSubfolders = fSubfoldersButton.getSelection();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java
index a5e2f036c..980d0abc4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ExternalArchiveSourceContainerBrowser.java
@@ -33,6 +33,7 @@ public class ExternalArchiveSourceContainerBrowser extends AbstractSourceContain
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
String rootDir = DebugUIPlugin.getDefault().getDialogSettings().get(ROOT_DIR);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
index d040e54e6..32d4e246c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerBrowser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,18 +33,19 @@ public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
FolderSourceContainerDialog dialog = new FolderSourceContainerDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
if (dialog.open() == Window.OK) {
Object[] selection= ((ElementTreeSelectionDialog)dialog).getResult();
- ArrayList containers = new ArrayList();
+ ArrayList<ISourceContainer> containers = new ArrayList<ISourceContainer>();
for (int i= 0; i < selection.length; i++) {
if(selection[i] instanceof IFolder) {
containers.add(new FolderSourceContainer((IFolder)selection[i], dialog.isSearchSubfolders()));
}
}
- return (ISourceContainer[])containers.toArray(new ISourceContainer[containers.size()]);
+ return containers.toArray(new ISourceContainer[containers.size()]);
}
return new ISourceContainer[0];
}
@@ -52,6 +53,7 @@ public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
return containers.length == 1 && containers[0].getType().getId().equals(FolderSourceContainer.TYPE_ID);
}
@@ -59,6 +61,7 @@ public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser
/* (non-Javadoc)
* @see org.eclipse.debug.ui.sourcelookup.AbstractSourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
FolderSourceContainerDialog dialog = new FolderSourceContainerDialog(shell, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
FolderSourceContainer container = (FolderSourceContainer) containers[0];
@@ -67,13 +70,13 @@ public class FolderSourceContainerBrowser extends AbstractSourceContainerBrowser
if (dialog.open() == Window.OK) {
container.dispose();
Object[] selection= ((ElementTreeSelectionDialog)dialog).getResult();
- ArrayList list = new ArrayList();
+ ArrayList<ISourceContainer> list = new ArrayList<ISourceContainer>();
for (int i= 0; i < selection.length; i++) {
if(selection[i] instanceof IFolder) {
list.add(new FolderSourceContainer((IFolder)selection[i], dialog.isSearchSubfolders()));
}
}
- return (ISourceContainer[])list.toArray(new ISourceContainer[list.size()]);
+ return list.toArray(new ISourceContainer[list.size()]);
}
return new ISourceContainer[0];
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
index a3e3864ea..c0daeb805 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/FolderSourceContainerDialog.java
@@ -66,6 +66,7 @@ public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
*
* @since 3.2
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite parentc = (Composite)super.createDialogArea(parent);
fSubfoldersButton = new Button(parentc, SWT.CHECK);
@@ -86,6 +87,7 @@ public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
setInput(ResourcesPlugin.getWorkspace().getRoot());
setComparator(new ResourceComparator(ResourceComparator.NAME));
ISelectionStatusValidator validator= new ISelectionStatusValidator() {
+ @Override
public IStatus validate(Object[] selection) {
for (int i= 0; i < selection.length; i++) {
if (!(selection[i] instanceof IFolder)) {
@@ -102,6 +104,7 @@ public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.ADD_FOLDER_CONTAINER_DIALOG);
setSearchSubfolders(DebugUIPlugin.getDefault().getDialogSettings().getBoolean(LAST_SUBDIR_SETTING));
addFilter(new ViewerFilter() {
+ @Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
if(!(element instanceof IFolder)) {
if(element instanceof IProject) {
@@ -137,6 +140,7 @@ public class FolderSourceContainerDialog extends ElementTreeSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.SelectionStatusDialog#okPressed()
*/
+ @Override
protected void okPressed() {
fSearchSubfolders = fSubfoldersButton.getSelection();
DebugUIPlugin.getDefault().getDialogSettings().put(LAST_SUBDIR_SETTING, fSearchSubfolders);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
index a5c0e8c43..7902f7581 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerBrowser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.debug.internal.ui.sourcelookup.browsers;
import java.util.ArrayList;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.debug.core.sourcelookup.ISourceContainer;
@@ -37,6 +38,7 @@ public class ProjectSourceContainerBrowser extends AbstractSourceContainerBrowse
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell,org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
Object input = ResourcesPlugin.getWorkspace().getRoot();
IStructuredContentProvider contentProvider=new BasicContainerContentProvider();
@@ -45,13 +47,14 @@ public class ProjectSourceContainerBrowser extends AbstractSourceContainerBrowse
SourceLookupUIMessages.projectSelection_chooseLabel);
if(dialog.open() == Window.OK){
Object[] elements= ((ListSelectionDialog)dialog).getResult();
- ArrayList res= new ArrayList();
+ ArrayList<ISourceContainer> res = new ArrayList<ISourceContainer>();
for (int i= 0; i < elements.length; i++) {
- if(!(elements[i] instanceof IProject))
- continue;
+ if(!(elements[i] instanceof IProject)) {
+ continue;
+ }
res.add(new ProjectSourceContainer((IProject)elements[i], ((ProjectSourceContainerDialog)dialog).isAddRequiredProjects()));
}
- return (ISourceContainer[])res.toArray(new ISourceContainer[res.size()]);
+ return res.toArray(new ISourceContainer[res.size()]);
}
return new ISourceContainer[0];
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java
index 3467f1bf8..667410697 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/ProjectSourceContainerDialog.java
@@ -46,6 +46,7 @@ public class ProjectSourceContainerDialog extends ListSelectionDialog {
/**
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Font font = parent.getFont();
@@ -54,6 +55,7 @@ public class ProjectSourceContainerDialog extends ListSelectionDialog {
final Button addRequired = new Button(composite, SWT.CHECK);
addRequired.setText(SourceLookupUIMessages.projectSelection_requiredLabel);
addRequired.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fAddRequiredProjects = addRequired.getSelection();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
index ea7a9144a..253032eb8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkingSetSourceContainerBrowser.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,27 +28,28 @@ import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
* @since 3.0
*/
public class WorkingSetSourceContainerBrowser extends AbstractSourceContainerBrowser {
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#
+ * createSourceContainers(org.eclipse.swt.widgets.Shell,
+ * org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
- ArrayList containers = new ArrayList();
- IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell,true);
-
- if(dialog.open() == Window.OK)
- {
+ ArrayList<ISourceContainer> containers = new ArrayList<ISourceContainer>();
+ IWorkingSetSelectionDialog dialog = PlatformUI.getWorkbench().getWorkingSetManager().createWorkingSetSelectionDialog(shell, true);
+
+ if (dialog.open() == Window.OK) {
IWorkingSet[] selections = dialog.getSelection();
- if(selections != null)
- {
- for(int i=0; i<selections.length; i++)
- {
- containers.add(new WorkingSetSourceContainer(selections[i]));
- }
- }
+ if (selections != null) {
+ for (int i = 0; i < selections.length; i++) {
+ containers.add(new WorkingSetSourceContainer(selections[i]));
+ }
+ }
}
-
- return (ISourceContainer[])containers.toArray(new ISourceContainer[containers.size()]);
+
+ return containers.toArray(new ISourceContainer[containers.size()]);
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java
index 63758920c..795e5c2e3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/sourcelookup/browsers/WorkspaceSourceContainerBrowser.java
@@ -26,6 +26,7 @@ public class WorkspaceSourceContainerBrowser extends AbstractSourceContainerBrow
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#createSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
ISourceContainer[] containers = new ISourceContainer[1];
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
index 418c69f23..558376095 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FilePrompt.java
@@ -22,6 +22,7 @@ public class FilePrompt extends PromptingResolver {
* Prompts the user to choose a file
* @see PromptExpanderBase#prompt()
*/
+ @Override
public void prompt() {
FileDialog dialog = new FileDialog(getShell());
dialog.setText(dialogMessage);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java
index 861fcebe8..76dc24657 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/FolderPrompt.java
@@ -22,6 +22,7 @@ public class FolderPrompt extends PromptingResolver {
* Prompts the user to choose a folder.
* @see PromptExpanderBase#prompt()
*/
+ @Override
public void prompt() {
DirectoryDialog dialog = new DirectoryDialog(getShell());
dialog.setText(dialogMessage);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java
index e535d9185..1eb238f69 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PasswordPrompt.java
@@ -33,6 +33,7 @@ public class PasswordPrompt extends PromptingResolver {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.stringsubstitution.PromptingResolver#prompt()
*/
+ @Override
public void prompt() {
Dialog dialog = new Dialog((Shell)null){
private Text text;
@@ -40,6 +41,7 @@ public class PasswordPrompt extends PromptingResolver {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
// create composite
Composite composite = (Composite) super.createDialogArea(parent);
@@ -68,6 +70,7 @@ public class PasswordPrompt extends PromptingResolver {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#buttonPressed(int)
*/
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
returnValue = text.getText();
@@ -80,6 +83,7 @@ public class PasswordPrompt extends PromptingResolver {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
newShell.setText(StringSubstitutionMessages.StringPromptExpander_0);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
index fc00f409e..2aa1aaaac 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/PromptingResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 Matt Conway and others.
+ * Copyright (c) 2000, 2013 Matt Conway and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,8 +11,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.stringsubstitution;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
@@ -22,6 +20,8 @@ import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.swt.widgets.Shell;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Base implementation for variable resolvers that prompt the user
* for their value.
@@ -80,7 +80,7 @@ abstract class PromptingResolver implements IDynamicVariableResolver {
}
if (promptHint != null) {
- dialogMessage = MessageFormat.format(StringSubstitutionMessages.PromptExpanderBase_0, new String[] {promptHint});
+ dialogMessage = MessageFormat.format(StringSubstitutionMessages.PromptExpanderBase_0, new Object[] { promptHint });
} else {
dialogMessage = StringSubstitutionMessages.PromptExpanderBase_1;
}
@@ -89,11 +89,13 @@ abstract class PromptingResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.stringsubstitution.IContextVariableResolver#resolveValue(org.eclipse.debug.internal.core.stringsubstitution.IContextVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
String value = null;
setupDialog(argument);
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
prompt();
}
@@ -103,7 +105,7 @@ abstract class PromptingResolver implements IDynamicVariableResolver {
lastValue = dialogResultString;
} else {
// dialogResultString == null means prompt was cancelled
- throw new DebugException(new Status(IStatus.CANCEL, DebugUIPlugin.getUniqueIdentifier(), IStatus.CANCEL, MessageFormat.format(StringSubstitutionMessages.PromptingResolver_0, new String[] { variable.getName() }), null));
+ throw new DebugException(new Status(IStatus.CANCEL, DebugUIPlugin.getUniqueIdentifier(), IStatus.CANCEL, MessageFormat.format(StringSubstitutionMessages.PromptingResolver_0, new Object[] { variable.getName() }), null));
}
return value;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java
index edc465e1a..d58cf76ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/ResourceSelector.java
@@ -26,6 +26,7 @@ public class ResourceSelector implements IArgumentSelector {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector#selectArgument(org.eclipse.debug.internal.core.stringsubstitution.IStringVariable)
*/
+ @Override
public String selectArgument(IStringVariable variable, Shell shell) {
ResourceListSelectionDialog dialog = new ResourceListSelectionDialog(shell, ResourcesPlugin.getWorkspace().getRoot(), IResource.FILE | IResource.FOLDER | IResource.PROJECT);
dialog.setTitle(StringSubstitutionMessages.ResourceSelector_0);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
index 842af04e7..dce7853fa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -72,6 +72,7 @@ public class SelectedResourceManager {
else {
final IStructuredSelection[] selection = new IStructuredSelection[1];
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
selection[0] = getCurrentSelection0();
}
@@ -126,6 +127,7 @@ public class SelectedResourceManager {
else {
final IResource[] resource = new IResource[1];
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
resource[0] = getSelectedResource0();
}
@@ -160,7 +162,7 @@ public class SelectedResourceManager {
if(selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
if(!ss.isEmpty()) {
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while (iterator.hasNext() && resource == null) {
Object next = iterator.next();
resource = (IResource) Platform.getAdapterManager().getAdapter(next, IResource.class);
@@ -188,6 +190,7 @@ public class SelectedResourceManager {
else {
final String[] text = new String[1];
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
text[0] = getSelectedText0();
}
@@ -239,6 +242,7 @@ public class SelectedResourceManager {
else {
final IWorkbenchWindow[] window = new IWorkbenchWindow[1];
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
window[0] = DebugUIPlugin.getActiveWorkbenchWindow();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java
index 0fcedc27a..a0b379925 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedResourceResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -28,12 +28,13 @@ public class SelectedResourceResolver extends ResourceResolver implements IDynam
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
IResource resource = SelectedResourceManager.getDefault().getSelectedResource();
if (resource != null) {
return translateToValue(resource, variable);
}
- abort(MessageFormat.format(StringSubstitutionMessages.SelectedResourceResolver_0, new String[]{getReferenceExpression(variable, argument)}), null);
+ abort(MessageFormat.format(StringSubstitutionMessages.SelectedResourceResolver_0, new Object[] { getReferenceExpression(variable, argument) }), null);
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
index e2726b883..31acde4b6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SelectedTextResolver.java
@@ -24,6 +24,7 @@ public class SelectedTextResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) {
String selection = selectedResourceManager.getSelectedText();
String selectedText = argument;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java
index da44ec551..12066063b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringPrompt.java
@@ -23,6 +23,7 @@ public class StringPrompt extends PromptingResolver {
* Prompts the user to input a string.
* @see PromptExpanderBase#prompt()
*/
+ @Override
public void prompt() {
InputDialog dialog = new InputDialog(null, StringSubstitutionMessages.StringPromptExpander_0, dialogMessage, defaultValue == null ? lastValue : defaultValue, null);
int dialogResult = dialog.open();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java
index ca12e4196..3c8f6d12a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariableLabelProvider.java
@@ -19,6 +19,7 @@ public class StringVariableLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof IStringVariable) {
IStringVariable variable = (IStringVariable)element;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
index c3c87ae66..d649557fa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/StringVariablePresentationManager.java
@@ -49,7 +49,7 @@ public class StringVariablePresentationManager {
* Table of configuration elements for variable presentations,
* keyed by variable name.
*/
- private Map fConfigurations;
+ private Map<String, IConfigurationElement> fConfigurations;
/**
* Returns the singleton string variable presentation manager.
@@ -71,7 +71,7 @@ public class StringVariablePresentationManager {
* @return argument selector or <code>null</code>
*/
public IArgumentSelector getArgumentSelector(IStringVariable variable) {
- IConfigurationElement element = (IConfigurationElement) fConfigurations.get(variable.getName());
+ IConfigurationElement element = fConfigurations.get(variable.getName());
if (element != null) {
try {
return (IArgumentSelector)element.createExecutableExtension(ATTR_ARGUMENT_SELECTOR);
@@ -93,14 +93,14 @@ public class StringVariablePresentationManager {
* Load extensions
*/
private void initialize() {
- fConfigurations = new HashMap();
+ fConfigurations = new HashMap<String, IConfigurationElement>();
IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS);
IConfigurationElement elements[]= point.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
IConfigurationElement element = elements[i];
String name= element.getAttribute(ATTR_NAME);
if (name == null) {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new String[] {element.getDeclaringExtension().getLabel()})); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(MessageFormat.format("String variable presentation extension missing required 'variableName' attribute: {0}", new Object[] { element.getDeclaringExtension().getLabel() })); //$NON-NLS-1$
continue;
}
fConfigurations.put(name, element);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java
index 4f5d2157b..8b805b7f5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/stringsubstitution/SystemPropertyArgumentSelector.java
@@ -27,6 +27,7 @@ public class SystemPropertyArgumentSelector implements IArgumentSelector {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.stringsubstitution.IArgumentSelector#selectArgument(org.eclipse.core.variables.IStringVariable, org.eclipse.swt.widgets.Shell)
*/
+ @Override
public String selectArgument(IStringVariable variable, Shell shell) {
ElementListSelectionDialog dialog = new ElementListSelectionDialog(shell, new LabelProvider());
dialog.setElements(System.getProperties().keySet().toArray());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
index 55ad863d4..d24d85179 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
+import java.util.ListIterator;
import java.util.Map;
import org.eclipse.core.runtime.CoreException;
@@ -44,8 +45,21 @@ import org.eclipse.jface.viewers.ViewerSorter;
public abstract class AsynchronousModel {
private ModelNode fRoot; // root node
- private Map fElementToNodes = new HashMap(); // map of element to corresponding tree nodes (list)
- private Map fModelProxies = new HashMap(); // map of installed model proxies, by element
+ private Map<Object, ModelNode[]> fElementToNodes = new HashMap<Object, ModelNode[]>(); // map
+ // of
+ // element
+ // to
+ // corresponding
+ // tree
+ // nodes
+ // (list)
+ private Map<Object, IModelProxy> fModelProxies = new HashMap<Object, IModelProxy>(); // map
+ // of
+ // installed
+ // model
+ // proxies,
+ // by
+ // element
private AsynchronousViewer fViewer; // viewer this model works for
private boolean fDisposed = false; // whether disposed
@@ -54,6 +68,7 @@ public abstract class AsynchronousModel {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#getChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, IPresentationContext context) throws CoreException {
return EMPTY;
}
@@ -61,6 +76,7 @@ public abstract class AsynchronousModel {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#hasChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected boolean hasChildren(Object element, IPresentationContext context) throws CoreException {
return false;
}
@@ -68,6 +84,7 @@ public abstract class AsynchronousModel {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AsynchronousContentAdapter#supportsPartId(java.lang.String)
*/
+ @Override
protected boolean supportsPartId(String id) {
return true;
}
@@ -78,12 +95,12 @@ public abstract class AsynchronousModel {
/**
* List of requests currently being performed.
*/
- private List fPendingUpdates = new ArrayList();
+ private List<IStatusMonitor> fPendingUpdates = new ArrayList<IStatusMonitor>();
/**
- * List of pending viewer udpates
+ * List of pending viewer updates
*/
- private List fViewerUpdates = new ArrayList();
+ private List<IStatusMonitor> fViewerUpdates = new ArrayList<IStatusMonitor>();
/**
* Constructs a new empty tree model
@@ -154,9 +171,9 @@ public abstract class AsynchronousModel {
* Cancels all pending update requests.
*/
protected synchronized void cancelPendingUpdates() {
- Iterator updates = fPendingUpdates.iterator();
+ Iterator<IStatusMonitor> updates = fPendingUpdates.iterator();
while (updates.hasNext()) {
- IStatusMonitor update = (IStatusMonitor) updates.next();
+ IStatusMonitor update = updates.next();
updates.remove();
update.setCanceled(true);
}
@@ -177,6 +194,7 @@ public abstract class AsynchronousModel {
if (proxy != null) {
fModelProxies.put(element, proxy);
Job job = new Job("Model Proxy installed notification job") {//$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
proxy.init(getPresentationContext());
@@ -199,7 +217,7 @@ public abstract class AsynchronousModel {
* @param element the element context
*/
protected synchronized void disposeModelProxy(Object element) {
- IModelProxy proxy = (IModelProxy) fModelProxies.remove(element);
+ IModelProxy proxy = fModelProxies.remove(element);
if (proxy != null) {
getViewer().modelProxyRemoved(proxy);
proxy.dispose();
@@ -211,13 +229,10 @@ public abstract class AsynchronousModel {
*/
private void disposeAllModelProxies() {
synchronized(fModelProxies) {
- Iterator updatePolicies = fModelProxies.values().iterator();
- while (updatePolicies.hasNext()) {
- IModelProxy proxy = (IModelProxy)updatePolicies.next();
+ for (IModelProxy proxy : fModelProxies.values()) {
getViewer().modelProxyRemoved(proxy);
proxy.dispose();
}
-
fModelProxies.clear();
}
}
@@ -281,7 +296,7 @@ public abstract class AsynchronousModel {
*/
protected synchronized void unmapNode(ModelNode node) {
Object element = node.getElement();
- ModelNode[] nodes = (ModelNode[]) fElementToNodes.get(element);
+ ModelNode[] nodes = fElementToNodes.get(element);
if (nodes == null) {
return;
}
@@ -311,7 +326,7 @@ public abstract class AsynchronousModel {
* @return associated nodes or <code>null</code>
*/
public synchronized ModelNode[] getNodes(Object element) {
- return (ModelNode[]) fElementToNodes.get(element);
+ return fElementToNodes.get(element);
}
/**
@@ -332,7 +347,7 @@ public abstract class AsynchronousModel {
protected void requestScheduled(IStatusMonitor update) {
AsynchronousRequestMonitor absUpdate = (AsynchronousRequestMonitor) update;
synchronized (fPendingUpdates) {
- Iterator updates = fPendingUpdates.listIterator();
+ ListIterator<IStatusMonitor> updates = fPendingUpdates.listIterator();
while (updates.hasNext()) {
AsynchronousRequestMonitor pendingUpdate = (AsynchronousRequestMonitor) updates.next();
if (absUpdate.contains(pendingUpdate)) {
@@ -378,16 +393,18 @@ public abstract class AsynchronousModel {
protected Object[] filter(Object parent, Object[] elements) {
ViewerFilter[] filters = getViewer().getFilters();
if (filters != null) {
- ArrayList filtered = new ArrayList(elements.length);
+ ArrayList<Object> filtered = new ArrayList<Object>(elements.length);
for (int i = 0; i < elements.length; i++) {
boolean add = true;
for (int j = 0; j < filters.length; j++) {
add = filters[j].select(getViewer(), parent, elements[i]);
- if (!add)
+ if (!add) {
break;
+ }
}
- if (add)
+ if (add) {
filtered.add(elements[i]);
+ }
}
return filtered.toArray();
}
@@ -526,8 +543,7 @@ public abstract class AsynchronousModel {
* @param parentNode parent node
* @param kids list of model elements
*/
- protected void setChildren(final ModelNode parentNode, List kids) {
-
+ protected void setChildren(final ModelNode parentNode, List<Object> kids) {
final Object[] children = filter(parentNode.getElement(), kids.toArray());
final AsynchronousViewer viewer = getViewer();
ViewerSorter sorter = viewer.getSorter();
@@ -593,7 +609,8 @@ public abstract class AsynchronousModel {
//update viewer outside the lock
final ModelNode[] finalUnmap = unmap;
preservingSelection(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (finalUnmap != null) {
for (int i = 0; i < finalUnmap.length; i++) {
viewer.unmapNode(finalUnmap[i]);
@@ -605,6 +622,7 @@ public abstract class AsynchronousModel {
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
if (fRoot != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
index c5fc0235c..92071d2ac 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousRequestMonitor.java
@@ -43,7 +43,8 @@ public abstract class AsynchronousRequestMonitor extends AbstractRequestMonitor
private boolean fDone = false;
protected WorkbenchJob fViewerUpdateJob = new WorkbenchJob("Asynchronous viewer update") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
// necessary to check if widget is disposed. The item may
// have been removed from the tree when another children update
// occurred.
@@ -131,7 +132,8 @@ public abstract class AsynchronousRequestMonitor extends AbstractRequestMonitor
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
*/
- public void setCanceled(boolean value) {
+ @Override
+ public void setCanceled(boolean value) {
super.setCanceled(value);
if (value) {
getModel().requestCanceled(this);
@@ -141,7 +143,8 @@ public abstract class AsynchronousRequestMonitor extends AbstractRequestMonitor
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
- public final void done() {
+ @Override
+ public final void done() {
synchronized (this) {
fDone = true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java
index a6cfaf8fe..aa2ffa508 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousSchedulingRuleFactory.java
@@ -29,10 +29,12 @@ public class AsynchronousSchedulingRuleFactory {
public SerialRule() {
}
+ @Override
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
+ @Override
public boolean isConflicting(ISchedulingRule rule) {
return rule instanceof SerialRule;
}
@@ -49,6 +51,7 @@ public class AsynchronousSchedulingRuleFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.ISchedulingRule#contains(org.eclipse.core.runtime.jobs.ISchedulingRule)
*/
+ @Override
public boolean contains(ISchedulingRule rule) {
return rule == this;
}
@@ -56,6 +59,7 @@ public class AsynchronousSchedulingRuleFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.ISchedulingRule#isConflicting(org.eclipse.core.runtime.jobs.ISchedulingRule)
*/
+ @Override
public boolean isConflicting(ISchedulingRule rule) {
if (rule instanceof SerialPerObjectRule) {
SerialPerObjectRule vup = (SerialPerObjectRule) rule;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java
index ae6ff9c3a..386e2396b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.viewers;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
@@ -33,6 +32,7 @@ public class AsynchronousTableModel extends AsynchronousModel {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousModel#add(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelNode, java.lang.Object)
*/
+ @Override
protected void add(ModelNode parent, Object element) {}
/**
@@ -52,14 +52,14 @@ public class AsynchronousTableModel extends AsynchronousModel {
* @param elements elements to add
*/
protected void added(Object[] elements) {
- List kids = null;
+ List<Object> kids = null;
boolean changed = false;
synchronized (this) {
ModelNode[] childrenNodes = getRootNode().getChildrenNodes();
if (childrenNodes == null) {
- kids = new ArrayList(elements.length);
+ kids = new ArrayList<Object>(elements.length);
} else {
- kids = new ArrayList(elements.length + childrenNodes.length);
+ kids = new ArrayList<Object>(elements.length + childrenNodes.length);
for (int i = 0; i < childrenNodes.length; i++) {
kids.add(childrenNodes[i].getElement());
}
@@ -95,14 +95,14 @@ public class AsynchronousTableModel extends AsynchronousModel {
* @param index index to insert at
*/
protected void inserted(Object[] elements, int index) {
- List kids = null;
+ List<Object> kids = null;
boolean changed = false;
synchronized (this) {
ModelNode[] childrenNodes = getRootNode().getChildrenNodes();
if (childrenNodes == null) {
- kids = new ArrayList(elements.length);
+ kids = new ArrayList<Object>(elements.length);
} else {
- kids = new ArrayList(elements.length + childrenNodes.length);
+ kids = new ArrayList<Object>(elements.length + childrenNodes.length);
for (int i = 0; i < childrenNodes.length; i++) {
kids.add(childrenNodes[i].getElement());
}
@@ -137,12 +137,12 @@ public class AsynchronousTableModel extends AsynchronousModel {
* @param elements elements to remove
*/
protected void removed(Object[] elements) {
- List kids = null;
+ List<Object> kids = null;
boolean changed = false;
synchronized (this) {
ModelNode[] childrenNodes = getRootNode().getChildrenNodes();
if (childrenNodes != null) {
- kids = new ArrayList(childrenNodes.length);
+ kids = new ArrayList<Object>(childrenNodes.length);
for (int i = 0; i < childrenNodes.length; i++) {
kids.add(childrenNodes[i].getElement());
}
@@ -180,7 +180,7 @@ public class AsynchronousTableModel extends AsynchronousModel {
remove(new Object[]{element});
return;
}
- List list = new ArrayList();
+ List<ModelNode> list = new ArrayList<ModelNode>();
synchronized (this) {
ModelNode[] nodes = getNodes(element);
for (int i = 0; i < nodes.length; i++) {
@@ -190,9 +190,7 @@ public class AsynchronousTableModel extends AsynchronousModel {
}
}
if (!list.isEmpty()) {
- Iterator iterator = list.iterator();
- while (iterator.hasNext()) {
- ModelNode node = (ModelNode) iterator.next();
+ for (ModelNode node : list) {
getViewer().nodeChanged(node);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
index a0885ce1d..97e5cdb13 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTableViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -81,24 +81,28 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
fTableEditorImpl = createTableEditorImpl();
}
- protected void hookControl(Control control) {
+ @Override
+ protected void hookControl(Control control) {
super.hookControl(control);
control.addMouseListener(new MouseAdapter() {
- public void mouseDown(MouseEvent e) {
+ @Override
+ public void mouseDown(MouseEvent e) {
fTableEditorImpl.handleMouseDown(e);
}
});
}
- public synchronized void dispose() {
+ @Override
+ public synchronized void dispose() {
fTableEditor.dispose();
fTable.dispose();
super.dispose();
}
- protected ISelection doAttemptSelectionToWidget(ISelection selection, boolean reveal) {
+ @Override
+ protected ISelection doAttemptSelectionToWidget(ISelection selection, boolean reveal) {
if (acceptsSelection(selection)) {
- List list = ((IStructuredSelection) selection).toList();
+ List<?> list = ((IStructuredSelection) selection).toList();
if (list == null) {
fTable.deselectAll();
return StructuredSelection.EMPTY;
@@ -128,11 +132,13 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
return StructuredSelection.EMPTY;
}
- protected boolean acceptsSelection(ISelection selection) {
+ @Override
+ protected boolean acceptsSelection(ISelection selection) {
return selection instanceof IStructuredSelection;
}
- protected ISelection getEmptySelection() {
+ @Override
+ protected ISelection getEmptySelection() {
return StructuredSelection.EMPTY;
}
@@ -143,16 +149,18 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
return null;
}
- protected List getSelectionFromWidget() {
+ @Override
+ protected List getSelectionFromWidget() {
TableItem[] selection = fTable.getSelection();
- List datas = new ArrayList(selection.length);
+ List<Object> datas = new ArrayList<Object>(selection.length);
for (int i = 0; i < selection.length; i++) {
datas.add(selection[i].getData());
}
return datas;
}
- public Control getControl() {
+ @Override
+ public Control getControl() {
return fTable;
}
@@ -163,14 +171,16 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#internalRefresh(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ModelNode)
*/
- protected void internalRefresh(ModelNode node) {
+ @Override
+ protected void internalRefresh(ModelNode node) {
super.internalRefresh(node);
if (node.getElement().equals(getInput())) {
updateChildren(node);
}
}
- protected void restoreLabels(Item item) {
+ @Override
+ protected void restoreLabels(Item item) {
TableItem tableItem = (TableItem) item;
String[] values = (String[]) tableItem.getData(OLD_LABEL);
Image[] images = (Image[]) tableItem.getData(OLD_IMAGE);
@@ -180,6 +190,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
}
}
+ @Override
public void setLabels(Widget widget, String[] labels, ImageDescriptor[] imageDescriptors) {
TableItem item = (TableItem) widget;
item.setText(labels);
@@ -188,14 +199,16 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
item.setData(OLD_IMAGE, images);
if (imageDescriptors != null) {
for (int i = 0; i < images.length; i++) {
- if (i < imageDescriptors.length)
- images[i] = getImage(imageDescriptors[i]);
+ if (i < imageDescriptors.length) {
+ images[i] = getImage(imageDescriptors[i]);
+ }
}
}
item.setImage(images);
}
- public void setColors(Widget widget, RGB[] foregrounds, RGB[] backgrounds) {
+ @Override
+ public void setColors(Widget widget, RGB[] foregrounds, RGB[] backgrounds) {
TableItem item = (TableItem) widget;
if (foregrounds == null) {
foregrounds = new RGB[fTable.getColumnCount()];
@@ -214,7 +227,8 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
}
}
- public void setFonts(Widget widget, FontData[] fontDatas) {
+ @Override
+ public void setFonts(Widget widget, FontData[] fontDatas) {
TableItem item = (TableItem) widget;
if (fontDatas != null) {
for (int i = 0; i < fontDatas.length; i++) {
@@ -234,7 +248,8 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
public void showColumnHeader(final boolean showHeaders) {
WorkbenchJob job = new WorkbenchJob("Set Header Visibility") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
if (!fTable.isDisposed())
{
fTable.setHeaderVisible(showHeaders);
@@ -252,11 +267,13 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
*
* @see org.eclipse.jface.viewers.StructuredViewer#reveal(java.lang.Object)
*/
- public void reveal(Object element) {
+ @Override
+ public void reveal(Object element) {
Assert.isNotNull(element);
Widget w = findItem(element);
- if (w instanceof TableItem)
- getTable().showItem((TableItem) w);
+ if (w instanceof TableItem) {
+ getTable().showItem((TableItem) w);
+ }
}
/**
@@ -281,37 +298,45 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
protected TableEditorImpl createTableEditorImpl() {
return new TableEditorImpl(this) {
- Rectangle getBounds(Item item, int columnNumber) {
+ @Override
+ Rectangle getBounds(Item item, int columnNumber) {
return ((TableItem) item).getBounds(columnNumber);
}
- int getColumnCount() {
+ @Override
+ int getColumnCount() {
return getTable().getColumnCount();
}
- Item[] getSelection() {
+ @Override
+ Item[] getSelection() {
return getTable().getSelection();
}
- void setEditor(Control w, Item item, int columnNumber) {
+ @Override
+ void setEditor(Control w, Item item, int columnNumber) {
fTableEditor.setEditor(w, (TableItem) item, columnNumber);
}
- void setSelection(StructuredSelection selection, boolean b) {
+ @Override
+ void setSelection(StructuredSelection selection, boolean b) {
AsynchronousTableViewer.this.setSelection(selection, b);
}
- void showSelection() {
+ @Override
+ void showSelection() {
getTable().showSelection();
}
- void setLayoutData(CellEditor.LayoutData layoutData) {
+ @Override
+ void setLayoutData(CellEditor.LayoutData layoutData) {
fTableEditor.grabHorizontal = layoutData.grabHorizontal;
fTableEditor.horizontalAlignment = layoutData.horizontalAlignment;
fTableEditor.minimumWidth = layoutData.minimumWidth;
}
- void handleDoubleClickEvent() {
+ @Override
+ void handleDoubleClickEvent() {
Viewer viewer = getViewer();
fireDoubleClick(new DoubleClickEvent(viewer, viewer.getSelection()));
fireOpen(new OpenEvent(viewer, viewer.getSelection()));
@@ -319,12 +344,13 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
};
}
- protected ISelection newSelectionFromWidget() {
+ @Override
+ protected ISelection newSelectionFromWidget() {
Control control = getControl();
if (control == null || control.isDisposed()) {
return StructuredSelection.EMPTY;
}
- List list = getSelectionFromWidget();
+ List<?> list = getSelectionFromWidget();
return new StructuredSelection(list);
}
@@ -361,8 +387,9 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
protected int indexForElement(Object element) {
ViewerSorter sorter = getSorter();
- if (sorter == null)
- return fTable.getItemCount();
+ if (sorter == null) {
+ return fTable.getItemCount();
+ }
int count = fTable.getItemCount();
int min = 0, max = count - 1;
while (min <= max) {
@@ -381,56 +408,68 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
}
return mid;
}
- if (compare < 0)
- min = mid + 1;
- else
- max = mid - 1;
+ if (compare < 0) {
+ min = mid + 1;
+ } else {
+ max = mid - 1;
+ }
}
return min;
}
public void add(Object element) {
- if (element != null)
- add(new Object[] { element });
+ if (element != null) {
+ add(new Object[] { element });
+ }
}
public void add(Object[] elements) {
if (elements == null || elements.length == 0)
- return; // done
+ {
+ return; // done
+ }
((AsynchronousTableModel)getModel()).add(elements);
}
public void remove(Object element) {
- if (element != null)
- remove(new Object[] { element });
+ if (element != null) {
+ remove(new Object[] { element });
+ }
}
public void remove(final Object[] elements) {
if (elements == null || elements.length == 0)
- return; // done
+ {
+ return; // done
+ }
((AsynchronousTableModel)getModel()).remove(elements);
}
public void insert(Object element, int position) {
- if (element != null)
- insert(new Object[] { element }, position);
+ if (element != null) {
+ insert(new Object[] { element }, position);
+ }
}
public void insert(Object[] elements, int position) {
- if (elements == null || elements.length == 0)
- return;
+ if (elements == null || elements.length == 0) {
+ return;
+ }
((AsynchronousTableModel)getModel()).insert(elements, position);
}
public void replace(Object element, Object replacement) {
if (element == null || replacement == null)
- throw new IllegalArgumentException("unexpected null parameter"); //$NON-NLS-1$
+ {
+ throw new IllegalArgumentException("unexpected null parameter"); //$NON-NLS-1$
+ }
((AsynchronousTableModel)getModel()).replace(element, replacement);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#createModel()
*/
+ @Override
protected AsynchronousModel createModel() {
return new AsynchronousTableModel(this);
}
@@ -438,7 +477,8 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#setItemCount(org.eclipse.swt.widgets.Widget, int)
*/
- protected void setItemCount(Widget parent, int itemCount) {
+ @Override
+ protected void setItemCount(Widget parent, int itemCount) {
fTable.setItemCount(itemCount);
}
@@ -450,6 +490,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#createUpdatePolicy()
*/
+ @Override
public AbstractUpdatePolicy createUpdatePolicy() {
return new TableUpdatePolicy();
}
@@ -457,6 +498,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#getParentWidget(org.eclipse.swt.widgets.Widget)
*/
+ @Override
protected Widget getParentWidget(Widget widget) {
if (widget instanceof TableItem) {
return ((TableItem)widget).getParent();
@@ -467,6 +509,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#getChildWidget(org.eclipse.swt.widgets.Widget, int)
*/
+ @Override
protected Widget getChildWidget(Widget parent, int index) {
if (index < fTable.getItemCount()) {
return fTable.getItem(index);
@@ -477,6 +520,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#clear(org.eclipse.swt.widgets.Widget)
*/
+ @Override
protected void clear(Widget item) {
if (item instanceof TableItem) {
int i = fTable.indexOf((TableItem)item);
@@ -489,6 +533,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#clearChild(org.eclipse.swt.widgets.Widget, int)
*/
+ @Override
protected void clearChild(Widget parent, int childIndex) {
if (parent instanceof Table) {
fTable.clear(childIndex);
@@ -498,6 +543,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#clearChildren(org.eclipse.swt.widgets.Widget)
*/
+ @Override
protected void clearChildren(Widget item) {
if (item instanceof Table) {
fTable.clearAll();
@@ -507,6 +553,7 @@ public class AsynchronousTableViewer extends AsynchronousViewer implements Liste
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AsynchronousViewer#indexOf(org.eclipse.swt.widgets.Widget, org.eclipse.swt.widgets.Widget)
*/
+ @Override
protected int indexOf(Widget parent, Widget child) {
if (parent instanceof Table) {
return ((Table)parent).indexOf((TableItem)child);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
index d81bc33a3..1f4b9d06d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -82,21 +82,21 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
* use the method <code>getImage(...)</code> to cache images for
* image descriptors. The images are disposed when this viewer is disposed.
*/
- private Map fImageCache = new HashMap();
+ private Map<ImageDescriptor, Image> fImageCache = new HashMap<ImageDescriptor, Image>();
/**
* Cache of the fonts used for elements in this tree viewer. Label updates
* use the method <code>getFont(...)</code> to cache fonts for
* FontData objects. The fonts are disposed with the viewer.
*/
- private Map fFontCache = new HashMap();
+ private Map<FontData, Font> fFontCache = new HashMap<FontData, Font>();
/**
* Cache of the colors used for elements in this tree viewer. Label updates
* use the method <code>getColor(...)</code> to cache colors for
* RGB values. The colors are disposed with the viewer.
*/
- private Map fColorCache = new HashMap();
+ private Map<RGB, Color> fColorCache = new HashMap<RGB, Color>();
/**
* The context in which this viewer is being used - i.e. what part it is contained
@@ -138,6 +138,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
* Hash lookup is required, don't let subclasses change behavior.
* @param enable if hash lookup should be used in the viewer
*/
+ @Override
public final void setUseHashlookup(boolean enable) {
Assert.isTrue(enable);
super.setUseHashlookup(enable);
@@ -146,6 +147,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#hookControl(org.eclipse.swt.widgets.Control)
*/
+ @Override
protected void hookControl(Control control) {
super.hookControl(control);
control.addListener(SWT.SetData, this);
@@ -156,23 +158,15 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
* so it can perform cleanup.
*/
public synchronized void dispose() {
- Iterator images = fImageCache.values().iterator();
- while (images.hasNext()) {
- Image image = (Image) images.next();
+ for (Image image : fImageCache.values()) {
image.dispose();
}
fImageCache.clear();
-
- Iterator fonts = fFontCache.values().iterator();
- while (fonts.hasNext()) {
- Font font = (Font) fonts.next();
+ for (Font font : fFontCache.values()) {
font.dispose();
}
fFontCache.clear();
-
- Iterator colors = fColorCache.values().iterator();
- while (colors.hasNext()) {
- Color color = (Color) colors.next();
+ for (Color color : fColorCache.values()) {
color.dispose();
}
fColorCache.clear();
@@ -228,6 +222,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#unmapAllElements()
*/
+ @Override
protected synchronized void unmapAllElements() {
super.unmapAllElements();
AsynchronousModel model = getModel();
@@ -239,6 +234,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object, java.lang.Object)
*/
+ @Override
protected synchronized void inputChanged(Object input, Object oldInput) {
fPendingSelection = null;
if (fCurrentSelection != null) {
@@ -306,7 +302,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
if (descriptor == null) {
return null;
}
- Image image = (Image) fImageCache.get(descriptor);
+ Image image = fImageCache.get(descriptor);
if (image == null) {
image = new Image(getControl().getDisplay(), descriptor.getImageData());
fImageCache.put(descriptor, image);
@@ -342,7 +338,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
if (fontData == null) {
return null;
}
- Font font = (Font) fFontCache.get(fontData);
+ Font font = fFontCache.get(fontData);
if (font == null) {
font = new Font(getControl().getDisplay(), fontData);
fFontCache.put(fontData, font);
@@ -376,7 +372,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
if (rgb == null) {
return null;
}
- Color color = (Color) fColorCache.get(rgb);
+ Color color = fColorCache.get(rgb);
if (color == null) {
color = new Color(getControl().getDisplay(), rgb);
fColorCache.put(rgb, color);
@@ -396,6 +392,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
*/
+ @Override
protected Widget doFindItem(Object element) {
// this viewer maps model nodes to widgets, so the element is a ModelNode
AsynchronousModel model = getModel();
@@ -416,7 +413,8 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
*
* @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
*/
- protected Widget doFindInputItem(Object element) {
+ @Override
+ protected Widget doFindInputItem(Object element) {
if (element instanceof ModelNode) {
ModelNode node = (ModelNode) element;
if (node.getElement().equals(getInput())) {
@@ -429,12 +427,14 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#doUpdateItem(org.eclipse.swt.widgets.Widget, java.lang.Object, boolean)
*/
+ @Override
protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object)
*/
+ @Override
protected void internalRefresh(Object element) {
// get the nodes in the model
AsynchronousModel model = getModel();
@@ -467,6 +467,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
*/
+ @Override
public synchronized void setSelection(ISelection selection, boolean reveal) {
setSelection(selection, reveal, false);
}
@@ -497,6 +498,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
attemptSelection(reveal);
} else {
WorkbenchJob job = new WorkbenchJob("attemptSelection") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
attemptSelection(reveal);
return Status.OK_STATUS;
@@ -531,6 +533,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#getSelection()
*/
+ @Override
public ISelection getSelection() {
Control control = getControl();
if (control == null || control.isDisposed() || fCurrentSelection == null) {
@@ -542,6 +545,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
*/
+ @Override
protected void handleSelect(SelectionEvent event) {
// handle case where an earlier selection listener disposed the control.
Control control = getControl();
@@ -553,6 +557,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#handlePostSelect(org.eclipse.swt.events.SelectionEvent)
*/
+ @Override
protected void handlePostSelect(SelectionEvent e) {
SelectionChangedEvent event = new SelectionChangedEvent(this, newSelectionFromWidget());
firePostSelectionChanged(event);
@@ -591,6 +596,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(org.eclipse.jface.viewers.ISelection, boolean)
*/
+ @Override
final protected void setSelectionToWidget(ISelection selection, final boolean reveal) {
// NOT USED
throw new IllegalArgumentException("This method should not be called"); //$NON-NLS-1$
@@ -599,6 +605,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.util.List, boolean)
*/
+ @Override
final protected void setSelectionToWidget(List l, boolean reveal) {
// NOT USED
throw new IllegalArgumentException("This method should not be called"); //$NON-NLS-1$
@@ -676,12 +683,15 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
* A content provider that does nothing.
*/
private class NullContentProvider implements IStructuredContentProvider {
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
+ @Override
public Object[] getElements(Object inputElement) {
return null;
}
@@ -701,6 +711,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#preservingSelection(java.lang.Runnable)
*/
+ @Override
protected synchronized void preservingSelection(Runnable updateCode) {
if (fPendingSelection == null || fPendingSelection.isEmpty()) {
ISelection oldSelection = null;
@@ -720,6 +731,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
}
} else {
WorkbenchJob job = new WorkbenchJob("attemptSelection") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
synchronized (AsynchronousViewer.this) {
if (!getControl().isDisposed()) {
@@ -779,7 +791,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
}
if (selection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while (iterator.hasNext()) {
Object element = iterator.next();
if (getModel().getNodes(element) == null) {
@@ -819,6 +831,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#updateSelection(org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected synchronized void updateSelection(ISelection selection) {
fCurrentSelection = selection;
super.updateSelection(selection);
@@ -1041,6 +1054,7 @@ public abstract class AsynchronousViewer extends StructuredViewer implements Lis
*
* @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void handleEvent(final Event event) {
update((Item)event.item, event.index);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
index 6050992fb..6dd261a1f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ChildrenRequestMonitor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -32,7 +32,7 @@ class ChildrenRequestMonitor extends AsynchronousRequestMonitor implements IChil
/**
* Collection of children retrieved
*/
- private List fChildren = new ArrayList();
+ private List<Object> fChildren = new ArrayList<Object>();
/**
* Constucts a monitor to retrieve and update the children of the given
@@ -48,7 +48,8 @@ class ChildrenRequestMonitor extends AsynchronousRequestMonitor implements IChil
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IChildrenRequestMonitor#addChild(java.lang.Object)
*/
- public void addChild(Object child) {
+ @Override
+ public void addChild(Object child) {
synchronized (fChildren) {
fChildren.add(child);
}
@@ -59,7 +60,8 @@ class ChildrenRequestMonitor extends AsynchronousRequestMonitor implements IChil
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IChildrenRequestMonitor#addChildren(java.lang.Object[])
*/
- public void addChildren(Object[] children) {
+ @Override
+ public void addChildren(Object[] children) {
synchronized (fChildren) {
for (int i = 0; i < children.length; i++) {
fChildren.add(children[i]);
@@ -72,20 +74,22 @@ class ChildrenRequestMonitor extends AsynchronousRequestMonitor implements IChil
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor)
*/
- protected boolean contains(AsynchronousRequestMonitor update) {
+ @Override
+ protected boolean contains(AsynchronousRequestMonitor update) {
return (update instanceof ChildrenRequestMonitor) && contains(update.getNode());
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
*/
- protected void performUpdate() {
+ @Override
+ protected void performUpdate() {
synchronized (fChildren) {
if (fFirstUpdate) {
getModel().setChildren(getNode(), fChildren);
fFirstUpdate = false;
} else {
- for (Iterator iter = fChildren.iterator(); iter.hasNext();) {
+ for (Iterator<Object> iter = fChildren.iterator(); iter.hasNext();) {
Object child = iter.next();
getModel().add(getNode(), child);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java
index 4ef42ab5b..dd0d444fc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/FindElementDialog.java
@@ -42,6 +42,7 @@ public class FindElementDialog extends ElementListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.ui.dialogs.ElementListSelectionDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Control comp = super.createDialogArea(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugHelpContextIds.FIND_ELEMENT_DIALOG);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java
index 152a33248..9785246aa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelRequestMonitor.java
@@ -65,6 +65,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
AsynchronousViewer viewer = getModel().getViewer();
Widget widget = viewer.findItem(getNode());
@@ -80,6 +81,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor)
*/
+ @Override
protected boolean contains(AsynchronousRequestMonitor update) {
return update instanceof LabelRequestMonitor && update.getNode() == getNode();
}
@@ -89,6 +91,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setLabel(java.lang.String)
*/
+ @Override
public void setLabels(String[] text) {
fLabels = text;
}
@@ -98,6 +101,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setFontData(org.eclipse.swt.graphics.FontData)
*/
+ @Override
public void setFontDatas(FontData[] fontData) {
fFontDatas = fontData;
}
@@ -107,6 +111,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
*/
+ @Override
public void setImageDescriptors(ImageDescriptor[] image) {
fImageDescriptors = image;
}
@@ -116,6 +121,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setForeground(org.eclipse.swt.graphics.RGB)
*/
+ @Override
public void setForegrounds(RGB[] foreground) {
fForegrounds = foreground;
}
@@ -125,6 +131,7 @@ class LabelRequestMonitor extends AsynchronousRequestMonitor implements ILabelRe
*
* @see org.eclipse.debug.ui.viewers.ILabelRequestMonitor#setBackground(org.eclipse.swt.graphics.RGB)
*/
+ @Override
public void setBackgrounds(RGB[] background) {
fBackgrounds = background;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java
index 2e04a1af8..2896d964e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/LabelResult.java
@@ -24,10 +24,12 @@ class LabelResult extends LabelRequestMonitor implements ILabelResult {
super(node, model);
}
+ @Override
protected synchronized void scheduleViewerUpdate(long ms) {
notifyAll();
}
+ @Override
public synchronized boolean isDone() {
return super.isDone();
}
@@ -35,6 +37,7 @@ class LabelResult extends LabelRequestMonitor implements ILabelResult {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getElement()
*/
+ @Override
public Object getElement() {
return getNode().getElement();
}
@@ -42,6 +45,7 @@ class LabelResult extends LabelRequestMonitor implements ILabelResult {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getImages()
*/
+ @Override
public Image[] getImages() {
return getModel().getViewer().getImages(getImageDescriptors());
}
@@ -49,6 +53,7 @@ class LabelResult extends LabelRequestMonitor implements ILabelResult {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getLabels()
*/
+ @Override
public String[] getLabels() {
return super.getLabels();
}
@@ -56,6 +61,7 @@ class LabelResult extends LabelRequestMonitor implements ILabelResult {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getTreePath()
*/
+ @Override
public TreePath getTreePath() {
return getNode().getTreePath();
}
@@ -63,6 +69,7 @@ class LabelResult extends LabelRequestMonitor implements ILabelResult {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.ILabelResult#getDepth()
*/
+ @Override
public int getDepth() {
int level = 0;
ModelNode node = getNode().getParentNode();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
index ee2eddeff..bfd3492e9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/ModelNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -93,7 +93,7 @@ public class ModelNode {
* @return
*/
public synchronized TreePath getTreePath() {
- List path = new ArrayList();
+ List<Object> path = new ArrayList<Object>();
ModelNode node = this;
while (node != null) {
path.add(0, node.getElement());
@@ -194,7 +194,8 @@ public class ModelNode {
fIsContainer = container;
}
- public String toString() {
+ @Override
+ public String toString() {
StringBuffer buf = new StringBuffer();
if (isDisposed()) {
buf.append("[DISPOSED] "); //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java
index 4adec277b..7474a58bb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/PartPresentationContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.ui.IWorkbenchPart;
* @since 3.3
* @deprecated getPart() is now supported by IPresentationContext itself.
*/
+@Deprecated
public class PartPresentationContext extends PresentationContext {
/**
@@ -30,6 +31,7 @@ public class PartPresentationContext extends PresentationContext {
super(part);
}
+ @Override
public IWorkbenchPart getPart() {
return super.getPart();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java
index 360186c45..5cff2a94a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableAddRequestMonitor.java
@@ -31,6 +31,7 @@ public class TableAddRequestMonitor extends AsynchronousRequestMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
((AsynchronousTableModel)getModel()).added(fElements);
}
@@ -38,6 +39,7 @@ public class TableAddRequestMonitor extends AsynchronousRequestMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor)
*/
+ @Override
protected boolean contains(AsynchronousRequestMonitor update) {
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
index e4fda98fc..c592b5f90 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableEditorImpl.java
@@ -85,6 +85,7 @@ public abstract class TableEditorImpl {
fCellEditor.setFocus();
if (fFocusListener == null) {
fFocusListener = new FocusAdapter() {
+ @Override
public void focusLost(FocusEvent e) {
applyEditorValue();
}
@@ -92,6 +93,7 @@ public abstract class TableEditorImpl {
}
control.addFocusListener(fFocusListener);
fMouseListener = new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
// time wrap?
// check for expiration of doubleClickTime
@@ -276,14 +278,17 @@ public abstract class TableEditorImpl {
private void initCellEditorListener() {
fCellEditorListener = new ICellEditorListener() {
+ @Override
public void editorValueChanged(boolean oldValidState, boolean newValidState) {
// Ignore.
}
+ @Override
public void cancelEditor() {
TableEditorImpl.this.cancelEditing();
}
+ @Override
public void applyEditorValue() {
TableEditorImpl.this.applyEditorValue();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
index 57f15cdd4..e7837550f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableInsertRequestMonitor.java
@@ -31,6 +31,7 @@ public class TableInsertRequestMonitor extends TableAddRequestMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
((AsynchronousTableModel)getModel()).inserted(fElements, fIndex);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java
index 421ade779..05ed29031 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableRemoveRequestMonitor.java
@@ -29,6 +29,7 @@ public class TableRemoveRequestMonitor extends TableAddRequestMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
((AsynchronousTableModel)getModel()).removed(fElements);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
index ca66b8696..074822a03 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableReplaceRequestMonitor.java
@@ -33,6 +33,7 @@ public class TableReplaceRequestMonitor extends AsynchronousRequestMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
((AsynchronousTableModel)getModel()).replaced(fOriginal, fReplacement);
}
@@ -40,6 +41,7 @@ public class TableReplaceRequestMonitor extends AsynchronousRequestMonitor {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor#contains(org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousRequestMonitor)
*/
+ @Override
protected boolean contains(AsynchronousRequestMonitor update) {
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java
index b3f176362..44d4eb32f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/TableUpdatePolicy.java
@@ -22,7 +22,8 @@ import org.eclipse.jface.viewers.StructuredSelection;
*/
public class TableUpdatePolicy extends org.eclipse.debug.internal.ui.viewers.AbstractUpdatePolicy implements IModelChangedListener {
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
+ @Override
+ public void modelChanged(IModelDelta delta, IModelProxy proxy) {
updateNodes(new IModelDelta[] {delta});
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
index 6d518b21f..58dc2e865 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/AbstractBreadcrumb.java
@@ -167,6 +167,7 @@ public abstract class AbstractBreadcrumb {
fComposite.setLayout(gridLayout);
fDisplayFocusListener= new Listener() {
+ @Override
public void handleEvent(Event event) {
if (fComposite.isDisposed()) return;
@@ -188,6 +189,7 @@ public abstract class AbstractBreadcrumb {
fBreadcrumbViewer= createViewer(fComposite);
fBreadcrumbViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
Object element= ((IStructuredSelection) event.getSelection()).getFirstElement();
if (element == null)
@@ -201,6 +203,7 @@ public abstract class AbstractBreadcrumb {
});
fBreadcrumbViewer.addOpenListener(new IOpenListener() {
+ @Override
public void open(OpenEvent event) {
doOpen(event.getSelection());
}
@@ -264,6 +267,7 @@ public abstract class AbstractBreadcrumb {
deinstallDisplayListeners();
fDisplayKeyListener= new Listener() {
+ @Override
public void handleEvent(Event event) {
if (event.keyCode != SWT.ESC)
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
index d70e7aa92..2a7d9d672 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItem.java
@@ -83,6 +83,7 @@ class BreadcrumbItem extends Item {
/*
* @see org.eclipse.swt.widgets.Widget#dispose()
*/
+ @Override
public void dispose() {
fContainer.dispose();
super.dispose();
@@ -207,6 +208,7 @@ class BreadcrumbItem extends Item {
/*
* @see org.eclipse.swt.widgets.Item#setText(java.lang.String)
*/
+ @Override
public void setText(String string) {
super.setText(string);
fDetailsBlock.setText(string);
@@ -219,6 +221,7 @@ class BreadcrumbItem extends Item {
/*
* @see org.eclipse.swt.widgets.Item#setImage(org.eclipse.swt.graphics.Image)
*/
+ @Override
public void setImage(Image image) {
super.setImage(image);
fDetailsBlock.setImage(image);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
index 8aa09ca1e..6482c4ac2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDetails.java
@@ -76,6 +76,7 @@ class BreadcrumbItemDetails {
layout.marginWidth= 2;
fImageComposite.setLayout(layout);
fImageComposite.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
if (fHasFocus && !isTextVisible()) {
e.gc.drawFocus(e.x, e.y, e.width, e.height);
@@ -98,6 +99,7 @@ class BreadcrumbItemDetails {
fTextComposite.setLayout(layout);
addElementListener(fTextComposite);
fTextComposite.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
if (fHasFocus && isTextVisible()) {
e.gc.drawFocus(e.x, e.y, e.width, e.height);
@@ -114,11 +116,13 @@ class BreadcrumbItemDetails {
addElementListener(fElementText);
fTextComposite.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ @Override
public void getName(AccessibleEvent e) {
e.result= fElementText.getText();
}
});
fImageComposite.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ @Override
public void getName(AccessibleEvent e) {
e.result= fElementText.getText();
}
@@ -295,6 +299,7 @@ class BreadcrumbItemDetails {
*/
private void installFocusComposite(Composite composite) {
composite.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
int index= fParent.getViewer().getIndexOfItem(fParent);
@@ -313,6 +318,7 @@ class BreadcrumbItemDetails {
}
});
composite.addKeyListener(new KeyListener() {
+ @Override
public void keyPressed(KeyEvent e) {
BreadcrumbViewer viewer= fParent.getViewer();
@@ -369,11 +375,13 @@ class BreadcrumbItemDetails {
shell.setFocus();
}
+ @Override
public void keyReleased(KeyEvent e) {
}
});
composite.addFocusListener(new FocusListener() {
+ @Override
public void focusGained(FocusEvent e) {
if (!fHasFocus) {
fHasFocus= true;
@@ -381,6 +389,7 @@ class BreadcrumbItemDetails {
}
}
+ @Override
public void focusLost(FocusEvent e) {
if (fHasFocus) {
fHasFocus= false;
@@ -397,9 +406,11 @@ class BreadcrumbItemDetails {
*/
private void addElementListener(Control control) {
control.addMouseListener(new MouseListener() {
+ @Override
public void mouseDoubleClick(MouseEvent e) {
}
+ @Override
public void mouseDown(MouseEvent e) {
BreadcrumbViewer viewer= fParent.getViewer();
Shell shell= fParent.getDropDownShell();
@@ -409,10 +420,12 @@ class BreadcrumbItemDetails {
}
}
+ @Override
public void mouseUp(MouseEvent e) {
}
});
control.addMenuDetectListener(new MenuDetectListener() {
+ @Override
public void menuDetected(MenuDetectEvent e) {
BreadcrumbViewer viewer= fParent.getViewer();
viewer.selectItem(fParent);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
index 25779b586..84f9f1de0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbItemDropDown.java
@@ -80,6 +80,7 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
/*
* @see org.eclipse.jface.resource.CompositeImageDescriptor#drawCompositeImage(int, int)
*/
+ @Override
protected void drawCompositeImage(int width, int height) {
Display display= fParentComposite.getDisplay();
@@ -133,6 +134,7 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
/*
* @see org.eclipse.jface.resource.CompositeImageDescriptor#getSize()
*/
+ @Override
protected Point getSize() {
return new Point(10, 16);
}
@@ -180,13 +182,15 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
fToolBar= new ToolBar(composite, SWT.FLAT);
fToolBar.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
fToolBar.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
+ @Override
+ public void getName(AccessibleEvent e) {
e.result= BreadcrumbMessages.BreadcrumbItemDropDown_showDropDownMenu_action_toolTip;
}
});
ToolBarManager manager= new ToolBarManager(fToolBar);
final Action showDropDownMenuAction= new Action(null, SWT.NONE) {
+ @Override
public void run() {
Shell shell= fParent.getDropDownShell();
if (shell != null)
@@ -210,6 +214,7 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
if (IS_MAC_WORKAROUND) {
manager.getControl().addMouseListener(new MouseAdapter() {
// see also BreadcrumbItemDetails#addElementListener(Control)
+ @Override
public void mouseDown(MouseEvent e) {
showDropDownMenuAction.run();
}
@@ -280,7 +285,8 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
/*
* @see org.eclipse.swt.events.ControlAdapter#controlResized(org.eclipse.swt.events.ControlEvent)
*/
- public void controlResized(ControlEvent e) {
+ @Override
+ public void controlResized(ControlEvent e) {
if (fIsResizingProgrammatically)
return;
@@ -322,6 +328,7 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
*/
private void installCloser(final Shell shell) {
final Listener focusListener= new Listener() {
+ @Override
public void handleEvent(Event event) {
Widget focusElement= event.widget;
boolean isFocusBreadcrumbTreeFocusWidget= focusElement == shell || focusElement instanceof Control && ((Control)focusElement).getShell() == shell;
@@ -364,12 +371,14 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
display.addFilter(SWT.FocusOut, focusListener);
final ControlListener controlListener= new ControlListener() {
+ @Override
public void controlMoved(ControlEvent e) {
if (!shell.isDisposed()) {
shell.close();
}
}
+ @Override
public void controlResized(ControlEvent e) {
if (!shell.isDisposed()) {
shell.close();
@@ -379,6 +388,7 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
fToolBar.getShell().addControlListener(controlListener);
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (DebugUIPlugin.DEBUG_BREADCRUMB) {
DebugUIPlugin.trace("==> shell disposed"); //$NON-NLS-1$
@@ -393,9 +403,11 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
}
});
shell.addShellListener(new ShellListener() {
+ @Override
public void shellActivated(ShellEvent e) {
}
+ @Override
public void shellClosed(ShellEvent e) {
if (DebugUIPlugin.DEBUG_BREADCRUMB) {
DebugUIPlugin.trace("==> shellClosed"); //$NON-NLS-1$
@@ -406,12 +418,15 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
fMenuIsShown= false;
}
+ @Override
public void shellDeactivated(ShellEvent e) {
}
+ @Override
public void shellDeiconified(ShellEvent e) {
}
+ @Override
public void shellIconified(ShellEvent e) {
}
});
@@ -607,17 +622,20 @@ class BreadcrumbItemDropDown implements IBreadcrumbDropDownSite {
return (fParent.getViewer().getStyle() & SWT.BOTTOM) == 0;
}
- public void close() {
+ @Override
+ public void close() {
if (fShell != null && !fShell.isDisposed()) {
fShell.close();
}
}
- public void notifySelection(ISelection selection) {
+ @Override
+ public void notifySelection(ISelection selection) {
fParent.getViewer().fireMenuSelection(selection);
}
- public void updateSize() {
+ @Override
+ public void updateSize() {
if (fShell != null && !fShell.isDisposed()) {
resizeShell(fShell);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
index d659b0bef..37d0fac29 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/BreadcrumbViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -70,7 +70,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
private final int fStyle;
private final Composite fContainer;
- private final ArrayList fBreadcrumbItems;
+ private final ArrayList<BreadcrumbItem> fBreadcrumbItems;
private final ListenerList fMenuListeners;
private Image fGradientBackground;
@@ -93,13 +93,14 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
*/
public BreadcrumbViewer(Composite parent, int style) {
fStyle = style;
- fBreadcrumbItems= new ArrayList();
+ fBreadcrumbItems = new ArrayList<BreadcrumbItem>();
fMenuListeners= new ListenerList();
fContainer= new Composite(parent, SWT.NONE);
GridData layoutData= new GridData(SWT.FILL, SWT.TOP, true, false);
fContainer.setLayoutData(layoutData);
fContainer.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
e.doit= true;
}
@@ -107,15 +108,17 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
fContainer.setBackgroundMode(SWT.INHERIT_DEFAULT);
fContainer.addListener(SWT.Resize, new Listener() {
- public void handleEvent(Event event) {
+ @Override
+ public void handleEvent(Event event) {
int height= fContainer.getClientArea().height;
if (fGradientBackground == null || fGradientBackground.getBounds().height != height) {
Image image= height == 0 ? null : createGradientImage(height, event.display);
fContainer.setBackgroundImage(image);
- if (fGradientBackground != null)
- fGradientBackground.dispose();
+ if (fGradientBackground != null) {
+ fGradientBackground.dispose();
+ }
fGradientBackground= image;
}
}
@@ -136,6 +139,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
fContainer.setLayout(gridLayout);
fContainer.addListener(SWT.Resize, new Listener() {
+ @Override
public void handleEvent(Event event) {
updateSize();
fContainer.layout(true, true);
@@ -160,6 +164,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.Viewer#getControl()
*/
+ @Override
public Control getControl() {
return fContainer;
}
@@ -167,6 +172,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#reveal(java.lang.Object)
*/
+ @Override
public void reveal(Object element) {
//all elements are always visible
}
@@ -180,10 +186,11 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
if (fSelectedItem != null) {
fSelectedItem.setFocus(true);
} else {
- if (fBreadcrumbItems.size() == 0)
+ if (fBreadcrumbItems.size() == 0) {
return;
+ }
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(fBreadcrumbItems.size() - 1);
+ BreadcrumbItem item= fBreadcrumbItems.get(fBreadcrumbItems.size() - 1);
item.setFocus(true);
}
}
@@ -193,9 +200,10 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
*/
public boolean isDropDownOpen() {
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.isMenuShown())
+ BreadcrumbItem item= fBreadcrumbItems.get(i);
+ if (item.isMenuShown()) {
return true;
+ }
}
return false;
@@ -209,9 +217,10 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
*/
public Shell getDropDownShell() {
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.isMenuShown())
+ BreadcrumbItem item= fBreadcrumbItems.get(i);
+ if (item.isMenuShown()) {
return item.getDropDownShell();
+ }
}
return null;
@@ -240,6 +249,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#assertContentProviderType(org.eclipse.jface.viewers.IContentProvider)
*/
+ @Override
protected void assertContentProviderType(IContentProvider provider) {
super.assertContentProviderType(provider);
Assert.isTrue(provider instanceof ITreePathContentProvider);
@@ -248,14 +258,17 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object, java.lang.Object)
*/
+ @Override
protected void inputChanged(final Object input, Object oldInput) {
- if (fContainer.isDisposed())
+ if (fContainer.isDisposed()) {
return;
+ }
disableRedraw();
try {
preservingSelection(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
buildItemChain(input);
}
});
@@ -267,12 +280,15 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
*/
+ @Override
protected Widget doFindInputItem(Object element) {
- if (element == null)
+ if (element == null) {
return null;
+ }
- if (element == getInput() || element.equals(getInput()))
+ if (element == getInput() || element.equals(getInput())) {
return doFindItem(element);
+ }
return null;
}
@@ -280,14 +296,17 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
*/
+ @Override
protected Widget doFindItem(Object element) {
- if (element == null)
+ if (element == null) {
return null;
+ }
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.getData() == element || element.equals(item.getData()))
+ BreadcrumbItem item= fBreadcrumbItems.get(i);
+ if (item.getData() == element || element.equals(item.getData())) {
return item;
+ }
}
return null;
@@ -296,6 +315,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#doUpdateItem(org.eclipse.swt.widgets.Widget, java.lang.Object, boolean)
*/
+ @Override
protected void doUpdateItem(Widget widget, Object element, boolean fullMap) {
myDoUpdateItem(widget, element, fullMap);
}
@@ -326,7 +346,8 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
* ITreeSelection.
* @return the current selection
*/
- public ISelection getSelection() {
+ @Override
+ public ISelection getSelection() {
Control control = getControl();
if (control == null || control.isDisposed()) {
return TreeSelection.EMPTY;
@@ -341,9 +362,9 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
}
protected TreePath getTreePathFromItem(BreadcrumbItem item) {
- List elements = new ArrayList(fBreadcrumbItems.size());
+ List<Object> elements = new ArrayList<Object>(fBreadcrumbItems.size());
for (int i = 0; i < fBreadcrumbItems.size(); i++) {
- elements.add( ((BreadcrumbItem)fBreadcrumbItems.get(i)).getData() );
+ elements.add( fBreadcrumbItems.get(i).getData() );
if (fBreadcrumbItems.get(i).equals(item)) {
return new TreePath(elements.toArray());
}
@@ -354,14 +375,17 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#getSelectionFromWidget()
*/
+ @Override
protected List getSelectionFromWidget() {
- if (fSelectedItem == null)
+ if (fSelectedItem == null) {
return Collections.EMPTY_LIST;
+ }
- if (fSelectedItem.getData() == null)
+ if (fSelectedItem.getData() == null) {
return Collections.EMPTY_LIST;
+ }
- ArrayList result= new ArrayList();
+ ArrayList<Object> result = new ArrayList<Object>();
result.add(fSelectedItem.getData());
return result;
}
@@ -369,6 +393,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object)
*/
+ @Override
protected void internalRefresh(Object element) {
disableRedraw();
@@ -378,7 +403,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
BreadcrumbItem item= (BreadcrumbItem) doFindItem(element);
if (item == null || element != null && element.equals(getInput())) {
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item1= (BreadcrumbItem) fBreadcrumbItems.get(i);
+ BreadcrumbItem item1= fBreadcrumbItems.get(i);
layoutChanged = refreshItem(item1) || layoutChanged;
}
} else {
@@ -397,14 +422,16 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
/*
* @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.util.List, boolean)
*/
+ @Override
protected void setSelectionToWidget(List l, boolean reveal) {
BreadcrumbItem focusItem= null;
// Unselect the currently selected items, and remember the focused item.
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (item.hasFocus())
+ BreadcrumbItem item= fBreadcrumbItems.get(i);
+ if (item.hasFocus()) {
focusItem= item;
+ }
item.setSelected(false);
}
@@ -415,7 +442,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
// Set the new selection to items.
fSelectedItem = null;
- for (Iterator iterator= l.iterator(); iterator.hasNext();) {
+ for (Iterator<Object> iterator = l.iterator(); iterator.hasNext();) {
Object element= iterator.next();
BreadcrumbItem item= (BreadcrumbItem) doFindItem(element);
if (item != null) {
@@ -440,8 +467,9 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
* @param item the item to select or <code>null</code>
*/
void selectItem(BreadcrumbItem item) {
- if (fSelectedItem != null)
+ if (fSelectedItem != null) {
fSelectedItem.setSelected(false);
+ }
fSelectedItem= item;
setSelectionToWidget(getSelection(), false);
@@ -466,7 +494,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
* @return the item ad the given <code>index</code>
*/
BreadcrumbItem getItem(int index) {
- return (BreadcrumbItem) fBreadcrumbItems.get(index);
+ return fBreadcrumbItems.get(index);
}
/**
@@ -477,9 +505,10 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
*/
int getIndexOfItem(BreadcrumbItem item) {
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem pItem= (BreadcrumbItem) fBreadcrumbItems.get(i);
- if (pItem == item)
+ BreadcrumbItem pItem= fBreadcrumbItems.get(i);
+ if (pItem == item) {
return i;
+ }
}
return -1;
@@ -527,27 +556,28 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
* one will be selected
*/
void doTraverse(boolean next) {
- if (fSelectedItem == null)
+ if (fSelectedItem == null) {
return;
+ }
int index= fBreadcrumbItems.indexOf(fSelectedItem);
if (next) {
if (index == fBreadcrumbItems.size() - 1) {
- BreadcrumbItem current= (BreadcrumbItem) fBreadcrumbItems.get(index);
+ BreadcrumbItem current= fBreadcrumbItems.get(index);
current.openDropDownMenu();
current.getDropDownShell().setFocus();
} else {
- BreadcrumbItem nextItem= (BreadcrumbItem) fBreadcrumbItems.get(index + 1);
+ BreadcrumbItem nextItem= fBreadcrumbItems.get(index + 1);
selectItem(nextItem);
}
} else {
if (index == 0) {
- BreadcrumbItem root= (BreadcrumbItem) fBreadcrumbItems.get(index);
+ BreadcrumbItem root= fBreadcrumbItems.get(index);
root.openDropDownMenu();
root.getDropDownShell().setFocus();
} else {
- selectItem((BreadcrumbItem) fBreadcrumbItems.get(index - 1));
+ selectItem(fBreadcrumbItems.get(index - 1));
}
}
}
@@ -558,7 +588,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
*/
private void buildItemChain(Object input) {
if (fBreadcrumbItems.size() > 0) {
- BreadcrumbItem last= (BreadcrumbItem) fBreadcrumbItems.get(fBreadcrumbItems.size() - 1);
+ BreadcrumbItem last= fBreadcrumbItems.get(fBreadcrumbItems.size() - 1);
last.setIsLastItem(false);
}
@@ -592,21 +622,22 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
BreadcrumbItem last = null;
if (index <= fBreadcrumbItems.size()) {
- last = ((BreadcrumbItem)fBreadcrumbItems.get(index - 1));
+ last = (fBreadcrumbItems.get(index - 1));
last.setIsLastItem(true);
}
while (index < fBreadcrumbItems.size()) {
updateLayout = true;
- BreadcrumbItem item= (BreadcrumbItem) fBreadcrumbItems.remove(fBreadcrumbItems.size() - 1);
+ BreadcrumbItem item= fBreadcrumbItems.remove(fBreadcrumbItems.size() - 1);
if (item.hasFocus() && last != null) {
last.setFocus(true);
}
if (item == fSelectedItem) {
selectItem(null);
}
- if (item.getData() != null)
+ if (item.getData() != null) {
unmapElement(item.getData());
+ }
item.dispose();
}
@@ -653,7 +684,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
private boolean updateOrCreateItem(int index, TreePath path, Object element) {
BreadcrumbItem item;
if (fBreadcrumbItems.size() > index) {
- item = (BreadcrumbItem)fBreadcrumbItems.get(index);
+ item = fBreadcrumbItems.get(index);
if (item.getData() != null) {
unmapElement(item.getData());
}
@@ -692,7 +723,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
if (currentWidth > width) {
int index= 0;
while (currentWidth > width && index < fBreadcrumbItems.size() - 1) {
- BreadcrumbItem viewer= (BreadcrumbItem) fBreadcrumbItems.get(index);
+ BreadcrumbItem viewer= fBreadcrumbItems.get(index);
if (viewer.isShowText()) {
viewer.setShowText(false);
currentWidth= getCurrentWidth();
@@ -707,7 +738,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
int index= fBreadcrumbItems.size() - 1;
while (currentWidth < width && index >= 0) {
- BreadcrumbItem viewer= (BreadcrumbItem) fBreadcrumbItems.get(index);
+ BreadcrumbItem viewer= fBreadcrumbItems.get(index);
if (!viewer.isShowText()) {
viewer.setShowText(true);
currentWidth= getCurrentWidth();
@@ -734,7 +765,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
private int getCurrentWidth() {
int result= 0;
for (int i= 0, size= fBreadcrumbItems.size(); i < size; i++) {
- BreadcrumbItem viewer= (BreadcrumbItem) fBreadcrumbItems.get(i);
+ BreadcrumbItem viewer= fBreadcrumbItems.get(i);
result+= viewer.getWidth();
}
@@ -745,8 +776,9 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
* Enables redrawing of the breadcrumb.
*/
private void enableRedraw() {
- if (IS_GTK) //flickers on GTK
+ if (IS_GTK) {
return;
+ }
fContainer.setRedraw(true);
}
@@ -759,8 +791,9 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
* </p>
*/
private void disableRedraw() {
- if (IS_GTK) //flickers on GTK
+ if (IS_GTK) {
return;
+ }
fContainer.setRedraw(false);
}
@@ -871,6 +904,7 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
*
* @since 3.7
*/
+ @Override
protected void handleDispose(DisposeEvent event) {
if (fGradientBackground != null) {
fGradientBackground.dispose();
@@ -878,14 +912,11 @@ public abstract class BreadcrumbViewer extends StructuredViewer {
}
if (fBreadcrumbItems != null) {
- Iterator iterator= fBreadcrumbItems.iterator();
- while (iterator.hasNext()) {
- BreadcrumbItem item= (BreadcrumbItem)iterator.next();
+ for (BreadcrumbItem item : fBreadcrumbItems) {
item.dispose();
}
}
super.handleDispose(event);
}
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
index ddd13cd96..365c5a400 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/breadcrumb/TreeViewerDropDown.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 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
@@ -84,7 +84,8 @@ public abstract class TreeViewerDropDown {
fDropDownViewer= createTreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL, path);
fDropDownViewer.addOpenListener(new IOpenListener() {
- public void open(OpenEvent event) {
+ @Override
+ public void open(OpenEvent event) {
if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) {
DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()$treeViewer>open"); //$NON-NLS-1$
}
@@ -95,24 +96,30 @@ public abstract class TreeViewerDropDown {
final Tree tree = fDropDownViewer.getTree();
tree.addMouseListener(new MouseListener() {
- public void mouseUp(MouseEvent e) {
+ @Override
+ public void mouseUp(MouseEvent e) {
if (DebugUIPlugin.DEBUG_TREE_VIEWER_DROPDOWN) {
DebugUIPlugin.trace("BreadcrumbItemDropDown.showMenu()$treeViewer>mouseUp"); //$NON-NLS-1$
}
- if (e.button != 1)
- return;
+ if (e.button != 1) {
+ return;
+ }
- if ((OpenStrategy.getOpenMethod() & OpenStrategy.SINGLE_CLICK) != 0)
- return;
+ if ((OpenStrategy.getOpenMethod() & OpenStrategy.SINGLE_CLICK) != 0) {
+ return;
+ }
TreeItem item= tree.getItem(new Point(e.x, e.y));
- if (item == null)
- return;
+ if (item == null) {
+ return;
+ }
- List pathElements = new LinkedList();
+ List<Object> pathElements = new LinkedList<Object>();
while(item != null) {
Object data = item.getData();
- if (data == null) return;
+ if (data == null) {
+ return;
+ }
pathElements.add(0, data);
item = item.getParentItem();
}
@@ -120,10 +127,12 @@ public abstract class TreeViewerDropDown {
openElement(new TreeSelection(new TreePath(pathElements.toArray())));
}
- public void mouseDown(MouseEvent e) {
+ @Override
+ public void mouseDown(MouseEvent e) {
}
- public void mouseDoubleClick(MouseEvent e) {
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
}
});
@@ -131,7 +140,8 @@ public abstract class TreeViewerDropDown {
TreeItem fLastItem= null;
long fLastScrollTime = 0;
- public void mouseMove(MouseEvent e) {
+ @Override
+ public void mouseMove(MouseEvent e) {
if (tree.equals(e.getSource())) {
Object o= tree.getItem(new Point(e.x, e.y));
if (fLastItem == null ^ o == null) {
@@ -149,8 +159,9 @@ public abstract class TreeViewerDropDown {
// Scroll up
if (currentItem.getParentItem() == null) {
int index= tree.indexOf((TreeItem) o);
- if (index < 1)
- return;
+ if (index < 1) {
+ return;
+ }
fLastItem= tree.getItem(index - 1);
tree.setSelection(new TreeItem[] { fLastItem });
@@ -167,8 +178,9 @@ public abstract class TreeViewerDropDown {
// Scroll down
if (currentItem.getParentItem() == null) {
int index= tree.indexOf((TreeItem) o);
- if (index >= tree.getItemCount() - 1)
- return;
+ if (index >= tree.getItemCount() - 1) {
+ return;
+ }
fLastItem= tree.getItem(index + 1);
tree.setSelection(new TreeItem[] { fLastItem });
@@ -191,7 +203,8 @@ public abstract class TreeViewerDropDown {
});
tree.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
+ @Override
+ public void keyPressed(KeyEvent e) {
if (e.keyCode == SWT.ARROW_UP) {
// No elements in the tree (bug 262961).
if (tree.getItemCount() == 0) {
@@ -200,30 +213,36 @@ public abstract class TreeViewerDropDown {
}
TreeItem[] selection= tree.getSelection();
- if (selection.length != 1)
- return;
+ if (selection.length != 1) {
+ return;
+ }
int selectionIndex= tree.indexOf(selection[0]);
- if (selectionIndex != 0)
- return;
+ if (selectionIndex != 0) {
+ return;
+ }
fDropDownSite.close();
}
}
- public void keyReleased(KeyEvent e) {
+ @Override
+ public void keyReleased(KeyEvent e) {
}
});
fDropDownViewer.addTreeListener(new ITreeViewerListener() {
- public void treeCollapsed(TreeExpansionEvent event) {
+ @Override
+ public void treeCollapsed(TreeExpansionEvent event) {
}
- public void treeExpanded(TreeExpansionEvent event) {
+ @Override
+ public void treeExpanded(TreeExpansionEvent event) {
tree.setRedraw(false);
new UIJob(tree.getDisplay(), IInternalDebugCoreConstants.EMPTY_STRING) {
{ setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
if (!tree.isDisposed()) {
try {
fDropDownSite.updateSize();
@@ -260,8 +279,9 @@ public abstract class TreeViewerDropDown {
* @param selection The selection to open.
*/
protected void openElement(ISelection selection) {
- if (selection == null || !(selection instanceof ITreeSelection) || selection.isEmpty())
- return;
+ if (selection == null || !(selection instanceof ITreeSelection) || selection.isEmpty()) {
+ return;
+ }
// This might or might not open an editor
fDropDownSite.notifySelection(selection);
@@ -276,8 +296,9 @@ public abstract class TreeViewerDropDown {
DebugUIPlugin.trace(" tree hasFocus: " + treeHasFocus); //$NON-NLS-1$
}
- if (tree.isDisposed())
- return;
+ if (tree.isDisposed()) {
+ return;
+ }
if (!treeHasFocus) {
fDropDownSite.close();
@@ -289,9 +310,9 @@ public abstract class TreeViewerDropDown {
private void toggleExpansionState(TreePath path) {
Tree tree= fDropDownViewer.getTree();
- if (fDropDownViewer.getExpandedState(path))
- fDropDownViewer.collapseToLevel(path, 1);
- else {
+ if (fDropDownViewer.getExpandedState(path)) {
+ fDropDownViewer.collapseToLevel(path, 1);
+ } else {
tree.setRedraw(false);
try {
fDropDownViewer.expandToLevel(path, 1);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
index eace53efe..4b1cf136e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenCountUpdate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,7 +34,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
* Other child count updates for the same content provider. Coalesced requests are
* batched together into an array.
*/
- private List fBatchedRequests = null;
+ private List<ViewerUpdateMonitor> fBatchedRequests = null;
/**
* Flag whether filtering is enabled in viewer. If filtering is enabled, then a
@@ -68,6 +68,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
fFilteredChildren = provider.getFilteredChildren(elementPath);
}
+ @Override
public synchronized void cancel() {
if (fChildrenUpdate != null) {
fChildrenUpdate.cancel();
@@ -75,6 +76,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
super.cancel();
}
+ @Override
protected synchronized void scheduleViewerUpdate() {
// If filtering is enabled perform child update on all children in order to update
// viewer filters.
@@ -92,14 +94,17 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
}
fChildrenUpdate = new ChildrenUpdate(getContentProvider(), getViewerInput(), getElementPath(), getElement(), startIdx, count, getElementContentProvider()) {
- protected void performUpdate() {
+ @Override
+ protected void performUpdate() {
performUpdate(true);
ChildrenCountUpdate.super.scheduleViewerUpdate();
}
- protected void scheduleViewerUpdate() {
+ @Override
+ protected void scheduleViewerUpdate() {
execInDisplayThread(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (!getContentProvider().isDisposed() && !isCanceled()) {
performUpdate();
}
@@ -108,7 +113,8 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
}
};
execInDisplayThread(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
fChildrenUpdate.startRequest();
}
});
@@ -123,6 +129,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ViewerUpdateMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
int viewCount = fCount;
TreePath elementPath = getElementPath();
@@ -145,10 +152,12 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
getContentProvider().getStateTracker().restorePendingStateOnUpdate(getElementPath(), -1, true, true, false);
}
+ @Override
public void setChildCount(int numChildren) {
fCount = numChildren;
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("IChildrenCountUpdate: "); //$NON-NLS-1$
@@ -159,6 +168,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
*/
+ @Override
boolean coalesce(ViewerUpdateMonitor request) {
if (request instanceof ChildrenCountUpdate) {
if (getElementPath().equals(request.getElementPath())) {
@@ -166,7 +176,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
return true;
} else if (getElementContentProvider().equals(request.getElementContentProvider())) {
if (fBatchedRequests == null) {
- fBatchedRequests = new ArrayList(4);
+ fBatchedRequests = new ArrayList<ViewerUpdateMonitor>(4);
fBatchedRequests.add(this);
}
fBatchedRequests.add(request);
@@ -179,11 +189,12 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
*/
+ @Override
void startRequest() {
if (fBatchedRequests == null) {
getElementContentProvider().update(new IChildrenCountUpdate[]{this});
} else {
- IChildrenCountUpdate[] updates = (IChildrenCountUpdate[]) fBatchedRequests.toArray(new IChildrenCountUpdate[fBatchedRequests.size()]);
+ IChildrenCountUpdate[] updates = fBatchedRequests.toArray(new IChildrenCountUpdate[fBatchedRequests.size()]);
// notify that the other updates have also started to ensure correct sequence
// of model updates - **** start at index 1 since the first (0) update has
// already notified the content provider that it has started.
@@ -194,12 +205,13 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
}
}
+ @Override
boolean containsUpdate(TreePath path) {
if (getElementPath().equals(path)) {
return true;
} else if (fBatchedRequests != null) {
for (int i = 0; i < fBatchedRequests.size(); i++) {
- if (((ViewerUpdateMonitor)fBatchedRequests.get(i)).getElementPath().equals(path)) {
+ if (fBatchedRequests.get(i).getElementPath().equals(path)) {
return true;
}
}
@@ -210,6 +222,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getPriority()
*/
+ @Override
int getPriority() {
return 2;
}
@@ -217,6 +230,7 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
*/
+ @Override
TreePath getSchedulingPath() {
TreePath path = getElementPath();
if (path.getSegmentCount() > 0) {
@@ -229,14 +243,16 @@ class ChildrenCountUpdate extends ViewerUpdateMonitor implements IChildrenCountU
return fCount;
}
- protected boolean doEquals(ViewerUpdateMonitor update) {
+ @Override
+ protected boolean doEquals(ViewerUpdateMonitor update) {
return
update instanceof ChildrenCountUpdate &&
getViewerInput().equals(update.getViewerInput()) &&
getElementPath().equals(update.getElementPath());
}
- protected int doHashCode() {
+ @Override
+ protected int doHashCode() {
return getClass().hashCode() + getViewerInput().hashCode() + getElementPath().hashCode();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
index 0020eaf7d..db71f4c80 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ChildrenUpdate.java
@@ -109,6 +109,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
*
* @see org.eclipse.debug.ui.viewers.AsynchronousRequestMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
performUpdate(false);
}
@@ -116,6 +117,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#setChild(java.lang.Object, int)
*/
+ @Override
public void setChild(Object child, int index) {
if (fElements == null) {
fElements = new Object[fLength];
@@ -129,6 +131,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
*
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
*/
+ @Override
public synchronized boolean coalesce(ViewerUpdateMonitor request) {
if (request instanceof ChildrenUpdate) {
ChildrenUpdate cu = (ChildrenUpdate) request;
@@ -151,6 +154,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
return false;
}
+ @Override
boolean containsUpdate(TreePath path) {
return getElementPath().equals(path);
}
@@ -160,6 +164,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getLength()
*/
+ @Override
public int getLength() {
return fLength;
}
@@ -167,6 +172,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate#getOffset()
*/
+ @Override
public int getOffset() {
return fIndex;
}
@@ -174,10 +180,12 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
*/
+ @Override
void startRequest() {
getElementContentProvider().update(new IChildrenUpdate[]{this});
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("IChildrenUpdate: "); //$NON-NLS-1$
@@ -193,6 +201,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getPriority()
*/
+ @Override
int getPriority() {
return 3;
}
@@ -200,6 +209,7 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
*/
+ @Override
TreePath getSchedulingPath() {
return getElementPath();
}
@@ -218,7 +228,8 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
return fElements;
}
- protected boolean doEquals(ViewerUpdateMonitor update) {
+ @Override
+ protected boolean doEquals(ViewerUpdateMonitor update) {
return
update instanceof ChildrenUpdate &&
((ChildrenUpdate)update).getOffset() == getOffset() &&
@@ -227,7 +238,8 @@ public class ChildrenUpdate extends ViewerUpdateMonitor implements IChildrenUpda
getElementPath().equals(update.getElementPath());
}
- protected int doHashCode() {
+ @Override
+ protected int doHashCode() {
return (int)Math.pow(
(getClass().hashCode() + getViewerInput().hashCode() + getElementPath().hashCode()) * (getOffset() + 2),
getLength() + 2);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
index ee9922504..592b73664 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementCompareRequest.java
@@ -60,6 +60,7 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest#setEqual(boolean)
*/
+ @Override
public void setEqual(boolean equal) {
fEqual = equal;
}
@@ -67,6 +68,7 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
+ @Override
public void done() {
ITreeModelViewer viewer = getContentProvider().getViewer();
if (viewer == null) return; // disposed
@@ -74,7 +76,8 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
fProvider.getStateTracker().compareFinished(ElementCompareRequest.this, fDelta);
} else {
viewer.getDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (getContentProvider().isDisposed()) return;
fProvider.getStateTracker().compareFinished(ElementCompareRequest.this, fDelta);
}
@@ -119,7 +122,8 @@ public class ElementCompareRequest extends MementoUpdate implements IElementComp
return fCheckChildrenRealized;
}
- public String toString() {
+ @Override
+ public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("IElementCompareRequest: "); //$NON-NLS-1$
buf.append(getElement());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
index 1a706ce9c..6351fc3a4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ElementMementoRequest.java
@@ -45,6 +45,7 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
+ @Override
public void done() {
ITreeModelViewer viewer = getContentProvider().getViewer();
@@ -53,7 +54,8 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
doComplete();
} else {
viewer.getDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
doComplete();
}
});
@@ -71,6 +73,7 @@ class ElementMementoRequest extends MementoUpdate implements IElementMementoRequ
fManager.requestComplete(ElementMementoRequest.this);
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("IElementMementoRequest: "); //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
index 22450539b..af91ff4ea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/FilterTransform.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -38,7 +38,8 @@ public class FilterTransform {
class Node {
private int[] filteredIndexes = null;
private Object[] filteredElements = null;
- private Map children = null; // only set for parent nodes, indexed by child
+ private Map<Object, Node> children = null; // only set for parent nodes,
+ // indexed by child
Node() {
}
@@ -81,10 +82,10 @@ public class FilterTransform {
}
if (children == null) {
- children = new HashMap();
+ children = new HashMap<Object, Node>();
}
Object element = path.getSegment(pathIndex);
- Node node = (Node) children.get(element);
+ Node node = children.get(element);
if (node == null) {
node = new Node();
children.put(element, node);
@@ -100,7 +101,7 @@ public class FilterTransform {
return false;
}
Object child = path.getSegment(pathIndex);
- Node node = (Node) children.get(child);
+ Node node = children.get(child);
if (node != null) {
if (node.clear(path, pathIndex + 1)) {
children.remove(child);
@@ -146,7 +147,7 @@ public class FilterTransform {
return false;
}
Object element = path.getSegment(pathIndex);
- Node node = (Node) children.get(element);
+ Node node = children.get(element);
if (node == null) {
return false;
}
@@ -160,13 +161,14 @@ public class FilterTransform {
}
Node find(TreePath path, int pathIndex) {
- if (pathIndex == path.getSegmentCount())
+ if (pathIndex == path.getSegmentCount()) {
return this;
+ }
if (children == null) {
return null;
}
Object child = path.getSegment(pathIndex);
- Node node = (Node) children.get(child);
+ Node node = children.get(child);
if (node != null) {
return node.find(path, pathIndex + 1);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
index 942b0b82b..d16ba7b2c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/HasChildrenUpdate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,7 +27,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
private boolean fHasChildren = false;
- private List fBatchedRequests = null;
+ private List<ViewerUpdateMonitor> fBatchedRequests = null;
/**
* Constructs a request to update an element
@@ -45,6 +45,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.ViewerUpdateMonitor#performUpdate()
*/
+ @Override
protected void performUpdate() {
TreeModelContentProvider contentProvider = getContentProvider();
TreePath elementPath = getElementPath();
@@ -62,10 +63,12 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
}
}
+ @Override
public void setHasChilren(boolean hasChildren) {
fHasChildren = hasChildren;
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("IHasChildrenUpdate: "); //$NON-NLS-1$
@@ -76,6 +79,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#coalesce(org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor)
*/
+ @Override
boolean coalesce(ViewerUpdateMonitor request) {
if (request instanceof HasChildrenUpdate) {
if (getElementPath().equals(request.getElementPath())) {
@@ -83,7 +87,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
return true;
} else if (getElementContentProvider().equals(request.getElementContentProvider())) {
if (fBatchedRequests == null) {
- fBatchedRequests = new ArrayList();
+ fBatchedRequests = new ArrayList<ViewerUpdateMonitor>();
fBatchedRequests.add(this);
}
fBatchedRequests.add(request);
@@ -96,11 +100,12 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#startRequest()
*/
+ @Override
void startRequest() {
if (fBatchedRequests == null) {
getElementContentProvider().update(new IHasChildrenUpdate[]{this});
} else {
- IHasChildrenUpdate[] updates = (IHasChildrenUpdate[]) fBatchedRequests.toArray(new IHasChildrenUpdate[fBatchedRequests.size()]);
+ IHasChildrenUpdate[] updates = fBatchedRequests.toArray(new IHasChildrenUpdate[fBatchedRequests.size()]);
// notify that the other updates have also started to ensure correct sequence
// of model updates - **** start at index 1 since the first (0) update has
// already notified the content provider that it has started.
@@ -111,12 +116,13 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
}
}
+ @Override
boolean containsUpdate(TreePath path) {
if (getElementPath().equals(path)) {
return true;
} else if (fBatchedRequests != null) {
for (int i = 0; i < fBatchedRequests.size(); i++) {
- if (((ViewerUpdateMonitor)fBatchedRequests.get(i)).getElementPath().equals(path)) {
+ if (fBatchedRequests.get(i).getElementPath().equals(path)) {
return true;
}
}
@@ -128,6 +134,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getPriority()
*/
+ @Override
int getPriority() {
return 1;
}
@@ -135,6 +142,7 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ViewerUpdateMonitor#getSchedulingPath()
*/
+ @Override
TreePath getSchedulingPath() {
TreePath path = getElementPath();
if (path.getSegmentCount() > 0) {
@@ -147,14 +155,16 @@ class HasChildrenUpdate extends ViewerUpdateMonitor implements IHasChildrenUpdat
return fHasChildren;
}
- protected boolean doEquals(ViewerUpdateMonitor update) {
+ @Override
+ protected boolean doEquals(ViewerUpdateMonitor update) {
return
update instanceof HasChildrenUpdate &&
getViewerInput().equals(update.getViewerInput()) &&
getElementPath().equals(update.getElementPath());
}
- protected int doHashCode() {
+ @Override
+ protected int doHashCode() {
return getClass().hashCode() + getViewerInput().hashCode() + getElementPath().hashCode();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java
index a0ed967ea..9aa4c1f62 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/IInternalTreeModelViewer.java
@@ -35,7 +35,8 @@ public interface IInternalTreeModelViewer extends ITreeModelViewer {
* @return an array of viewer filters
* @see org.eclipse.jface.viewers.StructuredViewer#setFilters(ViewerFilter[])
*/
- public ViewerFilter[] getFilters();
+ @Override
+ public ViewerFilter[] getFilters();
/**
* Reveals the given element in the viewer.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
index e85d818fa..8d064cb27 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ITreeModelViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -17,6 +18,7 @@ package org.eclipse.debug.internal.ui.viewers.model;
*
* @deprecated This internal interface was replaced by {@link org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer}.
*/
+@Deprecated
public interface ITreeModelViewer extends org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
index 829ae860e..cbd39c940 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalTreeModelViewer.java
@@ -15,7 +15,6 @@ package org.eclipse.debug.internal.ui.viewers.model;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
@@ -76,6 +75,7 @@ import org.eclipse.ui.IMemento;
*
* @since 3.3
*/
+@SuppressWarnings("deprecation")
public class InternalTreeModelViewer extends TreeViewer implements IInternalTreeModelViewer, org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer
{
@@ -90,25 +90,25 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* Map of columns presentation id to its visible columns id's (String[])
* When a columns presentation is not in the map, default settings are used.
*/
- private final Map fVisibleColumns = new HashMap();
+ private final Map<String, String[]> fVisibleColumns = new HashMap<String, String[]>();
/**
* Map of column id's to persisted sizes
*/
- private final Map fColumnSizes = new HashMap();
+ private final Map<Object, Integer> fColumnSizes = new HashMap<Object, Integer>();
/**
* Map of column presentation id's to an array of integers representing the column order
* for that presentation, or <code>null</code> if default.
*/
- private final Map fColumnOrder = new HashMap();
+ private final Map<String, int[]> fColumnOrder = new HashMap<String, int[]>();
/**
* Map of column presentation id to whether columns should be displayed
* for that presentation (the user can toggle columns on/off when a
* presentation is optional.
*/
- private final Map fShowColumns = new HashMap();
+ private final Map<String, Boolean> fShowColumns = new HashMap<String, Boolean>();
/**
* Item's tree path cache
@@ -163,6 +163,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.swt.events.ControlListener#controlMoved(org.eclipse.swt.events.ControlEvent)
*/
+ @Override
public void controlMoved(ControlEvent e) {
persistColumnOrder();
}
@@ -170,6 +171,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.swt.events.ControlListener#controlResized(org.eclipse.swt.events.ControlEvent)
*/
+ @Override
public void controlResized(ControlEvent e) {
persistColumnSizes();
}
@@ -187,6 +189,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean canModify(Object element, String property) {
IElementEditor editor = ViewerAdapterService.getElementEditor(element);
if (editor != null) {
@@ -213,6 +216,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object, java.lang.String)
*/
+ @Override
public Object getValue(Object element, String property) {
if (fModifier != null) {
return fModifier.getValue(element, property);
@@ -223,6 +227,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object, java.lang.String, java.lang.Object)
*/
+ @Override
public void modify(Object element, String property, Object value) {
if (fModifier != null) {
if (element instanceof Item) {
@@ -311,9 +316,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @see org.eclipse.jface.viewers.TreeViewer#hookControl(org.eclipse.swt.widgets.Control)
*/
+ @Override
protected void hookControl(Control control) {
Tree treeControl = (Tree) control;
treeControl.addListener(SWT.SetData, new Listener() {
+ @Override
public void handleEvent(Event event) {
// to avoid flash, reset previous label data
TreeItem item = (TreeItem) event.item;
@@ -375,6 +382,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* Override the default handler for invalid selection to allow model
* selection policy to select the new selection.
*/
+ @Override
protected void handleInvalidSelection(ISelection selection, ISelection newSelection) {
IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(selection, getPresentationContext());
if (selectionPolicy != null) {
@@ -399,6 +407,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ContentViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
*/
+ @Override
protected void handleDispose(DisposeEvent event) {
if (fColumnPresentation != null) {
fColumnPresentation.dispose();
@@ -413,10 +422,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @return presentation context
*/
+ @Override
public IPresentationContext getPresentationContext() {
return fContext;
}
+ @Override
protected void unmapElement(Object element, Widget widget) {
if (fNotifyUnmap) {
// TODO: should we update the filter with the "new non-identical element"?
@@ -425,6 +436,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
super.unmapElement(element, widget);
}
+ @Override
protected void associate(Object element, Item item) {
// see AbstractTreeViewer.associate(...)
Object data = item.getData();
@@ -448,6 +460,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @see org.eclipse.jface.viewers.TreeViewer#mapElement(java.lang.Object, org.eclipse.swt.widgets.Widget)
*/
+ @Override
protected void mapElement(Object element, Widget widget) {
super.mapElement(element, widget);
if (widget instanceof Item) {
@@ -463,6 +476,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @see org.eclipse.jface.viewers.AbstractTreeViewer#insert(java.lang.Object, java.lang.Object, int)
*/
+ @Override
public void insert(Object parentElementOrTreePath, Object element, int position) {
try {
fInserting = true;
@@ -478,6 +492,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @see org.eclipse.jface.viewers.StructuredViewer#hasFilters()
*/
+ @Override
protected boolean hasFilters() {
if (fInserting) {
return false;
@@ -485,6 +500,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return super.hasFilters();
}
+ @Override
protected void unmapAllElements() {
// Do nothing when called from StructuredViewer.setInput(), to avoid
// clearing elements before viewer state is saved.
@@ -497,6 +513,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object, java.lang.Object)
*/
+ @Override
protected void inputChanged(Object input, Object oldInput) {
fCellModifier.clear();
// Clear items map now that ITreeModelContentProvider.inputChanged() was already called.
@@ -626,6 +643,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
+ @Override
protected void internalRefresh(Object element, boolean updateLabels) {
ITreeModelContentProvider contentProvider = (ITreeModelContentProvider)getContentProvider();
@@ -677,7 +695,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
protected boolean isShowColumns(String columnPresentationId) {
- Boolean bool = (Boolean) fShowColumns.get(columnPresentationId);
+ Boolean bool = fShowColumns.get(columnPresentationId);
if (bool == null) {
return true;
}
@@ -719,7 +737,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
column.setData(id);
}
- int[] order = (int[]) fColumnOrder.get(presentation.getId());
+ int[] order = fColumnOrder.get(presentation.getId());
if (order != null) {
tree.setColumnOrder(order);
}
@@ -744,7 +762,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
if (avg == 0) {
tree.addPaintListener(new PaintListener() {
- public void paintControl(PaintEvent e) {
+ @Override
+ public void paintControl(PaintEvent e) {
Tree tree2 = getTree();
String[] visibleColumns = getVisibleColumns();
if (visibleColumns != null) {
@@ -766,7 +785,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
TreeColumn treeColumn = columns[i];
Object colData = treeColumn.getData();
String columnId = colData instanceof String ? (String) colData : null;
- Integer width = (Integer) fColumnSizes.get(colData);
+ Integer width = fColumnSizes.get(colData);
if (width == null) {
int ans = getInitialColumnWidth(columnId, treeWidgetWidth, visibleColumnIds);
if (ans == -1) {
@@ -797,11 +816,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @return visible columns or <code>null</code>
*/
+ @Override
public String[] getVisibleColumns() {
if (isShowColumns()) {
IColumnPresentation presentation = getColumnPresentation();
if (presentation != null) {
- String[] columns = (String[]) fVisibleColumns.get(presentation.getId());
+ String[] columns = fVisibleColumns.get(presentation.getId());
if (columns == null) {
return presentation.getInitialColumns();
} else {
@@ -892,28 +912,22 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*/
public void saveState(IMemento memento) {
if (!fColumnSizes.isEmpty()) {
- Iterator iterator = fColumnSizes.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
+ for (Entry<Object, Integer> entry : fColumnSizes.entrySet()) {
IMemento sizes = memento.createChild(COLUMN_SIZES, (String)entry.getKey());
- sizes.putInteger(SIZE, ((Integer)entry.getValue()).intValue());
+ sizes.putInteger(SIZE, entry.getValue().intValue());
}
}
if (!fShowColumns.isEmpty()) {
- Iterator iterator = fShowColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- IMemento sizes = memento.createChild(SHOW_COLUMNS, (String)entry.getKey());
- sizes.putString(SHOW_COLUMNS, ((Boolean)entry.getValue()).toString());
+ for (Entry<String, Boolean> entry : fShowColumns.entrySet()) {
+ IMemento sizes = memento.createChild(SHOW_COLUMNS, entry.getKey());
+ sizes.putString(SHOW_COLUMNS, entry.getValue().toString());
}
}
if (!fVisibleColumns.isEmpty()) {
- Iterator iterator = fVisibleColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- String id = (String) entry.getKey();
+ for (Entry<String, String[]> entry : fVisibleColumns.entrySet()) {
+ String id = entry.getKey();
IMemento visible = memento.createChild(VISIBLE_COLUMNS, id);
- String[] columns = (String[]) entry.getValue();
+ String[] columns = entry.getValue();
visible.putInteger(SIZE, columns.length);
for (int i = 0; i < columns.length; i++) {
visible.putString(COLUMN+Integer.toString(i), columns[i]);
@@ -921,12 +935,10 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
if (!fColumnOrder.isEmpty()) {
- Iterator iterator = fColumnOrder.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- String id = (String) entry.getKey();
+ for (Entry<String, int[]> entry : fColumnOrder.entrySet()) {
+ String id = entry.getKey();
IMemento orderMemento = memento.createChild(COLUMN_ORDER, id);
- int[] order = (int[]) entry.getValue();
+ int[] order = entry.getValue();
orderMemento.putInteger(SIZE, order.length);
for (int i = 0; i < order.length; i++) {
orderMemento.putInteger(COLUMN+Integer.toString(i), order[i]);
@@ -1010,6 +1022,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* @param candidate the candidate for the new selection
* @return if the current selection should be replaced with the candidate selection
*/
+ @Override
public boolean overrideSelection(ISelection current, ISelection candidate) {
IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(current, getPresentationContext());
if (selectionPolicy == null) {
@@ -1027,6 +1040,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @see org.eclipse.jface.viewers.StructuredViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
*/
+ @Override
public void setSelection(ISelection selection, boolean reveal) {
if (!overrideSelection(getSelection(), selection)) {
return;
@@ -1038,6 +1052,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
+ @Override
public void setSelection(ISelection selection, boolean reveal, boolean force) {
trySelection(selection, reveal, force);
}
@@ -1045,6 +1060,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#trySelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
+ @Override
public boolean trySelection(ISelection selection, boolean reveal, boolean force) {
if (force || overrideSelection(getSelection(), selection)) {
super.setSelection(selection, reveal);
@@ -1057,6 +1073,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @param listener listener
*/
+ @Override
public void addViewerUpdateListener(IViewerUpdateListener listener) {
((ITreeModelContentProvider)getContentProvider()).addViewerUpdateListener(listener);
}
@@ -1066,6 +1083,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @param listener listener
*/
+ @Override
public void removeViewerUpdateListener(IViewerUpdateListener listener) {
ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
if (cp != null) {
@@ -1078,6 +1096,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @param listener model delta listener
*/
+ @Override
public void addModelChangedListener(IModelChangedListener listener) {
((ITreeModelContentProvider)getContentProvider()).addModelChangedListener(listener);
}
@@ -1087,6 +1106,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @param listener model delta listener
*/
+ @Override
public void removeModelChangedListener(IModelChangedListener listener) {
ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
if (cp != null) {
@@ -1094,11 +1114,13 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- public void addStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void addStateUpdateListener(IStateUpdateListener listener) {
((ITreeModelContentProvider)getContentProvider()).addStateUpdateListener(listener);
}
- public void removeStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void removeStateUpdateListener(IStateUpdateListener listener) {
ITreeModelContentProvider cp = (ITreeModelContentProvider)getContentProvider();
if (cp != null) {
cp.removeStateUpdateListener(listener);
@@ -1108,6 +1130,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/*
* (non-Javadoc) Method declared in AbstractTreeViewer.
*/
+ @Override
protected void doUpdateItem(final Item item, Object element) {
if (!(item instanceof TreeItem)) {
return;
@@ -1132,10 +1155,12 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
+ @Override
public void addLabelUpdateListener(ILabelUpdateListener listener) {
((ITreeModelLabelProvider)getLabelProvider()).addLabelUpdateListener(listener);
}
+ @Override
public void removeLabelUpdateListener(ILabelUpdateListener listener) {
if (!getControl().isDisposed()) {
((ITreeModelLabelProvider)getLabelProvider()).removeLabelUpdateListener(listener);
@@ -1165,6 +1190,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return null;
}
+ @Override
public Item[] getChildren(Widget widget) {
return super.getChildren(widget);
}
@@ -1174,6 +1200,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* @param item the item to compute the {@link TreePath} for
* @return {@link TreePath}
*/
+ @Override
protected TreePath getTreePathFromItem(Item item) {
return super.getTreePathFromItem(item);
}
@@ -1190,6 +1217,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRefreshStruct(org.eclipse.swt.widgets.Widget,
* java.lang.Object, boolean)
*/
+ @Override
protected void internalRefreshStruct(Widget widget, Object element,
boolean updateLabels) {
// clear all starting with the given widget
@@ -1298,7 +1326,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
//**************************************************************************
// Another couple of methods copied from TreeViewer to workaround the UI bug 266189.
//
- protected void createChildren(Widget widget) {
+ @Override
+ protected void createChildren(Widget widget) {
Object element = widget.getData();
if (element == null && widget instanceof TreeItem) {
// parent has not been materialized
@@ -1349,6 +1378,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
*
* @param elementPath tree path to element to consider for expansion
*/
+ @Override
public void autoExpand(TreePath elementPath) {
int level = getAutoExpandLevel();
if (level > 0 || level == ITreeModelViewer.ALL_LEVELS) {
@@ -1358,7 +1388,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- public int findElementIndex(TreePath parentPath, Object element) {
+ @Override
+ public int findElementIndex(TreePath parentPath, Object element) {
Widget parentItem = findItem(parentPath);
if (parentItem != null) {
Item[] children = getChildren(parentItem);
@@ -1373,7 +1404,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return -1;
}
- public boolean getElementChildrenRealized(TreePath parentPath) {
+ @Override
+ public boolean getElementChildrenRealized(TreePath parentPath) {
Widget parentItem = findItem(parentPath);
if (parentItem != null) {
Item[] children = getChildren(parentItem);
@@ -1386,7 +1418,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return true;
}
- public Display getDisplay() {
+ @Override
+ public Display getDisplay() {
Control control = getControl();
if (control != null) {
return control.getDisplay();
@@ -1396,7 +1429,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
protected static final String[] STATE_PROPERTIES = new String[]{ IBasicPropertyConstants.P_TEXT, IBasicPropertyConstants.P_IMAGE };
- public void update(Object element) {
+ @Override
+ public void update(Object element) {
update(element, STATE_PROPERTIES);
}
@@ -1412,7 +1446,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
static String PREV_CHECKED_KEY = "PREV_CHECKED_KEY"; //$NON-NLS-1$
static String PREV_GRAYED_KEY = "PREV_GRAYED_KEY"; //$NON-NLS-1$
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] imageDescriptors,
+ @Override
+ public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] imageDescriptors,
FontData[] fontDatas, RGB[] _foregrounds, RGB[] _backgrounds)
{
Widget widget = findItem(path);
@@ -1512,7 +1547,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
+ @Override
+ public ViewerLabel getElementLabel(TreePath path, String columnId) {
if (path.getSegmentCount() == 0) {
return null;
}
@@ -1545,7 +1581,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return null;
}
- public void reveal(TreePath path, int index) {
+ @Override
+ public void reveal(TreePath path, int index) {
Widget item = findItem(path);
TreeItem[] children = null;
if (item instanceof TreeItem) {
@@ -1558,7 +1595,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- public int getChildCount(TreePath path) {
+ @Override
+ public int getChildCount(TreePath path) {
if (path.getSegmentCount() == 0) {
return ((Tree)getControl()).getItemCount();
} else {
@@ -1572,7 +1610,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return -1;
}
- public Object getChildElement(TreePath path, int index) {
+ @Override
+ public Object getChildElement(TreePath path, int index) {
TreeItem childItem = null;
if (path.getSegmentCount() == 0) {
Tree tree = (Tree)getControl();
@@ -1595,7 +1634,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return null;
}
- public TreePath getTopElementPath() {
+ @Override
+ public TreePath getTopElementPath() {
TreeItem topItem = ((Tree)getControl()).getTopItem();
if (topItem != null && topItem.getData() != null) {
return getTreePathFromItem(topItem);
@@ -1603,10 +1643,11 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return null;
}
- public boolean saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
+ @Override
+ public boolean saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
Tree tree = (Tree) getControl();
TreeItem[] selection = tree.getSelection();
- Set set = new HashSet();
+ Set<TreeItem> set = new HashSet<TreeItem>();
for (int i = 0; i < selection.length; i++) {
set.add(selection[i]);
}
@@ -1647,7 +1688,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- private void doSaveElementState(TreePath parentPath, ModelDelta delta, TreeItem item, Collection set, int index, int flagsToSave) {
+ private void doSaveElementState(TreePath parentPath, ModelDelta delta, TreeItem item, Collection<TreeItem> set, int index, int flagsToSave) {
Object element = item.getData();
if (element != null) {
boolean expanded = item.getExpanded();
@@ -1681,7 +1722,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- public void updateViewer(IModelDelta delta) {
+ @Override
+ public void updateViewer(IModelDelta delta) {
((ITreeModelContentProvider)getContentProvider()).updateModel(delta, ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS);
}
@@ -1689,6 +1731,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelCheckProvider#setElementChecked(org.eclipse.jface.viewers.TreePath, boolean, boolean)
*/
+ @Override
public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
Widget widget = findItem(path);
@@ -1703,7 +1746,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
- public boolean getElementChecked(TreePath path) {
+ @Override
+ public boolean getElementChecked(TreePath path) {
Widget widget = findItem(path);
if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
@@ -1720,7 +1764,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* @param path the path of the element to set grayed
* @return grayed
*/
- public boolean getElementGrayed(TreePath path) {
+ @Override
+ public boolean getElementGrayed(TreePath path) {
Widget widget = findItem(path);
if (widget != null && widget instanceof TreeItem && !widget.isDisposed()) {
@@ -1731,7 +1776,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return false;
}
- public boolean getHasChildren(Object elementOrTreePath) {
+ @Override
+ public boolean getHasChildren(Object elementOrTreePath) {
if (elementOrTreePath instanceof TreePath &&
((TreePath)elementOrTreePath).getSegmentCount() == 0)
{
@@ -1750,7 +1796,8 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
return false;
}
- public TreePath[] getElementPaths(Object element) {
+ @Override
+ public TreePath[] getElementPaths(Object element) {
Widget[] items = internalFindItems(element);
TreePath[] paths = new TreePath[items.length];
for (int i = 0; i < items.length; i++) {
@@ -1767,6 +1814,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
* (non-Javadoc)
* @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
*/
+ @Override
protected void handleSelect(SelectionEvent event) {
super.handleSelect(event);
@@ -1794,6 +1842,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
+ @Override
protected void handleTreeExpand(TreeEvent event) {
super.handleTreeExpand(event);
IContentProvider contentProvider = getContentProvider();
@@ -1803,6 +1852,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
}
}
+ @Override
protected void handleTreeCollapse(TreeEvent event) {
super.handleTreeCollapse(event);
IContentProvider contentProvider = getContentProvider();
@@ -1815,6 +1865,7 @@ public class InternalTreeModelViewer extends TreeViewer implements IInternalTree
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget#clearSelectionQuiet()
*/
+ @Override
public void clearSelectionQuiet() {
getTree().setSelection(new TreeItem[0]);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
index b4d8a6554..68e472f61 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/InternalVirtualTreeModelViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 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
@@ -7,7 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
- * IBM - ongoing bug fixing
+ * IBM Corporation - ongoing bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -63,6 +63,7 @@ import org.eclipse.ui.IMemento;
* A tree model viewer without a UI component.
* @since 3.5
*/
+@SuppressWarnings("deprecation")
public class InternalVirtualTreeModelViewer extends Viewer
implements IVirtualItemListener,
org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer,
@@ -127,7 +128,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
* tree may contain the same element in several places, so the map values
* are lists.
*/
- private Map fItemsMap = new HashMap();
+ private Map<Object, List<VirtualItem>> fItemsMap = new HashMap<Object, List<VirtualItem>>();
/**
* Whether to notify the content provider when an element is unmapped.
@@ -172,14 +173,14 @@ public class InternalVirtualTreeModelViewer extends Viewer
* Map of columns presentation id to its visible columns id's (String[])
* When a columns presentation is not in the map, default settings are used.
*/
- private Map fVisibleColumns = new HashMap();
+ private Map<String, String[]> fVisibleColumns = new HashMap<String, String[]>();
/**
* Map of column presentation id to whether columns should be displayed
* for that presentation (the user can toggle columns on/off when a
* presentation is optional.
*/
- private Map fShowColumns = new HashMap();
+ private Map<String, Boolean> fShowColumns = new HashMap<String, Boolean>();
/**
* Runnable for validating the virtual tree. It is scheduled to run in the
@@ -201,21 +202,25 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public Object getInput() {
+ @Override
+ public Object getInput() {
return fInput;
}
- public Control getControl() {
+ @Override
+ public Control getControl() {
// The virtual viewer does not have an SWT control associated with it.
// Fortunately this method is not used by the base Viewer class.
return null;
}
- public Display getDisplay() {
+ @Override
+ public Display getDisplay() {
return fDisplay;
}
- public void setInput(Object input) {
+ @Override
+ public void setInput(Object input) {
Object oldInput = fInput;
getContentProvider().inputChanged(this, oldInput, input);
fItemsMap.clear();
@@ -229,7 +234,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
refresh();
}
- public void replace(Object parentElementOrTreePath, final int index, Object element) {
+ @Override
+ public void replace(Object parentElementOrTreePath, final int index, Object element) {
VirtualItem[] selectedItems = fTree.getSelection();
TreeSelection selection = (TreeSelection) getSelection();
VirtualItem[] itemsToDisassociate;
@@ -281,7 +287,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
return fTree;
}
- public void insert(Object parentOrTreePath, Object element, int position) {
+ @Override
+ public void insert(Object parentOrTreePath, Object element, int position) {
if (parentOrTreePath instanceof TreePath) {
VirtualItem parentItem = findItem((TreePath) parentOrTreePath);
if (parentItem != null) {
@@ -296,17 +303,19 @@ public class InternalVirtualTreeModelViewer extends Viewer
validate();
}
- public void remove(final Object parentOrTreePath, final int index) {
- final List oldSelection = new LinkedList(Arrays
- .asList(((TreeSelection) getSelection()).getPaths()));
+ @Override
+ public void remove(final Object parentOrTreePath, final int index) {
+ final List<TreePath> oldSelection = new LinkedList<TreePath>(Arrays.asList(((TreeSelection) getSelection()).getPaths()));
preservingSelection(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
TreePath removedPath = null;
VirtualItem[] parentItems = findItems(parentOrTreePath);
for (int i = 0; i < parentItems.length; i++) {
VirtualItem parentItem = parentItems[i];
- if (parentItem.isDisposed())
- continue;
+ if (parentItem.isDisposed()) {
+ continue;
+ }
// Parent item is not expanded so just update its contents so that
// the plus sign gets refreshed.
@@ -329,8 +338,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
if (removedPath != null) {
boolean removed = false;
- for (Iterator it = oldSelection.iterator(); it.hasNext();) {
- TreePath path = (TreePath) it.next();
+ for (Iterator<TreePath> it = oldSelection.iterator(); it.hasNext();) {
+ TreePath path = it.next();
if (path.startsWith(removedPath, null)) {
it.remove();
removed = true;
@@ -338,7 +347,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
if (removed) {
setSelection(
- new TreeSelection((TreePath[]) oldSelection.toArray(new TreePath[oldSelection.size()])),
+ new TreeSelection(oldSelection.toArray(new TreePath[oldSelection.size()])),
false);
}
}
@@ -346,7 +355,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
});
}
- public void remove(Object elementOrPath) {
+ @Override
+ public void remove(Object elementOrPath) {
if (elementOrPath.equals(getInput()) || TreePath.EMPTY.equals(elementOrPath)) {
setInput(null);
return;
@@ -441,7 +451,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
// }
- public void reveal(TreePath path, final int index) {
+ @Override
+ public void reveal(TreePath path, final int index) {
VirtualItem parentItem = findItem(path);
if (parentItem != null && parentItem.getItemCount() >= index) {
VirtualItem revealItem = parentItem.getItem(new Index(index));
@@ -451,7 +462,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
// TODO: implement reveal()
}
- public int findElementIndex(TreePath parentPath, Object element) {
+ @Override
+ public int findElementIndex(TreePath parentPath, Object element) {
VirtualItem parentItem = findItem(parentPath);
if (parentItem != null) {
VirtualItem item = parentItem.findItem(element);
@@ -462,7 +474,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
return -1;
}
- public boolean getElementChildrenRealized(TreePath parentPath) {
+ @Override
+ public boolean getElementChildrenRealized(TreePath parentPath) {
VirtualItem parentItem = findItem(parentPath);
if (parentItem != null) {
return !parentItem.childrenNeedDataUpdate();
@@ -481,12 +494,14 @@ public class InternalVirtualTreeModelViewer extends Viewer
public static int ALL_LEVELS = -1;
- public void refresh() {
+ @Override
+ public void refresh() {
refresh(fTree);
validate();
}
- public void refresh(Object element) {
+ @Override
+ public void refresh(Object element) {
VirtualItem[] items = findItems(element);
for (int i = 0; i < items.length; i++) {
refresh(items[i]);
@@ -537,7 +552,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
private void validate() {
if (fValidateRunnable == null) {
fValidateRunnable = new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (!fTree.isDisposed()) {
fValidateRunnable = null;
fTree.validate();
@@ -548,15 +564,18 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- protected void inputChanged(Object input, Object oldInput) {
+ @Override
+ protected void inputChanged(Object input, Object oldInput) {
resetColumns(input);
}
- public int getAutoExpandLevel() {
+ @Override
+ public int getAutoExpandLevel() {
return fAutoExpandToLevel;
}
- public void setAutoExpandLevel(int level) {
+ @Override
+ public void setAutoExpandLevel(int level) {
fAutoExpandToLevel = level;
}
@@ -565,11 +584,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
return fTree;
}
- List itemsList = (List)fItemsMap.get(path.getLastSegment());
+ List<VirtualItem> itemsList = fItemsMap.get(path.getLastSegment());
if (itemsList != null) {
- for (int i = 0; i < itemsList.size(); i++) {
- if ( path.equals(getTreePathFromItem((VirtualItem)itemsList.get(i))) ) {
- return (VirtualItem)itemsList.get(i);
+ for (VirtualItem item : itemsList) {
+ if (path.equals(getTreePathFromItem(item))) {
+ return item;
}
}
}
@@ -588,15 +607,16 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
element = path.getLastSegment();
}
- List itemsList = (List) fItemsMap.get(element);
+ List<VirtualItem> itemsList = fItemsMap.get(element);
if (itemsList == null) {
return EMPTY_ITEMS_ARRAY;
} else {
- return (VirtualItem[]) itemsList.toArray(new VirtualItem[itemsList.size()]);
+ return itemsList.toArray(new VirtualItem[itemsList.size()]);
}
}
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images,
+ @Override
+ public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images,
FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
VirtualItem item = findItem(path);
if (item != null) {
@@ -608,9 +628,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public void setChildCount(final Object elementOrTreePath, final int count) {
+ @Override
+ public void setChildCount(final Object elementOrTreePath, final int count) {
preservingSelection(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
VirtualItem[] items = findItems(elementOrTreePath);
for (int i = 0; i < items.length; i++) {
VirtualItem[] children = items[i].getItems();
@@ -627,9 +649,11 @@ public class InternalVirtualTreeModelViewer extends Viewer
validate();
}
- public void setHasChildren(final Object elementOrTreePath, final boolean hasChildren) {
+ @Override
+ public void setHasChildren(final Object elementOrTreePath, final boolean hasChildren) {
preservingSelection(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
VirtualItem[] items = findItems(elementOrTreePath);
for (int i = 0; i < items.length; i++) {
VirtualItem item = items[i];
@@ -656,7 +680,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
});
}
- public boolean getHasChildren(Object elementOrTreePath) {
+ @Override
+ public boolean getHasChildren(Object elementOrTreePath) {
VirtualItem[] items = findItems(elementOrTreePath);
if (items.length > 0) {
return items[0].hasItems();
@@ -691,7 +716,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
private TreePath getTreePathFromItem(VirtualItem item) {
- List segments = new LinkedList();
+ List<Object> segments = new LinkedList<Object>();
while (item.getParent() != null) {
segments.add(0, item.getData());
item = item.getParent();
@@ -708,7 +733,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- List itemsList = (List) fItemsMap.get(element);
+ List<VirtualItem> itemsList = fItemsMap.get(element);
if (itemsList != null) {
itemsList.remove(item);
if (itemsList.isEmpty()) {
@@ -723,9 +748,9 @@ public class InternalVirtualTreeModelViewer extends Viewer
// re-inserted to make sure that the new instance of element is used
// in case the element has changed but the elment is equal to the old
// one.
- List itemsList = (List) fItemsMap.remove(element);
+ List<VirtualItem> itemsList = fItemsMap.remove(element);
if (itemsList == null) {
- itemsList = new ArrayList(1);
+ itemsList = new ArrayList<VirtualItem>(1);
}
if (!itemsList.contains(item)) {
@@ -738,7 +763,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
item.setData(TREE_PATH_KEY, getTreePathFromItem(item));
}
- public void revealed(VirtualItem item) {
+ @Override
+ public void revealed(VirtualItem item) {
if (item.needsDataUpdate()) {
virtualLazyUpdateData(item);
} else if (item.getData() != null) {
@@ -751,7 +777,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public void disposed(VirtualItem item) {
+ @Override
+ public void disposed(VirtualItem item) {
if (!fTree.isDisposed()) {
Object data = item.getData();
if (data != null) {
@@ -817,21 +844,24 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public void setSelection(ISelection selection, boolean reveal) {
+ @Override
+ public void setSelection(ISelection selection, boolean reveal) {
setSelection(selection, reveal, false);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
- public void setSelection(ISelection selection, boolean reveal, boolean force) {
+ @Override
+ public void setSelection(ISelection selection, boolean reveal, boolean force) {
trySelection(selection, reveal, force);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelViewer#trySelection(org.eclipse.jface.viewers.ISelection, boolean, boolean)
*/
- public boolean trySelection(ISelection selection, boolean reveal, boolean force) {
+ @Override
+ public boolean trySelection(ISelection selection, boolean reveal, boolean force) {
if (!force && !overrideSelection(getSelection(), selection)) {
return false;
}
@@ -849,7 +879,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
private void internalSetSelection(ISelection selection, boolean reveal) {
if (selection instanceof ITreeSelection) {
TreePath[] paths = ((ITreeSelection) selection).getPaths();
- List newSelection = new ArrayList(paths.length);
+ List<VirtualItem> newSelection = new ArrayList<VirtualItem>(paths.length);
for (int i = 0; i < paths.length; ++i) {
// Use internalExpand since item may not yet be created. See
// 1G6B1AR.
@@ -858,7 +888,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
newSelection.add(item);
}
}
- fTree.setSelection((VirtualItem[]) newSelection.toArray(new VirtualItem[newSelection.size()]));
+ fTree.setSelection(newSelection.toArray(new VirtualItem[newSelection.size()]));
// Although setting the selection in the control should reveal it,
// setSelection may be a no-op if the selection is unchanged,
@@ -868,7 +898,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
// Iterate backwards so the first item in the list
// is the one guaranteed to be visible
for (int i = (newSelection.size() - 1); i >= 0; i--) {
- fTree.showItem((VirtualItem) newSelection.get(i));
+ fTree.showItem(newSelection.get(i));
}
}
} else {
@@ -879,7 +909,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
validate();
}
- public void update(Object element) {
+ @Override
+ public void update(Object element) {
VirtualItem[] items = findItems(element);
for (int i = 0; i < items.length; i++) {
doUpdate(items[i]);
@@ -891,25 +922,23 @@ public class InternalVirtualTreeModelViewer extends Viewer
validate();
}
- public ISelection getSelection() {
+ @Override
+ public ISelection getSelection() {
if (fTree.isDisposed()) {
return TreeSelection.EMPTY;
}
VirtualItem[] items = fTree.getSelection();
- ArrayList list = new ArrayList(items.length);
- Map map = new LinkedHashMap(items.length * 4/3);
-
+ ArrayList<TreePath> list = new ArrayList<TreePath>(items.length);
+ Map<VirtualItem, TreePath> map = new LinkedHashMap<VirtualItem, TreePath>(items.length * 4 / 3);
for (int i = 0; i < items.length; i++) {
TreePath path = null;
-
if (items[i].getData() != null) {
path = getTreePathFromItem(items[i]);
list.add(path);
}
map.put(items[i], path);
}
- //return new VirtualTreeSelection(map, (TreePath[]) list.toArray(new TreePath[list.size()]));
- return new TreeSelection((TreePath[]) list.toArray(new TreePath[list.size()]));
+ return new TreeSelection(list.toArray(new TreePath[list.size()]));
}
private void preservingSelection(Runnable updateCode) {
@@ -939,7 +968,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public void expandToLevel(Object elementOrTreePath, int level) {
+ @Override
+ public void expandToLevel(Object elementOrTreePath, int level) {
VirtualItem[] items = findItems(elementOrTreePath);
if (items.length > 0) {
expandToLevel(items[0], level);
@@ -947,7 +977,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
validate();
}
- public void setExpandedState(Object elementOrTreePath, boolean expanded) {
+ @Override
+ public void setExpandedState(Object elementOrTreePath, boolean expanded) {
VirtualItem[] items = findItems(elementOrTreePath);
for (int i = 0; i < items.length; i++) {
items[i].setExpanded(expanded);
@@ -955,7 +986,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
validate();
}
- public boolean getExpandedState(Object elementOrTreePath) {
+ @Override
+ public boolean getExpandedState(Object elementOrTreePath) {
VirtualItem[] items = findItems(elementOrTreePath);
if (items.length > 0) {
return items[0].getExpanded();
@@ -1017,7 +1049,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
* @param candidate New potential selection requested by model.
* @return true if candidate selection should be set to viewer.
*/
- public boolean overrideSelection(ISelection current, ISelection candidate) {
+ @Override
+ public boolean overrideSelection(ISelection current, ISelection candidate) {
IModelSelectionPolicy selectionPolicy = ViewerAdapterService.getSelectionPolicy(current, getPresentationContext());
if (selectionPolicy == null) {
return true;
@@ -1028,18 +1061,21 @@ public class InternalVirtualTreeModelViewer extends Viewer
return !selectionPolicy.isSticky(current, getPresentationContext());
}
- public ViewerFilter[] getFilters() {
+ @Override
+ public ViewerFilter[] getFilters() {
return fFilters;
}
- public void addFilter(ViewerFilter filter) {
+ @Override
+ public void addFilter(ViewerFilter filter) {
ViewerFilter[] newFilters = new ViewerFilter[fFilters.length + 1];
System.arraycopy(fFilters, 0, newFilters, 0, fFilters.length);
newFilters[fFilters.length] = filter;
fFilters = newFilters;
}
- public void setFilters(ViewerFilter[] filters) {
+ @Override
+ public void setFilters(ViewerFilter[] filters) {
fFilters = filters;
}
@@ -1066,7 +1102,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
*
* @return presentation context
*/
- public IPresentationContext getPresentationContext() {
+ @Override
+ public IPresentationContext getPresentationContext() {
return fContext;
}
@@ -1172,7 +1209,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
protected boolean isShowColumns(String columnPresentationId) {
- Boolean bool = (Boolean) fShowColumns.get(columnPresentationId);
+ Boolean bool = fShowColumns.get(columnPresentationId);
if (bool == null) {
return true;
}
@@ -1199,11 +1236,12 @@ public class InternalVirtualTreeModelViewer extends Viewer
*
* @return visible columns or <code>null</code>
*/
- public String[] getVisibleColumns() {
+ @Override
+ public String[] getVisibleColumns() {
if (isShowColumns()) {
IColumnPresentation presentation = getColumnPresentation();
if (presentation != null) {
- String[] columns = (String[]) fVisibleColumns.get(presentation.getId());
+ String[] columns = fVisibleColumns.get(presentation.getId());
if (columns == null) {
return presentation.getInitialColumns();
}
@@ -1263,20 +1301,15 @@ public class InternalVirtualTreeModelViewer extends Viewer
*/
public void saveState(IMemento memento) {
if (!fShowColumns.isEmpty()) {
- Iterator iterator = fShowColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- IMemento sizes = memento.createChild(SHOW_COLUMNS, (String)entry.getKey());
- sizes.putString(SHOW_COLUMNS, ((Boolean)entry.getValue()).toString());
+ for (Entry<String, Boolean> entry : fShowColumns.entrySet()) {
+ IMemento sizes = memento.createChild(SHOW_COLUMNS, entry.getKey());
+ sizes.putString(SHOW_COLUMNS, entry.getValue().toString());
}
}
if (!fVisibleColumns.isEmpty()) {
- Iterator iterator = fVisibleColumns.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
- String id = (String) entry.getKey();
- IMemento visible = memento.createChild(VISIBLE_COLUMNS, id);
- String[] columns = (String[]) entry.getValue();
+ for (Entry<String, String[]> entry : fVisibleColumns.entrySet()) {
+ IMemento visible = memento.createChild(VISIBLE_COLUMNS, entry.getKey());
+ String[] columns = entry.getValue();
visible.putInteger(SIZE, columns.length);
for (int i = 0; i < columns.length; i++) {
visible.putString(COLUMN+Integer.toString(i), columns[i]);
@@ -1330,44 +1363,52 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void addViewerUpdateListener(IViewerUpdateListener listener) {
getContentProvider().addViewerUpdateListener(listener);
}
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void removeViewerUpdateListener(IViewerUpdateListener listener) {
ITreeModelContentProvider cp = getContentProvider();
if (cp != null) {
cp.removeViewerUpdateListener(listener);
}
}
- public void addModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void addModelChangedListener(IModelChangedListener listener) {
getContentProvider().addModelChangedListener(listener);
}
- public void removeModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void removeModelChangedListener(IModelChangedListener listener) {
ITreeModelContentProvider cp = getContentProvider();
if (cp != null) {
cp.removeModelChangedListener(listener);
}
}
- public void addStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void addStateUpdateListener(IStateUpdateListener listener) {
getContentProvider().addStateUpdateListener(listener);
}
- public void removeStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void removeStateUpdateListener(IStateUpdateListener listener) {
ITreeModelContentProvider cp = getContentProvider();
if (cp != null) {
cp.removeStateUpdateListener(listener);
}
}
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
+ @Override
+ public void addLabelUpdateListener(ILabelUpdateListener listener) {
getLabelProvider().addLabelUpdateListener(listener);
}
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
+ @Override
+ public void removeLabelUpdateListener(ILabelUpdateListener listener) {
getLabelProvider().removeLabelUpdateListener(listener);
}
@@ -1377,7 +1418,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
*
* @param elementPath tree path to element to consider for expansion
*/
- public void autoExpand(TreePath elementPath) {
+ @Override
+ public void autoExpand(TreePath elementPath) {
int level = getAutoExpandLevel();
if (level > 0 || level == org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer.ALL_LEVELS) {
if (level == org.eclipse.debug.internal.ui.viewers.model.provisional.ITreeModelViewer.ALL_LEVELS || level > elementPath.getSegmentCount()) {
@@ -1386,7 +1428,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public int getChildCount(TreePath path) {
+ @Override
+ public int getChildCount(TreePath path) {
int childCount = -1;
VirtualItem[] items = findItems(path);
if (items.length > 0) {
@@ -1401,7 +1444,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
return childCount;
}
- public Object getChildElement(TreePath path, int index) {
+ @Override
+ public Object getChildElement(TreePath path, int index) {
VirtualItem[] items = findItems(path);
if (items.length > 0) {
if (index < items[0].getItemCount()) {
@@ -1411,14 +1455,16 @@ public class InternalVirtualTreeModelViewer extends Viewer
return null;
}
- public TreePath getTopElementPath() {
+ @Override
+ public TreePath getTopElementPath() {
return null;
}
- public boolean saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
+ @Override
+ public boolean saveElementState(TreePath path, ModelDelta delta, int flagsToSave) {
VirtualTree tree = getTree();
VirtualItem[] selection = tree.getSelection();
- Set set = new HashSet();
+ Set<VirtualItem> set = new HashSet<VirtualItem>();
for (int i = 0; i < selection.length; i++) {
set.add(selection[i]);
}
@@ -1450,7 +1496,7 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- private void doSaveElementState(TreePath parentPath, ModelDelta delta, VirtualItem item, Collection set, int flagsToSave) {
+ private void doSaveElementState(TreePath parentPath, ModelDelta delta, VirtualItem item, Collection<VirtualItem> set, int flagsToSave) {
Object element = item.getData();
if (element != null) {
boolean expanded = item.getExpanded();
@@ -1480,11 +1526,13 @@ public class InternalVirtualTreeModelViewer extends Viewer
}
}
- public void updateViewer(IModelDelta delta) {
+ @Override
+ public void updateViewer(IModelDelta delta) {
getContentProvider().updateModel(delta, ITreeModelContentProvider.ALL_MODEL_DELTA_FLAGS);
}
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
+ @Override
+ public ViewerLabel getElementLabel(TreePath path, String columnId) {
if (path.getSegmentCount() == 0) {
return null;
}
@@ -1517,7 +1565,8 @@ public class InternalVirtualTreeModelViewer extends Viewer
return null;
}
- public TreePath[] getElementPaths(Object element) {
+ @Override
+ public TreePath[] getElementPaths(Object element) {
VirtualItem[] items = findItems(element);
TreePath[] paths = new TreePath[items.length];
for (int i = 0; i < items.length; i++) {
@@ -1570,25 +1619,30 @@ public class InternalVirtualTreeModelViewer extends Viewer
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.ITreeModelContentProviderTarget#clearSelectionQuiet()
*/
- public void clearSelectionQuiet() {
+ @Override
+ public void clearSelectionQuiet() {
getTree().setSelection(EMPTY_ITEMS_ARRAY);
}
- public boolean getElementChecked(TreePath path) {
+ @Override
+ public boolean getElementChecked(TreePath path) {
// Not supported
return false;
}
- public boolean getElementGrayed(TreePath path) {
+ @Override
+ public boolean getElementGrayed(TreePath path) {
// Not supported
return false;
}
- public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
+ @Override
+ public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
// Not supported
}
- public String toString() {
+ @Override
+ public String toString() {
return getTree().toString();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
index c188a4af1..5bbffb307 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/LabelUpdate.java
@@ -64,6 +64,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#getColumnIds()
*/
+ @Override
public String[] getColumnIds() {
return fColumnIds;
}
@@ -71,6 +72,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
+ @Override
public TreePath getElementPath() {
return fElementPath;
}
@@ -78,6 +80,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setBackground(org.eclipse.swt.graphics.RGB, int)
*/
+ @Override
public void setBackground(RGB background, int columnIndex) {
if (background == null) {
return;
@@ -91,6 +94,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setFontData(org.eclipse.swt.graphics.FontData, int)
*/
+ @Override
public void setFontData(FontData fontData, int columnIndex) {
if (fontData == null) {
return;
@@ -104,6 +108,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setForeground(org.eclipse.swt.graphics.RGB, int)
*/
+ @Override
public void setForeground(RGB foreground, int columnIndex) {
if (foreground == null) {
return;
@@ -117,6 +122,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setImageDescriptor(org.eclipse.jface.resource.ImageDescriptor, int)
*/
+ @Override
public void setImageDescriptor(ImageDescriptor image, int columnIndex) {
if (image == null) {
return;
@@ -130,6 +136,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate#setLabel(java.lang.String, int)
*/
+ @Override
public void setLabel(String text, int columnIndex) {
fLabels[columnIndex] = text;
}
@@ -137,6 +144,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
*/
+ @Override
public IPresentationContext getPresentationContext() {
return fContext;
}
@@ -144,6 +152,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.commands.Request#done()
*/
+ @Override
public void done() {
fProvider.complete(this);
}
@@ -160,10 +169,12 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
+ @Override
public Object getElement() {
return getElementPath().getLastSegment();
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("ILabelUpdate: "); //$NON-NLS-1$
@@ -174,6 +185,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
*/
+ @Override
public Object getViewerInput() {
return fViewerInput;
}
@@ -181,6 +193,7 @@ class LabelUpdate extends Request implements ILabelUpdate, ICheckUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckUpdate#setChecked(boolean, boolean)
*/
+ @Override
public void setChecked(boolean checked, boolean grayed) {
fChecked = checked;
fGrayed = grayed;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
index b4c8f5368..081058bd1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/MementoUpdate.java
@@ -50,6 +50,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
*/
+ @Override
public IPresentationContext getPresentationContext() {
return fContext;
}
@@ -57,6 +58,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
+ @Override
public Object getElement() {
return fElement;
}
@@ -64,6 +66,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
+ @Override
public TreePath getElementPath() {
return fElementPath;
}
@@ -83,6 +86,7 @@ abstract class MementoUpdate extends Request implements IViewerUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
*/
+ @Override
public Object getViewerInput() {
return fViewerInput;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
index c76348744..36fa8c7d6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/SubTreeModelViewer.java
@@ -82,13 +82,15 @@ public class SubTreeModelViewer extends TreeModelViewer {
public class DelegatingTreeModelViewer extends Viewer
implements IInternalTreeModelViewer
{
- public void reveal(TreePath path, int index) {
+ @Override
+ public void reveal(TreePath path, int index) {
if (path.startsWith(fRootPath, null)) {
SubTreeModelViewer.this.reveal(createSubPath(path), index);
}
}
- public void replace(Object parentOrTreePath, int index, Object element) {
+ @Override
+ public void replace(Object parentOrTreePath, int index, Object element) {
if (parentOrTreePath instanceof TreePath) {
TreePath path = (TreePath)parentOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -99,7 +101,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void setChildCount(Object elementOrTreePath, int count) {
+ @Override
+ public void setChildCount(Object elementOrTreePath, int count) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -110,7 +113,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void setHasChildren(Object elementOrTreePath, boolean hasChildren) {
+ @Override
+ public void setHasChildren(Object elementOrTreePath, boolean hasChildren) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -121,11 +125,13 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void autoExpand(TreePath elementPath) {
+ @Override
+ public void autoExpand(TreePath elementPath) {
// not supported
}
- public void setExpandedState(Object elementOrTreePath, boolean expanded) {
+ @Override
+ public void setExpandedState(Object elementOrTreePath, boolean expanded) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -136,7 +142,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void expandToLevel(Object elementOrTreePath, int level) {
+ @Override
+ public void expandToLevel(Object elementOrTreePath, int level) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -147,7 +154,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void remove(Object elementOrTreePath) {
+ @Override
+ public void remove(Object elementOrTreePath) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -158,7 +166,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void remove(Object parentOrTreePath, final int index) {
+ @Override
+ public void remove(Object parentOrTreePath, final int index) {
if (parentOrTreePath instanceof TreePath) {
TreePath path = (TreePath)parentOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -169,7 +178,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public void insert(Object parentOrTreePath, Object element, int position) {
+ @Override
+ public void insert(Object parentOrTreePath, Object element, int position) {
if (parentOrTreePath instanceof TreePath) {
TreePath path = (TreePath)parentOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -180,7 +190,8 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
}
- public boolean getExpandedState(Object elementOrTreePath) {
+ @Override
+ public boolean getExpandedState(Object elementOrTreePath) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -192,14 +203,16 @@ public class SubTreeModelViewer extends TreeModelViewer {
return false;
}
- public int getChildCount(TreePath path) {
+ @Override
+ public int getChildCount(TreePath path) {
if (path.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.getChildCount(createSubPath(path));
}
return -1;
}
- public boolean getHasChildren(Object elementOrTreePath) {
+ @Override
+ public boolean getHasChildren(Object elementOrTreePath) {
if (elementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)elementOrTreePath;
if (path.startsWith(fRootPath, null)) {
@@ -211,163 +224,200 @@ public class SubTreeModelViewer extends TreeModelViewer {
return false;
}
- public Object getChildElement(TreePath path, int index) {
+ @Override
+ public Object getChildElement(TreePath path, int index) {
if (path.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.getChildElement(createSubPath(path), index);
}
return null;
}
- public TreePath getTopElementPath() {
+ @Override
+ public TreePath getTopElementPath() {
return createFullPath(SubTreeModelViewer.this.getTopElementPath());
}
- public int findElementIndex(TreePath parentPath, Object element) {
+ @Override
+ public int findElementIndex(TreePath parentPath, Object element) {
if (parentPath.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.findElementIndex(createSubPath(parentPath), element);
}
return -1;
}
- public boolean getElementChildrenRealized(TreePath parentPath) {
+ @Override
+ public boolean getElementChildrenRealized(TreePath parentPath) {
if (parentPath.startsWith(fRootPath, null)) {
return SubTreeModelViewer.this.getElementChildrenRealized(createSubPath(parentPath));
}
return true;
}
- public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
+ @Override
+ public void setElementData(TreePath path, int numColumns, String[] labels, ImageDescriptor[] images, FontData[] fontDatas, RGB[] foregrounds, RGB[] backgrounds) {
if (path.startsWith(fRootPath, null)) {
SubTreeModelViewer.this.setElementData(createSubPath(path), numColumns, labels, images, fontDatas, foregrounds, backgrounds);
}
}
- public Control getControl() {
+ @Override
+ public Control getControl() {
return SubTreeModelViewer.this.getControl();
}
- public Object getInput() {
+ @Override
+ public Object getInput() {
return SubTreeModelViewer.this.getInput();
}
- public ISelection getSelection() {
+ @Override
+ public ISelection getSelection() {
return SubTreeModelViewer.this.getSelection();
}
- public void refresh() {
+ @Override
+ public void refresh() {
SubTreeModelViewer.this.refresh();
}
- public void setInput(Object input) {
+ @Override
+ public void setInput(Object input) {
SubTreeModelViewer.this.setInput(input);
}
- public void setSelection(ISelection selection, boolean reveal) {
+ @Override
+ public void setSelection(ISelection selection, boolean reveal) {
SubTreeModelViewer.this.setSelection(selection, reveal);
}
- public String[] getVisibleColumns() {
+ @Override
+ public String[] getVisibleColumns() {
return SubTreeModelViewer.this.getVisibleColumns();
}
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
+ @Override
+ public void addLabelUpdateListener(ILabelUpdateListener listener) {
SubTreeModelViewer.this.addLabelUpdateListener(listener);
}
- public void addModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void addModelChangedListener(IModelChangedListener listener) {
SubTreeModelViewer.this.addModelChangedListener(listener);
}
- public void addStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void addStateUpdateListener(IStateUpdateListener listener) {
SubTreeModelViewer.this.addStateUpdateListener(listener);
}
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void addViewerUpdateListener(IViewerUpdateListener listener) {
SubTreeModelViewer.this.addViewerUpdateListener(listener);
}
- public int getAutoExpandLevel() {
+ @Override
+ public int getAutoExpandLevel() {
return SubTreeModelViewer.this.getAutoExpandLevel();
}
- public Display getDisplay() {
+ @Override
+ public Display getDisplay() {
return SubTreeModelViewer.this.getDisplay();
}
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
+ @Override
+ public ViewerLabel getElementLabel(TreePath path, String columnId) {
return SubTreeModelViewer.this.getElementLabel(path, columnId);
}
- public IPresentationContext getPresentationContext() {
+ @Override
+ public IPresentationContext getPresentationContext() {
return SubTreeModelViewer.this.getPresentationContext();
}
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
+ @Override
+ public void removeLabelUpdateListener(ILabelUpdateListener listener) {
SubTreeModelViewer.this.removeLabelUpdateListener(listener);
}
- public void removeModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void removeModelChangedListener(IModelChangedListener listener) {
SubTreeModelViewer.this.removeModelChangedListener(listener);
}
- public void removeStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void removeStateUpdateListener(IStateUpdateListener listener) {
SubTreeModelViewer.this.removeStateUpdateListener(listener);
}
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void removeViewerUpdateListener(IViewerUpdateListener listener) {
SubTreeModelViewer.this.removeViewerUpdateListener(listener);
}
- public boolean saveElementState(TreePath path, ModelDelta delta, int deltaFlags) {
+ @Override
+ public boolean saveElementState(TreePath path, ModelDelta delta, int deltaFlags) {
return SubTreeModelViewer.this.saveElementState(path, delta, deltaFlags);
}
- public void setAutoExpandLevel(int level) {
+ @Override
+ public void setAutoExpandLevel(int level) {
SubTreeModelViewer.this.setAutoExpandLevel(level);
}
- public void setSelection(ISelection selection, boolean reveal, boolean force) {
+ @Override
+ public void setSelection(ISelection selection, boolean reveal, boolean force) {
SubTreeModelViewer.this.setSelection(selection, reveal, force);
}
- public boolean trySelection(ISelection selection, boolean reveal, boolean force) {
+ @Override
+ public boolean trySelection(ISelection selection, boolean reveal, boolean force) {
return SubTreeModelViewer.this.trySelection(selection, reveal, force);
}
- public void updateViewer(IModelDelta delta) {
+ @Override
+ public void updateViewer(IModelDelta delta) {
SubTreeModelViewer.this.updateViewer(delta);
}
- public ViewerFilter[] getFilters() {
+ @Override
+ public ViewerFilter[] getFilters() {
return SubTreeModelViewer.this.getFilters();
}
- public void addFilter(ViewerFilter filter) {
+ @Override
+ public void addFilter(ViewerFilter filter) {
SubTreeModelViewer.this.addFilter(filter);
}
- public void setFilters(ViewerFilter[] filters) {
+ @Override
+ public void setFilters(ViewerFilter[] filters) {
SubTreeModelViewer.this.setFilters(filters);
}
- public boolean overrideSelection(ISelection current, ISelection candidate) {
+ @Override
+ public boolean overrideSelection(ISelection current, ISelection candidate) {
return SubTreeModelViewer.this.overrideSelection(current, candidate);
}
- public void refresh(Object element) {
+ @Override
+ public void refresh(Object element) {
SubTreeModelViewer.this.refresh(element);
}
- public void update(Object element) {
+ @Override
+ public void update(Object element) {
SubTreeModelViewer.this.update(element);
}
- public void clearSelectionQuiet() {
+ @Override
+ public void clearSelectionQuiet() {
SubTreeModelViewer.this.clearSelectionQuiet();
}
- public TreePath[] getElementPaths(Object element) {
+ @Override
+ public TreePath[] getElementPaths(Object element) {
TreePath[] subViewerPaths = SubTreeModelViewer.this.getElementPaths(element);
TreePath[] retVal = new TreePath[subViewerPaths.length];
for (int i = 0; i < subViewerPaths.length; i++) {
@@ -376,15 +426,18 @@ public class SubTreeModelViewer extends TreeModelViewer {
return retVal;
}
- public boolean getElementChecked(TreePath path) {
+ @Override
+ public boolean getElementChecked(TreePath path) {
return SubTreeModelViewer.this.getElementChecked(createSubPath(path));
}
- public boolean getElementGrayed(TreePath path) {
+ @Override
+ public boolean getElementGrayed(TreePath path) {
return SubTreeModelViewer.this.getElementGrayed(createSubPath(path));
}
- public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
+ @Override
+ public void setElementChecked(TreePath path, boolean checked, boolean grayed) {
SubTreeModelViewer.this.setElementChecked(createSubPath(path), checked, grayed);
}
}
@@ -402,75 +455,93 @@ public class SubTreeModelViewer extends TreeModelViewer {
fBaseProvider = new TreeModelContentProvider();
}
- public void updateHasChildren(TreePath path) {
+ @Override
+ public void updateHasChildren(TreePath path) {
fBaseProvider.updateHasChildren(createFullPath(path));
}
- public void updateChildCount(TreePath path, int currentChildCount) {
+ @Override
+ public void updateChildCount(TreePath path, int currentChildCount) {
fBaseProvider.updateChildCount(createFullPath(path), currentChildCount);
}
- public void updateElement(TreePath parentPath, int viewIndex) {
+ @Override
+ public void updateElement(TreePath parentPath, int viewIndex) {
fBaseProvider.updateElement(createFullPath(parentPath), viewIndex);
}
- public int viewToModelCount(TreePath parentPath, int count) {
+ @Override
+ public int viewToModelCount(TreePath parentPath, int count) {
return fBaseProvider.viewToModelCount(createFullPath(parentPath), count);
}
- public int viewToModelIndex(TreePath parentPath, int index) {
+ @Override
+ public int viewToModelIndex(TreePath parentPath, int index) {
return fBaseProvider.viewToModelIndex(createFullPath(parentPath), index);
}
- public void addModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void addModelChangedListener(IModelChangedListener listener) {
fBaseProvider.addModelChangedListener(listener);
}
- public void preserveState(TreePath subPath) {
+ @Override
+ public void preserveState(TreePath subPath) {
fBaseProvider.preserveState(createFullPath(subPath));
}
- public void addStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void addStateUpdateListener(IStateUpdateListener listener) {
fBaseProvider.addStateUpdateListener(listener);
}
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void addViewerUpdateListener(IViewerUpdateListener listener) {
fBaseProvider.addViewerUpdateListener(listener);
}
- public int getModelDeltaMask() {
+ @Override
+ public int getModelDeltaMask() {
return fBaseProvider.getModelDeltaMask();
}
- public int modelToViewChildCount(TreePath parentPath, int count) {
+ @Override
+ public int modelToViewChildCount(TreePath parentPath, int count) {
return fBaseProvider.modelToViewChildCount(createFullPath(parentPath), count);
}
- public int modelToViewIndex(TreePath parentPath, int index) {
+ @Override
+ public int modelToViewIndex(TreePath parentPath, int index) {
return fBaseProvider.modelToViewIndex(createFullPath(parentPath), index);
}
- public void removeModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void removeModelChangedListener(IModelChangedListener listener) {
fBaseProvider.removeModelChangedListener(listener);
}
- public void removeStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void removeStateUpdateListener(IStateUpdateListener listener) {
fBaseProvider.removeStateUpdateListener(listener);
}
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void removeViewerUpdateListener(IViewerUpdateListener listener) {
fBaseProvider.removeViewerUpdateListener(listener);
}
- public void setModelDeltaMask(int mask) {
+ @Override
+ public void setModelDeltaMask(int mask) {
fBaseProvider.setModelDeltaMask(mask);
}
- public boolean areTreeModelViewerFiltersApplicable(Object parentElement) {
+ @Override
+ public boolean areTreeModelViewerFiltersApplicable(Object parentElement) {
return fBaseProvider.areTreeModelViewerFiltersApplicable(parentElement);
}
- public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
+ @Override
+ public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
if (parentElementOrTreePath instanceof TreePath) {
TreePath path = (TreePath)parentElementOrTreePath;
return fBaseProvider.shouldFilter(createFullPath(path), element);
@@ -480,37 +551,45 @@ public class SubTreeModelViewer extends TreeModelViewer {
}
- public void unmapPath(TreePath path) {
+ @Override
+ public void unmapPath(TreePath path) {
fBaseProvider.unmapPath(createFullPath(path));
}
- public void updateModel(IModelDelta delta, int mask) {
+ @Override
+ public void updateModel(IModelDelta delta, int mask) {
fBaseProvider.updateModel(delta, mask);
}
- public TreePath[] getParents(Object element) {
+ @Override
+ public TreePath[] getParents(Object element) {
// Not used
return null;
}
- public void cancelRestore(TreePath path, int flags) {
+ @Override
+ public void cancelRestore(TreePath path, int flags) {
fBaseProvider.cancelRestore(createFullPath(path), flags);
}
- public void dispose() {
+ @Override
+ public void dispose() {
fBaseProvider.dispose();
}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
fBaseProvider.inputChanged(fDelegatingViewer, oldInput, newInput);
}
+ @Override
public void postInputChanged(IInternalTreeModelViewer viewer,
Object oldInput, Object newInput) {
fBaseProvider.postInputChanged(viewer, oldInput, newInput);
}
- public boolean setChecked(TreePath path, boolean checked) {
+ @Override
+ public boolean setChecked(TreePath path, boolean checked) {
return fBaseProvider.setChecked(createFullPath(path), checked);
}
@@ -530,44 +609,54 @@ public class SubTreeModelViewer extends TreeModelViewer {
fBaseProvider = new TreeModelLabelProvider(viewer);
}
- public boolean update(TreePath elementPath) {
+ @Override
+ public boolean update(TreePath elementPath) {
return fBaseProvider.update( createFullPath(elementPath) );
}
- public void addLabelUpdateListener(ILabelUpdateListener listener) {
+ @Override
+ public void addLabelUpdateListener(ILabelUpdateListener listener) {
fBaseProvider.addLabelUpdateListener(listener);
}
- public Color getColor(RGB rgb) {
+ @Override
+ public Color getColor(RGB rgb) {
return fBaseProvider.getColor(rgb);
}
- public Font getFont(FontData fontData) {
+ @Override
+ public Font getFont(FontData fontData) {
return fBaseProvider.getFont(fontData);
}
- public Image getImage(ImageDescriptor descriptor) {
+ @Override
+ public Image getImage(ImageDescriptor descriptor) {
return fBaseProvider.getImage(descriptor);
}
- public void removeLabelUpdateListener(ILabelUpdateListener listener) {
+ @Override
+ public void removeLabelUpdateListener(ILabelUpdateListener listener) {
fBaseProvider.removeLabelUpdateListener(listener);
}
- public void addListener(ILabelProviderListener listener) {
+ @Override
+ public void addListener(ILabelProviderListener listener) {
fBaseProvider.addListener(listener);
}
- public void dispose() {
+ @Override
+ public void dispose() {
fBaseProvider.dispose();
super.dispose();
}
- public boolean isLabelProperty(Object element, String property) {
+ @Override
+ public boolean isLabelProperty(Object element, String property) {
return fBaseProvider.isLabelProperty(element, property);
}
- public void removeListener(ILabelProviderListener listener) {
+ @Override
+ public void removeListener(ILabelProviderListener listener) {
fBaseProvider.removeListener(listener);
}
}
@@ -609,11 +698,13 @@ public class SubTreeModelViewer extends TreeModelViewer {
return fDelegatingViewer;
}
- protected ITreeModelContentProvider createContentProvider() {
+ @Override
+ protected ITreeModelContentProvider createContentProvider() {
return new SubTreeModelContentProvider();
}
- protected ITreeModelLabelProvider createLabelProvider() {
+ @Override
+ protected ITreeModelLabelProvider createLabelProvider() {
return new SubTreeModelLabelProvider(getDelegatingViewer());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
index 68a194a69..da68d82c1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TimeTriggeredProgressMonitorDialog.java
@@ -82,7 +82,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
* @see org.eclipse.core.runtime.IProgressMonitor#beginTask(java.lang.String,
* int)
*/
- public void beginTask(String name, int totalWork) {
+ @Override
+ public void beginTask(String name, int totalWork) {
superMonitor.beginTask(name, totalWork);
checkTicking();
}
@@ -107,7 +108,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
- public void done() {
+ @Override
+ public void done() {
superMonitor.done();
checkTicking();
}
@@ -117,7 +119,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#internalWorked(double)
*/
- public void internalWorked(double work) {
+ @Override
+ public void internalWorked(double work) {
superMonitor.internalWorked(work);
checkTicking();
}
@@ -127,7 +130,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#isCanceled()
*/
- public boolean isCanceled() {
+ @Override
+ public boolean isCanceled() {
return superMonitor.isCanceled();
}
@@ -136,7 +140,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#setCanceled(boolean)
*/
- public void setCanceled(boolean value) {
+ @Override
+ public void setCanceled(boolean value) {
superMonitor.setCanceled(value);
}
@@ -146,7 +151,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#setTaskName(java.lang.String)
*/
- public void setTaskName(String name) {
+ @Override
+ public void setTaskName(String name) {
superMonitor.setTaskName(name);
checkTicking();
@@ -157,7 +163,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#subTask(java.lang.String)
*/
- public void subTask(String name) {
+ @Override
+ public void subTask(String name) {
superMonitor.subTask(name);
checkTicking();
}
@@ -167,7 +174,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.core.runtime.IProgressMonitor#worked(int)
*/
- public void worked(int work) {
+ @Override
+ public void worked(int work) {
superMonitor.worked(work);
checkTicking();
@@ -180,7 +188,8 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.jface.dialogs.ProgressMonitorDialog#getProgressMonitor()
*/
- public IProgressMonitor getProgressMonitor() {
+ @Override
+ public IProgressMonitor getProgressMonitor() {
if (wrapperedMonitor == null) {
createWrapperedMonitor();
}
@@ -192,13 +201,15 @@ public class TimeTriggeredProgressMonitorDialog extends ProgressMonitorDialog {
*
* @see org.eclipse.jface.operations.IRunnableContext#run(boolean, boolean, IRunnableWithProgress)
*/
- public void run(final boolean fork, final boolean cancelable,
+ @Override
+ public void run(final boolean fork, final boolean cancelable,
final IRunnableWithProgress runnable) throws InvocationTargetException,
InterruptedException {
final InvocationTargetException[] invokes = new InvocationTargetException[1];
final InterruptedException[] interrupt = new InterruptedException[1];
Runnable dialogWaitRunnable = new Runnable() {
- public void run() {
+ @Override
+ public void run() {
try {
TimeTriggeredProgressMonitorDialog.super.run(fork, cancelable, runnable);
} catch (InvocationTargetException e) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
index 131186b01..6a2b05603 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelContentProvider.java
@@ -29,7 +29,6 @@ import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.debug.core.IRequest;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ICheckboxModelProxy;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
@@ -77,7 +76,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* Used to install different model proxy instances for one element depending
* on the tree path.
*/
- private Map fTreeModelProxies = new HashMap(); // tree model proxy by
+ private Map<TreePath, IModelProxy> fTreeModelProxies = new HashMap<TreePath, IModelProxy>(); // tree
+ // model
+ // proxy
+ // by
// element tree path
/**
@@ -86,7 +88,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* Used to install a single model proxy which is responsible for all
* instances of an element in the model tree.
*/
- private Map fModelProxies = new HashMap(); // model proxy by element
+ private Map<Object, IModelProxy> fModelProxies = new HashMap<Object, IModelProxy>(); // model
+ // proxy
+ // by
+ // element
/**
* Map of nodes that have been filtered from the viewer.
@@ -112,15 +117,15 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/**
* Map of updates in progress: element path -> list of requests
*/
- private Map fRequestsInProgress = new HashMap();
+ private Map<TreePath, List<ViewerUpdateMonitor>> fRequestsInProgress = new HashMap<TreePath, List<ViewerUpdateMonitor>>();
/**
* Map of dependent requests waiting for parent requests to complete:
* element path -> list of requests
*/
- private Map fWaitingRequests = new HashMap();
+ private Map<TreePath, List<ViewerUpdateMonitor>> fWaitingRequests = new HashMap<TreePath, List<ViewerUpdateMonitor>>();
- private List fCompletedUpdates = new ArrayList();
+ private List<ViewerUpdateMonitor> fCompletedUpdates = new ArrayList<ViewerUpdateMonitor>();
private Runnable fCompletedUpdatesRunnable;
@@ -143,18 +148,18 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
static final TreePath EMPTY_TREE_PATH = new TreePath(new Object[] {});
- public void dispose() {
- if (fViewer == null) return;
+ @Override
+ public void dispose() {
+ if (fViewer == null) {
+ return;
+ }
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
// cancel pending updates
- Iterator iterator = fRequestsInProgress.values().iterator();
- while (iterator.hasNext()) {
- List requests = (List) iterator.next();
- Iterator reqIter = requests.iterator();
- while (reqIter.hasNext()) {
- ((IRequest) reqIter.next()).cancel();
+ for (List<ViewerUpdateMonitor> requests : fRequestsInProgress.values()) {
+ for (ViewerUpdateMonitor vu : requests) {
+ vu.cancel();
}
}
fWaitingRequests.clear();
@@ -178,7 +183,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
synchronized(this) {
fViewer = (IInternalTreeModelViewer) viewer;
}
@@ -190,7 +196,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
- public void postInputChanged(IInternalTreeModelViewer viewer, Object oldInput, Object newInput) {
+ @Override
+ public void postInputChanged(IInternalTreeModelViewer viewer, Object oldInput, Object newInput) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
cancelSubtreeUpdates(TreePath.EMPTY);
@@ -203,39 +210,48 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void addViewerUpdateListener(IViewerUpdateListener listener) {
fUpdateListeners.add(listener);
}
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void removeViewerUpdateListener(IViewerUpdateListener listener) {
fUpdateListeners.remove(listener);
}
- public void addStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void addStateUpdateListener(IStateUpdateListener listener) {
fStateTracker.addStateUpdateListener(listener);
}
- public void preserveState(TreePath path) {
+ @Override
+ public void preserveState(TreePath path) {
fStateTracker.appendToPendingStateDelta(path);
}
- public void removeStateUpdateListener(IStateUpdateListener listener) {
+ @Override
+ public void removeStateUpdateListener(IStateUpdateListener listener) {
fStateTracker.removeStateUpdateListener(listener);
}
- public void addModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void addModelChangedListener(IModelChangedListener listener) {
fModelListeners.add(listener);
}
- public void removeModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void removeModelChangedListener(IModelChangedListener listener) {
fModelListeners.remove(listener);
}
- public void cancelRestore(final TreePath path, final int flags) {
+ @Override
+ public void cancelRestore(final TreePath path, final int flags) {
fStateTracker.cancelRestore(path, flags);
}
- public boolean setChecked(TreePath path, boolean checked) {
+ @Override
+ public boolean setChecked(TreePath path, boolean checked) {
IModelProxy elementProxy = getElementProxy(path);
if (elementProxy instanceof ICheckboxModelProxy) {
return ((ICheckboxModelProxy) elementProxy).setChecked(getPresentationContext(), getViewer().getInput(), path, checked);
@@ -277,7 +293,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
} else if (proxy != null) {
final IModelProxy finalProxy = proxy;
Job job = new Job("Model Proxy installed notification job") {//$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
IPresentationContext context = null;
Viewer viewer = null;
@@ -296,7 +313,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
return Status.OK_STATUS;
}
- public boolean shouldRun() {
+ @Override
+ public boolean shouldRun() {
return !isDisposed();
}
};
@@ -313,13 +331,13 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
private IModelProxy getElementProxy(TreePath path) {
while (path != null) {
- IModelProxy proxy = (IModelProxy) fTreeModelProxies.get(path);
+ IModelProxy proxy = fTreeModelProxies.get(path);
if (proxy != null) {
return proxy;
}
Object element = path.getSegmentCount() == 0 ? getViewer().getInput() : path.getLastSegment();
- proxy = (IModelProxy) fModelProxies.get(element);
+ proxy = fModelProxies.get(element);
if (proxy != null) {
return proxy;
}
@@ -334,17 +352,11 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
private void disposeAllModelProxies() {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
- Iterator updatePolicies = fModelProxies.values().iterator();
- while (updatePolicies.hasNext()) {
- IModelProxy proxy = (IModelProxy) updatePolicies.next();
+ for (IModelProxy proxy : fModelProxies.values()) {
proxy.dispose();
}
fModelProxies.clear();
-
- updatePolicies = fTreeModelProxies.values().iterator();
- while (updatePolicies.hasNext()) {
- IModelProxy proxy = (IModelProxy) updatePolicies.next();
+ for (IModelProxy proxy : fTreeModelProxies.values()) {
proxy.dispose();
}
fTreeModelProxies.clear();
@@ -355,17 +367,18 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* @param path the {@link TreePath} to dispose the model proxy for
*/
private void disposeModelProxy(TreePath path) {
- IModelProxy proxy = (IModelProxy) fTreeModelProxies.remove(path);
+ IModelProxy proxy = fTreeModelProxies.remove(path);
if (proxy != null) {
proxy.dispose();
}
- proxy = (IModelProxy) fModelProxies.remove(path.getLastSegment());
+ proxy = fModelProxies.remove(path.getLastSegment());
if (proxy != null) {
proxy.dispose();
}
}
- public void modelChanged(final IModelDelta delta, final IModelProxy proxy) {
+ @Override
+ public void modelChanged(final IModelDelta delta, final IModelProxy proxy) {
Display display = null;
// Check if the viewer is still available, i.e. if the content provider
@@ -383,7 +396,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
else {
fViewer.getDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
doModelChanged(delta, proxy);
}
});
@@ -415,18 +429,23 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
- public void setModelDeltaMask(int mask) {
+ @Override
+ public void setModelDeltaMask(int mask) {
fModelDeltaMask = mask;
}
- public int getModelDeltaMask() {
+ @Override
+ public int getModelDeltaMask() {
return fModelDeltaMask;
}
- public void updateModel(IModelDelta delta, int mask) {
+ @Override
+ public void updateModel(IModelDelta delta, int mask) {
// Processing deltas with null input leads to NPEs
// (Bug 380288 - NPE switching to the Breakpoints View)
- if (getViewer() == null || getViewer().getInput() == null) return;
+ if (getViewer() == null || getViewer().getInput() == null) {
+ return;
+ }
IModelDelta[] deltaArray = new IModelDelta[] { delta };
updateNodes(deltaArray, mask & (IModelDelta.REMOVED | IModelDelta.UNINSTALL));
@@ -445,7 +464,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* @return corresponding tree path
*/
TreePath getFullTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
+ ArrayList<Object> list = new ArrayList<Object>();
while (node.getParentDelta() != null) {
list.add(0, node.getElement());
node = node.getParentDelta();
@@ -461,7 +480,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* @return corresponding tree path
*/
TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
+ ArrayList<Object> list = new ArrayList<Object>();
IModelDelta parentDelta = node.getParentDelta();
while (parentDelta != null) {
list.add(0, node.getElement());
@@ -482,23 +501,28 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
- public int viewToModelIndex(TreePath parentPath, int index) {
+ @Override
+ public int viewToModelIndex(TreePath parentPath, int index) {
return fTransform.viewToModelIndex(parentPath, index);
}
- public int viewToModelCount(TreePath parentPath, int count) {
+ @Override
+ public int viewToModelCount(TreePath parentPath, int count) {
return fTransform.viewToModelCount(parentPath, count);
}
- public int modelToViewIndex(TreePath parentPath, int index) {
+ @Override
+ public int modelToViewIndex(TreePath parentPath, int index) {
return fTransform.modelToViewIndex(parentPath, index);
}
- public int modelToViewChildCount(TreePath parentPath, int count) {
+ @Override
+ public int modelToViewChildCount(TreePath parentPath, int count) {
return fTransform.modelToViewCount(parentPath, count);
}
- public boolean areTreeModelViewerFiltersApplicable(Object parentElement) {
+ @Override
+ public boolean areTreeModelViewerFiltersApplicable(Object parentElement) {
ViewerFilter[] filters = fViewer.getFilters();
if (filters.length > 0) {
for (int j = 0; j < filters.length; j++) {
@@ -512,7 +536,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
return false;
}
- public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
+ @Override
+ public boolean shouldFilter(Object parentElementOrTreePath, Object element) {
ViewerFilter[] filters = fViewer.getFilters();
if (filters.length > 0) {
for (int j = 0; j < filters.length; j++) {
@@ -520,7 +545,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
// Skip the filter if not applicable to parent element
Object parentElement = parentElementOrTreePath instanceof TreePath
? ((TreePath)parentElementOrTreePath).getLastSegment() : parentElementOrTreePath;
- if (parentElement == null) parentElement = fViewer.getInput();
+ if (parentElement == null) {
+ parentElement = fViewer.getInput();
+ }
if (!((TreeModelViewerFilter)filters[j]).isApplicable(fViewer, parentElement)) {
continue;
}
@@ -534,7 +561,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
return false;
}
- public void unmapPath(TreePath path) {
+ @Override
+ public void unmapPath(TreePath path) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
fTransform.clear(path);
cancelSubtreeUpdates(path);
@@ -589,9 +617,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
void updateStarted(ViewerUpdateMonitor update) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
- List requests = (List) fRequestsInProgress.get(update.getSchedulingPath());
+ List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(update.getSchedulingPath());
if (requests == null) {
- requests = new ArrayList();
+ requests = new ArrayList<ViewerUpdateMonitor>();
fRequestsInProgress.put(update.getSchedulingPath(), requests);
}
requests.add(update);
@@ -613,9 +641,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*
* @param updates the updates to notify
*/
- void updatesComplete(final List updates) {
+ void updatesComplete(final List<ViewerUpdateMonitor> updates) {
for (int i = 0; i < updates.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor)updates.get(i);
+ ViewerUpdateMonitor update = updates.get(i);
notifyUpdate(UPDATE_COMPLETE, update);
if (DebugUIPlugin.DEBUG_UPDATE_SEQUENCE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
DebugUIPlugin.trace("\tEND - " + update); //$NON-NLS-1$
@@ -624,15 +652,18 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
// Wait a single cycle to allow viewer to queue requests triggered by completed updates.
getViewer().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (isDisposed()) return;
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
for (int i = 0; i < updates.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor)updates.get(i);
+ ViewerUpdateMonitor update = updates.get(i);
// Search for update in list using identity test. Otherwise a completed canceled
// update may trigger removal of up-to-date running update on the same element.
- List requests = (List) fRequestsInProgress.get(update.getSchedulingPath());
+ List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(update.getSchedulingPath());
boolean found = false;
if (requests != null) {
for (int j = 0; j < requests.size(); j++) {
@@ -694,7 +725,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
for (int i = 0; i < listeners.length; i++) {
final IViewerUpdateListener listener = (IViewerUpdateListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
switch (type) {
case UPDATE_SEQUENCE_BEGINS:
listener.viewerUpdatesBegin();
@@ -708,10 +740,13 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
case UPDATE_COMPLETE:
listener.updateComplete(update);
break;
+ default:
+ break;
}
}
- public void handleException(Throwable exception) {
+ @Override
+ public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
});
@@ -726,34 +761,28 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
private void cancelSubtreeUpdates(TreePath path) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
- Iterator iterator = fRequestsInProgress.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- TreePath entryPath = (TreePath) entry.getKey();
+ for (Entry<TreePath, List<ViewerUpdateMonitor>> entry : fRequestsInProgress.entrySet()) {
+ TreePath entryPath = entry.getKey();
if (entryPath.startsWith(path, null)) {
- List requests = (List) entry.getValue();
- Iterator reqIter = requests.iterator();
+ List<ViewerUpdateMonitor> requests = entry.getValue();
+ Iterator<ViewerUpdateMonitor> reqIter = requests.iterator();
while (reqIter.hasNext()) {
// Cancel update and remove from requests list. Removing from
// fRequestsInProgress ensures that isRequestBlocked() won't be triggered
// by a canceled update.
- ((IRequest) reqIter.next()).cancel();
+ reqIter.next().cancel();
reqIter.remove();
}
}
}
- List purge = new ArrayList();
- iterator = fWaitingRequests.keySet().iterator();
- while (iterator.hasNext()) {
- TreePath entryPath = (TreePath) iterator.next();
+ List<TreePath> purge = new ArrayList<TreePath>();
+ for (TreePath entryPath : fWaitingRequests.keySet()) {
if (entryPath.startsWith(path, null)) {
purge.add(entryPath);
}
}
- iterator = purge.iterator();
- while (iterator.hasNext()) {
- fWaitingRequests.remove(iterator.next());
+ for (TreePath tp : purge) {
+ fWaitingRequests.remove(tp);
}
fStateTracker.cancelStateSubtreeUpdates(path);
@@ -769,20 +798,20 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
Assert.isTrue(getViewer().getDisplay().getThread() == Thread.currentThread());
TreePath schedulingPath = update.getSchedulingPath();
- List requests = (List) fWaitingRequests.get(schedulingPath);
+ List<ViewerUpdateMonitor> requests = fWaitingRequests.get(schedulingPath);
if (requests == null) {
- requests = new LinkedList();
+ requests = new LinkedList<ViewerUpdateMonitor>();
requests.add(update);
fWaitingRequests.put(schedulingPath, requests);
- List inProgressList = (List)fRequestsInProgress.get(schedulingPath);
+ List<ViewerUpdateMonitor> inProgressList = fRequestsInProgress.get(schedulingPath);
if (inProgressList != null) {
int staleUpdateIndex = inProgressList.indexOf(update);
if (staleUpdateIndex >= 0) {
// Cancel update and remove from requests list. Removing from
// fRequestsInProgress ensures that isRequestBlocked() won't be triggered
// by a canceled update.
- ViewerUpdateMonitor staleUpdate = (ViewerUpdateMonitor)inProgressList.remove(staleUpdateIndex);
+ ViewerUpdateMonitor staleUpdate = inProgressList.remove(staleUpdateIndex);
staleUpdate.cancel();
// Note: Do not reset the inProgressList to null. This would cause the
// updateStarted() method to think that a new update sequence is
@@ -792,8 +821,11 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
if (inProgressList == null || inProgressList.isEmpty()) {
getViewer().getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (isDisposed()) return;
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
trigger(update.getSchedulingPath());
}
});
@@ -813,10 +845,8 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* toCoalesce parameter request. Either way the returned request needs to be added to the
* waiting requests list.
*/
- private ViewerUpdateMonitor coalesce(List requests, ViewerUpdateMonitor toCoalesce) {
- Iterator reqIter = requests.iterator();
- while (reqIter.hasNext()) {
- ViewerUpdateMonitor waiting = (ViewerUpdateMonitor) reqIter.next();
+ private ViewerUpdateMonitor coalesce(List<ViewerUpdateMonitor> requests, ViewerUpdateMonitor toCoalesce) {
+ for (ViewerUpdateMonitor waiting : requests) {
if (waiting.coalesce(toCoalesce)) {
requests.remove(waiting);
// coalesced with existing request, done
@@ -836,8 +866,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
boolean areChildrenUpdatesPending(TreePath path) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
-
- List requests = (List) fWaitingRequests.get(path);
+ List<ViewerUpdateMonitor> requests = fWaitingRequests.get(path);
if (requests != null) {
for (int i = 0; i < requests.size(); i++) {
if (requests.get(i) instanceof ChildrenUpdate) {
@@ -845,7 +874,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
}
- requests = (List) fRequestsInProgress.get(path);
+ requests = fRequestsInProgress.get(path);
if (requests != null) {
int numChildrenUpdateRequests = 0;
for (int i = 0; i < requests.size(); i++) {
@@ -877,22 +906,20 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
if (fWaitingRequests.isEmpty()) {
return;
}
- List waiting = (List) fWaitingRequests.get(schedulingPath);
+ List<ViewerUpdateMonitor> waiting = fWaitingRequests.get(schedulingPath);
if (waiting == null) {
// no waiting, update the entry with the shortest path
int length = Integer.MAX_VALUE;
- Iterator entries = fWaitingRequests.entrySet().iterator();
- Entry candidate = null;
- while (entries.hasNext()) {
- Entry entry = (Entry) entries.next();
- TreePath key = (TreePath) entry.getKey();
+ Entry<TreePath, List<ViewerUpdateMonitor>> candidate = null;
+ for (Entry<TreePath, List<ViewerUpdateMonitor>> entry : fWaitingRequests.entrySet()) {
+ TreePath key = entry.getKey();
if (key.getSegmentCount() < length && !isRequestBlocked(key)) {
candidate = entry;
length = key.getSegmentCount();
}
}
if (candidate != null) {
- startHighestPriorityRequest((TreePath) candidate.getKey(), (List) candidate.getValue());
+ startHighestPriorityRequest(candidate.getKey(), candidate.getValue());
}
} else if (!isRequestBlocked(schedulingPath)) {
// start the highest priority request
@@ -908,14 +935,14 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
*/
private boolean isRequestBlocked(TreePath requestPath) {
TreePath parentPath = requestPath;
- List parentRequests = (List)fRequestsInProgress.get(parentPath);
+ List<ViewerUpdateMonitor> parentRequests = fRequestsInProgress.get(parentPath);
while (parentRequests == null || parentRequests.isEmpty()) {
parentPath = parentPath.getParentPath();
if (parentPath == null) {
// no running requests: start request
return false;
}
- parentRequests = (List)fRequestsInProgress.get(parentPath);
+ parentRequests = fRequestsInProgress.get(parentPath);
}
return true;
}
@@ -924,12 +951,10 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
* @param key the {@link TreePath}
* @param waiting the list of waiting requests
*/
- private void startHighestPriorityRequest(TreePath key, List waiting) {
+ private void startHighestPriorityRequest(TreePath key, List<ViewerUpdateMonitor> waiting) {
int priority = 4;
ViewerUpdateMonitor next = null;
- Iterator requests = waiting.iterator();
- while (requests.hasNext()) {
- ViewerUpdateMonitor vu = (ViewerUpdateMonitor) requests.next();
+ for (ViewerUpdateMonitor vu : waiting) {
if (vu.getPriority() < priority) {
next = vu;
priority = next.getPriority();
@@ -971,12 +996,12 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
private void rescheduleUpdates(TreePath parentPath, int modelIndex) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
- List requests = (List) fRequestsInProgress.get(parentPath);
- List reCreate = null;
+ List<ViewerUpdateMonitor> requests = fRequestsInProgress.get(parentPath);
+ List<IChildrenUpdate> reCreate = null;
if (requests != null) {
- Iterator iterator = requests.iterator();
+ Iterator<ViewerUpdateMonitor> iterator = requests.iterator();
while (iterator.hasNext()) {
- IViewerUpdate update = (IViewerUpdate) iterator.next();
+ ViewerUpdateMonitor update = iterator.next();
if (update instanceof IChildrenUpdate) {
IChildrenUpdate childrenUpdate = (IChildrenUpdate) update;
if (childrenUpdate.getOffset() > modelIndex) {
@@ -986,7 +1011,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
childrenUpdate.cancel();
iterator.remove();
if (reCreate == null) {
- reCreate = new ArrayList();
+ reCreate = new ArrayList<IChildrenUpdate>();
}
reCreate.add(childrenUpdate);
if (DebugUIPlugin.DEBUG_CONTENT_PROVIDER && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(getPresentationContext())) {
@@ -996,11 +1021,9 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
}
}
}
- requests = (List) fWaitingRequests.get(parentPath);
+ requests = fWaitingRequests.get(parentPath);
if (requests != null) {
- Iterator iterator = requests.iterator();
- while (iterator.hasNext()) {
- IViewerUpdate update = (IViewerUpdate) iterator.next();
+ for (ViewerUpdateMonitor update : requests) {
if (update instanceof IChildrenUpdate) {
IChildrenUpdate childrenUpdate = (IChildrenUpdate) update;
if (childrenUpdate.getOffset() > modelIndex) {
@@ -1016,9 +1039,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
// have to do this last else the requests would be waiting and
// get modified.
if (reCreate != null) {
- Iterator iterator = reCreate.iterator();
- while (iterator.hasNext()) {
- IChildrenUpdate childrenUpdate = (IChildrenUpdate) iterator.next();
+ for (IChildrenUpdate childrenUpdate : reCreate) {
int start = childrenUpdate.getOffset() - 1;
int end = start + childrenUpdate.getLength();
for (int i = start; i < end; i++) {
@@ -1071,37 +1092,37 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
TreePath parentPath = path.getParentPath();
- List requests = (List) fWaitingRequests.get(path);
+ List<ViewerUpdateMonitor> requests = fWaitingRequests.get(path);
if (requests != null) {
for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
+ ViewerUpdateMonitor update = requests.get(i);
if (update instanceof ChildrenUpdate) {
return true;
}
}
}
- requests = (List) fWaitingRequests.get(parentPath);
+ requests = fWaitingRequests.get(parentPath);
if (requests != null) {
for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
+ ViewerUpdateMonitor update = requests.get(i);
if (update.containsUpdate(path)) {
return true;
}
}
}
- requests = (List) fRequestsInProgress.get(path);
+ requests = fRequestsInProgress.get(path);
if (requests != null) {
for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
+ ViewerUpdateMonitor update = requests.get(i);
if (update instanceof ChildrenUpdate) {
return true;
}
}
}
- requests = (List) fRequestsInProgress.get(parentPath);
+ requests = fRequestsInProgress.get(parentPath);
if (requests != null) {
for (int i = 0; i < requests.size(); i++) {
- ViewerUpdateMonitor update = (ViewerUpdateMonitor) requests.get(i);
+ ViewerUpdateMonitor update = requests.get(i);
if (update.getElement().equals(path.getLastSegment())) {
return true;
}
@@ -1597,6 +1618,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#getParents(java.lang.Object)
*/
+ @Override
public TreePath[] getParents(Object element) {
return null;
}
@@ -1604,6 +1626,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#updateChildCount(org.eclipse.jface.viewers.TreePath, int)
*/
+ @Override
public void updateChildCount(TreePath treePath, int currentChildCount) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
@@ -1616,6 +1639,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#updateElement(org.eclipse.jface.viewers.TreePath, int)
*/
+ @Override
public void updateElement(TreePath parentPath, int viewIndex) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
@@ -1629,6 +1653,7 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILazyTreePathContentProvider#updateHasChildren(org.eclipse.jface.viewers.TreePath)
*/
+ @Override
public void updateHasChildren(TreePath path) {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
@@ -1648,12 +1673,15 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
Display display;
Runnable updateJob = null;
synchronized(this) {
- if (isDisposed()) return;
+ if (isDisposed()) {
+ return;
+ }
display = getViewer().getDisplay();
fCompletedUpdates.add(update);
if (fCompletedUpdatesRunnable == null) {
fCompletedUpdatesRunnable = new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (!isDisposed()) {
performUpdates();
}
@@ -1678,19 +1706,19 @@ public class TreeModelContentProvider implements ITreeModelContentProvider, ICon
private void performUpdates() {
Assert.isTrue( getViewer().getDisplay().getThread() == Thread.currentThread() );
- List jobCompletedUpdates;
+ List<ViewerUpdateMonitor> jobCompletedUpdates;
synchronized(this) {
if (isDisposed()) {
return;
}
jobCompletedUpdates = fCompletedUpdates;
fCompletedUpdatesRunnable = null;
- fCompletedUpdates = new ArrayList();
+ fCompletedUpdates = new ArrayList<ViewerUpdateMonitor>();
}
// necessary to check if viewer is disposed
try {
for (int i = 0; i < jobCompletedUpdates.size(); i++) {
- ViewerUpdateMonitor completedUpdate = (ViewerUpdateMonitor)jobCompletedUpdates.get(i);
+ ViewerUpdateMonitor completedUpdate = jobCompletedUpdates.get(i);
if (!completedUpdate.isCanceled() && !isDisposed()) {
IStatus status = completedUpdate.getStatus();
if (status == null || status.isOK()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
index 2b37f0e03..3aeea632b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/TreeModelLabelProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,10 +14,10 @@ package org.eclipse.debug.internal.ui.viewers.model;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.ISafeRunnable;
@@ -54,28 +54,28 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* Note: access this variable should be synchronized with <code>this</code>.
*/
- private List fComplete;
+ private List<ILabelUpdate> fComplete;
/**
* Cache of images used for elements in this label provider. Label updates
* use the method <code>getImage(...)</code> to cache images for
* image descriptors. The images are disposed with this label provider.
*/
- private Map fImageCache = new HashMap();
+ private Map<ImageDescriptor, Image> fImageCache = new HashMap<ImageDescriptor, Image>();
/**
* Cache of the fonts used for elements in this label provider. Label updates
* use the method <code>getFont(...)</code> to cache fonts for
* FontData objects. The fonts are disposed with this label provider.
*/
- private Map fFontCache = new HashMap();
+ private Map<FontData, Font> fFontCache = new HashMap<FontData, Font>();
/**
* Cache of the colors used for elements in this label provider. Label updates
* use the method <code>getColor(...)</code> to cache colors for
* RGB values. The colors are disposed with this label provider.
*/
- private Map fColorCache = new HashMap();
+ private Map<RGB, Color> fColorCache = new HashMap<RGB, Color>();
/**
* Label listeners
@@ -86,7 +86,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* Updates waiting to be sent to the label provider. The map contains
* lists of updates, keyed using the provider.
*/
- private Map fPendingUpdates = new HashMap();
+ private Map<IElementLabelProvider, List<ILabelUpdate>> fPendingUpdates = new HashMap<IElementLabelProvider, List<ILabelUpdate>>();
/**
* A runnable that will send the label update requests.
@@ -98,7 +98,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/**
* List of updates in progress
*/
- private List fUpdatesInProgress = new ArrayList();
+ private List<ILabelUpdate> fUpdatesInProgress = new ArrayList<ILabelUpdate>();
/**
* Delta visitor actively cancels the outstanding label updates for
@@ -108,7 +108,8 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor#visit(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta, int)
*/
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & IModelDelta.CONTENT) > 0) {
cancelElementUpdates(delta.getElement(), true);
return false;
@@ -141,11 +142,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* @param descriptor image descriptor or <code>null</code>
* @return image or <code>null</code>
*/
+ @Override
public Image getImage(ImageDescriptor descriptor) {
if (descriptor == null) {
return null;
}
- Image image = (Image) fImageCache.get(descriptor);
+ Image image = fImageCache.get(descriptor);
if (image == null) {
image = new Image(getDisplay(), descriptor.getImageData());
fImageCache.put(descriptor, image);
@@ -169,11 +171,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* @param fontData font data or <code>null</code>
* @return font font or <code>null</code>
*/
+ @Override
public Font getFont(FontData fontData) {
if (fontData == null) {
return null;
}
- Font font = (Font) fFontCache.get(fontData);
+ Font font = fFontCache.get(fontData);
if (font == null) {
font = new Font(getDisplay(), fontData);
fFontCache.put(fontData, font);
@@ -188,11 +191,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* @param rgb RGB or <code>null</code>
* @return color or <code>null</code>
*/
+ @Override
public Color getColor(RGB rgb) {
if (rgb == null) {
return null;
}
- Color color = (Color) fColorCache.get(rgb);
+ Color color = fColorCache.get(rgb);
if (color == null) {
color = new Color(getDisplay(), rgb);
fColorCache.put(rgb, color);
@@ -203,60 +207,48 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.BaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
fViewer.removeModelChangedListener(this);
fViewer = null;
- List complete = null;
+ List<ILabelUpdate> complete = null;
synchronized(this) {
complete = fComplete;
fComplete = null;
}
if (complete != null) {
- for (Iterator itr = complete.iterator(); itr.hasNext();) {
- ((ILabelUpdate)itr.next()).cancel();
- }
+ for (ILabelUpdate update : complete) {
+ update.cancel();
+ }
}
-
- Iterator updatesInProgress = fUpdatesInProgress.iterator();
- while (updatesInProgress.hasNext()) {
- ILabelUpdate currentUpdate = (ILabelUpdate) updatesInProgress.next();
+ for (ILabelUpdate currentUpdate : fUpdatesInProgress) {
currentUpdate.cancel();
}
if (fPendingUpdatesRunnable != null) {
fPendingUpdatesRunnable = null;
}
- for (Iterator itr = fPendingUpdates.values().iterator(); itr.hasNext();) {
- List updateList = (List)itr.next();
- for (Iterator listItr = updateList.iterator(); listItr.hasNext();) {
- ((LabelUpdate)listItr.next()).cancel();
+ for (List<ILabelUpdate> updateList : fPendingUpdates.values()) {
+ for (ILabelUpdate update : updateList) {
+ update.cancel();
}
}
fPendingUpdates.clear();
- Iterator images = fImageCache.values().iterator();
- while (images.hasNext()) {
- Image image = (Image) images.next();
+ for (Image image : fImageCache.values()) {
image.dispose();
}
fImageCache.clear();
-
- Iterator fonts = fFontCache.values().iterator();
- while (fonts.hasNext()) {
- Font font = (Font) fonts.next();
+ for (Font font : fFontCache.values()) {
font.dispose();
}
fFontCache.clear();
-
- Iterator colors = fColorCache.values().iterator();
- while (colors.hasNext()) {
- Color color = (Color) colors.next();
+ for (Color color : fColorCache.values()) {
color.dispose();
}
fColorCache.clear();
-
super.dispose();
}
@@ -264,10 +256,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
return fViewer == null;
}
+ @Override
public void update(ViewerCell cell) {
// NOT USED - the viewer updates each row instead
}
+ @Override
public boolean update(TreePath elementPath) {
Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
@@ -277,15 +271,18 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
Object element = elementPath.getLastSegment();
IElementLabelProvider presentation = ViewerAdapterService.getLabelProvider(element);
if (presentation != null) {
- List updates = (List)fPendingUpdates.get(presentation);
+ List<ILabelUpdate> updates = fPendingUpdates.get(presentation);
if (updates == null) {
- updates = new LinkedList();
+ updates = new LinkedList<ILabelUpdate>();
fPendingUpdates.put(presentation, updates);
}
updates.add(new LabelUpdate(fViewer.getInput(), elementPath, this, visibleColumns, fViewer.getPresentationContext()));
fPendingUpdatesRunnable = new Runnable() {
- public void run() {
- if (isDisposed()) return;
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
startRequests(this);
}
};
@@ -302,10 +299,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
*/
private void cancelPathUpdates(TreePath elementPath) {
Assert.isTrue(fViewer.getDisplay().getThread() == Thread.currentThread());
-
- Iterator updatesInProgress = fUpdatesInProgress.iterator();
- while (updatesInProgress.hasNext()) {
- ILabelUpdate currentUpdate = (ILabelUpdate) updatesInProgress.next();
+ for (ILabelUpdate currentUpdate : fUpdatesInProgress) {
if (elementPath.equals(currentUpdate.getElementPath())) {
currentUpdate.cancel();
}
@@ -340,15 +334,14 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
if (runnable != fPendingUpdatesRunnable) {
return;
}
-
if (!fPendingUpdates.isEmpty()) {
- for (Iterator itr = fPendingUpdates.keySet().iterator(); itr.hasNext();) {
- IElementLabelProvider provider = (IElementLabelProvider)itr.next();
- List list = (List)fPendingUpdates.get(provider);
- for (Iterator listItr = list.iterator(); listItr.hasNext();) {
- updateStarted((ILabelUpdate)listItr.next());
+ List<ILabelUpdate> list = null;
+ for (Entry<IElementLabelProvider, List<ILabelUpdate>> entry : fPendingUpdates.entrySet()) {
+ list = entry.getValue();
+ for (ILabelUpdate update : list) {
+ updateStarted(update);
}
- provider.update( (ILabelUpdate[])list.toArray(new ILabelUpdate[list.size()]) );
+ entry.getKey().update(list.toArray(new ILabelUpdate[list.size()]));
}
}
fPendingUpdates.clear();
@@ -364,10 +357,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* of the update
*/
private void cancelElementUpdates(Object element, boolean searchFullPath) {
- Iterator updatesInProgress = fUpdatesInProgress.iterator();
- while (updatesInProgress.hasNext()) {
- ILabelUpdate currentUpdate = (ILabelUpdate) updatesInProgress.next();
-
+ for (ILabelUpdate currentUpdate : fUpdatesInProgress) {
if (searchFullPath) {
if (element.equals(fViewer.getInput())) {
currentUpdate.cancel();
@@ -403,24 +393,28 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
* @param update Update that is to be completed.
*/
synchronized void complete(ILabelUpdate update) {
- if (fViewer == null) return;
+ if (fViewer == null) {
+ return;
+ }
if (fComplete == null) {
- fComplete = new LinkedList();
+ fComplete = new LinkedList<ILabelUpdate>();
fViewer.getDisplay().asyncExec(new Runnable() {
- public void run() {
- if (isDisposed()) return;
- List updates = null;
+ @Override
+ public void run() {
+ if (isDisposed()) {
+ return;
+ }
+ List<ILabelUpdate> updates = null;
synchronized (TreeModelLabelProvider.this) {
updates = fComplete;
fComplete = null;
}
- for (Iterator itr = updates.iterator(); itr.hasNext();) {
- LabelUpdate itrUpdate = (LabelUpdate)itr.next();
+ for (ILabelUpdate itrUpdate : updates) {
if (itrUpdate.isCanceled()) {
updateComplete(itrUpdate);
} else {
- itrUpdate.performUpdate();
+ ((LabelUpdate) itrUpdate).performUpdate();
}
}
}
@@ -429,10 +423,12 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
fComplete.add(update);
}
+ @Override
public void addLabelUpdateListener(ILabelUpdateListener listener) {
fLabelListeners.add(listener);
}
+ @Override
public void removeLabelUpdateListener(ILabelUpdateListener listener) {
fLabelListeners.remove(listener);
}
@@ -486,6 +482,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
for (int i = 0; i < listeners.length; i++) {
final ILabelUpdateListener listener = (ILabelUpdateListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
switch (type) {
case TreeModelContentProvider.UPDATE_SEQUENCE_BEGINS:
@@ -500,8 +497,11 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
case TreeModelContentProvider.UPDATE_COMPLETE:
listener.labelUpdateComplete(update);
break;
+ default:
+ break;
}
}
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
@@ -510,6 +510,7 @@ public class TreeModelLabelProvider extends ColumnLabelProvider
}
}
+ @Override
public void modelChanged(IModelDelta delta, IModelProxy proxy) {
delta.accept(fCancelPendingUpdatesVisitor);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
index 539e806c4..15b304571 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerAdapterService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -154,7 +154,7 @@ public class ViewerAdapterService {
* @param type adapter type
* @return adapter or <code>null</code>
*/
- private static Object getAdapter(Object element, Class type) {
+ private static Object getAdapter(Object element, Class<?> type) {
return DebugPlugin.getAdapter(element, type);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
index dcf9a2015..3c46cf1b9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerInputUpdate.java
@@ -64,7 +64,8 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
* When <code>done()</code> is called, the viewer must be informed that the update is complete in the UI thread.
*/
protected WorkbenchJob fViewerInputUpdateJob = new WorkbenchJob("Asynchronous viewer input update") { //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
if (ViewerInputUpdate.this.isCanceled()){
return Status.CANCEL_STATUS;
}
@@ -92,6 +93,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getPresentationContext()
*/
+ @Override
public IPresentationContext getPresentationContext() {
return fContext;
}
@@ -99,7 +101,8 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
- public final void done() {
+ @Override
+ public final void done() {
synchronized (this) {
if (isDone()) {
return;
@@ -121,6 +124,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getElement()
*/
+ @Override
public Object getElement() {
return fSource;
}
@@ -128,6 +132,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
+ @Override
public TreePath getElementPath() {
return TreePath.EMPTY;
}
@@ -135,6 +140,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#setViewerInput(java.lang.Object)
*/
+ @Override
public void setInputElement(Object element) {
fInputElement = element;
}
@@ -142,6 +148,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate#getViewerInput()
*/
+ @Override
public Object getInputElement() {
return fInputElement;
}
@@ -149,6 +156,7 @@ public class ViewerInputUpdate extends Request implements IViewerInputUpdate {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
*/
+ @Override
public Object getViewerInput() {
return fViewerInput;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
index e69c3dc53..b208e5af4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerStateTracker.java
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;
@@ -119,7 +120,7 @@ class ViewerStateTracker {
/**
* LRU cache for viewer states
*/
- class LRUMap extends LinkedHashMap {
+ class LRUMap<K, V> extends LinkedHashMap<K, V> {
private static final long serialVersionUID = 1L;
private int fMaxSize;
@@ -129,7 +130,8 @@ class ViewerStateTracker {
fMaxSize = maxSize;
}
- protected boolean removeEldestEntry(Entry eldest) {
+ @Override
+ protected boolean removeEldestEntry(Entry<K, V> eldest) {
return size() > fMaxSize;
}
}
@@ -146,7 +148,7 @@ class ViewerStateTracker {
/**
* Map of viewer states keyed by viewer input mementos
*/
- private Map fViewerStates = new LRUMap(20);
+ private Map<String, ModelDelta> fViewerStates = new LRUMap<String, ModelDelta>(20);
/**
* Pending viewer state to be restored
@@ -173,7 +175,7 @@ class ViewerStateTracker {
/**
* Set of IMementoManager's that are currently saving state
*/
- private Set fPendingStateSaves = new HashSet();
+ private Set<IElementMementoCollector> fPendingStateSaves = new HashSet<IElementMementoCollector>();
/**
* Used to queue a viewer input for state restore
@@ -193,7 +195,8 @@ class ViewerStateTracker {
TreePath fPath;
IModelDelta fDelta;
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
if (obj instanceof CompareRequestKey) {
CompareRequestKey key = (CompareRequestKey) obj;
return key.fDelta.equals(fDelta) && key.fPath.equals(fPath);
@@ -201,7 +204,8 @@ class ViewerStateTracker {
return false;
}
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fDelta.hashCode() + fPath.hashCode();
}
}
@@ -209,7 +213,7 @@ class ViewerStateTracker {
/**
* Compare requests that are currently running.
*/
- private Map fCompareRequestsInProgress = new LinkedHashMap();
+ private Map<CompareRequestKey, ElementCompareRequest> fCompareRequestsInProgress = new LinkedHashMap<CompareRequestKey, ElementCompareRequest>();
/**
@@ -217,14 +221,12 @@ class ViewerStateTracker {
*/
void dispose() {
Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
-
- for (Iterator itr = fPendingStateSaves.iterator(); itr.hasNext(); ) {
- ((IElementMementoCollector)itr.next()).cancel();
+ for (IElementMementoCollector emc : fPendingStateSaves) {
+ emc.cancel();
}
fStateUpdateListeners.clear();
-
- for (Iterator itr = fCompareRequestsInProgress.values().iterator(); itr.hasNext();) {
- ((ElementCompareRequest)itr.next()).cancel();
+ for (ElementCompareRequest ecr : fCompareRequestsInProgress.values()) {
+ ecr.cancel();
}
fCompareRequestsInProgress.clear();
@@ -261,8 +263,11 @@ class ViewerStateTracker {
* IMementoManager#requestComplete(org.eclipse.debug.internal.ui
* .viewers.model.provisional.IElementMementoRequest)
*/
- public void requestComplete(ElementMementoRequest request) {
- if (fContentProvider.isDisposed()) return;
+ @Override
+ public void requestComplete(ElementMementoRequest request) {
+ if (fContentProvider.isDisposed()) {
+ return;
+ }
notifyStateUpdate(input, TreeModelContentProvider.UPDATE_COMPLETE, request);
@@ -272,7 +277,7 @@ class ViewerStateTracker {
try {
keyMemento.save(writer);
final String keyMementoString = writer.toString();
- ModelDelta stateDelta = (ModelDelta) fViewerStates.get(keyMementoString);
+ ModelDelta stateDelta = fViewerStates.get(keyMementoString);
if (stateDelta != null) {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE INPUT COMARE ENDED : " + fRequest + " - MATCHING STATE FOUND"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -281,9 +286,10 @@ class ViewerStateTracker {
// Process start of restore in an async cycle because we may still be inside inputChanged()
// call. I.e. the "input.equals(fContentProvider.getViewer().getInput())" test may fail.
fContentProvider.getViewer().getDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (!fContentProvider.isDisposed() && input.equals(fContentProvider.getViewer().getInput())) {
- ModelDelta stateDelta2 = (ModelDelta) fViewerStates.remove(keyMementoString);
+ ModelDelta stateDelta2 = fViewerStates.remove(keyMementoString);
if (stateDelta2 != null) {
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE BEGINS"); //$NON-NLS-1$
@@ -321,7 +327,8 @@ class ViewerStateTracker {
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .IMementoManager#processReqeusts()
*/
- public void processReqeusts() {
+ @Override
+ public void processReqeusts() {
notifyStateUpdate(input, STATE_RESTORE_SEQUENCE_BEGINS, null);
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE RESTORE INPUT COMARE BEGIN : " + fRequest); //$NON-NLS-1$
@@ -339,11 +346,13 @@ class ViewerStateTracker {
* IMementoManager#addRequest(org.eclipse.debug.internal.ui.viewers
* .model.provisional.IElementMementoRequest)
*/
- public void addRequest(ElementMementoRequest req) {
+ @Override
+ public void addRequest(ElementMementoRequest req) {
fRequest = req;
}
- public void cancel() {
+ @Override
+ public void cancel() {
// not used
}
@@ -364,7 +373,10 @@ class ViewerStateTracker {
* @param path Path to subtree to restore.
*/
void appendToPendingStateDelta(final TreePath path) {
- if (fContentProvider.getViewer() == null) return; // Not initialized yet.
+ if (fContentProvider.getViewer() == null)
+ {
+ return; // Not initialized yet.
+ }
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
DebugUIPlugin.trace("STATE APPEND BEGIN: " + path.getLastSegment()); //$NON-NLS-1$
@@ -391,7 +403,8 @@ class ViewerStateTracker {
// markers are used by the restore logic to know when a delta node can
// be removed.
delta.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta d, int depth) {
+ @Override
+ public boolean visit(IModelDelta d, int depth) {
if ((d.getFlags() & IModelDelta.EXPAND) != 0) {
((ModelDelta) d).setFlags(d.getFlags() | IModelDelta.CONTENT);
}
@@ -415,7 +428,8 @@ class ViewerStateTracker {
// attributes into the pending delta.
if (path.getSegmentCount() > 0) {
fPendingState.accept( new IModelDeltaVisitor() {
- public boolean visit(IModelDelta pendingDeltaNode, int depth) {
+ @Override
+ public boolean visit(IModelDelta pendingDeltaNode, int depth) {
TreePath pendingDeltaPath = fContentProvider.getViewerTreePath(pendingDeltaNode);
if (path.startsWith(pendingDeltaPath, null))
{
@@ -432,7 +446,8 @@ class ViewerStateTracker {
// Copy the pending state into the new appended state.
fPendingState.accept( new IModelDeltaVisitor() {
- public boolean visit(IModelDelta pendingDeltaNode, int depth) {
+ @Override
+ public boolean visit(IModelDelta pendingDeltaNode, int depth) {
// Skip the top element
if (pendingDeltaNode.getParentDelta() == null) {
return true;
@@ -495,8 +510,8 @@ class ViewerStateTracker {
* @param input the {@link ModelDelta} input
*/
protected void saveViewerState(Object input) {
- for (Iterator itr = fCompareRequestsInProgress.values().iterator(); itr.hasNext();) {
- ((ElementCompareRequest) itr.next()).cancel();
+ for (Iterator<ElementCompareRequest> itr = fCompareRequestsInProgress.values().iterator(); itr.hasNext();) {
+ itr.next().cancel();
itr.remove();
}
@@ -548,7 +563,8 @@ class ViewerStateTracker {
}
IModelDeltaVisitor pendingStateVisitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta pendingDeltaNode, int depth) {
+ @Override
+ public boolean visit(IModelDelta pendingDeltaNode, int depth) {
// Ignore the top element.
if (pendingDeltaNode.getParentDelta() == null) {
return true;
@@ -612,7 +628,8 @@ class ViewerStateTracker {
private void clearRevealFlag(ModelDelta saveRootDelta) {
IModelDeltaVisitor clearDeltaVisitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & IModelDelta.REVEAL) != 0) {
((ModelDelta) delta).setFlags(delta.getFlags() & ~IModelDelta.REVEAL);
}
@@ -624,7 +641,7 @@ class ViewerStateTracker {
private ModelDelta findSubDeltaParent(ModelDelta destinationDeltaRoot, IModelDelta subDelta) {
// Create a path of elements to the sub-delta.
- LinkedList deltaPath = new LinkedList();
+ LinkedList<IModelDelta> deltaPath = new LinkedList<IModelDelta>();
IModelDelta delta = subDelta;
while (delta.getParentDelta() != null) {
delta = delta.getParentDelta();
@@ -633,12 +650,12 @@ class ViewerStateTracker {
// For each element in the path of the sub-delta, find the corresponding
// element in the destination delta
- Iterator itr = deltaPath.iterator();
+ Iterator<IModelDelta> itr = deltaPath.iterator();
// Skip the root element
itr.next();
ModelDelta saveDelta = destinationDeltaRoot;
while (saveDelta != null && itr.hasNext()) {
- IModelDelta itrDelta = (IModelDelta) itr.next();
+ IModelDelta itrDelta = itr.next();
saveDelta = saveDelta.getChildDelta(itrDelta.getElement(), itrDelta.getIndex());
}
return saveDelta;
@@ -682,7 +699,7 @@ class ViewerStateTracker {
/**
* list of memento fRequests
*/
- private List fRequests = new ArrayList();
+ private List<IElementMementoRequest> fRequests = new ArrayList<IElementMementoRequest>();
/**
* Flag indicating whether the encoding of delta has been canceled.
@@ -698,7 +715,8 @@ class ViewerStateTracker {
* #requestComplete(org.eclipse.debug.internal.ui.viewers
* .model.provisional.IElementMementoRequest)
*/
- public void requestComplete(ElementMementoRequest request) {
+ @Override
+ public void requestComplete(ElementMementoRequest request) {
Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
notifyStateUpdate(input, TreeModelContentProvider.UPDATE_COMPLETE, request);
@@ -731,7 +749,8 @@ class ViewerStateTracker {
}
}
- public void cancel() {
+ @Override
+ public void cancel() {
Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
if (fCanceled) {
@@ -739,9 +758,7 @@ class ViewerStateTracker {
}
fCanceled = true;
- Iterator iterator = fRequests.iterator();
- while (iterator.hasNext()) {
- IElementMementoRequest req = (IElementMementoRequest) iterator.next();
+ for (IElementMementoRequest req : fRequests) {
req.cancel();
}
fRequests.clear();
@@ -758,32 +775,28 @@ class ViewerStateTracker {
* org.eclipse.debug.internal.ui.viewers.model.provisional.viewers
* .IMementoManager#processReqeusts()
*/
- public void processReqeusts() {
+ @Override
+ public void processReqeusts() {
Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
- Map providers = new HashMap();
- Iterator iterator = fRequests.iterator();
- while (iterator.hasNext()) {
- IElementMementoRequest request = (IElementMementoRequest) iterator.next();
+ Map<IElementMementoProvider, List<IElementMementoRequest>> providers = new HashMap<IElementMementoProvider, List<IElementMementoRequest>>();
+ for (IElementMementoRequest request : fRequests) {
notifyStateUpdate(input, TreeModelContentProvider.UPDATE_BEGINS, request);
IElementMementoProvider provider = ViewerAdapterService.getMementoProvider(request.getElement());
if (provider == null) {
provider = defaultProvider;
}
- List reqs = (List) providers.get(provider);
+ List<IElementMementoRequest> reqs = providers.get(provider);
if (reqs == null) {
- reqs = new ArrayList();
+ reqs = new ArrayList<IElementMementoRequest>();
providers.put(provider, reqs);
}
reqs.add(request);
}
- iterator = providers.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- IElementMementoProvider provider = (IElementMementoProvider) entry.getKey();
- List reqs = (List) entry.getValue();
- provider.encodeElements((IElementMementoRequest[]) reqs.toArray(new IElementMementoRequest[reqs
- .size()]));
+ for (Entry<IElementMementoProvider, List<IElementMementoRequest>> entry : providers.entrySet()) {
+ IElementMementoProvider provider = entry.getKey();
+ List<IElementMementoRequest> reqs = entry.getValue();
+ provider.encodeElements(reqs.toArray(new IElementMementoRequest[reqs.size()]));
}
}
@@ -796,7 +809,8 @@ class ViewerStateTracker {
* #addRequest(org.eclipse.debug.internal.ui.viewers.
* model.provisional.IElementMementoRequest)
*/
- public void addRequest(ElementMementoRequest request) {
+ @Override
+ public void addRequest(ElementMementoRequest request) {
Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
fRequests.add(request);
@@ -804,7 +818,8 @@ class ViewerStateTracker {
};
IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
// Add the CONTENT flag to all nodes with an EXPAND flag.
// During restoring, this flag is used as a marker indicating
// whether all the content of a given element has been
@@ -918,7 +933,8 @@ class ViewerStateTracker {
// If we're canceling select or reveal, cancel it for all of pending deltas
final int mask = flags & (IModelDelta.SELECT | IModelDelta.REVEAL);
fPendingState.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
int deltaFlags = delta.getFlags();
int newFlags = deltaFlags & ~mask;
if (DebugUIPlugin.DEBUG_STATE_SAVE_RESTORE && DebugUIPlugin.DEBUG_TEST_PRESENTATION_ID(fContentProvider.getPresentationContext())) {
@@ -935,7 +951,8 @@ class ViewerStateTracker {
final int mask = flags & ~(IModelDelta.SELECT | IModelDelta.REVEAL);
// For other flags (EXPAND/COLLAPSE), cancel only from the matching path.
fPendingState.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if (depth < path.getSegmentCount()) {
// Descend until we reach a matching depth.
TreePath deltaPath = fContentProvider.getViewerTreePath(delta);
@@ -1002,7 +1019,8 @@ class ViewerStateTracker {
}
IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
- public boolean visit(final IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(final IModelDelta delta, int depth) {
Object element = delta.getElement();
Object potentialMatch = depth != 0 ? path.getSegment(depth - 1) : fContentProvider.getViewer().getInput();
@@ -1015,7 +1033,7 @@ class ViewerStateTracker {
}
if (provider != null) {
CompareRequestKey key = new CompareRequestKey(path, delta);
- ElementCompareRequest existingRequest = (ElementCompareRequest) fCompareRequestsInProgress
+ ElementCompareRequest existingRequest = fCompareRequestsInProgress
.get(key);
if (existingRequest != null) {
// Check all the running compare updates for a
@@ -1085,7 +1103,8 @@ class ViewerStateTracker {
* #visit(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta,
* int)
*/
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
// Filter out the CONTENT flags from the delta flags, the content
// flag is only used as a marker indicating that all the sub-elements
// of a given delta have been retrieved.
@@ -1121,8 +1140,7 @@ class ViewerStateTracker {
}
private boolean areMementoUpdatesPending(IModelDelta delta) {
- for (Iterator itr = fCompareRequestsInProgress.keySet().iterator(); itr.hasNext();) {
- CompareRequestKey key = (CompareRequestKey) itr.next();
+ for (CompareRequestKey key : fCompareRequestsInProgress.keySet()) {
if (delta.getElement().equals(key.fDelta.getElement())) {
return true;
}
@@ -1136,7 +1154,8 @@ class ViewerStateTracker {
}
delta.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta _visitorDelta, int depth) {
+ @Override
+ public boolean visit(IModelDelta _visitorDelta, int depth) {
ModelDelta visitorDelta = (ModelDelta) _visitorDelta;
visitorDelta.setElement(ELEMENT_REMOVED);
visitorDelta.setFlags(IModelDelta.NO_CHANGE);
@@ -1315,7 +1334,8 @@ class ViewerStateTracker {
private int fCounter = 0;
private Object fModelInput = fPendingState.getElement();
- public void viewerUpdatesComplete() {
+ @Override
+ public void viewerUpdatesComplete() {
Assert.isTrue( fContentProvider.getViewer().getDisplay().getThread() == Thread.currentThread() );
IInternalTreeModelViewer viewer = fContentProvider.getViewer();
@@ -1345,9 +1365,12 @@ class ViewerStateTracker {
}
}
- public void viewerUpdatesBegin() {}
- public void updateStarted(IViewerUpdate update) {}
- public void updateComplete(IViewerUpdate update) {}
+ @Override
+ public void viewerUpdatesBegin() {}
+ @Override
+ public void updateStarted(IViewerUpdate update) {}
+ @Override
+ public void updateComplete(IViewerUpdate update) {}
/**
* Returns delta that is used to reveal the item.
@@ -1365,7 +1388,9 @@ class ViewerStateTracker {
fPendingSetTopItem = null;
IInternalTreeModelViewer viewer = fContentProvider.getViewer();
- if (viewer == null) return;
+ if (viewer == null) {
+ return;
+ }
// remove myself as viewer update listener
viewer.removeViewerUpdateListener(this);
@@ -1418,7 +1443,8 @@ class ViewerStateTracker {
private ModelDelta markRevealDelta(ModelDelta rootDelta) {
final ModelDelta[] revealDelta = new ModelDelta[1];
IModelDeltaVisitor visitor = new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if ( (delta.getFlags() & IModelDelta.REVEAL) != 0) {
revealDelta[0] = (ModelDelta)delta;
}
@@ -1475,10 +1501,10 @@ class ViewerStateTracker {
* @param path Path of element to cancel updates for.
*/
void cancelStateSubtreeUpdates(TreePath path) {
- for (Iterator itr = fCompareRequestsInProgress.keySet().iterator(); itr.hasNext();) {
- CompareRequestKey key = (CompareRequestKey) itr.next();
+ for (Iterator<CompareRequestKey> itr = fCompareRequestsInProgress.keySet().iterator(); itr.hasNext();) {
+ CompareRequestKey key = itr.next();
if (key.fPath.startsWith(path, null)) {
- ElementCompareRequest compareRequest = (ElementCompareRequest) fCompareRequestsInProgress.get(key);
+ ElementCompareRequest compareRequest = fCompareRequestsInProgress.get(key);
compareRequest.cancel();
itr.remove();
}
@@ -1525,30 +1551,34 @@ class ViewerStateTracker {
for (int i = 0; i < listeners.length; i++) {
final IStateUpdateListener listener = (IStateUpdateListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
switch (type) {
- case STATE_SAVE_SEQUENCE_BEGINS:
- listener.stateSaveUpdatesBegin(input);
- break;
- case STATE_SAVE_SEQUENCE_COMPLETE:
- listener.stateSaveUpdatesComplete(input);
- break;
- case STATE_RESTORE_SEQUENCE_BEGINS:
- listener.stateRestoreUpdatesBegin(input);
- break;
- case STATE_RESTORE_SEQUENCE_COMPLETE:
- listener.stateRestoreUpdatesComplete(input);
- break;
- case TreeModelContentProvider.UPDATE_BEGINS:
- listener.stateUpdateStarted(input, update);
- break;
- case TreeModelContentProvider.UPDATE_COMPLETE:
- listener.stateUpdateComplete(input, update);
- break;
+ case STATE_SAVE_SEQUENCE_BEGINS:
+ listener.stateSaveUpdatesBegin(input);
+ break;
+ case STATE_SAVE_SEQUENCE_COMPLETE:
+ listener.stateSaveUpdatesComplete(input);
+ break;
+ case STATE_RESTORE_SEQUENCE_BEGINS:
+ listener.stateRestoreUpdatesBegin(input);
+ break;
+ case STATE_RESTORE_SEQUENCE_COMPLETE:
+ listener.stateRestoreUpdatesComplete(input);
+ break;
+ case TreeModelContentProvider.UPDATE_BEGINS:
+ listener.stateUpdateStarted(input, update);
+ break;
+ case TreeModelContentProvider.UPDATE_COMPLETE:
+ listener.stateUpdateComplete(input, update);
+ break;
+ default:
+ break;
}
}
- public void handleException(Throwable exception) {
+ @Override
+ public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
});
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
index d75adc6cf..5058d4a48 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/ViewerUpdateMonitor.java
@@ -123,7 +123,8 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IProgressMonitor#done()
*/
- public final void done() {
+ @Override
+ public final void done() {
synchronized (this) {
if (isDone()) {
return;
@@ -155,6 +156,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
*/
+ @Override
public IPresentationContext getPresentationContext() {
return fContext;
}
@@ -162,6 +164,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
+ @Override
public Object getElement() {
return fElement;
}
@@ -169,6 +172,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
+ @Override
public TreePath getElementPath() {
return fElementPath;
}
@@ -213,6 +217,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
*/
+ @Override
public Object getViewerInput() {
return fViewerInput;
}
@@ -257,6 +262,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
return fIsDelegated;
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof ViewerUpdateMonitor) {
return doEquals((ViewerUpdateMonitor)obj);
@@ -264,6 +270,7 @@ public abstract class ViewerUpdateMonitor extends Request implements IViewerUpda
return false;
}
+ @Override
public int hashCode() {
return doHashCode();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
index afb1eae67..74244bf03 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,6 @@ package org.eclipse.debug.internal.ui.viewers.model;
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -64,24 +63,30 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
VirtualTreeModelViewer fVirtualViewer;
IProgressMonitor fProgressMonitor;
int fSelectionRootDepth;
- Set fItemsToUpdate;
+ Set<VirtualItem> fItemsToUpdate;
- public void labelUpdateStarted(ILabelUpdate update) {}
- public void labelUpdateComplete(ILabelUpdate update) {
+ @Override
+ public void labelUpdateStarted(ILabelUpdate update) {}
+ @Override
+ public void labelUpdateComplete(ILabelUpdate update) {
VirtualItem updatedItem = fVirtualViewer.findItem(update.getElementPath());
if (fItemsToUpdate.remove(updatedItem)) {
incrementProgress(1);
}
}
- public void labelUpdatesBegin() {
+ @Override
+ public void labelUpdatesBegin() {
}
- public void labelUpdatesComplete() {
+ @Override
+ public void labelUpdatesComplete() {
}
- public void revealed(VirtualItem item) {
+ @Override
+ public void revealed(VirtualItem item) {
}
- public void disposed(VirtualItem item) {
+ @Override
+ public void disposed(VirtualItem item) {
if (fItemsToUpdate.remove(item)) {
incrementProgress(1);
}
@@ -104,6 +109,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
/**
* @see AbstractDebugActionDelegate#initialize(IAction, ISelection)
*/
+ @Override
protected boolean initialize(IAction action, ISelection selection) {
if (!isInitialized()) {
IDebugView adapter= (IDebugView)getView().getAdapter(IDebugView.class);
@@ -148,21 +154,22 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
private class ItemsToCopyVirtualItemValidator implements IVirtualItemValidator {
- Set fItemsToCopy = Collections.EMPTY_SET;
- Set fItemsToValidate = Collections.EMPTY_SET;
+ Set<VirtualItem> fItemsToCopy = Collections.EMPTY_SET;
+ Set<VirtualItem> fItemsToValidate = Collections.EMPTY_SET;
- public boolean isItemVisible(VirtualItem item) {
+ @Override
+ public boolean isItemVisible(VirtualItem item) {
return fItemsToValidate.contains(item);
}
- public void showItem(VirtualItem item) {
+ @Override
+ public void showItem(VirtualItem item) {
}
- void setItemsToCopy(Set itemsToCopy) {
+ void setItemsToCopy(Set<VirtualItem> itemsToCopy) {
fItemsToCopy = itemsToCopy;
- fItemsToValidate = new HashSet();
- for (Iterator itr = itemsToCopy.iterator(); itr.hasNext();) {
- VirtualItem itemToCopy = (VirtualItem)itr.next();
+ fItemsToValidate = new HashSet<VirtualItem>();
+ for (VirtualItem itemToCopy : itemsToCopy) {
while (itemToCopy != null) {
fItemsToValidate.add(itemToCopy);
itemToCopy = itemToCopy.getParent();
@@ -194,7 +201,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
// Parse selected items from client viewer and add them to the virtual viewer selection.
listener.fSelectionRootDepth = Integer.MAX_VALUE;
TreeItem[] selection = getSelectedItems(clientViewer);
- Set vSelection = new HashSet(selection.length * 4/3);
+ Set<VirtualItem> vSelection = new HashSet<VirtualItem>(selection.length * 4 / 3);
for (int i = 0; i < selection.length; i++) {
TreePath parentPath = fClientViewer.getTreePathFromItem(selection[i].getParentItem());
listener.fSelectionRootDepth = Math.min(parentPath.getSegmentCount() + 1, listener.fSelectionRootDepth);
@@ -213,7 +220,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
}
}
validator.setItemsToCopy(vSelection);
- listener.fItemsToUpdate = new HashSet(vSelection);
+ listener.fItemsToUpdate = new HashSet<VirtualItem>(vSelection);
virtualViewer.getTree().validate();
return virtualViewer;
}
@@ -226,6 +233,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
* Do the specific action using the current selection.
* @param action Action that is running.
*/
+ @Override
public void run(final IAction action) {
if (fClientViewer.getSelection().isEmpty()) {
return;
@@ -241,6 +249,7 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
dialog.setCancelable(true);
IRunnableWithProgress runnable = new IRunnableWithProgress() {
+ @Override
public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
synchronized(listener) {
listener.fProgressMonitor = m;
@@ -273,13 +282,13 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
virtualViewer.dispose();
}
- private void copySelectionToClipboard(VirtualTreeModelViewer virtualViewer, Set itemsToCopy, int selectionRootDepth) {
+ private void copySelectionToClipboard(VirtualTreeModelViewer virtualViewer, Set<VirtualItem> itemsToCopy, int selectionRootDepth) {
StringBuffer buffer = new StringBuffer();
writeItemToBuffer (virtualViewer.getTree(), itemsToCopy, buffer, -selectionRootDepth);
writeBufferToClipboard(buffer);
}
- protected void writeItemToBuffer(VirtualItem item, Set itemsToCopy, StringBuffer buffer, int indent) {
+ protected void writeItemToBuffer(VirtualItem item, Set<VirtualItem> itemsToCopy, StringBuffer buffer, int indent) {
if (itemsToCopy.contains(item)) {
append(item, buffer, indent);
}
@@ -292,7 +301,9 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
}
protected void writeBufferToClipboard(StringBuffer buffer) {
- if (buffer.length() == 0) return;
+ if (buffer.length() == 0) {
+ return;
+ }
TextTransfer plainTextTransfer = TextTransfer.getInstance();
Clipboard clipboard= new Clipboard(fClientViewer.getControl().getDisplay());
@@ -322,10 +333,12 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
/**
* @see AbstractDebugActionDelegate#doAction(Object)
*/
+ @Override
protected void doAction(Object element) {
//not used
}
+ @Override
protected boolean getEnableStateForSelection(IStructuredSelection selection) {
if (selection.isEmpty()) {
return true;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
index b7af7180f..0c6208b47 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
@@ -68,28 +68,36 @@ public class VirtualFindAction extends Action implements IUpdate {
private IProgressMonitor fProgressMonitor;
private int fRemainingUpdatesCount = 0;
- public void labelUpdateStarted(ILabelUpdate update) {}
- public void labelUpdateComplete(ILabelUpdate update) {
+ @Override
+ public void labelUpdateStarted(ILabelUpdate update) {}
+ @Override
+ public void labelUpdateComplete(ILabelUpdate update) {
incrementProgress(1);
}
- public void labelUpdatesBegin() {
+ @Override
+ public void labelUpdatesBegin() {
fLabelUpdatesComplete = false;
}
- public void labelUpdatesComplete() {
+ @Override
+ public void labelUpdatesComplete() {
fLabelUpdatesComplete = true;
completeProgress();
}
- public void updateStarted(IViewerUpdate update) {}
- public void updateComplete(IViewerUpdate update) {
+ @Override
+ public void updateStarted(IViewerUpdate update) {}
+ @Override
+ public void updateComplete(IViewerUpdate update) {
if (update instanceof IChildrenUpdate) {
incrementProgress(((IChildrenUpdate)update).getLength());
}
}
- public void viewerUpdatesBegin() {
+ @Override
+ public void viewerUpdatesBegin() {
fViewerUpdatesComplete = false;
}
- public void viewerUpdatesComplete() {
+ @Override
+ public void viewerUpdatesComplete() {
fViewerUpdatesComplete = true;
completeProgress();
}
@@ -119,21 +127,24 @@ public class VirtualFindAction extends Action implements IUpdate {
private static class FindLabelProvider extends LabelProvider {
private VirtualTreeModelViewer fVirtualViewer;
- private Map fTextCache = new HashMap();
- public FindLabelProvider(VirtualTreeModelViewer viewer, List items) {
+ private Map<VirtualItem, String> fTextCache = new HashMap<VirtualItem, String>();
+
+ public FindLabelProvider(VirtualTreeModelViewer viewer, List<VirtualItem> items) {
fVirtualViewer = viewer;
for (int i = 0; i < items.size(); i++) {
- VirtualItem item = (VirtualItem)items.get(i);
+ VirtualItem item = items.get(i);
fTextCache.put(item, fVirtualViewer.getText(item, 0));
}
}
+ @Override
public Image getImage(Object element) {
return fVirtualViewer.getImage((VirtualItem) element, 0);
}
+ @Override
public String getText(Object element) {
- return (String)fTextCache.get(element);
+ return fTextCache.get(element);
}
}
@@ -169,6 +180,7 @@ public class VirtualFindAction extends Action implements IUpdate {
return fVirtualViewer;
}
+ @Override
public void run() {
final VirtualViewerListener listener = new VirtualViewerListener();
VirtualTreeModelViewer virtualViewer = initVirtualViewer(fClientViewer, listener);
@@ -181,7 +193,8 @@ public class VirtualFindAction extends Action implements IUpdate {
dialog.run(
true, true,
new IRunnableWithProgress() {
- public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
+ @Override
+ public void run(final IProgressMonitor m) throws InvocationTargetException, InterruptedException {
synchronized(listener) {
listener.fProgressMonitor = m;
listener.fProgressMonitor.beginTask(DebugUIPlugin.removeAccelerators(getText()), listener.fRemainingUpdatesCount);
@@ -204,7 +217,7 @@ public class VirtualFindAction extends Action implements IUpdate {
VirtualItem root = virtualViewer.getTree();
if (!monitor.isCanceled()) {
- List list = new ArrayList();
+ List<VirtualItem> list = new ArrayList<VirtualItem>();
collectAllChildren(root, list);
FindLabelProvider labelProvider = new FindLabelProvider(virtualViewer, list);
VirtualItem result = performFind(list, labelProvider);
@@ -221,7 +234,8 @@ public class VirtualFindAction extends Action implements IUpdate {
private int calcUpdatesCount(IModelDelta stateDelta) {
final int[] count = new int[] {0};
stateDelta.accept( new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & IModelDelta.EXPAND) != 0) {
count[0] += delta.getChildCount();
return true;
@@ -234,7 +248,7 @@ public class VirtualFindAction extends Action implements IUpdate {
return count[0] * 2;
}
- private void collectAllChildren(VirtualItem element, List collect) {
+ private void collectAllChildren(VirtualItem element, List<VirtualItem> collect) {
VirtualItem[] children = element.getItems();
if (children != null) {
for (int i = 0; i < children.length; i++) {
@@ -246,7 +260,7 @@ public class VirtualFindAction extends Action implements IUpdate {
}
}
- protected VirtualItem performFind(List items, FindLabelProvider labelProvider) {
+ protected VirtualItem performFind(List<VirtualItem> items, FindLabelProvider labelProvider) {
FindElementDialog dialog = new FindElementDialog(
fClientViewer.getControl().getShell(),
labelProvider,
@@ -268,7 +282,8 @@ public class VirtualFindAction extends Action implements IUpdate {
virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.SELECT);
// Set the force flag to all select delta in order to override model's selection policy.
stateDelta.accept(new IModelDeltaVisitor() {
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & IModelDelta.SELECT) != 0) {
((ModelDelta)delta).setFlags(delta.getFlags() | IModelDelta.FORCE);
}
@@ -285,11 +300,12 @@ public class VirtualFindAction extends Action implements IUpdate {
DebugUIPlugin.errorDialog(
fClientViewer.getControl().getShell(),
ActionMessages.VirtualFindAction_0,
- MessageFormat.format(ActionMessages.VirtualFindAction_1, new String[]{ labelProvider.getText(findItem) }),
+ MessageFormat.format(ActionMessages.VirtualFindAction_1, new Object[] { labelProvider.getText(findItem) }),
new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), ActionMessages.VirtualFindAction_1));
}
}
+ @Override
public void update() {
setEnabled( fClientViewer.getInput() != null && fClientViewer.getChildCount(TreePath.EMPTY) > 0 );
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java
index 25a04bc4c..270c1203a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ITreeModelViewer.java
@@ -76,7 +76,8 @@ public interface ITreeModelViewer extends ISelectionProvider {
*
* @return selection object
*/
- public ISelection getSelection();
+ @Override
+ public ISelection getSelection();
/**
* Sets a new selection for this viewer and optionally makes it visible.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
index 0eca89a05..f40307d4c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ModelDelta.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,8 +30,9 @@ public class ModelDelta implements IModelDelta {
private Object fElement;
private int fFlags;
private ModelDelta[] fNodes = EMPTY_NODES;
- private List fNodesList = null;
- private Map fNodesMap;
+ private List<ModelDelta> fNodesList = null;
+ // TODO this is not good, we are mixing a delta with an array of deltas
+ private Map<Object, Object> fNodesMap;
private Object fReplacement;
private int fIndex = -1;
private int fChildCount = -1;
@@ -95,13 +96,15 @@ public class ModelDelta implements IModelDelta {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getElement()
*/
- public Object getElement() {
+ @Override
+ public Object getElement() {
return fElement;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getFlags()
*/
+ @Override
public int getFlags() {
return fFlags;
}
@@ -172,13 +175,13 @@ public class ModelDelta implements IModelDelta {
private void mapNodes() {
if (fNodesList == null) {
- fNodesMap = new HashMap(1);
+ fNodesMap = new HashMap<Object, Object>(1);
return;
}
// Create a map with capacity for all child nodes.
- fNodesMap = new HashMap(fNodesList.size()*4/3);
+ fNodesMap = new HashMap<Object, Object>(fNodesList.size() * 4 / 3);
for (int i = 0; i < fNodesList.size(); i++) {
- mapNode( (ModelDelta)fNodesList.get(i) );
+ mapNode( fNodesList.get(i) );
}
}
@@ -261,6 +264,7 @@ public class ModelDelta implements IModelDelta {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getParent()
*/
+ @Override
public IModelDelta getParentDelta() {
return fParent;
}
@@ -268,29 +272,34 @@ public class ModelDelta implements IModelDelta {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getReplacementElement()
*/
- public Object getReplacementElement() {
+ @Override
+ public Object getReplacementElement() {
return fReplacement;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getIndex()
*/
- public int getIndex() {
+ @Override
+ public int getIndex() {
return fIndex;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelDelta#getNodes()
*/
+ @Override
public IModelDelta[] getChildDeltas() {
if (fNodes == null) {
- fNodes = (ModelDelta[])fNodesList.toArray(new ModelDelta[fNodesList.size()]);
+ fNodes = fNodesList.toArray(new ModelDelta[fNodesList.size()]);
}
return fNodes;
}
private void addDelta(ModelDelta delta) {
- if (fNodesList == null) fNodesList = new ArrayList(4);
+ if (fNodesList == null) {
+ fNodesList = new ArrayList<ModelDelta>(4);
+ }
fNodesList.add(delta);
fNodes = null;
if (fNodesMap != null) {
@@ -298,6 +307,7 @@ public class ModelDelta implements IModelDelta {
}
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer();
buf.append("Model Delta Start\n"); //$NON-NLS-1$
@@ -374,6 +384,7 @@ public class ModelDelta implements IModelDelta {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#getChildCount()
*/
+ @Override
public int getChildCount() {
return fChildCount;
}
@@ -381,6 +392,7 @@ public class ModelDelta implements IModelDelta {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta#accept(org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor)
*/
+ @Override
public void accept(IModelDeltaVisitor visitor) {
doAccept(visitor, 0);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
index 574964040..2a92a47c2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/PresentationContext.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,10 +12,9 @@
package org.eclipse.debug.internal.ui.viewers.model.provisional;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
@@ -46,7 +45,7 @@ public class PresentationContext implements IPresentationContext {
final private String fId;
final private ListenerList fListeners = new ListenerList();
- final private Map fProperties = new HashMap();
+ final private Map<String, Object> fProperties = new HashMap<String, Object>();
private IWorkbenchWindow fWindow;
private IWorkbenchPart fPart;
@@ -99,6 +98,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#getColumns()
*/
+ @Override
public String[] getColumns() {
return (String[]) getProperty(IPresentationContext.PROPERTY_COLUMNS);
}
@@ -117,6 +117,7 @@ public class PresentationContext implements IPresentationContext {
for (int i = 0; i < listeners.length; i++) {
final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
SafeRunner.run(new SafeRunnable() {
+ @Override
public void run() throws Exception {
listener.propertyChange(event);
}
@@ -138,6 +139,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#dispose()
*/
+ @Override
public void dispose() {
fProperties.clear();
setProperty(PROPERTY_DISPOSED, Boolean.TRUE);
@@ -150,6 +152,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener) {
fListeners.add(listener);
}
@@ -157,6 +160,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
fListeners.remove(listener);
}
@@ -164,6 +168,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#getId()
*/
+ @Override
public String getId() {
return fId;
}
@@ -171,6 +176,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#getProperty(java.lang.String)
*/
+ @Override
public Object getProperty(String property) {
synchronized (fProperties) {
return fProperties.get(property);
@@ -180,6 +186,7 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext#setProperty(java.lang.String, java.lang.Object)
*/
+ @Override
public void setProperty(String property, Object value) {
Object oldValue = null;
boolean propertySet = false;
@@ -251,23 +258,20 @@ public class PresentationContext implements IPresentationContext {
if (fProperties.size() == 0) {
return;
}
-
IMemento properties = memento.createChild(PRESENTATION_CONTEXT_PROPERTIES, getId());
- Iterator iterator = fProperties.entrySet().iterator();
- while (iterator.hasNext()) {
- Map.Entry entry = (Entry) iterator.next();
+ for (Entry<String, Object> entry : fProperties.entrySet()) {
if (entry.getValue() instanceof String) {
- IMemento value = properties.createChild(STRING, (String)entry.getKey());
+ IMemento value = properties.createChild(STRING, entry.getKey());
value.putString(STRING, (String)entry.getValue());
} else if (entry.getValue() instanceof Integer) {
- IMemento value = properties.createChild(INTEGER, (String)entry.getKey());
+ IMemento value = properties.createChild(INTEGER, entry.getKey());
value.putInteger(INTEGER, ((Integer)entry.getValue()).intValue());
} else if (entry.getValue() instanceof Boolean) {
- IMemento value = properties.createChild(BOOLEAN, (String)entry.getKey());
+ IMemento value = properties.createChild(BOOLEAN, entry.getKey());
value.putBoolean(BOOLEAN, ((Boolean)entry.getValue()).booleanValue());
} else if (entry.getValue() instanceof IPersistableElement) {
IPersistableElement persistable = (IPersistableElement)entry.getValue();
- IMemento value = properties.createChild(PERSISTABLE, (String)entry.getKey());
+ IMemento value = properties.createChild(PERSISTABLE, entry.getKey());
value.putString(PERSISTABLE, persistable.getFactoryId());
persistable.saveState(value);
}
@@ -284,18 +288,21 @@ public class PresentationContext implements IPresentationContext {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext#getProperties()
*/
+ @Override
public String[] getProperties() {
synchronized (fProperties) {
- Set keys = fProperties.keySet();
- return (String[]) keys.toArray(new String[keys.size()]);
+ Set<String> keys = fProperties.keySet();
+ return keys.toArray(new String[keys.size()]);
}
}
- public IWorkbenchPart getPart() {
+ @Override
+ public IWorkbenchPart getPart() {
return fPart;
}
- public IWorkbenchWindow getWindow() {
+ @Override
+ public IWorkbenchWindow getWindow() {
return fWindow;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
index 0c26078f9..5e3d35722 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/TreeModelViewer.java
@@ -44,6 +44,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @return presentation context
*/
+ @Override
public IPresentationContext getPresentationContext() {
return super.getPresentationContext();
}
@@ -53,6 +54,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param listener model delta listener
*/
+ @Override
public void addModelChangedListener(IModelChangedListener listener) {
super.addModelChangedListener(listener);
}
@@ -62,6 +64,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param listener model delta listener
*/
+ @Override
public void removeModelChangedListener(IModelChangedListener listener) {
super.removeModelChangedListener(listener);
}
@@ -71,6 +74,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param listener listener
*/
+ @Override
public void addViewerUpdateListener(IViewerUpdateListener listener) {
super.addViewerUpdateListener(listener);
}
@@ -80,6 +84,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param listener listener
*/
+ @Override
public void removeViewerUpdateListener(IViewerUpdateListener listener) {
super.removeViewerUpdateListener(listener);
}
@@ -90,6 +95,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @return whether columns can be toggled on/off
*/
+ @Override
public boolean canToggleColumns() {
return super.canToggleColumns();
}
@@ -100,6 +106,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @return column presentation or <code>null</code>
*/
+ @Override
public IColumnPresentation getColumnPresentation() {
return super.getColumnPresentation();
}
@@ -110,6 +117,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @return visible columns identifiers or <code>null</code>
*/
+ @Override
public String[] getVisibleColumns() {
return super.getVisibleColumns();
}
@@ -119,6 +127,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param memento the {@link IMemento} to read from
*/
+ @Override
public void initState(IMemento memento) {
super.initState(memento);
}
@@ -128,6 +137,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param memento the {@link IMemento} to save to
*/
+ @Override
public void saveState(IMemento memento) {
super.saveState(memento);
}
@@ -135,6 +145,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
/**
* @return Returns true if columns are being displayed currently.
*/
+ @Override
public boolean isShowColumns() {
return super.isShowColumns();
}
@@ -144,6 +155,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param columnIds array of column identifiers
*/
+ @Override
public void resetColumnSizes(String[] columnIds) {
super.resetColumnSizes(columnIds);
}
@@ -154,6 +166,7 @@ public class TreeModelViewer extends InternalTreeModelViewer {
* @param show whether to show columns if the current input supports
* columns
*/
+ @Override
public void setShowColumns(boolean show) {
super.setShowColumns(show);
}
@@ -166,11 +179,13 @@ public class TreeModelViewer extends InternalTreeModelViewer {
*
* @param ids column identifiers or <code>null</code>
*/
+ @Override
public void setVisibleColumns(String[] ids) {
super.setVisibleColumns(ids);
}
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
+ @Override
+ public ViewerLabel getElementLabel(TreePath path, String columnId) {
return super.getElementLabel(path, columnId);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
index 0a4e1ac96..d2c0815fe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/ViewerInputService.java
@@ -31,7 +31,8 @@ public class ViewerInputService {
* @since 3.6
*/
public final static Object NULL_INPUT = new IViewerInputProvider() {
- public void update(IViewerInputUpdate update) {
+ @Override
+ public void update(IViewerInputUpdate update) {
update.setInputElement(null);
update.done();
}
@@ -45,6 +46,7 @@ public class ViewerInputService {
private ITreeModelViewer fViewer;
private IViewerInputRequestor fProxyRequest = new IViewerInputRequestor() {
+ @Override
public void viewerInputComplete(final IViewerInputUpdate update) {
synchronized (ViewerInputService.this) {
if (fPendingUpdate == update) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java
index 764d50272..46aefd80b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualItem.java
@@ -13,6 +13,7 @@ package org.eclipse.debug.internal.ui.viewers.model.provisional;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.TreeMap;
import org.eclipse.core.runtime.Assert;
@@ -40,18 +41,20 @@ public class VirtualItem {
* Index object of a tree item. It allows the indexes to be modified
* as items are inserted and removed.
*/
- public static class Index implements Comparable {
+ public static class Index implements Comparable<Object> {
private Integer fIndexValue;
public Index(int index) {
fIndexValue = new Integer(index);
}
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
return obj instanceof Index && ((Index)obj).fIndexValue.equals(fIndexValue);
}
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fIndexValue.hashCode();
}
@@ -67,11 +70,13 @@ public class VirtualItem {
return fIndexValue.intValue();
}
- public int compareTo(Object obj) {
+ @Override
+ public int compareTo(Object obj) {
return obj instanceof Index ? fIndexValue.compareTo(((Index)obj).fIndexValue) : 0;
}
- public String toString() {
+ @Override
+ public String toString() {
return fIndexValue.toString();
}
}
@@ -92,7 +97,7 @@ public class VirtualItem {
* keeps the items sorted while allowing indexes (keys) to be modified as
* child items are inserted and removed.
*/
- private Map fItems = new TreeMap();
+ private Map<Index, VirtualItem> fItems = new TreeMap<Index, VirtualItem>();
/**
* Flag indicating whether this item has child items.
@@ -115,7 +120,7 @@ public class VirtualItem {
* The data held by this item. It includes the element as well as the item
* display attributes.
*/
- private Map fData = new HashMap(1);
+ private Map<String, Object> fData = new HashMap<String, Object>(1);
/**
* Flag indicating that the item needs to have it's label updated.
@@ -153,7 +158,7 @@ public class VirtualItem {
* @param index index of item to clear.
*/
public void clear(Index index) {
- VirtualItem item = (VirtualItem)fItems.remove(index);
+ VirtualItem item = fItems.remove(index);
if (item != null) {
item.dispose();
}
@@ -166,8 +171,8 @@ public class VirtualItem {
*/
public void clearAll() {
fData.clear();
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- ((VirtualItem)itr.next()).dispose();
+ for (VirtualItem item : fItems.values()) {
+ item.dispose();
}
fItems.clear();
}
@@ -192,11 +197,10 @@ public class VirtualItem {
* @return Item if found, <code>null</code> if not.
*/
public VirtualItem findItem(Object element) {
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- VirtualItem next = (VirtualItem)itr.next();
- Object nextData = next.getData();
+ for (VirtualItem item : fItems.values()) {
+ Object nextData = item.getData();
if ( (element != null && element.equals(nextData)) || (element == null && nextData == null) ) {
- return next;
+ return item;
}
}
return null;
@@ -334,8 +338,8 @@ public class VirtualItem {
// If collapsed, make sure that all the children are collapsed as well.
if (!fExpanded) {
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- ((VirtualItem)itr.next()).setExpanded(expanded);
+ for (VirtualItem item : fItems.values()) {
+ item.setExpanded(expanded);
}
}
}
@@ -375,11 +379,11 @@ public class VirtualItem {
*/
public void setItemCount(int count) {
fItemCount = count;
- for (Iterator itr = fItems.entrySet().iterator(); itr.hasNext();) {
- Map.Entry entry = (Map.Entry)itr.next();
- int index = ((Index)entry.getKey()).intValue();
+ for (Iterator<Entry<Index, VirtualItem>> itr = fItems.entrySet().iterator(); itr.hasNext();) {
+ Entry<Index, VirtualItem> entry = itr.next();
+ int index = entry.getKey().intValue();
if (index >= count) {
- VirtualItem item = (VirtualItem)entry.getValue();
+ VirtualItem item = entry.getValue();
item.dispose();
itr.remove();
}
@@ -414,7 +418,7 @@ public class VirtualItem {
public VirtualItem getItem(Index index) {
ensureItems();
- VirtualItem item = (VirtualItem)fItems.get(index);
+ VirtualItem item = fItems.get(index);
if (item == null) {
item = new VirtualItem(this, index);
fItems.put(index, item);
@@ -432,8 +436,7 @@ public class VirtualItem {
if (fItems == null || fItems.size() != fItemCount) {
return true;
}
- for (Iterator itr = fItems.values().iterator(); itr.hasNext();) {
- VirtualItem child = (VirtualItem)itr.next();
+ for (VirtualItem child : fItems.values()) {
if (child.needsDataUpdate()) {
return true;
}
@@ -449,7 +452,7 @@ public class VirtualItem {
* @return Child items array.
*/
public VirtualItem[] getItems() {
- return (VirtualItem[]) fItems.values().toArray(new VirtualItem[fItems.size()]);
+ return fItems.values().toArray(new VirtualItem[fItems.size()]);
}
/**
@@ -468,8 +471,7 @@ public class VirtualItem {
// Increment all items with an index higher than the given position.
fItemCount++;
ensureItems();
- for (Iterator itr = fItems.keySet().iterator(); itr.hasNext();) {
- Index childIndex = (Index)itr.next();
+ for (Index childIndex : fItems.keySet()) {
if (childIndex.intValue() >= position) {
childIndex.increment();
}
@@ -496,13 +498,13 @@ public class VirtualItem {
ensureItems();
VirtualItem removedItem = null;
- for (Iterator itr = fItems.entrySet().iterator(); itr.hasNext();) {
- Map.Entry entry = (Map.Entry)itr.next();
- Index childIndex = (Index)entry.getKey();
+ for (Iterator<Entry<Index, VirtualItem>> itr = fItems.entrySet().iterator(); itr.hasNext();) {
+ Entry<Index, VirtualItem> entry = itr.next();
+ Index childIndex = entry.getKey();
if (childIndex.intValue() > position.intValue()) {
childIndex.decrement();
} else if (childIndex.intValue() == position.intValue()) {
- removedItem = (VirtualItem)entry.getValue();
+ removedItem = entry.getValue();
removedItem.dispose();
itr.remove();
}
@@ -511,7 +513,7 @@ public class VirtualItem {
private void ensureItems() {
if (fItems == null) {
- fItems = new HashMap( Math.max(1, Math.min(fItemCount, 16)) );
+ fItems = new HashMap<Index, VirtualItem>(Math.max(1, Math.min(fItemCount, 16)));
}
}
@@ -523,7 +525,8 @@ public class VirtualItem {
return (VirtualTree)item;
}
- public String toString() {
+ @Override
+ public String toString() {
StringBuffer buffer = new StringBuffer();
toStringItem(buffer, IInternalDebugCoreConstants.EMPTY_STRING);
return buffer.toString();
@@ -535,7 +538,7 @@ public class VirtualItem {
buffer.append("\n"); //$NON-NLS-1$
indent = indent + " "; //$NON-NLS-1$
for (int i = 0; i < fItemCount; i++) {
- VirtualItem item = (VirtualItem)fItems.get(new Index(i));
+ VirtualItem item = fItems.get(new Index(i));
if (item != null) {
item.toStringItem(buffer, indent);
} else {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java
index 661a1ea76..41194464d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTree.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Wind River Systems and others.
+ * Copyright (c) 2011, 2013 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
@@ -7,11 +7,11 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model.provisional;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.swt.SWT;
@@ -35,7 +35,8 @@ public class VirtualTree extends VirtualItem {
private IVirtualItemValidator fValidator;
private class SelectedItemValidator implements IVirtualItemValidator {
- public boolean isItemVisible(VirtualItem item) {
+ @Override
+ public boolean isItemVisible(VirtualItem item) {
// visible items. For now only mark the selected items as visible.
for (int i = 0; i < fSelection.length; i++) {
VirtualItem selectionItem = fSelection[i];
@@ -49,14 +50,15 @@ public class VirtualTree extends VirtualItem {
return false;
}
- public void showItem(VirtualItem item) {
+ @Override
+ public void showItem(VirtualItem item) {
}
}
/**
* Set of listeners of the virtual tree.
*/
- private Set fVirtualItemListeners = new HashSet(1);
+ private Set<IVirtualItemListener> fVirtualItemListeners = new HashSet<IVirtualItemListener>(1);
/**
* The currently selected items. This array contains only
@@ -85,22 +87,26 @@ public class VirtualTree extends VirtualItem {
/**
* Disposes the virtual tree.
*/
- public void dispose() {
+ @Override
+ public void dispose() {
super.dispose();
fVirtualItemListeners.clear();
}
- public void setNeedsCountUpdate() {
+ @Override
+ public void setNeedsCountUpdate() {
super.setNeedsCountUpdate();
clearNeedsLabelUpdate();
clearNeedsDataUpdate();
}
- public void setNeedsLabelUpdate() {
+ @Override
+ public void setNeedsLabelUpdate() {
// no-op
}
- public void setData(String key, Object data) {
+ @Override
+ public void setData(String key, Object data) {
super.setData(key, data);
if (data == null) {
clearNeedsDataUpdate();
@@ -134,25 +140,27 @@ public class VirtualTree extends VirtualItem {
}
public void fireItemDisposed(VirtualItem item) {
- for (Iterator itr = fVirtualItemListeners.iterator(); itr.hasNext();) {
- ((IVirtualItemListener)itr.next()).disposed(item);
+ for (IVirtualItemListener listener : fVirtualItemListeners) {
+ listener.disposed(item);
}
}
public void fireItemRevealed(VirtualItem item) {
- for (Iterator itr = fVirtualItemListeners.iterator(); itr.hasNext();) {
- ((IVirtualItemListener)itr.next()).revealed(item);
+ for (IVirtualItemListener listener : fVirtualItemListeners) {
+ listener.revealed(item);
}
}
- public void setData(Object data) {
+ @Override
+ public void setData(Object data) {
super.setData(data);
// The root item always has children as long as the input is non-null,
// so that it should be expanded.
setHasItems(data != null);
}
- public void setHasItems(boolean hasChildren) {
+ @Override
+ public void setHasItems(boolean hasChildren) {
super.setHasItems(hasChildren);
// The root item is always expanded as long as it has children.
if (hasChildren) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
index 1b57cb020..e376ec92c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/provisional/VirtualTreeModelViewer.java
@@ -68,7 +68,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @return presentation context
*/
- public IPresentationContext getPresentationContext() {
+ @Override
+ public IPresentationContext getPresentationContext() {
return super.getPresentationContext();
}
@@ -77,7 +78,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param listener model delta listener
*/
- public void addModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void addModelChangedListener(IModelChangedListener listener) {
super.addModelChangedListener(listener);
}
@@ -86,7 +88,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param listener model delta listener
*/
- public void removeModelChangedListener(IModelChangedListener listener) {
+ @Override
+ public void removeModelChangedListener(IModelChangedListener listener) {
super.removeModelChangedListener(listener);
}
@@ -95,7 +98,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param listener listener
*/
- public void addViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void addViewerUpdateListener(IViewerUpdateListener listener) {
super.addViewerUpdateListener(listener);
}
@@ -104,7 +108,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param listener listener
*/
- public void removeViewerUpdateListener(IViewerUpdateListener listener) {
+ @Override
+ public void removeViewerUpdateListener(IViewerUpdateListener listener) {
super.removeViewerUpdateListener(listener);
}
@@ -114,7 +119,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @return whether columns can be toggled on/off
*/
- public boolean canToggleColumns() {
+ @Override
+ public boolean canToggleColumns() {
return super.canToggleColumns();
}
@@ -124,7 +130,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @return column presentation or <code>null</code>
*/
- public IColumnPresentation getColumnPresentation() {
+ @Override
+ public IColumnPresentation getColumnPresentation() {
return super.getColumnPresentation();
}
@@ -134,7 +141,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @return visible columns identifiers or <code>null</code>
*/
- public String[] getVisibleColumns() {
+ @Override
+ public String[] getVisibleColumns() {
return super.getVisibleColumns();
}
@@ -143,7 +151,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param memento the {@link IMemento} to read from
*/
- public void initState(IMemento memento) {
+ @Override
+ public void initState(IMemento memento) {
super.initState(memento);
}
@@ -152,14 +161,16 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param memento the {@link IMemento} to save to
*/
- public void saveState(IMemento memento) {
+ @Override
+ public void saveState(IMemento memento) {
super.saveState(memento);
}
/**
* @return Returns true if columns are being displayed currently.
*/
- public boolean isShowColumns() {
+ @Override
+ public boolean isShowColumns() {
return super.isShowColumns();
}
@@ -169,7 +180,8 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
* @param show whether to show columns if the current input supports
* columns
*/
- public void setShowColumns(boolean show) {
+ @Override
+ public void setShowColumns(boolean show) {
super.setShowColumns(show);
}
@@ -181,23 +193,28 @@ public class VirtualTreeModelViewer extends InternalVirtualTreeModelViewer {
*
* @param ids column identifiers or <code>null</code>
*/
- public void setVisibleColumns(String[] ids) {
+ @Override
+ public void setVisibleColumns(String[] ids) {
super.setVisibleColumns(ids);
}
- public void updateViewer(IModelDelta delta) {
+ @Override
+ public void updateViewer(IModelDelta delta) {
super.updateViewer(delta);
}
- public ViewerLabel getElementLabel(TreePath path, String columnId) {
+ @Override
+ public ViewerLabel getElementLabel(TreePath path, String columnId) {
return super.getElementLabel(path, columnId);
}
- public VirtualItem[] findItems(Object elementOrTreePath) {
+ @Override
+ public VirtualItem[] findItems(Object elementOrTreePath) {
return super.findItems(elementOrTreePath);
}
- public VirtualItem findItem(TreePath path) {
+ @Override
+ public VirtualItem findItem(TreePath path) {
return super.findItem(path);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java
index ddaf0f54f..4abe81e6b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractColumnPresentation.java
@@ -33,6 +33,7 @@ public abstract class AbstractColumnPresentation implements IColumnPresentation2
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#init(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
public void init(IPresentationContext context) {
fContext = context;
}
@@ -40,6 +41,7 @@ public abstract class AbstractColumnPresentation implements IColumnPresentation2
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#dispose()
*/
+ @Override
public void dispose() {
fContext = null;
}
@@ -47,6 +49,7 @@ public abstract class AbstractColumnPresentation implements IColumnPresentation2
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresentation#getImageDescriptor(java.lang.String)
*/
+ @Override
public ImageDescriptor getImageDescriptor(String id) {
return null;
}
@@ -63,6 +66,7 @@ public abstract class AbstractColumnPresentation implements IColumnPresentation2
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation2#getInitialColumnWidth(java.lang.String, int, java.lang.String[])
*/
+ @Override
public int getInitialColumnWidth(String id, int treeWidgetWidth, String[] visibleColumnIds) {
return -1;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java
index ccf1ec15b..1098dc999 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AbstractModelProxy.java
@@ -52,6 +52,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelProxy#addModelChangedListener(org.eclipse.debug.internal.ui.viewers.IModelChangedListener)
*/
+ @Override
public void addModelChangedListener(IModelChangedListener listener) {
synchronized (fListeners) {
fListeners.add(listener);
@@ -61,6 +62,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelProxy#removeModelChangedListener(org.eclipse.debug.internal.ui.viewers.IModelChangedListener)
*/
+ @Override
public void removeModelChangedListener(IModelChangedListener listener) {
synchronized (fListeners) {
fListeners.remove(listener);
@@ -82,10 +84,12 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
for (int i = 0; i < listeners.length; i++) {
final IModelChangedListener listener = (IModelChangedListener) listeners[i];
ISafeRunnable safeRunnable = new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
+ @Override
public void run() throws Exception {
listener.modelChanged(root, AbstractModelProxy.this);
}
@@ -113,6 +117,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
if (fInstallJob != null) {
fInstallJob.cancel();
@@ -135,6 +140,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
fDisposed = disposed;
}
+ @Override
public void initialize(ITreeModelViewer viewer) {
setDisposed(false);
@@ -142,7 +148,8 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
fViewer = viewer;
fContext = viewer.getPresentationContext();
fInstallJob = new Job("Model Proxy installed notification job") {//$NON-NLS-1$
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
synchronized(this) {
fInstallJob = null;
}
@@ -159,7 +166,8 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
*
* @see org.eclipse.core.runtime.jobs.Job#shouldRun()
*/
- public boolean shouldRun() {
+ @Override
+ public boolean shouldRun() {
return !isDisposed();
}
};
@@ -181,6 +189,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.IModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
*/
+ @Override
public void init(IPresentationContext context) {
}
@@ -190,6 +199,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
*
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
}
@@ -214,6 +224,7 @@ public abstract class AbstractModelProxy implements IModelProxy2 {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy#isDisposed()
*/
+ @Override
public synchronized boolean isDisposed() {
return fDisposed;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java
index 975955b54..16124acde 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousContentAdapter.java
@@ -35,8 +35,10 @@ public abstract class AsynchronousContentAdapter implements IAsynchronousContent
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter#retrieveChildren(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.provisional.IChildrenRequestMonitor)
*/
- public void retrieveChildren(final Object parent, final IPresentationContext context, final IChildrenRequestMonitor result) {
+ @Override
+ public void retrieveChildren(final Object parent, final IPresentationContext context, final IChildrenRequestMonitor result) {
Job job = new Job("Retrieving Children") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
computeChildren(parent, context, result);
@@ -65,8 +67,10 @@ public abstract class AsynchronousContentAdapter implements IAsynchronousContent
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousContentAdapter#isContainer(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, org.eclipse.debug.internal.ui.viewers.provisional.IContainerRequestMonitor)
*/
- public void isContainer(final Object element, final IPresentationContext context, final IContainerRequestMonitor result) {
+ @Override
+ public void isContainer(final Object element, final IPresentationContext context, final IContainerRequestMonitor result) {
Job job = new Job("Computing hasChildren") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
if (!monitor.isCanceled()) {
computeIsContainer(element, context, result);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java
index 62c1c2c16..dae6eb4eb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/provisional/AsynchronousLabelAdapter.java
@@ -37,10 +37,12 @@ public abstract class AsynchronousLabelAdapter implements IAsynchronousLabelAdap
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IAsynchronousLabelAdapter#retrieveLabel(java.lang.Object, org.eclipse.debug.ui.viewers.IPresentationContext, org.eclipse.debug.ui.viewers.ILabelRequestMonitor)
*/
+ @Override
public void retrieveLabel(final Object element, final IPresentationContext context, final ILabelRequestMonitor result) {
Job job = null;
if (requiresUIJob(element)) {
job = new UIJob("Retrieving labels") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
computeLabels(element, context, result);
return Status.OK_STATUS;
@@ -48,6 +50,7 @@ public abstract class AsynchronousLabelAdapter implements IAsynchronousLabelAdap
};
} else {
job = new Job("Retrieving labels") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
computeLabels(element, context, result);
return Status.OK_STATUS;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java
index 2f5113440..cb7432468 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointContainerProxy.java
@@ -42,6 +42,7 @@ public class BreakpointContainerProxy extends AbstractModelProxy implements IChe
/* (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)
*/
+ @Override
public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) {
boolean atLeastOne = false;
IBreakpoint[] breakpoints = fContainer.getBreakpoints();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointManagerProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointManagerProxy.java
index 639872ca6..4cdf6b506 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointManagerProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointManagerProxy.java
@@ -1,5 +1,5 @@
/*****************************************************************
- * Copyright (c) 2009, 2010 Texas Instruments and others
+ * Copyright (c) 2009, 2013 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
@@ -8,6 +8,7 @@
* Contributors:
* Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956)
* Wind River Systems - ongoing enhancements and bug fixing
+ * IBM Corporation - bug fixing
*****************************************************************/
package org.eclipse.debug.internal.ui.viewers.update;
@@ -67,7 +68,7 @@ public class BreakpointManagerProxy extends AbstractModelProxy {
/**
* List of posted deltas ready to be fired.
*/
- private List/*<DeltaInfo>*/ fPendingDeltas = new LinkedList();
+ private List<DeltaInfo> fPendingDeltas = new LinkedList<DeltaInfo>();
/**
@@ -98,6 +99,7 @@ public class BreakpointManagerProxy extends AbstractModelProxy {
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
super.installed(viewer);
if (fProvider != null) {
@@ -109,6 +111,7 @@ public class BreakpointManagerProxy extends AbstractModelProxy {
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#dispose()
*/
+ @Override
public void dispose() {
fProvider.unregisterModelProxy(fInput, this);
synchronized(this) {
@@ -148,8 +151,8 @@ public class BreakpointManagerProxy extends AbstractModelProxy {
// If we are processing a select delta, remove the previous select delta.
if (select) {
- for (Iterator itr = fPendingDeltas.iterator(); itr.hasNext(); ) {
- if ( ((DeltaInfo)itr.next()).fSelect ) {
+ for (Iterator<DeltaInfo> itr = fPendingDeltas.iterator(); itr.hasNext();) {
+ if ( itr.next().fSelect ) {
itr.remove();
}
}
@@ -162,7 +165,8 @@ public class BreakpointManagerProxy extends AbstractModelProxy {
setSystem(true);
}
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
Object[] deltas;
synchronized(BreakpointManagerProxy.this) {
deltas = fPendingDeltas.toArray();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java
index b4308d6c8..f27d14e02 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/BreakpointProxy.java
@@ -41,6 +41,7 @@ public class BreakpointProxy extends AbstractModelProxy implements ICheckboxMode
/* (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)
*/
+ @Override
public boolean setChecked(IPresentationContext context, Object viewerInput, TreePath path, boolean checked) {
try {
fBreakpoint.setEnabled(checked);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java
index de9cca250..4af6b9ddd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetEventHandler.java
@@ -35,10 +35,12 @@ public class DebugTargetEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean handlesEvent(DebugEvent event) {
return event.getSource() instanceof IDebugTarget;
}
+ @Override
protected void handleChange(DebugEvent event) {
int flags = IModelDelta.STATE;
if (event.getDetail() == DebugEvent.CONTENT) {
@@ -47,18 +49,22 @@ public class DebugTargetEventHandler extends DebugEventHandler {
fireDelta((IDebugTarget) event.getSource(), flags);
}
+ @Override
protected void handleCreate(DebugEvent event) {
fireDelta((IDebugTarget) event.getSource(), IModelDelta.EXPAND);
}
+ @Override
protected void handleResume(DebugEvent event) {
fireDelta((IDebugTarget) event.getSource(), IModelDelta.CONTENT | IModelDelta.STATE | IModelDelta.SELECT);
}
+ @Override
protected void handleSuspend(DebugEvent event) {
fireDelta((IDebugTarget) event.getSource(), IModelDelta.CONTENT | IModelDelta.STATE);
}
+ @Override
protected void handleTerminate(DebugEvent event) {
fireDelta((IDebugTarget) event.getSource(), IModelDelta.CONTENT | IModelDelta.STATE | IModelDelta.UNINSTALL);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java
index 88c643fee..ba61da8bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DebugTargetProxy.java
@@ -40,6 +40,7 @@ public class DebugTargetProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
super.dispose();
fDebugTarget = null;
@@ -48,6 +49,7 @@ public class DebugTargetProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean containsEvent(DebugEvent event) {
Object source = event.getSource();
if (source instanceof IDebugElement) {
@@ -63,7 +65,8 @@ public class DebugTargetProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
*/
- protected DebugEventHandler[] createEventHandlers() {
+ @Override
+ protected DebugEventHandler[] createEventHandlers() {
ThreadEventHandler threadEventHandler = new ThreadEventHandler(this);
return new DebugEventHandler[] { new DebugTargetEventHandler(this), threadEventHandler,
new StackFrameEventHandler(this, threadEventHandler) };
@@ -72,6 +75,7 @@ public class DebugTargetProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
// select any thread that is already suspended after installation
IDebugTarget target = fDebugTarget;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java
index 8c7105a3f..f0fb0f91c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultExpressionModelProxy.java
@@ -29,6 +29,7 @@ public class DefaultExpressionModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
super.dispose();
fExpression = null;
@@ -37,6 +38,7 @@ public class DefaultExpressionModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
*/
+ @Override
protected DebugEventHandler[] createEventHandlers() {
return new DebugEventHandler[]{new ExpressionEventHandler(this)};
}
@@ -44,6 +46,7 @@ public class DefaultExpressionModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean containsEvent(DebugEvent event) {
// handles change events from expressions and debug targets
if (event.getSource().equals(fExpression) || event.getSource().equals(fExpression.getDebugTarget())) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
index 6d00a473f..0856e4663 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelProxyFactory.java
@@ -33,6 +33,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
public class DefaultModelProxyFactory implements IModelProxyFactory {
+ @Override
public IModelProxy createModelProxy(Object element, IPresentationContext context) {
String id = context.getId();
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java
index 6d87308e3..bc98f89d6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultModelSelectionPolicyFactory.java
@@ -24,6 +24,7 @@ import org.eclipse.debug.ui.IDebugUIConstants;
*/
public class DefaultModelSelectionPolicyFactory implements IModelSelectionPolicyFactory {
+ @Override
public IModelSelectionPolicy createModelSelectionPolicyAdapter(Object element, IPresentationContext context) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (element instanceof IDebugElement) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java
index 655fad9c9..fcefebce4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultSelectionPolicy.java
@@ -44,6 +44,7 @@ public class DefaultSelectionPolicy implements IModelSelectionPolicy {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IModelSelectionPolicy#contains(org.eclipse.jface.viewers.ISelection, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
public boolean contains(ISelection selection, IPresentationContext context) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (selection instanceof IStructuredSelection) {
@@ -61,6 +62,7 @@ public class DefaultSelectionPolicy implements IModelSelectionPolicy {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IModelSelectionPolicy#overrides(org.eclipse.jface.viewers.ISelection, org.eclipse.jface.viewers.ISelection, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
public boolean overrides(ISelection existing, ISelection candidate, IPresentationContext context) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (existing instanceof IStructuredSelection && candidate instanceof IStructuredSelection) {
@@ -90,6 +92,7 @@ public class DefaultSelectionPolicy implements IModelSelectionPolicy {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.viewers.IModelSelectionPolicy#isSticky(org.eclipse.jface.viewers.ISelection, org.eclipse.debug.ui.viewers.IPresentationContext)
*/
+ @Override
public boolean isSticky(ISelection selection, IPresentationContext context) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(context.getId())) {
if (selection instanceof IStructuredSelection) {
@@ -123,7 +126,8 @@ public class DefaultSelectionPolicy implements IModelSelectionPolicy {
*
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelSelectionPolicy#replaceInvalidSelection(ISelection, ISelection)
*/
- public ISelection replaceInvalidSelection(ISelection selection, ISelection newSelection) {
+ @Override
+ public ISelection replaceInvalidSelection(ISelection selection, ISelection newSelection) {
if (selection instanceof ITreeSelection) {
TreePath[] paths = ((ITreeSelection)selection).getPaths();
if (paths.length > 0 && paths[0].getSegmentCount() > 1) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java
index dbab964af..e66723808 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultVariableViewModelProxy.java
@@ -37,11 +37,13 @@ public class DefaultVariableViewModelProxy extends EventHandlerModelProxy {
fFrame = frame;
}
+ @Override
public void dispose() {
super.dispose();
fFrame = null;
}
+ @Override
protected DebugEventHandler[] createEventHandlers() {
return new DebugEventHandler[] { new VariablesViewEventHandler(this, fFrame) };
}
@@ -49,6 +51,7 @@ public class DefaultVariableViewModelProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#containsEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected synchronized boolean containsEvent(DebugEvent event) {
if (!isDisposed()) {
Object source = event.getSource();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
index f09ffc14a..d2beb35d8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/DefaultWatchExpressionModelProxy.java
@@ -50,9 +50,11 @@ public class DefaultWatchExpressionModelProxy extends DefaultExpressionModelProx
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(final Viewer viewer) {
super.installed(viewer);
UIJob job = new UIJob("install watch expression model proxy") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!isDisposed()) {
IWorkbenchWindow[] workbenchWindows = PlatformUI.getWorkbench().getWorkbenchWindows();
@@ -86,6 +88,7 @@ public class DefaultWatchExpressionModelProxy extends DefaultExpressionModelProx
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DefaultExpressionModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
super.dispose();
if (fWindow != null) {
@@ -97,6 +100,7 @@ public class DefaultWatchExpressionModelProxy extends DefaultExpressionModelProx
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#createEventHandlers()
*/
+ @Override
protected DebugEventHandler[] createEventHandlers() {
return new DebugEventHandler[]{new ExpressionEventHandler(this)};
}
@@ -129,6 +133,7 @@ public class DefaultWatchExpressionModelProxy extends DefaultExpressionModelProx
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
contextActivated(event.getContext());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java
index 8adc0d4ca..4e418ec0c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/EventHandlerModelProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
/**
* Map of elements to timer tasks
*/
- private Map fTimerTasks = new HashMap();
+ private Map<Object, PendingSuspendTask> fTimerTasks = new HashMap<Object, PendingSuspendTask>();
/**
* Timer for timer tasks
@@ -40,7 +40,7 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
* Map of event source to resume events with a pending suspend that timed
* out.
*/
- private Map fPendingSuspends = new HashMap();
+ private Map<Object, DebugEvent> fPendingSuspends = new HashMap<Object, DebugEvent>();
/**
* Event handlers for specific elements
@@ -73,7 +73,8 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
*
* @see java.util.TimerTask#run()
*/
- public void run() {
+ @Override
+ public void run() {
synchronized (fPendingSuspends) {
fPendingSuspends.put(fEvent.getSource(), fEvent);
}
@@ -89,7 +90,8 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
*/
protected abstract DebugEventHandler[] createEventHandlers();
- public synchronized void dispose() {
+ @Override
+ public synchronized void dispose() {
super.dispose();
fTimer.cancel();
fTimerTasks.clear();
@@ -100,7 +102,8 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
}
}
- public void init(IPresentationContext context) {
+ @Override
+ public void init(IPresentationContext context) {
super.init(context);
DebugPlugin.getDefault().addDebugEventListener(this);
fHandlers = createEventHandlers();
@@ -111,7 +114,8 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
*
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
- public final void handleDebugEvents(DebugEvent[] events) {
+ @Override
+ public final void handleDebugEvents(DebugEvent[] events) {
if (isDisposed()) {
return;
}
@@ -186,14 +190,14 @@ public abstract class EventHandlerModelProxy extends AbstractModelProxy implemen
protected void dispatchSuspend(DebugEventHandler handler, DebugEvent event) {
// stop timer, if any
synchronized (this) {
- TimerTask task = (TimerTask) fTimerTasks.remove(event.getSource());
+ TimerTask task = fTimerTasks.remove(event.getSource());
if (task != null) {
task.cancel();
}
}
DebugEvent resume = null;
synchronized (this) {
- resume = (DebugEvent) fPendingSuspends.remove(event.getSource());
+ resume = fPendingSuspends.remove(event.getSource());
}
if (resume == null) {
handler.handleSuspend(event);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java
index 1b677dfa3..0c926de3d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionEventHandler.java
@@ -32,11 +32,13 @@ public class ExpressionEventHandler extends DebugEventHandler {
super(proxy);
}
- protected boolean handlesEvent(DebugEvent event) {
+ @Override
+ protected boolean handlesEvent(DebugEvent event) {
return event.getKind() == DebugEvent.CHANGE;
}
- protected void handleChange(DebugEvent event) {
+ @Override
+ protected void handleChange(DebugEvent event) {
ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getExpressionManager(), IModelDelta.NO_CHANGE);
IExpression expression = null;
if (event.getSource() instanceof IExpression) {
@@ -62,7 +64,8 @@ public class ExpressionEventHandler extends DebugEventHandler {
}
}
- protected void refreshRoot(DebugEvent event) {
+ @Override
+ protected void refreshRoot(DebugEvent event) {
ModelDelta delta = new ModelDelta(DebugPlugin.getDefault().getExpressionManager(), IModelDelta.CONTENT);
fireDelta(delta);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java
index 53527f91a..0b780533d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ExpressionManagerModelProxy.java
@@ -35,6 +35,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
*/
+ @Override
public void init(IPresentationContext context) {
super.init(context);
getExpressionManager().addExpressionListener(this);
@@ -44,6 +45,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
updateExpressions(getExpressionManager().getExpressions(), IModelDelta.INSTALL);
}
@@ -58,6 +60,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
getPresentationContext().removePropertyChangeListener(this);
super.dispose();
@@ -67,6 +70,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsMoved(org.eclipse.debug.core.model.IExpression[], int)
*/
+ @Override
public void expressionsMoved(IExpression[] expressions, int index){
int count = getElementsCount();
ModelDelta delta = new ModelDelta(getExpressionManager(), -1, IModelDelta.NO_CHANGE, count);
@@ -84,6 +88,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.internal.core.IExpressionsListener2#expressionsInserted(org.eclipse.debug.core.model.IExpression[], int)
*/
+ @Override
public void expressionsInserted(IExpression[] expressions, int index){
int count = getElementsCount();
ModelDelta delta = new ModelDelta(getExpressionManager(), -1, IModelDelta.NO_CHANGE, count);
@@ -97,6 +102,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsAdded(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsAdded(IExpression[] expressions) {
int index = getExpressionManager().getExpressions().length - expressions.length;
int count = getElementsCount();
@@ -111,6 +117,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsRemoved(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsRemoved(IExpression[] expressions) {
updateExpressions(expressions, IModelDelta.REMOVED | IModelDelta.UNINSTALL);
}
@@ -118,6 +125,7 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
/* (non-Javadoc)
* @see org.eclipse.debug.core.IExpressionsListener#expressionsChanged(org.eclipse.debug.core.model.IExpression[])
*/
+ @Override
public void expressionsChanged(IExpression[] expressions) {
updateExpressions(expressions, IModelDelta.CONTENT | IModelDelta.STATE);
}
@@ -138,7 +146,8 @@ public class ExpressionManagerModelProxy extends AbstractModelProxy implements I
(getPresentationContext().getColumns() != null ? 1 : 0);
}
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
// If columns are turned on/off, refresh the view to account for the
// "Add new expression" element.
if (IPresentationContext.PROPERTY_COLUMNS.equals(event.getProperty())) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
index fa014b865..e041ab6b8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchManagerProxy.java
@@ -30,6 +30,7 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
*/
+ @Override
public synchronized void init(IPresentationContext context) {
super.init(context);
fLaunchManager = DebugPlugin.getDefault().getLaunchManager();
@@ -39,6 +40,7 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
// expand existing launches
ILaunch[] launches = fLaunchManager.getLaunches();
@@ -50,6 +52,7 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
super.dispose();
if (fLaunchManager != null) {
@@ -61,12 +64,14 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
fireDelta(launches, IModelDelta.REMOVED);
}
@@ -74,6 +79,7 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
fireDelta(launches, IModelDelta.ADDED | IModelDelta.INSTALL);
}
@@ -81,6 +87,7 @@ public class LaunchManagerProxy extends AbstractModelProxy implements ILaunchesL
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
index 130e62c87..97ce3f571 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/LaunchProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,7 +39,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
* Set of launch's previous children. When a child is added,
* its model proxy is installed.
*/
- private Set fPrevChildren = new HashSet();
+ private Set<Object> fPrevChildren = new HashSet<Object>();
/**
* Constructs a new model proxy for the given launch.
@@ -53,6 +53,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#init(org.eclipse.debug.internal.ui.viewers.IPresentationContext)
*/
+ @Override
public void init(IPresentationContext context) {
super.init(context);
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
@@ -61,6 +62,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy#installed(org.eclipse.jface.viewers.Viewer)
*/
+ @Override
public void installed(Viewer viewer) {
// install model proxies for existing children
installModelProxies();
@@ -69,6 +71,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#dispose()
*/
+ @Override
public void dispose() {
super.dispose();
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
@@ -79,6 +82,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
if (launches[i] == fLaunch) {
@@ -91,6 +95,7 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
if (launches[i] == fLaunch) {
@@ -103,12 +108,14 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
for (int i = 0; i < launches.length; i++) {
if (launches[i] == fLaunch) {
@@ -139,8 +146,8 @@ public class LaunchProxy extends AbstractModelProxy implements ILaunchesListener
launchDelta.addNode(child, indexOf(child, children), IModelDelta.INSTALL, -1);
}
}
- List childrenList = Arrays.asList(children);
- for (Iterator itr = fPrevChildren.iterator(); itr.hasNext();) {
+ List<Object> childrenList = Arrays.asList(children);
+ for (Iterator<Object> itr = fPrevChildren.iterator(); itr.hasNext();) {
Object child = itr.next();
if (!childrenList.contains(child)) {
itr.remove();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java
index ea17c98f1..4945f6f32 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryBlockProxy.java
@@ -24,6 +24,7 @@ public class MemoryBlockProxy extends EventHandlerModelProxy {
private IMemoryBlock fMemoryBlock;
private DebugEventHandler fDebugEventHandler = new DebugEventHandler(this) {
+ @Override
protected boolean handlesEvent(DebugEvent event) {
if (event.getKind() == DebugEvent.CHANGE && event.getSource() == fMemoryBlock)
return true;
@@ -37,6 +38,7 @@ public class MemoryBlockProxy extends EventHandlerModelProxy {
return false;
}
+ @Override
protected void handleChange(DebugEvent event) {
if (event.getDetail() == DebugEvent.STATE)
{
@@ -50,11 +52,13 @@ public class MemoryBlockProxy extends EventHandlerModelProxy {
}
}
+ @Override
protected void handleSuspend(DebugEvent event) {
ModelDelta delta = new ModelDelta(fMemoryBlock, IModelDelta.CONTENT);
fireModelChanged(delta);
}
+ @Override
public synchronized void dispose() {
super.dispose();
}};
@@ -64,10 +68,12 @@ public class MemoryBlockProxy extends EventHandlerModelProxy {
fMemoryBlock = mb;
}
+ @Override
protected DebugEventHandler[] createEventHandlers() {
return new DebugEventHandler[]{fDebugEventHandler};
}
+ @Override
public void installed(Viewer viewer) {
super.installed(viewer);
setInstalled(true);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
index c6dba1f6c..8cdfebb6a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/MemoryRetrievalProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,7 @@
* display memory blocks that do not reference IDebugTarget
*
*******************************************************************************/
-
+
package org.eclipse.debug.internal.ui.viewers.update;
import java.util.Iterator;
@@ -39,135 +39,136 @@ import org.eclipse.ui.progress.UIJob;
public class MemoryRetrievalProxy extends AbstractModelProxy implements IMemoryBlockListener {
private IMemoryBlockRetrieval fRetrieval;
- public MemoryRetrievalProxy(IMemoryBlockRetrieval retrieval)
- {
+ public MemoryRetrievalProxy(IMemoryBlockRetrieval retrieval) {
fRetrieval = retrieval;
-
+
}
-
+
+ @Override
public void memoryBlocksAdded(IMemoryBlock[] memory) {
IMemoryBlock[] allMB = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
int lastIndex = allMB.length - memory.length;
ModelDelta delta = new ModelDelta(fRetrieval, 0, IModelDelta.NO_CHANGE, allMB.length);
-
- for (int i=0; i<memory.length; i++){
+
+ for (int i = 0; i < memory.length; i++) {
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory[i]);
-
- if (retrieval != null)
- {
- if (retrieval == fRetrieval)
- {
+
+ if (retrieval != null) {
+ if (retrieval == fRetrieval) {
// select the newly added memory block
- delta.addNode(memory[i], lastIndex+i, IModelDelta.ADDED | IModelDelta.SELECT, 0);
+ delta.addNode(memory[i], lastIndex + i, IModelDelta.ADDED | IModelDelta.SELECT, 0);
}
}
}
-
+
fireModelChanged(delta);
}
+ @Override
public void memoryBlocksRemoved(final IMemoryBlock[] memory) {
-
- UIJob job = new UIJob("memory blocks removed"){ //$NON-NLS-1$
+ UIJob job = new UIJob("memory blocks removed") { //$NON-NLS-1$
+
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
ModelDelta delta = new ModelDelta(fRetrieval, IModelDelta.NO_CHANGE);
-
+
// find a memory block to select
-
- for (int i=0; i<memory.length; i++){
+
+ for (int i = 0; i < memory.length; i++) {
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory[i]);
-
- if (retrieval != null)
- {
- if (retrieval == fRetrieval)
- {
- // do not change selection if the memory block removed is not
+
+ if (retrieval != null) {
+ if (retrieval == fRetrieval) {
+ // do not change selection if the memory block
+ // removed is not
// currently selected
// #getCurrentSelection must be run on the UI thread
- if (isMemoryBlockSelected(getCurrentSelection(), memory[i]))
+ if (isMemoryBlockSelected(getCurrentSelection(), memory[i])) {
addSelectDeltaNode(delta);
+ }
delta.addNode(memory[i], IModelDelta.REMOVED);
}
}
}
-
+
fireModelChanged(delta);
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
+ @Override
public void init(IPresentationContext context) {
super.init(context);
DebugPlugin.getDefault().getMemoryBlockManager().addListener(this);
}
-
- public void installed(Viewer viewer) {
+
+ @Override
+ public void installed(Viewer viewer) {
super.installed(viewer);
-
+
// Set the initial selection when the proxy is installed
// Otherwise, rendering pane cannot be populated.
setInitialSelection();
}
/**
- * Set the initial memory block selection when the proxy is installed.
- * This is done to ensure that when the memory view is opened, there is an initial
- * selection. Otherwise, the Rendering Pane will show up as blank.
+ * Set the initial memory block selection when the proxy is installed. This
+ * is done to ensure that when the memory view is opened, there is an
+ * initial selection. Otherwise, the Rendering Pane will show up as blank.
+ *
* @since 3.4
*/
protected void setInitialSelection() {
IMemoryBlock[] allMB = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- if (allMB.length > 0)
- {
+ if (allMB.length > 0) {
ModelDelta delta = new ModelDelta(fRetrieval, 0, IModelDelta.NO_CHANGE, allMB.length);
delta.addNode(allMB[0], 0, IModelDelta.SELECT, 0);
fireModelChanged(delta);
}
}
+ @Override
public synchronized void dispose() {
super.dispose();
DebugPlugin.getDefault().getMemoryBlockManager().removeListener(this);
}
- private void addSelectDeltaNode(ModelDelta delta)
- {
+ private void addSelectDeltaNode(ModelDelta delta) {
IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- if (memoryBlocks != null && memoryBlocks.length > 0)
- {
+ if (memoryBlocks != null && memoryBlocks.length > 0) {
delta.addNode(memoryBlocks[0], IModelDelta.SELECT);
}
}
-
+
private IStructuredSelection getCurrentSelection() {
Viewer viewer = getViewer();
if (viewer instanceof StructuredViewer) {
StructuredViewer sv = (StructuredViewer) viewer;
ISelection selection = sv.getSelection();
- if (selection instanceof IStructuredSelection)
- return (IStructuredSelection)selection;
+ if (selection instanceof IStructuredSelection) {
+ return (IStructuredSelection) selection;
+ }
}
return StructuredSelection.EMPTY;
}
-
- private boolean isMemoryBlockSelected(IStructuredSelection selection, IMemoryBlock memoryBlock)
- {
- if (!selection.isEmpty())
- {
- Iterator iter = selection.iterator();
- while (iter.hasNext())
- {
+
+ private boolean isMemoryBlockSelected(IStructuredSelection selection, IMemoryBlock memoryBlock) {
+ if (!selection.isEmpty()) {
+ Iterator<?> iter = selection.iterator();
+ while (iter.hasNext()) {
Object sel = iter.next();
- if (sel == memoryBlock)
+ if (sel == memoryBlock) {
return true;
-
- if (sel instanceof IMemoryRendering)
- {
- if (((IMemoryRendering)sel).getMemoryBlock() == memoryBlock)
+ }
+
+ if (sel instanceof IMemoryRendering) {
+ if (((IMemoryRendering) sel).getMemoryBlock() == memoryBlock) {
return true;
+ }
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java
index 14cfce57e..7ad095245 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ProcessProxy.java
@@ -24,18 +24,22 @@ public class ProcessProxy extends EventHandlerModelProxy {
private IProcess fProcess;
private DebugEventHandler fProcessEventHandler = new DebugEventHandler(this) {
- protected boolean handlesEvent(DebugEvent event) {
+ @Override
+ protected boolean handlesEvent(DebugEvent event) {
return event.getSource().equals(fProcess);
}
+ @Override
protected void handleChange(DebugEvent event) {
fireProcessDelta(IModelDelta.STATE);
}
- protected void handleCreate(DebugEvent event) {
+ @Override
+ protected void handleCreate(DebugEvent event) {
// do nothing - Launch change notification handles this
}
+ @Override
protected void handleTerminate(DebugEvent event) {
fireProcessDelta(IModelDelta.STATE | IModelDelta.UNINSTALL);
}
@@ -61,6 +65,7 @@ public class ProcessProxy extends EventHandlerModelProxy {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.EventHandlerModelProxy#dispose()
*/
+ @Override
public synchronized void dispose() {
super.dispose();
fProcess = null;
@@ -70,17 +75,20 @@ public class ProcessProxy extends EventHandlerModelProxy {
fProcess = process;
}
- protected synchronized boolean containsEvent(DebugEvent event) {
+ @Override
+ protected synchronized boolean containsEvent(DebugEvent event) {
return event.getSource().equals(fProcess);
}
- protected DebugEventHandler[] createEventHandlers() {
+ @Override
+ protected DebugEventHandler[] createEventHandlers() {
return new DebugEventHandler[] {fProcessEventHandler};
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.AbstractModelProxy#installed()
*/
+ @Override
public void installed(Viewer viewer) {
super.installed(viewer);
// select process if in run mode
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java
index 39d5c95f3..427a5c459 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/StackFrameEventHandler.java
@@ -36,6 +36,7 @@ public class StackFrameEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handlesEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected boolean handlesEvent(DebugEvent event) {
return event.getSource() instanceof IStackFrame;
}
@@ -43,6 +44,7 @@ public class StackFrameEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#handleChange(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void handleChange(DebugEvent event) {
IStackFrame frame = (IStackFrame) event.getSource();
ModelDelta root = fThreadHandler.buildRootDelta();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
index 7ca9f481f..4f8591004 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/ThreadEventHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -37,12 +37,12 @@ public class ThreadEventHandler extends DebugEventHandler {
* to select a thread when another is resumed. Threads
* are added in the order they suspend.
*/
- private Set fThreadQueue = new LinkedHashSet();
+ private Set<IThread> fThreadQueue = new LinkedHashSet<IThread>();
/**
* Map of previous TOS per thread
*/
- private Map fLastTopFrame = new HashMap();
+ private Map<IThread, IStackFrame> fLastTopFrame = new HashMap<IThread, IStackFrame>();
/**
* Constructs and event handler for a threads in the given viewer.
*
@@ -55,12 +55,14 @@ public class ThreadEventHandler extends DebugEventHandler {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.update.DebugEventHandler#dispose()
*/
+ @Override
public synchronized void dispose() {
fLastTopFrame.clear();
fThreadQueue.clear();
super.dispose();
}
+ @Override
protected void handleSuspend(DebugEvent event) {
IThread thread = (IThread) event.getSource();
if (event.isEvaluation()) {
@@ -94,6 +96,8 @@ public class ThreadEventHandler extends DebugEventHandler {
case DebugEvent.CLIENT_REQUEST:
extras = IModelDelta.EXPAND;
break;
+ default:
+ break;
}
fireDeltaUpdatingSelectedFrame(thread, IModelDelta.NO_CHANGE | extras, event);
}
@@ -109,6 +113,7 @@ public class ThreadEventHandler extends DebugEventHandler {
return o1.equals(o2);
}
+ @Override
protected void handleResume(DebugEvent event) {
IThread thread = removeSuspendedThread(event);
fireDeltaAndClearTopFrame(thread, IModelDelta.STATE | IModelDelta.CONTENT | IModelDelta.SELECT);
@@ -118,10 +123,12 @@ public class ThreadEventHandler extends DebugEventHandler {
}
}
+ @Override
protected void handleCreate(DebugEvent event) {
fireDeltaAndClearTopFrame((IThread) event.getSource(), IModelDelta.ADDED | IModelDelta.STATE);
}
+ @Override
protected void handleTerminate(DebugEvent event) {
IThread thread = (IThread) event.getSource();
IDebugTarget target = thread.getDebugTarget();
@@ -131,6 +138,7 @@ public class ThreadEventHandler extends DebugEventHandler {
}
}
+ @Override
protected void handleChange(DebugEvent event) {
if (event.getDetail() == DebugEvent.STATE) {
fireDeltaUpdatingThread((IThread) event.getSource(), IModelDelta.STATE);
@@ -139,6 +147,7 @@ public class ThreadEventHandler extends DebugEventHandler {
}
}
+ @Override
protected void handleLateSuspend(DebugEvent suspend, DebugEvent resume) {
IThread thread = queueSuspendedThread(suspend);
if (suspend.isEvaluation() && suspend.getDetail() == DebugEvent.EVALUATION_IMPLICIT) {
@@ -159,6 +168,7 @@ public class ThreadEventHandler extends DebugEventHandler {
}
}
+ @Override
protected void handleSuspendTimeout(DebugEvent event) {
IThread thread = removeSuspendedThread(event);
// don't collapse thread when waiting for long step or evaluation to complete
@@ -213,7 +223,7 @@ public class ThreadEventHandler extends DebugEventHandler {
ModelDelta node = addPathToThread(delta, thread);
IStackFrame prev = null;
synchronized (this) {
- prev = (IStackFrame) fLastTopFrame.get(thread);
+ prev = fLastTopFrame.get(thread);
}
IStackFrame frame = null;
try {
@@ -318,6 +328,7 @@ public class ThreadEventHandler extends DebugEventHandler {
fireDelta(delta);
}
+ @Override
protected boolean handlesEvent(DebugEvent event) {
return event.getSource() instanceof IThread;
}
@@ -349,7 +360,7 @@ public class ThreadEventHandler extends DebugEventHandler {
protected synchronized IThread getNextSuspendedThread() {
if (!fThreadQueue.isEmpty()) {
- return (IThread) fThreadQueue.iterator().next();
+ return fThreadQueue.iterator().next();
}
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java
index f72a8516b..6a7823fa5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/update/VariablesViewEventHandler.java
@@ -30,10 +30,12 @@ public class VariablesViewEventHandler extends DebugEventHandler {
fFrame = frame;
}
+ @Override
protected boolean handlesEvent(DebugEvent event) {
return true;
}
+ @Override
protected void refreshRoot(DebugEvent event) {
if (event.getDetail() != DebugEvent.EVALUATION_IMPLICIT) {
// Don't refresh everytime an implicit evaluation finishes
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
index a5674d048..a12318450 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 IBM Corporation and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,7 +29,7 @@ public class ViewContextManager implements IWindowListener {
/**
* Map of services
*/
- private Map fWindowToService = new HashMap();
+ private Map<IWorkbenchWindow, ViewContextService> fWindowToService = new HashMap<IWorkbenchWindow, ViewContextService>();
// singleton manager
private static ViewContextManager fgManager;
@@ -60,20 +60,23 @@ public class ViewContextManager implements IWindowListener {
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowActivated(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowDeactivated(IWorkbenchWindow window) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowClosed(IWorkbenchWindow window) {
- ViewContextService service = (ViewContextService) fWindowToService.get(window);
+ ViewContextService service = fWindowToService.get(window);
if (service != null) {
fWindowToService.remove(window);
service.dispose();
@@ -83,8 +86,9 @@ public class ViewContextManager implements IWindowListener {
/* (non-Javadoc)
* @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void windowOpened(IWorkbenchWindow window) {
- ViewContextService service = (ViewContextService) fWindowToService.get(window);
+ ViewContextService service = fWindowToService.get(window);
if (service == null) {
service = new ViewContextService(window);
fWindowToService.put(window, service);
@@ -98,7 +102,7 @@ public class ViewContextManager implements IWindowListener {
* @return view context service or <code>null</code>
*/
public ViewContextService getService(IWorkbenchWindow window) {
- return (ViewContextService) fWindowToService.get(window);
+ return fWindowToService.get(window);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
index d4bcd72ba..bc2aebb6d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ViewContextService.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -75,22 +75,22 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/**
* Maps the perspectives in this window to its last activated workbench context
*/
- private final Map fPerspectiveToActiveContext = new HashMap();
+ private final Map<IPerspectiveDescriptor, String> fPerspectiveToActiveContext = new HashMap<IPerspectiveDescriptor, String>();
/**
* Map of the perspectives to all workbench contexts activated in that perspective
*/
- private final Map fPerspectiveToActivatedContexts = new HashMap();
+ private final Map<IPerspectiveDescriptor, Set<String>> fPerspectiveToActivatedContexts = new HashMap<IPerspectiveDescriptor, Set<String>>();
/**
* Map of context id's to context view bindings
*/
- private Map fContextIdsToBindings;
+ private Map<String, DebugContextViewBindings> fContextIdsToBindings;
/**
* List of perspectives that debugging is allowed in
*/
- private Set fEnabledPerspectives = new HashSet();
+ private Set<String> fEnabledPerspectives = new HashSet<String>();
/**
* Whether to ignore perspective change call backs (set to
@@ -140,10 +140,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
private static final String XML_VALUE_CLOSED = "closed"; //$NON-NLS-1$
// ids of base debug views in debug perspective that should not be auto-closed
- private static Set fgBaseDebugViewIds = null;
+ private static Set<String> fgBaseDebugViewIds = null;
static {
- fgBaseDebugViewIds = new HashSet();
+ fgBaseDebugViewIds = new HashSet<String>();
fgBaseDebugViewIds.add(IDebugUIConstants.ID_DEBUG_VIEW);
fgBaseDebugViewIds.add(IDebugUIConstants.ID_VARIABLE_VIEW);
fgBaseDebugViewIds.add(IDebugUIConstants.ID_BREAKPOINT_VIEW);
@@ -166,7 +166,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
// all bindings including inherited bindings, top down in activation order
private String[] fAllViewBindingIds = null;
// associated binding to activate
- private final Map fAllViewIdToBindings = new HashMap();
+ private final Map<String, ViewBinding> fAllViewIdToBindings = new HashMap<String, ViewBinding>();
// all context id's in this context hierarchy (top down order)
private String[] fAllConetxtIds = null;
@@ -222,7 +222,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
if (fParentId == null) {
return null;
}
- return (DebugContextViewBindings) fContextIdsToBindings.get(fParentId);
+ return fContextIdsToBindings.get(fParentId);
}
/**
@@ -232,7 +232,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param perspective the perspective description
* @param allViewIds that are relevant to the chain activation.
*/
- public void activateChain(IWorkbenchPage page, IPerspectiveDescriptor perspective, Set allViewIds) {
+ public void activateChain(IWorkbenchPage page, IPerspectiveDescriptor perspective, Set<String> allViewIds) {
initializeChain();
doActivation(page, perspective, allViewIds, fAllConetxtIds);
}
@@ -251,7 +251,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param allViewIds id's of all the views that are relevant in this context activation
* @param contextIds associated contexts that are activated
*/
- private void doActivation(IWorkbenchPage page, IPerspectiveDescriptor perspective, Set allViewIds, String[] contextIds) {
+ private void doActivation(IWorkbenchPage page, IPerspectiveDescriptor perspective, Set<String> allViewIds, String[] contextIds) {
// note activation of all the relevant contexts
for (int i = 0; i < contextIds.length; i++) {
addActivated(contextIds[i]);
@@ -261,7 +261,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
// activate the view bindings and bring most relevant views to top
for (int i = 0; i < fAllViewBindingIds.length; i++) {
String viewId = fAllViewBindingIds[i];
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
+ ViewBinding binding = fAllViewIdToBindings.get(viewId);
binding.activated(page, perspective);
binding.checkZOrder(page, allViewIds);
}
@@ -273,18 +273,16 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
*/
private synchronized void initializeChain() {
if (fAllViewBindingIds == null) {
- List orderedIds = new ArrayList();
- List contexts = new ArrayList();
+ List<String> orderedIds = new ArrayList<String>();
+ List<DebugContextViewBindings> contexts = new ArrayList<DebugContextViewBindings>();
DebugContextViewBindings context = this;
while (context != null) {
contexts.add(0, context);
context = context.getParentContext();
}
- Iterator iterator = contexts.iterator();
fAllConetxtIds = new String[contexts.size()];
int pos = 0;
- while (iterator.hasNext()) {
- DebugContextViewBindings bindings = (DebugContextViewBindings) iterator.next();
+ for (DebugContextViewBindings bindings : contexts) {
fAllConetxtIds[pos] = bindings.getId();
pos++;
for (int i = 0; i < bindings.fViewBindingIds.length; i++) {
@@ -298,7 +296,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
}
}
- fAllViewBindingIds = (String[]) orderedIds.toArray(new String[orderedIds.size()]);
+ fAllViewBindingIds = orderedIds.toArray(new String[orderedIds.size()]);
}
}
@@ -315,7 +313,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
for (int i = 0; i < fViewBindingIds.length; i++) {
String viewId = fViewBindingIds[i];
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
+ ViewBinding binding = fAllViewIdToBindings.get(viewId);
binding.deactivated(page, perspective);
}
}
@@ -328,7 +326,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
*/
public void setViewOpened(boolean opened, String viewId) {
initializeChain();
- ViewBinding binding = (ViewBinding)fAllViewIdToBindings.get(viewId);
+ ViewBinding binding = fAllViewIdToBindings.get(viewId);
if (binding != null) {
if (opened) {
binding.userOpened();
@@ -340,7 +338,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
public void applyUserSettings(String viewId, Element viewElement) {
initializeChain();
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
+ ViewBinding binding = fAllViewIdToBindings.get(viewId);
if (binding != null) {
binding.applyUserSettings(viewElement);
}
@@ -353,12 +351,12 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param root the root XML element
* @param alreadyDone views already done
*/
- public void saveBindings(Document document, Element root, Set alreadyDone) {
+ public void saveBindings(Document document, Element root, Set<String> alreadyDone) {
for (int i = 0; i < fViewBindingIds.length; i++) {
String viewId = fViewBindingIds[i];
if (!alreadyDone.contains(viewId)) {
alreadyDone.add(viewId);
- ViewBinding binding = (ViewBinding) fAllViewIdToBindings.get(viewId);
+ ViewBinding binding = fAllViewIdToBindings.get(viewId);
binding.saveBindings(document, root);
}
}
@@ -373,15 +371,15 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/**
* Set of perspectives this view was opened in by the user
*/
- private final Set fUserOpened = new HashSet();
+ private final Set<String> fUserOpened = new HashSet<String>();
/**
* Set of perspectives this view was closed in by the user
*/
- private final Set fUserClosed = new HashSet();
+ private final Set<String> fUserClosed = new HashSet<String>();
/**
* Set of perspectives this view was auto-opened by view management.
*/
- private final Set fAutoOpened = new HashSet();
+ private final Set<String> fAutoOpened = new HashSet<String>();
public ViewBinding(IConfigurationElement element) {
fElement = element;
@@ -512,7 +510,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param page the page to check
* @param relevantViews the array of view identifiers
*/
- public void checkZOrder(IWorkbenchPage page, Set relevantViews) {
+ public void checkZOrder(IWorkbenchPage page, Set<String> relevantViews) {
// see if view is open already
IViewPart part = page.findView(getViewId());
if (part != null) {
@@ -572,8 +570,8 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
}
- private void appendPerspectives(Document document, Element parent, Set perpectives, String xmlValue) {
- String[] ids = (String[]) perpectives.toArray(new String[perpectives.size()]);
+ private void appendPerspectives(Document document, Element parent, Set<String> perpectives, String xmlValue) {
+ String[] ids = perpectives.toArray(new String[perpectives.size()]);
for (int i = 0; i < ids.length; i++) {
String id = ids[i];
Element element = document.createElement(XML_ELEMENT_PERSPECTIVE);
@@ -654,7 +652,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* Loads extensions which map context id's to view bindings.
*/
private void loadContextToViewExtensions() {
- fContextIdsToBindings = new HashMap();
+ fContextIdsToBindings = new HashMap<String, DebugContextViewBindings>();
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), ID_CONTEXT_VIEW_BINDINGS);
IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
for (int i = 0; i < configurationElements.length; i++) {
@@ -666,7 +664,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
continue;
}
ViewBinding info = new ViewBinding(element);
- DebugContextViewBindings bindings = (DebugContextViewBindings) fContextIdsToBindings.get(contextId);
+ DebugContextViewBindings bindings = fContextIdsToBindings.get(contextId);
if (bindings == null) {
bindings = new DebugContextViewBindings(contextId);
fContextIdsToBindings.put(contextId, bindings);
@@ -694,9 +692,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
Element entry = (Element) node;
if(entry.getNodeName().equalsIgnoreCase(XML_ELEMENT_VIEW)){
String id = entry.getAttribute(XML_ATTR_ID);
- Iterator bindings = fContextIdsToBindings.values().iterator();
- while (bindings.hasNext()) {
- DebugContextViewBindings binding = (DebugContextViewBindings) bindings.next();
+ for (DebugContextViewBindings binding : fContextIdsToBindings.values()) {
binding.applyUserSettings(id, entry);
}
}
@@ -753,8 +749,8 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
*
* @return list
*/
- public static Set parseList(String listString) {
- Set list = new HashSet(10);
+ public static Set<String> parseList(String listString) {
+ Set<String> list = new HashSet<String>(10);
StringTokenizer tokenizer = new StringTokenizer(listString, ","); //$NON-NLS-1$
while (tokenizer.hasMoreTokens()) {
String token = tokenizer.nextToken();
@@ -771,9 +767,8 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
*
* @since 3.5
*/
- public static Set getDefaultEnabledPerspectives() {
- Set perspectives = new HashSet(4);
-
+ public static Set<String> getDefaultEnabledPerspectives() {
+ Set<String> perspectives = new HashSet<String>(4);
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), ID_CONTEXT_VIEW_BINDINGS);
IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements();
for (int i = 0; i < configurationElements.length; i++) {
@@ -793,7 +788,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
if (isEnabledPerspective()) {
if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
IStructuredSelection ss = (IStructuredSelection) selection;
- Iterator iterator = ss.iterator();
+ Iterator<?> iterator = ss.iterator();
while (iterator.hasNext()) {
Object target = iterator.next();
ILaunch launch = DebugModelContextBindingManager.getLaunch(target);
@@ -806,24 +801,24 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
// Include the word '.internal.' so the context is filtered from the key binding pref page (Bug 144019) also see PerspectiveManager.handleBreakpointHit()
if (fContextService.getActiveContextIds().contains(type.getIdentifier() + ".internal." + getActivePerspective().getId())) { //$NON-NLS-1$
// get the leaf contexts to be activated
- List workbenchContexts = DebugModelContextBindingManager.getDefault().getWorkbenchContextsForDebugContext(target);
+ List<String> workbenchContexts = DebugModelContextBindingManager.getDefault().getWorkbenchContextsForDebugContext(target);
// TODO: do we need to check if contexts are actually enabled in workbench first?
if (!workbenchContexts.isEmpty()) {
// Quickly check if any contexts need activating
boolean needToActivate = false;
for (int i = 0; i < workbenchContexts.size(); i++) {
- if (!isActivated((String)workbenchContexts.get(i))) {
+ if (!isActivated(workbenchContexts.get(i))) {
needToActivate = true;
break;
}
}
if (needToActivate) {
- Set allViewIds = getAllContextsViewIDs(workbenchContexts);
+ Set<String> allViewIds = getAllContextsViewIDs(workbenchContexts);
// if all contexts already activate and last context is already active context == done
for (int i = 0; i < workbenchContexts.size(); i++) {
- String contextId = (String)workbenchContexts.get(i);
+ String contextId = workbenchContexts.get(i);
if (!isActivated(contextId)) {
activateChain(contextId, getActivePerspective(), allViewIds);
}
@@ -850,7 +845,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
private boolean isActiveContext(String contextId) {
IPerspectiveDescriptor activePerspective = getActivePerspective();
if (activePerspective != null) {
- String activeId = (String) fPerspectiveToActiveContext.get(activePerspective);
+ String activeId = fPerspectiveToActiveContext.get(activePerspective);
return contextId.equals(activeId);
}
return false;
@@ -865,7 +860,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
private boolean isActivated(String contextId) {
IPerspectiveDescriptor activePerspective = getActivePerspective();
if (activePerspective != null) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.get(activePerspective);
+ Set<String> contexts = fPerspectiveToActivatedContexts.get(activePerspective);
if (contexts != null) {
return contexts.contains(contextId);
}
@@ -876,9 +871,9 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
private void addActivated(String contextId) {
IPerspectiveDescriptor activePerspective = getActivePerspective();
if (activePerspective != null) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.get(activePerspective);
+ Set<String> contexts = fPerspectiveToActivatedContexts.get(activePerspective);
if (contexts == null) {
- contexts = new HashSet();
+ contexts = new HashSet<String>();
fPerspectiveToActivatedContexts.put(activePerspective, contexts);
}
contexts.add(contextId);
@@ -888,13 +883,14 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
private void removeActivated(String contextId) {
IPerspectiveDescriptor activePerspective = getActivePerspective();
if (activePerspective != null) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.get(activePerspective);
+ Set<String> contexts = fPerspectiveToActivatedContexts.get(activePerspective);
if (contexts != null) {
contexts.remove(contextId);
}
}
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
contextActivated(event.getContext());
@@ -904,18 +900,21 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener3#perspectiveOpened(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener3#perspectiveClosed(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveClosed(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener3#perspectiveDeactivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
}
@@ -925,12 +924,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param perspective the perspective descriptor
*/
private void clean(IPerspectiveDescriptor perspective) {
- Set contexts = (Set) fPerspectiveToActivatedContexts.remove(perspective);
+ Set<String> contexts = fPerspectiveToActivatedContexts.remove(perspective);
fPerspectiveToActiveContext.remove(perspective);
if (contexts != null) {
- Iterator iterator = contexts.iterator();
- while (iterator.hasNext()) {
- String id = (String) iterator.next();
+ for (String id : contexts) {
deactivate(id, perspective);
}
}
@@ -939,23 +936,23 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener3#perspectiveSavedAs(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveSavedAs(IWorkbenchPage page, IPerspectiveDescriptor oldPerspective, IPerspectiveDescriptor newPerspective) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String)
*/
+ @Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
if (!fIgnoreChanges && page.getWorkbenchWindow().equals(fWindow)) {
if(partRef != null) {
if (IWorkbenchPage.CHANGE_VIEW_SHOW == changeId || IWorkbenchPage.CHANGE_VIEW_HIDE == changeId) {
// Update only the contexts which are currently active (Bug 128065)
- Set activatedContexts = (Set)fPerspectiveToActivatedContexts.get(perspective);
+ Set<String> activatedContexts = fPerspectiveToActivatedContexts.get(perspective);
if (activatedContexts != null) {
- Iterator iterator = activatedContexts.iterator();
- while (iterator.hasNext()) {
- DebugContextViewBindings bindings =
- (DebugContextViewBindings)fContextIdsToBindings.get(iterator.next());
+ for (String id : activatedContexts) {
+ DebugContextViewBindings bindings = fContextIdsToBindings.get(id);
if (bindings != null) {
bindings.setViewOpened(IWorkbenchPage.CHANGE_VIEW_SHOW == changeId, partRef.getId());
}
@@ -969,6 +966,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
if (page.getWorkbenchWindow().equals(fWindow)) {
fActivePerspective = perspective;
@@ -982,6 +980,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
*/
+ @Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
}
@@ -991,30 +990,28 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param contextId the identifier of the {@link DebugContextViewBindings} to activate
* @param perspective the perspective description
*/
- private void activateChain(String contextId, IPerspectiveDescriptor perspective, Set allViewIds) {
- if (fWindow == null)
- {
+ private void activateChain(String contextId, IPerspectiveDescriptor perspective, Set<String> allViewIds) {
+ if (fWindow == null) {
return; // disposed
}
IWorkbenchPage page = fWindow.getActivePage();
if (page != null) {
- DebugContextViewBindings bindings= (DebugContextViewBindings) fContextIdsToBindings.get(contextId);
+ DebugContextViewBindings bindings= fContextIdsToBindings.get(contextId);
if (bindings != null) {
bindings.activateChain(page, perspective, allViewIds);
}
}
}
- private Set getAllContextsViewIDs(List contextsIds) {
- if (fWindow == null)
- {
+ private Set<String> getAllContextsViewIDs(List<String> contextsIds) {
+ if (fWindow == null) {
return Collections.EMPTY_SET; // disposed
}
- TreeSet viewIds = new TreeSet();
+ TreeSet<String> viewIds = new TreeSet<String>();
for (int i = 0; i < contextsIds.size(); i++) {
- DebugContextViewBindings bindings= (DebugContextViewBindings) fContextIdsToBindings.get(contextsIds.get(i));
+ DebugContextViewBindings bindings= fContextIdsToBindings.get(contextsIds.get(i));
if (bindings != null) {
String[] bindingViewIds = bindings.getAllViewBindingsIds();
for (int j = 0; j < bindingViewIds.length; j++) {
@@ -1029,13 +1026,10 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* Links each debug context view bindings with its parent context bindings
*/
private void linkParentContexts() {
- Iterator iterator = fContextIdsToBindings.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry)iterator.next();
- String contextId = (String) entry.getKey();
- DebugContextViewBindings bindings = (DebugContextViewBindings) entry.getValue();
+ for (Entry<String, DebugContextViewBindings> entry : fContextIdsToBindings.entrySet()) {
+ DebugContextViewBindings bindings = entry.getValue();
if (!bindings.getId().equals(DEBUG_CONTEXT)) {
- Context context = fContextService.getContext(contextId);
+ Context context = fContextService.getContext(entry.getKey());
try {
bindings.setParentId(context.getParentId());
} catch (NotDefinedException e) {
@@ -1063,13 +1057,12 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/* (non-Javadoc)
* @see org.eclipse.core.commands.contexts.IContextManagerListener#contextManagerChanged(org.eclipse.core.commands.contexts.ContextManagerEvent)
*/
+ @Override
public void contextManagerChanged(ContextManagerEvent event) {
if (event.isActiveContextsChanged() && getActivePerspective() != null) {
- Set disabledContexts = getDisabledContexts(event);
+ Set<String> disabledContexts = getDisabledContexts(event);
if (!disabledContexts.isEmpty()) {
- Iterator contexts = disabledContexts.iterator();
- while (contexts.hasNext()) {
- String contextId = (String)contexts.next();
+ for (String contextId : disabledContexts) {
if (isViewContext(contextId)) {
if (isActivated(contextId)) {
deactivate(contextId, getActivePerspective());
@@ -1090,7 +1083,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
IWorkbenchPage page = fWindow.getActivePage();
if (page != null) {
- DebugContextViewBindings bindings = (DebugContextViewBindings) fContextIdsToBindings.get(contextId);
+ DebugContextViewBindings bindings = fContextIdsToBindings.get(contextId);
if (bindings != null) {
bindings.deactivate(page, perspective);
}
@@ -1103,9 +1096,9 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @param event the event
* @return disabled context id's
*/
- private Set getDisabledContexts(ContextManagerEvent event) {
- Set prev = new HashSet(event.getPreviouslyActiveContextIds());
- Set activeContextIds = event.getContextManager().getActiveContextIds();
+ private Set<String> getDisabledContexts(ContextManagerEvent event) {
+ Set<String> prev = new HashSet<String>(event.getPreviouslyActiveContextIds());
+ Set<String> activeContextIds = event.getContextManager().getActiveContextIds();
if (activeContextIds != null) {
prev.removeAll(activeContextIds);
}
@@ -1130,10 +1123,8 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
Document document = DebugPlugin.newDocument();
Element root = document.createElement(XML_ELEMENT_VIEW_BINDINGS);
document.appendChild(root);
- Set done = new HashSet();
- Iterator bindings = fContextIdsToBindings.values().iterator();
- while (bindings.hasNext()) {
- DebugContextViewBindings binding = (DebugContextViewBindings) bindings.next();
+ Set<String> done = new HashSet<String>();
+ for (DebugContextViewBindings binding : fContextIdsToBindings.values()) {
binding.saveBindings(document, root, done);
}
String prefValue = IInternalDebugCoreConstants.EMPTY_STRING;
@@ -1156,7 +1147,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
* @return the array of perspective identifiers in which debugging is enabled
*/
public String[] getEnabledPerspectives() {
- return (String[]) fEnabledPerspectives.toArray(new String[fEnabledPerspectives.size()]);
+ return fEnabledPerspectives.toArray(new String[fEnabledPerspectives.size()]);
}
/**
@@ -1189,6 +1180,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener4#perspectivePreDeactivate(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectivePreDeactivate(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
if (page.getWorkbenchWindow().equals(fWindow)) {
fActivePerspective = null;
@@ -1196,6 +1188,7 @@ public class ViewContextService implements IDebugContextListener, IPerspectiveLi
}
}
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
if (!fIgnoreChanges) {
if (IDebugUIConstants.PREF_MANAGE_VIEW_PERSPECTIVES.equals(event.getKey())) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
index 4f0116d41..cdd141032 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainer.java
@@ -39,12 +39,12 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
/**
* Child breakpoints - inserting new element into this collection should use the insertBreakpoint method
*/
- final private List fBreakpoints = new ArrayList();
+ final private List<IBreakpoint> fBreakpoints = new ArrayList<IBreakpoint>();
/**
* Child containers - inserting new element into this container should use the insertChildContainer method
*/
- final private List fChildContainers = new ArrayList();
+ final private List<BreakpointContainer> fChildContainers = new ArrayList<BreakpointContainer>();
/**
* The category for this container
@@ -158,8 +158,9 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
}
int index = fBreakpoints.size();
for (; fComparator != null && index > 0; index--) {
- if (fComparator.compare(fBreakpoints.get(index-1), breakpoint) < 0)
- break;
+ if (fComparator.compare(fBreakpoints.get(index-1), breakpoint) < 0) {
+ break;
+ }
}
if (index < 0) {
index = 0;
@@ -177,12 +178,14 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
private int insertChildContainer(BreakpointContainer container) {
int index = fChildContainers.size();
for (; fComparator != null && index > 0; index--) {
- if (fComparator.compare(fChildContainers.get(index-1), container) < 0)
- break;
+ if (fComparator.compare(fChildContainers.get(index-1), container) < 0) {
+ break;
+ }
}
- if (index < 0)
- index = 0;
+ if (index < 0) {
+ index = 0;
+ }
fChildContainers.add(index, container);
return index;
@@ -225,10 +228,9 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
*/
private static IAdaptable[] getCategories(IBreakpoint breakpoint, IBreakpointOrganizer organizer) {
IAdaptable[] categories = organizer.getCategories(breakpoint);
-
- if (categories == null || categories.length == 0)
- categories = OtherBreakpointCategory.getCategories(organizer);
-
+ if (categories == null || categories.length == 0) {
+ categories = OtherBreakpointCategory.getCategories(organizer);
+ }
return categories;
}
@@ -239,21 +241,13 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @param category the category
* @return the breakpoint container, can be <code>null</code>.
*/
- private static BreakpointContainer findExistingContainer(List containers, IAdaptable category) {
- BreakpointContainer container = null;
-
- Iterator containerIt = containers.iterator();
- while (containerIt.hasNext()) {
- container = (BreakpointContainer) containerIt.next();
- IAdaptable containerCategory = container.getCategory();
-
- if (category.equals(containerCategory))
- break;
-
- container = null;
+ private static BreakpointContainer findExistingContainer(List<BreakpointContainer> containers, IAdaptable category) {
+ for (BreakpointContainer c : containers) {
+ if (category.equals(c.getCategory())) {
+ return c;
+ }
}
-
- return container;
+ return null;
}
// TODO [pchuong]: can be remove if BreakpointsContentProvider no longer uses this class
@@ -270,7 +264,9 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
*/
public void addBreakpoint(IBreakpoint breakpoint, ModelDelta rootDelta) {
final int bpIndex = insertBreakpoint(breakpoint);
- if (bpIndex < 0) return;
+ if (bpIndex < 0) {
+ return;
+ }
if (hasNesting()) {
IBreakpointOrganizer organizer = fNesting[0];
@@ -329,10 +325,9 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
if (removed) {
boolean addRemoveBpDelta = getContainers().length == 0;
- Iterator it = fChildContainers.iterator();
+ Iterator<BreakpointContainer> it = fChildContainers.iterator();
while (it.hasNext()) {
- BreakpointContainer container = (BreakpointContainer) it.next();
-
+ BreakpointContainer container = it.next();
// if the breakpoint contains in the container and it is the only breakpoint,
// than remove the container from the collection
if (container.contains(breakpoint)) {
@@ -344,7 +339,6 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
} else {
childDelta = rootDelta.addNode(container, IModelDelta.STATE);
}
-
// remove the breakpoint from the nested containers
container.removeBreakpoint(breakpoint, childDelta);
}
@@ -376,11 +370,12 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @param breakpoints the breakpoint to update
* @param add true if breakpoint should be added to the cache, otherwise remove the breakpoint from the cache
*/
- private static void updateSelfAndAncestorsBreakpointCache(BreakpointContainer container, List breakpoints, boolean add) {
+ private static void updateSelfAndAncestorsBreakpointCache(BreakpointContainer container, List<IBreakpoint> breakpoints, boolean add) {
if (container != null) {
container.fBreakpoints.removeAll(breakpoints);
- if (add)
- container.fBreakpoints.addAll(breakpoints);
+ if (add) {
+ container.fBreakpoints.addAll(breakpoints);
+ }
updateSelfAndAncestorsBreakpointCache(container.getParent(), breakpoints, add);
}
}
@@ -396,7 +391,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
int index = destContainer.insertBreakpoint(breakpoint);
Assert.isTrue(index >= 0);
- List breakpoints = destContainer.fBreakpoints;
+ List<IBreakpoint> breakpoints = destContainer.fBreakpoints;
destContainerDelta.addNode(breakpoint, index/*breakpoints.indexOf(breakpoint)*/, IModelDelta.ADDED|IModelDelta.INSTALL, 0);
destContainerDelta.setFlags(destContainerDelta.getFlags() | IModelDelta.EXPAND);
@@ -416,7 +411,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
sourceContainer.fParent = destContainer;
// add the breakpoints to the parent containers.
- List breakpoints = Arrays.asList(sourceContainer.getBreakpoints());
+ List<IBreakpoint> breakpoints = Arrays.asList(sourceContainer.getBreakpoints());
updateSelfAndAncestorsBreakpointCache(destContainer, breakpoints, true);
int index = destContainer.fChildContainers.indexOf(sourceContainer);
@@ -457,7 +452,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
*/
static public void removeBreakpoint(BreakpointContainer container, IBreakpoint breakpoint, ModelDelta containerDelta) {
container.removeBreakpoint(breakpoint, containerDelta);
- List breakpoints = new ArrayList();
+ List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>();
breakpoints.add(breakpoint);
updateSelfAndAncestorsBreakpointCache(container.getParent(), breakpoints, false);
}
@@ -476,11 +471,10 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
}
if (container.fChildContainers.size() == 0) {
- List breakpoints = new ArrayList();
-
- Iterator iterator = container.fBreakpoints.iterator();
+ List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>();
+ Iterator<IBreakpoint> iterator = container.fBreakpoints.iterator();
while (iterator.hasNext()) {
- Object obj = iterator.next();
+ IBreakpoint obj = iterator.next();
breakpoints.add(obj);
delta.addNode(obj, IModelDelta.UNINSTALL|IModelDelta.REMOVED);
iterator.remove();
@@ -491,12 +485,11 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
return;
}
- Iterator iterator = container.fChildContainers.iterator();
+ Iterator<BreakpointContainer> iterator = container.fChildContainers.iterator();
while (iterator.hasNext()) {
- BreakpointContainer childContainer = (BreakpointContainer) iterator.next();
+ BreakpointContainer childContainer = iterator.next();
ModelDelta childDelta = delta.addNode(childContainer, IModelDelta.REMOVED|IModelDelta.UNINSTALL);
iterator.remove();
-
removeAll(childContainer, childDelta);
}
}
@@ -515,8 +508,9 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
*
* @return the breakpoints in this container
*/
- public IBreakpoint[] getBreakpoints() {
- return (IBreakpoint[]) fBreakpoints.toArray(new IBreakpoint[fBreakpoints.size()]);
+ @Override
+ public IBreakpoint[] getBreakpoints() {
+ return fBreakpoints.toArray(new IBreakpoint[fBreakpoints.size()]);
}
/**
@@ -524,7 +518,8 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
*
* @return container category
*/
- public IAdaptable getCategory() {
+ @Override
+ public IAdaptable getCategory() {
return fCategory;
}
@@ -559,7 +554,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @return the containers nested in this container, can be empty.
*/
public BreakpointContainer[] getContainers() {
- return (BreakpointContainer[]) fChildContainers.toArray(new BreakpointContainer[fChildContainers.size()]);
+ return fChildContainers.toArray(new BreakpointContainer[fChildContainers.size()]);
}
/**
@@ -567,7 +562,8 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
*
* @return this container's organizer
*/
- public IBreakpointOrganizer getOrganizer() {
+ @Override
+ public IBreakpointOrganizer getOrganizer() {
return fOrganizer;
}
@@ -577,7 +573,8 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* @param breakpoint the breakpoint to check
* @return true if this container contains the given breakpoint
*/
- public boolean contains(IBreakpoint breakpoint) {
+ @Override
+ public boolean contains(IBreakpoint breakpoint) {
return fBreakpoints.contains(breakpoint);
}
@@ -593,7 +590,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
if (containers.length == 0) {
return new BreakpointContainer[]{this};
}
- ArrayList list = new ArrayList();
+ ArrayList<BreakpointContainer> list = new ArrayList<BreakpointContainer>();
for (int i = 0; i < containers.length; i++) {
BreakpointContainer container = containers[i];
BreakpointContainer[] subcontainers = container.getContainers(breakpoint);
@@ -603,7 +600,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
}
}
}
- return (BreakpointContainer[]) list.toArray(new BreakpointContainer[list.size()]);
+ return list.toArray(new BreakpointContainer[list.size()]);
}
return new BreakpointContainer[0];
}
@@ -612,18 +609,16 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof BreakpointContainer) {
-
BreakpointContainer container = (BreakpointContainer) obj;
-
// With Group by "Advanced" the same category can contain a different subset of breakpoints,
// therefore to have the same category is not enough to be equal.
if (! (fParent != null && container.fParent != null && fParent.equals(container.fParent) ||
fParent == null && container.fParent == null) ) {
return false;
}
-
if (getCategory() != null && container.getCategory() != null) {
return getCategory().equals(container.getCategory());
} else {
@@ -632,11 +627,12 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
}
return super.equals(obj);
}
-
+
/*
* (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)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getChildren().length;
}
@@ -645,6 +641,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* (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)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return getElements(getChildren(), index, length);
}
@@ -653,6 +650,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.model.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return id.equals(IDebugUIConstants.ID_BREAKPOINT_VIEW);
}
@@ -661,6 +659,7 @@ public class BreakpointContainer extends ElementContentProvider implements IAdap
* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
return Platform.getAdapterManager().getAdapter(this, adapter);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
index a1f3f7e5a..7a0c9dd2e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointContainerWorkbenchAdapter.java
@@ -28,7 +28,8 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
// not used
return null;
}
@@ -36,7 +37,8 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
- public ImageDescriptor getImageDescriptor(Object object) {
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
@@ -54,7 +56,8 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
- public String getLabel(Object object) {
+ @Override
+ public String getLabel(Object object) {
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
@@ -72,14 +75,16 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
- public Object getParent(Object o) {
+ @Override
+ public Object getParent(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
*/
- public RGB getForeground(Object object) {
+ @Override
+ public RGB getForeground(Object object) {
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
@@ -94,7 +99,8 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
*/
- public RGB getBackground(Object object) {
+ @Override
+ public RGB getBackground(Object object) {
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
@@ -109,7 +115,8 @@ public class BreakpointContainerWorkbenchAdapter implements IWorkbenchAdapter, I
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
*/
- public FontData getFont(Object object) {
+ @Override
+ public FontData getFont(Object object) {
if (object instanceof IBreakpointContainer) {
IBreakpointContainer container = (IBreakpointContainer) object;
IAdaptable category = container.getCategory();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java
index 221587fd2..b7a88d77d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointFactory.java
@@ -27,7 +27,8 @@ public class BreakpointFactory implements IElementFactory {
/* (non-Javadoc)
* @see org.eclipse.ui.IElementFactory#createElement(org.eclipse.ui.IMemento)
*/
- public IAdaptable createElement(IMemento memento) {
+ @Override
+ public IAdaptable createElement(IMemento memento) {
String longString = memento.getString(BreakpointPersistableElementAdapter.TAG_MARKER_ID);
String factoryId = memento.getString(BreakpointPersistableElementAdapter.TAG_RESOURCE_FACTORY_ID);
if (factoryId != null && longString != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
index fc1385156..36b064707 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerExtension.java
@@ -47,6 +47,7 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
*
* @return image descriptor
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
if (fDescriptor == null) {
fDescriptor = DebugUIPlugin.getImageDescriptor(fElement, ATTR_ICON);
@@ -62,6 +63,7 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
*
* @return this organizer's label
*/
+ @Override
public String getLabel() {
return fElement.getAttribute(ATTR_LABEL);
}
@@ -71,7 +73,8 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
*
* @return this organizer's identifier
*/
- public String getIdentifier() {
+ @Override
+ public String getIdentifier() {
return fElement.getAttribute(ATTR_ID);
}
@@ -94,56 +97,64 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
*/
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
+ @Override
+ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
return getOrganizer().getCategories(breakpoint);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
+ @Override
+ public void addPropertyChangeListener(IPropertyChangeListener listener) {
getOrganizer().addPropertyChangeListener(listener);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
+ @Override
+ public void removePropertyChangeListener(IPropertyChangeListener listener) {
getOrganizer().removePropertyChangeListener(listener);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
getOrganizer().addBreakpoint(breakpoint, category);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
getOrganizer().removeBreakpoint(breakpoint, category);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
return getOrganizer().canAdd(breakpoint, category);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
return getOrganizer().canRemove(breakpoint, category);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
// don't instantiate the delegate if it has not been used
if (fDelegate != null) {
fDelegate.dispose();
@@ -153,7 +164,8 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.breakpoints.IBreakpointOrganizer#getOthersLabel()
*/
- public String getOthersLabel() {
+ @Override
+ public String getOthersLabel() {
String attribute = fElement.getAttribute(ATTR_OTHERS_LABEL);
if (attribute == null) {
return DebugUIViewsMessages.OtherBreakpointOrganizer_0;
@@ -164,13 +176,15 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
*/
- public IAdaptable[] getCategories() {
+ @Override
+ public IAdaptable[] getCategories() {
return getOrganizer().getCategories();
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#addBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public void addBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
IBreakpointOrganizerDelegate organizer = getOrganizer();
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
@@ -185,6 +199,7 @@ public class BreakpointOrganizerExtension implements IBreakpointOrganizer, IBrea
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#removeBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public void removeBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
IBreakpointOrganizerDelegate organizer = getOrganizer();
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
index 4d39bf90e..eb09e90a9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointOrganizerManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,9 +42,9 @@ public class BreakpointOrganizerManager {
private static BreakpointOrganizerManager fgManager;
// map for lookup by id
- private Map fOrganizers = new HashMap();
+ private Map<String, IBreakpointOrganizer> fOrganizers = new HashMap<String, IBreakpointOrganizer>();
// cached sorted list by label
- private List fSorted = null;
+ private List<IBreakpointOrganizer> fSorted = null;
/**
* Returns the singleton instance of the breakpoint container
@@ -69,14 +69,15 @@ public class BreakpointOrganizerManager {
}
/**
- * Forces instantiation of orgranizer delegate.
+ * Forces instantiation of organizer delegate.
*
* @param organizerId organizer to start
*/
private void start(String organizerId) {
IBreakpointOrganizer organizer = getOrganizer(organizerId);
IPropertyChangeListener listener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
}
};
organizer.addPropertyChangeListener(listener);
@@ -117,22 +118,19 @@ public class BreakpointOrganizerManager {
*/
public IBreakpointOrganizer[] getOrganizers() {
if (fSorted == null) {
- Collection collection = fOrganizers.values();
- fSorted = new ArrayList();
+ Collection<IBreakpointOrganizer> collection = fOrganizers.values();
+ fSorted = new ArrayList<IBreakpointOrganizer>();
fSorted.addAll(collection);
- Collections.sort(fSorted, new Comparator() {
+ Collections.sort(fSorted, new Comparator<Object>() {
+ @Override
public int compare(Object o1, Object o2) {
IBreakpointOrganizer b1 = (IBreakpointOrganizer)o1;
IBreakpointOrganizer b2 = (IBreakpointOrganizer)o2;
return b1.getLabel().compareTo(b2.getLabel());
}
-
- public boolean equals(Object obj) {
- return this == obj;
- }
});
}
- return (IBreakpointOrganizer[]) fSorted.toArray(new IBreakpointOrganizer[fSorted.size()]);
+ return fSorted.toArray(new IBreakpointOrganizer[fSorted.size()]);
}
/**
@@ -141,7 +139,7 @@ public class BreakpointOrganizerManager {
* @return breakpoint organizer or <code>null</code>
*/
public IBreakpointOrganizer getOrganizer(String id) {
- return (IBreakpointOrganizer) fOrganizers.get(id);
+ return fOrganizers.get(id);
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
index 45c10845b..41af99aa5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointPersistableElementAdapter.java
@@ -38,14 +38,16 @@ public class BreakpointPersistableElementAdapter implements IPersistableElement
/* (non-Javadoc)
* @see org.eclipse.ui.IPersistableElement#getFactoryId()
*/
- public String getFactoryId() {
+ @Override
+ public String getFactoryId() {
return "org.eclipse.debug.ui.elementFactory.breakpoints"; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPersistableElement#saveState(org.eclipse.ui.IMemento)
*/
- public void saveState(IMemento memento) {
+ @Override
+ public void saveState(IMemento memento) {
IMarker marker = fBreakpoint.getMarker();
if (marker != null) {
IResource resource = marker.getResource();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
index 1725bd43e..ec22c8ff2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointSetOrganizer.java
@@ -13,11 +13,10 @@ package org.eclipse.debug.internal.ui.views.breakpoints;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.Map.Entry;
+import java.util.Set;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IMarkerDelta;
@@ -80,8 +79,9 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
*
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
*/
+ @Override
public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- List result = new ArrayList();
+ List<IAdaptable> result = new ArrayList<IAdaptable>();
IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
for (int i = 0; i < workingSets.length; i++) {
IWorkingSet set = workingSets[i];
@@ -96,7 +96,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
}
}
- return (IAdaptable[]) result.toArray(new IAdaptable[result.size()]);
+ return result.toArray(new IAdaptable[result.size()]);
}
/*
@@ -104,6 +104,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
*
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
*/
+ @Override
public void dispose() {
fWorkingSetManager.removePropertyChangeListener(this);
fWorkingSetManager = null;
@@ -117,6 +118,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
*
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property.equals(IInternalDebugUIConstants.MEMENTO_BREAKPOINT_WORKING_SET_NAME)) {
@@ -170,8 +172,9 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
*
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsAdded(org.eclipse.debug.core.model.IBreakpoint[])
*/
+ @Override
public void breakpointsAdded(IBreakpoint[] breakpoints) {
- Map setToBreakpoints = new HashMap();
+ Map<IWorkingSet, List<IBreakpoint>> setToBreakpoints = new HashMap<IWorkingSet, List<IBreakpoint>>();
for (int i = 0; i < breakpoints.length; i++) {
IMarker marker = breakpoints[i].getMarker();
String[] names = getWorkingsetAttributeFromMarker(marker, IInternalDebugUIConstants.WORKING_SET_NAME);
@@ -189,19 +192,17 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
}
}
- Iterator iterator = setToBreakpoints.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- IWorkingSet set = (IWorkingSet) entry.getKey();
- List list = (List) entry.getValue();
- addBreakpointsToSet((IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]), set);
+ for (Entry<IWorkingSet, List<IBreakpoint>> entry : setToBreakpoints.entrySet()) {
+ IWorkingSet set = entry.getKey();
+ List<IBreakpoint> list = entry.getValue();
+ addBreakpointsToSet(list.toArray(new IBreakpoint[list.size()]), set);
}
}
- private void queueToSet(IBreakpoint breakpoint, IWorkingSet set, Map queue) {
- List list = (List) queue.get(set);
+ private void queueToSet(IBreakpoint breakpoint, IWorkingSet set, Map<IWorkingSet, List<IBreakpoint>> queue) {
+ List<IBreakpoint> list = queue.get(set);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<IBreakpoint>();
queue.put(set, list);
}
list.add(breakpoint);
@@ -217,8 +218,8 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
private void addBreakpointsToSet(IBreakpoint[] breakpoints, IWorkingSet set) {
if (set != null) {
IAdaptable[] elements = set.getElements();
- Set collection = new HashSet(elements.length);
- List list = new ArrayList(elements.length + breakpoints.length);
+ Set<IAdaptable> collection = new HashSet<IAdaptable>(elements.length);
+ List<IAdaptable> list = new ArrayList<IAdaptable>(elements.length + breakpoints.length);
for(int i = 0; i < elements.length; i++) {
collection.add(elements[i]);
list.add(elements[i]);
@@ -231,7 +232,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
fCache.flushMarkerCache(breakpoint.getMarker());
}
}
- set.setElements((IAdaptable[]) list.toArray(new IAdaptable[list.size()]));
+ set.setElements(list.toArray(new IAdaptable[list.size()]));
}
}
@@ -241,6 +242,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsRemoved(org.eclipse.debug.core.model.IBreakpoint[],
* org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsRemoved(IBreakpoint[] breakpoints,
IMarkerDelta[] deltas) {
IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
@@ -274,14 +276,14 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
}
if (update) {
- List newElements = new ArrayList(elements.length);
+ List<IAdaptable> newElements = new ArrayList<IAdaptable>(elements.length);
for (int i = 0; i < elements.length; i++) {
IAdaptable adaptable = elements[i];
if (adaptable != null) {
newElements.add(adaptable);
}
}
- workingSet.setElements((IAdaptable[]) newElements.toArray(new IAdaptable[newElements.size()]));
+ workingSet.setElements(newElements.toArray(new IAdaptable[newElements.size()]));
}
}
@@ -291,6 +293,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
* @see org.eclipse.debug.core.IBreakpointsListener#breakpointsChanged(org.eclipse.debug.core.model.IBreakpoint[],
* org.eclipse.core.resources.IMarkerDelta[])
*/
+ @Override
public void breakpointsChanged(IBreakpoint[] breakpoints, IMarkerDelta[] deltas) {
}
@@ -342,6 +345,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
if (category instanceof WorkingSetCategory) {
WorkingSetCategory wsc = (WorkingSetCategory) category;
@@ -356,6 +360,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
if (category instanceof WorkingSetCategory) {
WorkingSetCategory wsc = (WorkingSetCategory) category;
@@ -370,6 +375,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
addBreakpoints(new IBreakpoint[]{breakpoint}, category);
}
@@ -400,11 +406,12 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint,
* org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
if (category instanceof WorkingSetCategory) {
IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
IAdaptable[] elements = set.getElements();
- List list = new ArrayList();
+ List<IAdaptable> list = new ArrayList<IAdaptable>();
for (int i = 0; i < elements.length; i++) {
IAdaptable adaptable = elements[i];
if (!adaptable.equals(breakpoint)) {
@@ -413,7 +420,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
}
fCache.removeMappedEntry(breakpoint.getMarker(), set.getName());
fCache.flushMarkerCache(breakpoint.getMarker());
- set.setElements((IAdaptable[]) list.toArray(new IAdaptable[list.size()]));
+ set.setElements(list.toArray(new IAdaptable[list.size()]));
}
}
@@ -422,9 +429,10 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
*
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
*/
+ @Override
public IAdaptable[] getCategories() {
IWorkingSet[] workingSets = fWorkingSetManager.getWorkingSets();
- List all = new ArrayList();
+ List<IAdaptable> all = new ArrayList<IAdaptable>();
for (int i = 0; i < workingSets.length; i++) {
IWorkingSet set = workingSets[i];
if (IDebugUIConstants.BREAKPOINT_WORKINGSET_ID.equals(set
@@ -432,12 +440,13 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
all.add(new WorkingSetCategory(set));
}
}
- return (IAdaptable[]) all.toArray(new IAdaptable[all.size()]);
+ return all.toArray(new IAdaptable[all.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#addBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public void addBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
if (category instanceof WorkingSetCategory) {
IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
@@ -448,11 +457,12 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegateExtension#removeBreakpoints(org.eclipse.debug.core.model.IBreakpoint[], org.eclipse.core.runtime.IAdaptable)
*/
+ @Override
public void removeBreakpoints(IBreakpoint[] breakpoints, IAdaptable category) {
if (category instanceof WorkingSetCategory) {
IWorkingSet set = ((WorkingSetCategory) category).getWorkingSet();
IAdaptable[] elements = set.getElements();
- List list = new ArrayList(elements.length);
+ List<IAdaptable> list = new ArrayList<IAdaptable>(elements.length);
for (int i = 0; i < elements.length; i++) {
list.add(elements[i]);
}
@@ -462,7 +472,7 @@ public class BreakpointSetOrganizer extends AbstractBreakpointOrganizerDelegate
fCache.flushMarkerCache(breakpoint.getMarker());
list.remove(breakpoint);
}
- set.setElements((IAdaptable[]) list.toArray(new IAdaptable[list.size()]));
+ set.setElements(list.toArray(new IAdaptable[list.size()]));
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
index 613072513..2f419f2df 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointTypeOrganizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,19 +27,20 @@ import org.eclipse.debug.ui.IBreakpointTypeCategory;
*/
public class BreakpointTypeOrganizer extends AbstractBreakpointOrganizerDelegate {
- private Map fTypes = new HashMap();
+ private Map<String, IAdaptable[]> fTypes = new HashMap<String, IAdaptable[]>();
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
*/
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
+ @Override
+ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
IBreakpointTypeCategory category = (IBreakpointTypeCategory) breakpoint.getAdapter(IBreakpointTypeCategory.class);
if (category != null) {
return new IAdaptable[]{category};
}
String name = DebugPlugin.getDefault().getBreakpointManager().getTypeName(breakpoint);
if (name != null) {
- IAdaptable[] categories = (IAdaptable[]) fTypes.get(name);
+ IAdaptable[] categories = fTypes.get(name);
if (categories == null) {
categories = new IAdaptable[]{new BreakpointTypeCategory(name)};
fTypes.put(name, categories);
@@ -52,8 +53,8 @@ public class BreakpointTypeOrganizer extends AbstractBreakpointOrganizerDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
fTypes.clear();
}
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java
index bb8f51073..6d843d2b4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetCache.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,10 +24,9 @@ import org.eclipse.ui.IWorkingSetManager;
import org.eclipse.ui.PlatformUI;
/**
- * Class to cache the breakpoint to workingset information in its underlying
- * marker as breakpoints are moved between breakpoint working sets.
- * It resolves the need for constant attribute lookup and parsing to
- * fix bug 103731
+ * Class to cache the breakpoint to working set information in its underlying
+ * marker as breakpoints are moved between breakpoint working sets. It resolves
+ * the need for constant attribute lookup and parsing to fix bug 103731
*
* @since 3.2
*/
@@ -38,13 +37,13 @@ public class BreakpointWorkingSetCache {
* key: marker
* value: vector of working sets the marker belongs to
*/
- HashMap fCache = null;
+ HashMap<IMarker, Vector<Object>> fCache = null;
/**
* Default constructor
*/
public BreakpointWorkingSetCache() {
- fCache = new HashMap(15);
+ fCache = new HashMap<IMarker, Vector<Object>>(15);
}
/**
@@ -53,9 +52,9 @@ public class BreakpointWorkingSetCache {
* @param entry the entry to add to the cache
*/
public void addEntry(IMarker marker, Object entry) {
- Vector list = (Vector)fCache.get(marker);
+ Vector<Object> list = fCache.get(marker);
if (list == null) {
- list = new Vector();
+ list = new Vector<Object>();
list.addElement(entry);
fCache.put(marker, list);
}
@@ -72,7 +71,7 @@ public class BreakpointWorkingSetCache {
* @param entry the entry to remove
*/
public void removeMappedEntry(IMarker marker, Object entry) {
- Vector list = (Vector)fCache.get(marker);
+ Vector<Object> list = fCache.get(marker);
if(list != null) {
list.remove(entry);
}
@@ -84,7 +83,7 @@ public class BreakpointWorkingSetCache {
*/
public void flushMarkerCache(IMarker marker) {
IWorkingSetManager manager = PlatformUI.getWorkbench().getWorkingSetManager();
- Vector list = (Vector)fCache.get(marker);
+ Vector<Object> list = fCache.get(marker);
if(list != null) {
String names = IImportExportConstants.DELIMITER;
String ids = IImportExportConstants.DELIMITER;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java
index 1bb0901f4..b82c79975 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetElementAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 IBM Corporation and others.
+ * Copyright (c) 2009, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ public class BreakpointWorkingSetElementAdapter implements IWorkingSetElementAda
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkingSetElementAdapter#adaptElements(org.eclipse.ui.IWorkingSet, org.eclipse.core.runtime.IAdaptable[])
*/
+ @Override
public IAdaptable[] adaptElements(IWorkingSet ws, IAdaptable[] elements) {
for (int i = 0; i < elements.length; i++) {
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(elements[i], IBreakpoint.class);
@@ -42,19 +43,20 @@ public class BreakpointWorkingSetElementAdapter implements IWorkingSetElementAda
}
private IAdaptable[] selectBreakpoints(IAdaptable[] elements) {
- List breakpoints = new ArrayList(elements.length);
+ List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>(elements.length);
for (int i = 0; i < elements.length; i++) {
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(elements[i], IBreakpoint.class);
if (breakpoint != null) {
breakpoints.add(breakpoint);
}
}
- return (IAdaptable[]) breakpoints.toArray(new IAdaptable[breakpoints.size()]);
+ return breakpoints.toArray(new IAdaptable[breakpoints.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkingSetElementAdapter#dispose()
*/
+ @Override
public void dispose() {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
index 19879e841..f141d634e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointWorkingSetPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -72,6 +72,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
/*
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite= new Composite(parent, SWT.NONE);
@@ -86,6 +87,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
fWorkingSetName.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
fWorkingSetName.addModifyListener(
new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
validateInput();
}
@@ -111,6 +113,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
Button selectAllButton = SWTFactory.createPushButton(buttonComposite, DebugUIViewsMessages.BreakpointWorkingSetPage_selectAll_label, null);
selectAllButton.setToolTipText(DebugUIViewsMessages.BreakpointWorkingSetPage_selectAll_toolTip);
selectAllButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent selectionEvent) {
BreakpointsViewer viewer = fTViewer.getViewer();
viewer.getTree().selectAll();
@@ -123,14 +126,16 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
Button deselectAllButton = SWTFactory.createPushButton(buttonComposite, DebugUIViewsMessages.BreakpointWorkingSetPage_deselectAll_label, null);
deselectAllButton.setToolTipText(DebugUIViewsMessages.BreakpointWorkingSetPage_deselectAll_toolTip);
deselectAllButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent selectionEvent) {
BreakpointsViewer viewer = fTViewer.getViewer();
viewer.setCheckedElements(new Object[] {});
validateInput();
}
});
- if (fWorkingSet != null)
+ if (fWorkingSet != null) {
fWorkingSetName.setText(fWorkingSet.getName());
+ }
validateInput();
Dialog.applyDialogFont(composite);
}
@@ -138,6 +143,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
/*
* Implements method from IWorkingSetPage
*/
+ @Override
public IWorkingSet getSelection() {
return fWorkingSet;
}
@@ -145,6 +151,7 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
/*
* Implements method from IWorkingSetPage
*/
+ @Override
public void setSelection(IWorkingSet workingSet) {
Assert.isNotNull(workingSet, "Working set must not be null"); //$NON-NLS-1$
fWorkingSet= workingSet;
@@ -158,10 +165,11 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
/*
* Implements method from IWorkingSetPage
*/
+ @Override
public void finish() {
String workingSetName = fWorkingSetName.getText();
Object[] adaptable = fTViewer.getCheckedElements().toArray();
- ArrayList elements = new ArrayList();
+ ArrayList<IBreakpoint> elements = new ArrayList<IBreakpoint>();
//weed out non-breakpoint elements since 3.2
for(int i = 0; i < adaptable.length; i++) {
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(adaptable[i], IBreakpoint.class);
@@ -171,10 +179,10 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
}//end for
if (fWorkingSet == null) {
IWorkingSetManager workingSetManager= PlatformUI.getWorkbench().getWorkingSetManager();
- fWorkingSet = workingSetManager.createWorkingSet(workingSetName, (IAdaptable[])elements.toArray(new IAdaptable[elements.size()]));
+ fWorkingSet = workingSetManager.createWorkingSet(workingSetName, elements.toArray(new IAdaptable[elements.size()]));
} else {
fWorkingSet.setName(workingSetName);
- fWorkingSet.setElements((IAdaptable[])elements.toArray(new IAdaptable[elements.size()]));
+ fWorkingSet.setElements(elements.toArray(new IAdaptable[elements.size()]));
}
}
@@ -185,8 +193,9 @@ public class BreakpointWorkingSetPage extends WizardPage implements IWorkingSetP
String errorMessage= null;
String newText= fWorkingSetName.getText();
- if (newText.equals(newText.trim()) == false)
- errorMessage = DebugUIViewsMessages.BreakpointWorkingSetPage_4;
+ if (newText.equals(newText.trim()) == false) {
+ errorMessage = DebugUIViewsMessages.BreakpointWorkingSetPage_4;
+ }
if (newText.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
if (fFirstCheck) {
setPageComplete(false);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java
index 6fe092e01..6d087385e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsComparator.java
@@ -34,6 +34,7 @@ public class BreakpointsComparator extends ViewerComparator {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerComparator#isSorterProperty(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean isSorterProperty(Object element,String propertyId) {
return propertyId.equals(IBasicPropertyConstants.P_TEXT);
}
@@ -56,6 +57,7 @@ public class BreakpointsComparator extends ViewerComparator {
* equal to the second element; and a positive number if the first
* element is greater than the second element
*/
+ @Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (!(e1 instanceof IBreakpoint)) {
return super.compare(viewer, e1, e2);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java
index a49b1a505..72c065a97 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,7 +40,8 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
*/
- public Object[] getChildren(Object parentElement) {
+ @Override
+ public Object[] getChildren(Object parentElement) {
if (parentElement.equals(DebugPlugin.getDefault().getBreakpointManager())) {
return fElements;
} else if (parentElement instanceof BreakpointContainer) {
@@ -52,28 +53,32 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
*/
- public Object getParent(Object element) {
+ @Override
+ public Object getParent(Object element) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
- public boolean hasChildren(Object element) {
+ @Override
+ public boolean hasChildren(Object element) {
return getChildren(element).length > 0;
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
- public Object[] getElements(Object inputElement) {
+ @Override
+ public Object[] getElements(Object inputElement) {
return getChildren(inputElement);
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
fDisposed = true;
fElements = null;
setOrganizers(null);
@@ -82,7 +87,8 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
/* (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) {
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
fViewer = (BreakpointsViewer)viewer;
if (newInput != null) {
reorganize();
@@ -97,16 +103,16 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
* if none
*/
public void setOrganizers(IBreakpointOrganizer[] organizers) {
- if (organizers != null && organizers.length == 0) {
- organizers = null;
- }
// remove previous listeners
if (fOrganizers != null) {
for (int i = 0; i < fOrganizers.length; i++) {
fOrganizers[i].removePropertyChangeListener(this);
}
}
- fOrganizers = organizers;
+ fOrganizers = organizers;
+ if (organizers != null && organizers.length == 0) {
+ fOrganizers = null;
+ }
// add listeners
if (fOrganizers != null) {
for (int i = 0; i < fOrganizers.length; i++) {
@@ -148,14 +154,14 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
*/
public BreakpointContainer[] getRoots(IBreakpoint breakpoint) {
if (isShowingGroups()) {
- List list = new ArrayList();
+ List<BreakpointContainer> list = new ArrayList<BreakpointContainer>();
for (int i = 0; i < fElements.length; i++) {
BreakpointContainer container = (BreakpointContainer) fElements[i];
if (container.contains(breakpoint)) {
list.add(container);
}
}
- return (BreakpointContainer[]) list.toArray(new BreakpointContainer[list.size()]);
+ return list.toArray(new BreakpointContainer[list.size()]);
}
return null;
}
@@ -180,7 +186,7 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
fElements = breakpoints;
} else {
IBreakpointOrganizer organizer = fOrganizers[0];
- Map categoriesToContainers = new HashMap();
+ Map<IAdaptable, BreakpointContainer> categoriesToContainers = new HashMap<IAdaptable, BreakpointContainer>();
for (int i = 0; i < breakpoints.length; i++) {
IBreakpoint breakpoint = breakpoints[i];
IAdaptable[] categories = organizer.getCategories(breakpoint);
@@ -189,7 +195,7 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
}
for (int j = 0; j < categories.length; j++) {
IAdaptable category = categories[j];
- BreakpointContainer container = (BreakpointContainer) categoriesToContainers.get(category);
+ BreakpointContainer container = categoriesToContainers.get(category);
if (container == null) {
IBreakpointOrganizer[] nesting = null;
if (fOrganizers.length > 1) {
@@ -207,7 +213,7 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
if (emptyCategories != null) {
for (int i = 0; i < emptyCategories.length; i++) {
IAdaptable category = emptyCategories[i];
- BreakpointContainer container = (BreakpointContainer) categoriesToContainers.get(category);
+ BreakpointContainer container = categoriesToContainers.get(category);
if (container == null) {
container = new BreakpointContainer(category, organizer, null);
categoriesToContainers.put(category, container);
@@ -224,6 +230,7 @@ public class BreakpointsContentProvider implements ITreeContentProvider, IProper
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(IBreakpointOrganizerDelegate.P_CATEGORY_CHANGED)) {
// TODO: only re-organize if showing the changed category
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java
index 60093f275..ef2443bd9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDragAdapter.java
@@ -55,14 +55,16 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe
/* (non-Javadoc)
* @see org.eclipse.jface.util.TransferDragSourceListener#getTransfer()
*/
- public Transfer getTransfer() {
+ @Override
+ public Transfer getTransfer() {
return LocalSelectionTransfer.getTransfer();
}
/* non Java-doc
* @see org.eclipse.swt.dnd.DragSourceListener#dragStart
*/
- public void dragStart(DragSourceEvent event) {
+ @Override
+ public void dragStart(DragSourceEvent event) {
ISelection selection = fViewer.getSelection();
LocalSelectionTransfer.getTransfer().setSelection(selection);
LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL);
@@ -83,7 +85,8 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe
/* non Java-doc
* @see org.eclipse.swt.dnd.DragSourceListener#dragSetData
*/
- public void dragSetData(DragSourceEvent event) {
+ @Override
+ public void dragSetData(DragSourceEvent event) {
// For consistency set the data to the selection even though
// the selection is provided by the LocalSelectionTransfer
// to the drop target adapter.
@@ -93,7 +96,8 @@ public class BreakpointsDragAdapter extends DragSourceAdapter implements Transfe
/* non Java-doc
* @see org.eclipse.swt.dnd.DragSourceListener#dragFinished
*/
- public void dragFinished(DragSourceEvent event) {
+ @Override
+ public void dragFinished(DragSourceEvent event) {
if (event.detail == DND.DROP_MOVE) {
// remove from source on move operation
if (fViewer instanceof BreakpointsViewer) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java
index 2ba3c310a..5f2276fde 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsDropAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -52,7 +52,8 @@ public class BreakpointsDropAdapter extends ViewerDropAdapter {
/**
* @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
*/
- public boolean performDrop(Object data) {
+ @Override
+ public boolean performDrop(Object data) {
// This is temporary
if (getViewer() instanceof BreakpointsViewer) {
return ((BreakpointsViewer)getViewer()).performDrop(fTarget, (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection());
@@ -70,10 +71,11 @@ public class BreakpointsDropAdapter extends ViewerDropAdapter {
/**
* @see org.eclipse.jface.viewers.ViewerDropAdapter#determineTarget(org.eclipse.swt.dnd.DropTargetEvent)
*/
+ @Override
protected Object determineTarget(DropTargetEvent event) {
fTarget = (Item) event.item;
if (fTarget instanceof TreeItem) {
- List list = new ArrayList();
+ List<Object> list = new ArrayList<Object>();
TreeItem item = (TreeItem)fTarget;
while (item != null) {
list.add(item.getData());
@@ -89,7 +91,8 @@ public class BreakpointsDropAdapter extends ViewerDropAdapter {
/**
* @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
*/
- public boolean validateDrop(Object target, int operation, TransferData transferType) {
+ @Override
+ public boolean validateDrop(Object target, int operation, TransferData transferType) {
// This is temporary
if (getViewer() instanceof BreakpointsViewer) {
return ((BreakpointsViewer)getViewer()).canDrop(fTarget, (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java
index b7e557000..63b875639 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsLabelProvider.java
@@ -41,7 +41,8 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
fWorkbenchLabelProvider.dispose();
fPresentation.dispose();
super.dispose();
@@ -50,7 +51,8 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
- public Image getImage(Object element) {
+ @Override
+ public Image getImage(Object element) {
if (element instanceof IBreakpoint) {
return fPresentation.getImage(element);
}
@@ -80,7 +82,8 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
- public String getText(Object element) {
+ @Override
+ public String getText(Object element) {
if (element instanceof IBreakpoint) {
return fPresentation.getText(element);
}
@@ -90,7 +93,8 @@ public class BreakpointsLabelProvider extends LabelProvider implements IFontProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
*/
- public Font getFont(Object element) {
+ @Override
+ public Font getFont(Object element) {
if (element instanceof IBreakpoint) {
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
index 123e35197..490ed9d29 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsView.java
@@ -107,9 +107,11 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
private RedoActionHandler fRedoAction;
+ @Override
public void dispose() {
- if (fClipboard != null)
- fClipboard.dispose();
+ if (fClipboard != null) {
+ fClipboard.dispose();
+ }
DebugPlugin.getDefault().getBreakpointManager().removeBreakpointManagerListener(this);
fUndoAction.dispose();
@@ -122,6 +124,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
*/
+ @Override
protected String getDetailPanePreferenceKey() {
return IDebugPreferenceConstants.BREAKPOINTS_DETAIL_PANE_ORIENTATION;
}
@@ -130,6 +133,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.BREAKPOINT_VIEW;
}
@@ -138,6 +142,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getViewerStyle()
*/
+ @Override
protected int getViewerStyle() {
return SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL | SWT.FULL_SELECTION | SWT.CHECK;
}
@@ -146,6 +151,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Viewer createViewer(Composite parent) {
TreeModelViewer viewer = (TreeModelViewer) super.createViewer(parent);
@@ -162,12 +168,14 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getModelPresentation()
*/
+ @Override
protected IDebugModelPresentation getModelPresentation() {
if (fModelPresentation == null) {
fModelPresentation = new VariablesViewModelPresentation() {
/**
* Undo double slashes.
*/
+ @Override
public String getText(Object element) {
IDebugModelPresentation lp= getConfiguredPresentation(element);
if (lp != null) {
@@ -192,6 +200,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
tbm.add(new Separator(IDebugUIConstants.BREAKPOINT_GROUP));
tbm.add(getAction(ACTION_SHOW_MODEL_BREAKPOINT));
@@ -204,6 +213,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
protected void fillContextMenu(IMenuManager menu) {
updateObjects();
menu.add(new Separator(IDebugUIConstants.EMPTY_NAVIGATION_GROUP));
@@ -230,6 +240,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createActions()
*/
+ @Override
protected void createActions() {
IAction action = new OpenBreakpointMarkerAction(getViewer());
setAction(ACTION_GOTO_MARKER, action);
@@ -269,6 +280,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
*
* @seeorg.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
*/
+ @Override
protected String getToggleActionLabel() {
return DebugUIViewsMessages.BreakpointsView_12;
}
@@ -278,6 +290,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
*
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
*/
+ @Override
protected String getPresentationContextId() {
return IDebugUIConstants.ID_BREAKPOINT_VIEW;
}
@@ -287,6 +300,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
*
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#contextActivated(org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected void contextActivated(ISelection selection) {
IPresentationContext presentationContext = getTreeModelViewer().getPresentationContext();
@@ -306,6 +320,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
*
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#setViewerInput(java.lang.Object)
*/
+ @Override
protected void setViewerInput(Object context) {
Object current = getViewer().getInput();
if (current == null && context == null) {
@@ -330,6 +345,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#viewerInputUpdateComplete(org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate)
*/
+ @Override
protected void viewerInputUpdateComplete(IViewerInputUpdate update) {
// handles non-standard debug model
IStatus status = update.getStatus();
@@ -384,17 +400,18 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
if (value != null) {
String[] ids = value.split(","); //$NON-NLS-1$
BreakpointOrganizerManager manager = BreakpointOrganizerManager.getDefault();
- List organziers= new ArrayList();
+ List<IBreakpointOrganizer> organziers = new ArrayList<IBreakpointOrganizer>();
for (int i = 0; i < ids.length; i++) {
IBreakpointOrganizer organizer = manager.getOrganizer(ids[i]);
if (organizer != null) {
organziers.add(organizer);
}
}
- fOrganizers = (IBreakpointOrganizer[]) organziers.toArray(new IBreakpointOrganizer[organziers.size()]);
+ fOrganizers = organziers.toArray(new IBreakpointOrganizer[organziers.size()]);
- for (int i = 0; i < fOrganizers.length; i++)
- fOrganizers[i].addPropertyChangeListener(this);
+ for (int i = 0; i < fOrganizers.length; i++) {
+ fOrganizers[i].addPropertyChangeListener(this);
+ }
}
}
}
@@ -404,6 +421,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* Initializes drag and drop for the breakpoints viewer
* @param viewer the viewer to add drag and drop support to
*/
+ @Override
protected void initDragAndDrop(TreeModelViewer viewer) {
int ops = DND.DROP_MOVE | DND.DROP_COPY;
// drop
@@ -416,6 +434,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#saveViewerState(org.eclipse.ui.IMemento)
*/
+ @Override
public void saveViewerState(IMemento memento) {
StringBuffer buffer = new StringBuffer();
if (fOrganizers != null) {
@@ -502,8 +521,10 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
*/
+ @Override
public void breakpointManagerEnablementChanged(boolean enabled) {
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
+ @Override
public void run() {
IAction action = getAction(ACTION_SKIP_BREAKPOINTS);
if (action != null) {
@@ -524,7 +545,8 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
virtualViewer.setAutoExpandLevel(-1);
virtualViewer.addViewerUpdateListener(new IViewerUpdateListener() {
- public void viewerUpdatesComplete() {
+ @Override
+ public void viewerUpdatesComplete() {
ModelDelta stateDelta = new ModelDelta(virtualViewer.getInput(), IModelDelta.NO_CHANGE);
virtualViewer.saveElementState(TreePath.EMPTY, stateDelta, IModelDelta.EXPAND);
ITreeModelViewer treeModelViewer = ((ITreeModelViewer) getViewer());
@@ -533,9 +555,12 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
}
virtualViewer.dispose();
}
- public void viewerUpdatesBegin() {}
- public void updateStarted(IViewerUpdate update) {}
- public void updateComplete(IViewerUpdate update) {}
+ @Override
+ public void viewerUpdatesBegin() {}
+ @Override
+ public void updateStarted(IViewerUpdate update) {}
+ @Override
+ public void updateComplete(IViewerUpdate update) {}
});
virtualViewer.setInput(getViewer().getInput());
}
@@ -576,7 +601,7 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
}
IStructuredSelection ss = (IStructuredSelection) selection;
IBreakpointContainer container = (IBreakpointContainer) target;
- for(Iterator iter = ss.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = ss.iterator(); iter.hasNext();) {
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(iter.next(), IBreakpoint.class);
if (breakpoint == null || container.contains(breakpoint) || !container.getOrganizer().canAdd(breakpoint, container.getCategory())) {
return false;
@@ -728,29 +753,26 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
if (paths == null) {
return;
}
-
- Map containersToBreakpoints = new HashMap();
+ Map<IBreakpointContainer, List<IBreakpoint>> containersToBreakpoints = new HashMap<IBreakpointContainer, List<IBreakpoint>>();
for (int i = 0; i < paths.length; i++) {
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(paths[i].getLastSegment(), IBreakpoint.class);
if (breakpoint != null) {
IBreakpointContainer container = getRemovableContainer(paths[i]);
if(container != null) {
- List list = (List) containersToBreakpoints.get(container);
+ List<IBreakpoint> list = containersToBreakpoints.get(container);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<IBreakpoint>();
containersToBreakpoints.put(container, list);
}
list.add(breakpoint);
}
}
}
- Iterator iterator = containersToBreakpoints.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- IBreakpointContainer container = (IBreakpointContainer) entry.getKey();
- List list = (List) entry.getValue();
+ for (Entry<IBreakpointContainer, List<IBreakpoint>> entry : containersToBreakpoints.entrySet()) {
+ IBreakpointContainer container = entry.getKey();
+ List<IBreakpoint> list = entry.getValue();
IBreakpointOrganizer organizer = container.getOrganizer();
- IBreakpoint[] breakpoints = (IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]);
+ IBreakpoint[] breakpoints = list.toArray(new IBreakpoint[list.size()]);
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
IBreakpointOrganizerDelegateExtension extension = (IBreakpointOrganizerDelegateExtension) organizer;
extension.removeBreakpoints(breakpoints, container.getCategory());
@@ -779,8 +801,8 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
}
IBreakpointOrganizer organizer = container.getOrganizer();
- List breakpoints = new ArrayList(selection.size());
- for (Iterator iter = selection.iterator(); iter.hasNext();) {
+ List<IBreakpoint> breakpoints = new ArrayList<IBreakpoint>(selection.size());
+ for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
IBreakpoint breakpoint = (IBreakpoint) DebugPlugin.getAdapter(iter.next(), IBreakpoint.class);
if (breakpoint != null) {
breakpoints.add(breakpoint);
@@ -789,15 +811,14 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
IBreakpointOrganizerDelegateExtension extension = (IBreakpointOrganizerDelegateExtension) organizer;
extension.addBreakpoints(
- (IBreakpoint[])breakpoints.toArray(new IBreakpoint[breakpoints.size()]),
+ breakpoints.toArray(new IBreakpoint[breakpoints.size()]),
container.getCategory());
} else {
for (int i = 0; i < breakpoints.size(); i++) {
- organizer.addBreakpoint((IBreakpoint)breakpoints.get(i), container.getCategory());
+ organizer.addBreakpoint(breakpoints.get(i), container.getCategory());
}
}
// TODO expandToLevel(target.getData(), ALL_LEVELS);
-
return true;
}
@@ -819,9 +840,8 @@ public class BreakpointsView extends VariablesView implements IBreakpointManager
if (selection == null || target == null) {
return false;
}
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
IBreakpoint breakpoint = (IBreakpoint)DebugPlugin.getAdapter(iter.next(), IBreakpoint.class);
-
if (breakpoint == null || !checkAddableParentContainers(target, breakpoint)){
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java
index 3635107a6..4ffb30c12 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/BreakpointsViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -85,14 +85,14 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
public IBreakpoint[] getVisibleBreakpoints() {
IBreakpointManager manager= DebugPlugin.getDefault().getBreakpointManager();
Object[] elements= ((ITreeContentProvider)getContentProvider()).getElements(manager);
- List list = new ArrayList();
+ List<IBreakpoint> list = new ArrayList<IBreakpoint>();
for (int i = 0; i < elements.length; i++) {
TreeItem item = (TreeItem) searchItem(elements[i]);
if (item != null) {
collectExpandedBreakpoints(item, list);
}
}
- return (IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]);
+ return list.toArray(new IBreakpoint[list.size()]);
}
/**
@@ -102,10 +102,10 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
* @param item the item to get breakpoints from
* @param list collection of visible breakpoints
*/
- private void collectExpandedBreakpoints(TreeItem item, List list) {
+ private void collectExpandedBreakpoints(TreeItem item, List<IBreakpoint> list) {
Object data = item.getData();
if (data instanceof IBreakpoint) {
- list.add(data);
+ list.add((IBreakpoint) data);
return;
}
if (item.getExpanded()) {
@@ -213,7 +213,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
if(items == null) {
return;
}
- Map containersToBreakpoints = new HashMap();
+ Map<IBreakpointContainer, List<IBreakpoint>> containersToBreakpoints = new HashMap<IBreakpointContainer, List<IBreakpoint>>();
IBreakpointContainer container = null;
IBreakpoint breakpoint = null;
for(int i = 0; i < items.length; i++) {
@@ -221,22 +221,20 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
breakpoint = (IBreakpoint)items[i].getData();
container = getRemovableContainer(items[i]);
if(container != null) {
- List list = (List) containersToBreakpoints.get(container);
+ List<IBreakpoint> list = containersToBreakpoints.get(container);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<IBreakpoint>();
containersToBreakpoints.put(container, list);
}
list.add(breakpoint);
}
}
}
- Iterator iterator = containersToBreakpoints.entrySet().iterator();
- while (iterator.hasNext()) {
- Entry entry = (Entry) iterator.next();
- container = (IBreakpointContainer) entry.getKey();
- List list = (List) entry.getValue();
+ for (Entry<IBreakpointContainer, List<IBreakpoint>> entry : containersToBreakpoints.entrySet()) {
+ container = entry.getKey();
+ List<IBreakpoint> list = entry.getValue();
IBreakpointOrganizer organizer = container.getOrganizer();
- IBreakpoint[] breakpoints = (IBreakpoint[]) list.toArray(new IBreakpoint[list.size()]);
+ IBreakpoint[] breakpoints = list.toArray(new IBreakpoint[list.size()]);
if (organizer instanceof IBreakpointOrganizerDelegateExtension) {
IBreakpointOrganizerDelegateExtension extension = (IBreakpointOrganizerDelegateExtension) organizer;
extension.removeBreakpoints(breakpoints, container.getCategory());
@@ -266,7 +264,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
if(selection == null || target == null) {
return false;
}
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
Object currentObject = iter.next();
if (!(currentObject instanceof IBreakpoint) || !checkAddableParentContainers(target, (IBreakpoint)currentObject)){
return false;
@@ -328,7 +326,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
System.arraycopy(array, 0, breakpoints, 0, array.length);
extension.addBreakpoints(breakpoints, container.getCategory());
} else {
- for(Iterator iter = selection.iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = selection.iterator(); iter.hasNext();) {
breakpoint = (IBreakpoint) iter.next();
organizer.addBreakpoint(breakpoint, container.getCategory());
}
@@ -340,6 +338,7 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#refresh()
*/
+ @Override
public void refresh() {
super.refresh();
initializeCheckedState();
@@ -376,12 +375,12 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
* @return a list of widget occurrences to update or an empty list
*/
private Widget[] searchItems(Object element) {
- ArrayList list = new ArrayList();
+ ArrayList<TreeItem> list = new ArrayList<TreeItem>();
TreeItem[] items = getTree().getItems();
for (int i = 0; i < items.length; i++) {
findAllOccurrences(items[i], element, list);
}
- return (Widget[]) list.toArray(new Widget[0]);
+ return list.toArray(new Widget[0]);
}
/**
@@ -390,9 +389,9 @@ public class BreakpointsViewer extends CheckboxTreeViewer {
* @param item the item in the tree
* @param element the element to compare
*/
- private void findAllOccurrences(TreeItem item, Object element, ArrayList list) {
+ private void findAllOccurrences(TreeItem item, Object element, ArrayList<TreeItem> list) {
if (element.equals(item.getData())) {
- list.add(item);
+ list.add(item);
}
TreeItem[] items = item.getItems();
for (int i = 0; i < items.length; i++) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java
index 20d10f06e..ab81f41b1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ElementComparator.java
@@ -1,5 +1,5 @@
/*****************************************************************
- * Copyright (c) 2009, 2010 Texas Instruments and others
+ * Copyright (c) 2009, 2013 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
@@ -8,6 +8,7 @@
* Contributors:
* Patrick Chuong (Texas Instruments) - Initial API and implementation (Bug 238956)
* Pawel Piech (Windriver) - Ongoing bug fixes and enhancements (Bug 311457)
+ * IBM Corporation - bug fixing
*****************************************************************/
package org.eclipse.debug.internal.ui.views.breakpoints;
@@ -30,27 +31,29 @@ import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
*
* @since 3.6
*/
-public class ElementComparator implements Comparator {
+public class ElementComparator implements Comparator<Object> {
final private static String SPACE = " "; //$NON-NLS-1$
protected DebugModelPresentationContext fContext;
public ElementComparator(IPresentationContext context) {
- if (context instanceof DebugModelPresentationContext)
+ if (context instanceof DebugModelPresentationContext) {
fContext = (DebugModelPresentationContext) context;
+ }
}
/* (non-Javadoc)
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
+ @Override
public int compare(Object arg0, Object arg1) {
IBreakpoint bp0 = (IBreakpoint)DebugPlugin.getAdapter(arg0, IBreakpoint.class);
IBreakpoint bp1 = (IBreakpoint)DebugPlugin.getAdapter(arg1, IBreakpoint.class);
if (bp0 != null && bp1 != null) {
- return compare(bp0, bp1);
+ return doCompare(bp0, bp1);
} else if (arg0 instanceof IBreakpointContainer && arg1 instanceof IBreakpointContainer) {
- return compare((IBreakpointContainer) arg0, (IBreakpointContainer) arg1);
+ return doCompare((IBreakpointContainer) arg0, (IBreakpointContainer) arg1);
} else {
return -1; // just return -1 if the two objects are not IBreakpoint type
}
@@ -63,7 +66,7 @@ public class ElementComparator implements Comparator {
* @param c2
* @return
*/
- private int compare(IBreakpointContainer c1, IBreakpointContainer c2) {
+ private int doCompare(IBreakpointContainer c1, IBreakpointContainer c2) {
// The "Other" breakpoint category should be listed last.
// (Bug 311457).
if (c1.getCategory() instanceof OtherBreakpointCategory) {
@@ -93,7 +96,7 @@ public class ElementComparator implements Comparator {
* @param b2
* @return
*/
- private int compare(IBreakpoint b1, IBreakpoint b2) {
+ private int doCompare(IBreakpoint b1, IBreakpoint b2) {
String text1 = IInternalDebugCoreConstants.EMPTY_STRING;
String text2 = IInternalDebugCoreConstants.EMPTY_STRING;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java
index bf2a4b316..656899ba0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/FileBreakpointOrganizer.java
@@ -27,7 +27,8 @@ public class FileBreakpointOrganizer extends AbstractBreakpointOrganizerDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
*/
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
+ @Override
+ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
IMarker marker = breakpoint.getMarker();
if (marker != null) {
IResource resource = marker.getResource();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java
index 03d8ebdda..5aaef21e4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/ProjectBreakpointOrganizer.java
@@ -26,7 +26,8 @@ public class ProjectBreakpointOrganizer extends AbstractBreakpointOrganizerDeleg
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
*/
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
+ @Override
+ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
IMarker marker = breakpoint.getMarker();
if (marker != null) {
IProject project = marker.getResource().getProject();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
index 14125fcd2..bce1bbffe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetBreakpointOrganizer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -44,9 +44,10 @@ public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDe
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories(org.eclipse.debug.core.model.IBreakpoint)
*/
- public IAdaptable[] getCategories(IBreakpoint breakpoint) {
- List result = new ArrayList();
- List parents = new ArrayList();
+ @Override
+ public IAdaptable[] getCategories(IBreakpoint breakpoint) {
+ List<IAdaptable> result = new ArrayList<IAdaptable>();
+ List<IResource> parents = new ArrayList<IResource>();
IResource res = breakpoint.getMarker().getResource();
parents.add(res);
while (res != null) {
@@ -70,13 +71,14 @@ public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDe
}
}
}
- return (IAdaptable[]) result.toArray(new IAdaptable[result.size()]);
+ return result.toArray(new IAdaptable[result.size()]);
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
fWorkingSetManager.removePropertyChangeListener(this);
fWorkingSetManager = null;
super.dispose();
@@ -85,7 +87,8 @@ public class WorkingSetBreakpointOrganizer extends AbstractBreakpointOrganizerDe
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
IWorkingSet set = null;
if (event.getNewValue() instanceof IWorkingSet) {
set = (IWorkingSet) event.getNewValue();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java
index 79519b1b5..7dd94a277 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/breakpoints/WorkingSetCategory.java
@@ -40,21 +40,24 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
- public Object[] getChildren(Object o) {
+ @Override
+ public Object[] getChildren(Object o) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
- public ImageDescriptor getImageDescriptor(Object object) {
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
return fWorkingSet.getImageDescriptor();
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
- public String getLabel(Object o) {
+ @Override
+ public String getLabel(Object o) {
StringBuffer name = new StringBuffer(fWorkingSet.getName());
if (isDefault()) {
name.append(DebugUIViewsMessages.WorkingSetCategory_0);
@@ -65,7 +68,8 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
- public Object getParent(Object o) {
+ @Override
+ public Object getParent(Object o) {
return null;
}
@@ -81,7 +85,8 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
if (obj instanceof WorkingSetCategory) {
WorkingSetCategory category = (WorkingSetCategory) obj;
return category.getWorkingSet().equals(fWorkingSet);
@@ -92,28 +97,32 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fWorkingSet.hashCode();
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
*/
- public RGB getForeground(Object element) {
+ @Override
+ public RGB getForeground(Object element) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
*/
- public RGB getBackground(Object element) {
+ @Override
+ public RGB getBackground(Object element) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
*/
- public FontData getFont(Object element) {
+ @Override
+ public FontData getFont(Object element) {
if (isDefault()) {
FontData[] fontData = JFaceResources.getDefaultFont().getFontData();
if (fontData != null && fontData.length > 0) {
@@ -134,7 +143,8 @@ public class WorkingSetCategory extends PlatformObject implements IWorkbenchAdap
return fWorkingSet.equals(BreakpointSetOrganizer.getDefaultWorkingSet());
}
- public String toString() {
+ @Override
+ public String toString() {
return fWorkingSet.getName();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
index b623b26e3..d00a40569 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleLineNotifier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,7 +36,7 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
/**
* Console listeners
*/
- private List fListeners = new ArrayList(2);
+ private List<IConsoleLineTracker> fListeners = new ArrayList<IConsoleLineTracker>(2);
/**
* The console this notifier is tracking
@@ -46,6 +46,7 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListenerDelegate#connect(org.eclipse.ui.console.TextConsole)
*/
+ @Override
public void connect(TextConsole console) {
if (console instanceof ProcessConsole) {
fConsole = (ProcessConsole)console;
@@ -63,6 +64,7 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#disconnect()
*/
+ @Override
public synchronized void disconnect() {
try {
IDocument document = fConsole.getDocument();
@@ -83,7 +85,7 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
public synchronized void consoleClosed() {
int size = fListeners.size();
for (int i = 0; i < size; i++) {
- IConsoleLineTracker tracker = (IConsoleLineTracker) fListeners.get(i);
+ IConsoleLineTracker tracker = fListeners.get(i);
if (tracker instanceof IConsoleLineTrackerExtension) {
((IConsoleLineTrackerExtension) tracker).consoleClosed();
}
@@ -101,14 +103,16 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
* @param listener the listener to add
*/
public void addConsoleListener(IConsoleLineTracker listener) {
- if (!fListeners.contains(listener))
- fListeners.add(listener);
+ if (!fListeners.contains(listener)) {
+ fListeners.add(listener);
+ }
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#matchFound(org.eclipse.ui.console.PatternMatchEvent)
*/
- public void matchFound(PatternMatchEvent event) {
+ @Override
+ public void matchFound(PatternMatchEvent event) {
try {
IDocument document = fConsole.getDocument();
int lineOfOffset = document.getLineOfOffset(event.getOffset());
@@ -122,7 +126,7 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
public void lineAppended(IRegion region) {
int size = fListeners.size();
for (int i=0; i<size; i++) {
- IConsoleLineTracker tracker = (IConsoleLineTracker) fListeners.get(i);
+ IConsoleLineTracker tracker = fListeners.get(i);
tracker.lineAppended(region);
}
}
@@ -130,7 +134,8 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
if(event.getProperty().equals(IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE)) {
fConsole.removePropertyChangeListener(this);
consoleClosed();
@@ -140,21 +145,24 @@ public class ConsoleLineNotifier implements IPatternMatchListener, IPropertyChan
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#getPattern()
*/
- public String getPattern() {
+ @Override
+ public String getPattern() {
return ".*\\r(\\n?)|.*\\n"; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#getCompilerFlags()
*/
- public int getCompilerFlags() {
+ @Override
+ public int getCompilerFlags() {
return 0;
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#getLineQualifier()
*/
- public String getLineQualifier() {
+ @Override
+ public String getLineQualifier() {
return "\\n|\\r"; //$NON-NLS-1$
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
index 9d3a049bc..794264c51 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveAllTerminatedAction.java
@@ -34,6 +34,7 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
for (int i = 0; i < launches.length; i++) {
@@ -50,6 +51,7 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
ILaunch[] launches = DebugPlugin.getDefault().getLaunchManager().getLaunches();
RemoveAllTerminatedAction.removeTerminatedLaunches(launches);
@@ -69,7 +71,8 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
- public void launchesRemoved(ILaunch[] launches) {
+ @Override
+ public void launchesRemoved(ILaunch[] launches) {
if (isEnabled()) {
update();
}
@@ -78,18 +81,21 @@ public class ConsoleRemoveAllTerminatedAction extends Action implements IUpdate,
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
- public void launchesAdded(ILaunch[] launches) {
+ @Override
+ public void launchesAdded(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
- public void launchesChanged(ILaunch[] launches) {
+ @Override
+ public void launchesChanged(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
update();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
index dcd6847c0..aa4a60c92 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleRemoveLaunchAction.java
@@ -70,7 +70,8 @@ public class ConsoleRemoveLaunchAction extends Action implements IViewActionDele
}
}
- public synchronized void run() {
+ @Override
+ public synchronized void run() {
ILaunch launch = getLaunch();
if (launch != null) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
@@ -78,30 +79,36 @@ public class ConsoleRemoveLaunchAction extends Action implements IViewActionDele
}
}
- public void init(IViewPart view) {
+ @Override
+ public void init(IViewPart view) {
if (view instanceof IConsoleView) {
fConsoleView = (IConsoleView) view;
}
update();
}
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
run();
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
}
- public void consolesAdded(IConsole[] consoles) {
+ @Override
+ public void consolesAdded(IConsole[] consoles) {
}
- public void consolesRemoved(IConsole[] consoles) {
+ @Override
+ public void consolesRemoved(IConsole[] consoles) {
update();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesTerminated(ILaunch[] launches) {
update();
}
@@ -109,18 +116,21 @@ public class ConsoleRemoveLaunchAction extends Action implements IViewActionDele
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesRemoved(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesAdded(ILaunch[] launches) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
*/
+ @Override
public void launchesChanged(ILaunch[] launches) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java
index 7ff97a24d..4d2babb25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleShowPreferencesAction.java
@@ -29,14 +29,16 @@ public class ConsoleShowPreferencesAction extends Action implements IViewActionD
*
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
- public void init(IViewPart view) {}
+ @Override
+ public void init(IViewPart view) {}
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
SWTFactory.showPreferencePage("org.eclipse.debug.ui.ConsolePreferencePage"); //$NON-NLS-1$
}
@@ -46,7 +48,8 @@ public class ConsoleShowPreferencesAction extends Action implements IViewActionD
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction,
* org.eclipse.jface.viewers.ISelection)
*/
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
// do nothing
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java
index cdb9707b3..61d975135 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleTerminateAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,6 +19,7 @@ import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.commands.ITerminateHandler;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.debug.core.model.ITerminate;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
@@ -57,6 +58,7 @@ public class ConsoleTerminateAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
IProcess process = fConsole.getProcess();
setEnabled(process.canTerminate());
@@ -65,9 +67,10 @@ public class ConsoleTerminateAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IProcess process = fConsole.getProcess();
- List targets = collectTargets(process);
+ List<ITerminate> targets = collectTargets(process);
targets.add(process);
DebugCommandService service = DebugCommandService.getService(fWindow);
service.executeCommand(ITerminateHandler.class, targets.toArray(), null);
@@ -79,10 +82,10 @@ public class ConsoleTerminateAction extends Action implements IUpdate {
* @param process the process to collect {@link IDebugTarget}s for
* @return associated targets
*/
- private List collectTargets(IProcess process) {
+ private List<ITerminate> collectTargets(IProcess process) {
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = launchManager.getLaunches();
- List targets = new ArrayList();
+ List<ITerminate> targets = new ArrayList<ITerminate>();
for (int i = 0; i < launches.length; i++) {
ILaunch launch = launches[i];
IProcess[] processes = launch.getProcesses();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
index 88cf70b0c..abffd38da 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java
@@ -16,7 +16,6 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.core.resources.IFile;
@@ -89,10 +88,11 @@ import com.ibm.icu.text.MessageFormat;
*
* @since 3.0
*/
+@SuppressWarnings("deprecation")
public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSetListener, IPropertyChangeListener {
private IProcess fProcess = null;
- private List fStreamListeners = new ArrayList();
+ private List<StreamListener> fStreamListeners = new ArrayList<StreamListener>();
private IConsoleColorProvider fColorProvider;
@@ -160,10 +160,10 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
fFileOutputStream = new FileOutputStream(outputFile, append);
fileLoc = outputFile.getAbsolutePath();
- message = MessageFormat.format(ConsoleMessages.ProcessConsole_1, new String[] {fileLoc});
+ message = MessageFormat.format(ConsoleMessages.ProcessConsole_1, new Object[] { fileLoc });
addPatternMatchListener(new ConsoleLogFilePatternMatcher(fileLoc));
} catch (FileNotFoundException e) {
- message = MessageFormat.format(ConsoleMessages.ProcessConsole_2, new String[] {file});
+ message = MessageFormat.format(ConsoleMessages.ProcessConsole_2, new Object[] { file });
} catch (CoreException e) {
DebugUIPlugin.log(e);
}
@@ -254,7 +254,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
}
if (process.isTerminated()) {
- return MessageFormat.format(ConsoleMessages.ProcessConsole_0, new String[] { label });
+ return MessageFormat.format(ConsoleMessages.ProcessConsole_0, new Object[] { label });
}
return label;
}
@@ -262,7 +262,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
- public void propertyChange(PropertyChangeEvent evt) {
+ @Override
+ public void propertyChange(PropertyChangeEvent evt) {
String property = evt.getProperty();
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
if (property.equals(IDebugPreferenceConstants.CONSOLE_WRAP) || property.equals(IDebugPreferenceConstants.CONSOLE_WIDTH)) {
@@ -289,23 +290,27 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
setTabWidth(tabWidth);
} else if (property.equals(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT)) {
boolean activateOnOut = store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT);
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
+ @SuppressWarnings("resource")
+ IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
if (stream != null) {
stream.setActivateOnWrite(activateOnOut);
}
} else if (property.equals(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR)) {
boolean activateOnErr = store.getBoolean(IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR);
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
+ @SuppressWarnings("resource")
+ IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
if (stream != null) {
stream.setActivateOnWrite(activateOnErr);
}
} else if (property.equals(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR)) {
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
+ @SuppressWarnings("resource")
+ IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM);
if (stream != null) {
stream.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM));
}
} else if (property.equals(IDebugPreferenceConstants.CONSOLE_SYS_ERR_COLOR)) {
- IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
+ @SuppressWarnings("resource")
+ IOConsoleOutputStream stream = getStream(IDebugUIConstants.ID_STANDARD_ERROR_STREAM);
if (stream != null) {
stream.setColor(fColorProvider.getColor(IDebugUIConstants.ID_STANDARD_ERROR_STREAM));
}
@@ -323,9 +328,9 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#getStream(java.lang.String)
*/
- public IOConsoleOutputStream getStream(String streamIdentifier) {
- for (Iterator i = fStreamListeners.iterator(); i.hasNext();) {
- StreamListener listener = (StreamListener) i.next();
+ @Override
+ public IOConsoleOutputStream getStream(String streamIdentifier) {
+ for (StreamListener listener : fStreamListeners) {
if (listener.fStreamId.equals(streamIdentifier)) {
return listener.fStream;
}
@@ -336,14 +341,16 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#getProcess()
*/
- public IProcess getProcess() {
+ @Override
+ public IProcess getProcess() {
return fProcess;
}
/**
* @see org.eclipse.ui.console.IOConsole#dispose()
*/
- protected void dispose() {
+ @Override
+ protected void dispose() {
super.dispose();
fColorProvider.disconnect();
closeStreams();
@@ -354,14 +361,13 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
}
/**
- * cleanup method to clsoe all of the open stream to this console
- */
+ * cleanup method to close all of the open stream to this console
+ */
private synchronized void closeStreams() {
if (fStreamsClosed) {
return;
}
- for (Iterator i = fStreamListeners.iterator(); i.hasNext();) {
- StreamListener listener = (StreamListener) i.next();
+ for (StreamListener listener : fStreamListeners) {
listener.closeStream();
}
if (fFileOutputStream != null) {
@@ -381,11 +387,11 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
}
/**
- * disposes ofthe listeners for each of the stream associated with this console
- */
+ * disposes the listeners for each of the stream associated with this
+ * console
+ */
private synchronized void disposeStreams() {
- for (Iterator i = fStreamListeners.iterator(); i.hasNext();) {
- StreamListener listener = (StreamListener) i.next();
+ for (StreamListener listener : fStreamListeners) {
listener.dispose();
}
fFileOutputStream = null;
@@ -395,7 +401,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.ui.console.AbstractConsole#init()
*/
- protected void init() {
+ @Override
+ protected void init() {
super.init();
if (fProcess.isTerminated()) {
closeStreams();
@@ -418,7 +425,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
}
DebugUIPlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
setFont(JFaceResources.getFont(IDebugUIConstants.PREF_CONSOLE_FONT));
setBackground(DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_BAKGROUND_COLOR));
}
@@ -430,7 +438,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
*
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
- public void handleDebugEvents(DebugEvent[] events) {
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
if (event.getSource().equals(getProcess())) {
@@ -453,6 +462,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
String name = getName();
if (!name.equals(newName)) {
UIJob job = new UIJob("Update console title") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
ProcessConsole.this.setName(newName);
warnOfContentChange();
@@ -474,7 +484,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#connect(org.eclipse.debug.core.model.IStreamsProxy)
*/
- public void connect(IStreamsProxy streamsProxy) {
+ @Override
+ public void connect(IStreamsProxy streamsProxy) {
IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
IStreamMonitor streamMonitor = streamsProxy.getErrorStreamMonitor();
if (streamMonitor != null) {
@@ -494,7 +505,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#connect(org.eclipse.debug.core.model.IStreamMonitor, java.lang.String)
*/
- public void connect(IStreamMonitor streamMonitor, String streamIdentifier) {
+ @Override
+ public void connect(IStreamMonitor streamMonitor, String streamIdentifier) {
connect(streamMonitor, streamIdentifier, false);
}
@@ -505,7 +517,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
* @param streamIdentifier stream identifier
* @param activateOnWrite whether the stream should displayed when written to
*/
- private void connect(IStreamMonitor streamMonitor, String streamIdentifier, boolean activateOnWrite) {
+ @SuppressWarnings("resource")
+ private void connect(IStreamMonitor streamMonitor, String streamIdentifier, boolean activateOnWrite) {
IOConsoleOutputStream stream = null;
if (fAllocateConsole) {
stream = newOutputStream();
@@ -522,7 +535,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#addLink(org.eclipse.debug.ui.console.IConsoleHyperlink, int, int)
*/
- public void addLink(IConsoleHyperlink link, int offset, int length) {
+ @Override
+ public void addLink(IConsoleHyperlink link, int offset, int length) {
try {
addHyperlink(link, offset, length);
} catch (BadLocationException e) {
@@ -533,7 +547,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#addLink(org.eclipse.ui.console.IHyperlink, int, int)
*/
- public void addLink(IHyperlink link, int offset, int length) {
+ @Override
+ public void addLink(IHyperlink link, int offset, int length) {
try {
addHyperlink(link, offset, length);
} catch (BadLocationException e) {
@@ -544,7 +559,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/**
* @see org.eclipse.debug.ui.console.IConsole#getRegion(org.eclipse.debug.ui.console.IConsoleHyperlink)
*/
- public IRegion getRegion(IConsoleHyperlink link) {
+ @Override
+ public IRegion getRegion(IConsoleHyperlink link) {
return super.getRegion(link);
}
@@ -578,22 +594,25 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
* @see org.eclipse.debug.core.IStreamListener#streamAppended(java.lang.String,
* org.eclipse.debug.core.model.IStreamMonitor)
*/
- public void streamAppended(String text, IStreamMonitor monitor) {
+ @Override
+ public void streamAppended(String text, IStreamMonitor monitor) {
String encoding = getEncoding();
if (fFlushed) {
try {
if (fStream != null) {
- if (encoding == null)
- fStream.write(text);
- else
- fStream.write(text.getBytes(encoding));
+ if (encoding == null) {
+ fStream.write(text);
+ } else {
+ fStream.write(text.getBytes(encoding));
+ }
}
if (fFileOutputStream != null) {
synchronized (fFileOutputStream) {
- if (encoding == null)
- fFileOutputStream.write(text.getBytes());
- else
- fFileOutputStream.write(text.getBytes(encoding));
+ if (encoding == null) {
+ fFileOutputStream.write(text.getBytes());
+ } else {
+ fFileOutputStream.write(text.getBytes(encoding));
+ }
}
}
} catch (IOException e) {
@@ -671,7 +690,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
*
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
String encoding = getEncoding();
try {
byte[] b = new byte[1024];
@@ -680,10 +700,11 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
read = fInput.read(b);
if (read > 0) {
String s;
- if (encoding != null)
- s = new String(b, 0, read, encoding);
- else
- s = new String(b, 0, read);
+ if (encoding != null) {
+ s = new String(b, 0, read, encoding);
+ } else {
+ s = new String(b, 0, read);
+ }
streamsProxy.write(s);
}
}
@@ -699,7 +720,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
*
* @see org.eclipse.ui.console.IConsole#getImageDescriptor()
*/
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
if (super.getImageDescriptor() == null) {
setImageDescriptor(computeImageDescriptor());
}
@@ -723,11 +745,13 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
return buffer.toString();
}
- public String getPattern() {
+ @Override
+ public String getPattern() {
return fFilePath;
}
- public void matchFound(PatternMatchEvent event) {
+ @Override
+ public void matchFound(PatternMatchEvent event) {
try {
addHyperlink(new ConsoleLogFileHyperlink(fFilePath), event.getOffset(), event.getLength());
removePatternMatchListener(this);
@@ -735,18 +759,22 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
}
}
- public int getCompilerFlags() {
+ @Override
+ public int getCompilerFlags() {
return 0;
}
- public String getLineQualifier() {
+ @Override
+ public String getLineQualifier() {
return null;
}
- public void connect(TextConsole console) {
+ @Override
+ public void connect(TextConsole console) {
}
- public void disconnect() {
+ @Override
+ public void disconnect() {
}
}
@@ -756,7 +784,8 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
fFilePath = filePath;
}
- public void linkActivated() {
+ @Override
+ public void linkActivated() {
IEditorInput input;
Path path = new Path(fFilePath);
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -776,9 +805,11 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
} catch (PartInitException e) {
}
}
- public void linkEntered() {
+ @Override
+ public void linkEntered() {
}
- public void linkExited() {
+ @Override
+ public void linkExited() {
}
}
@@ -791,36 +822,44 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
fFile = file;
}
- public IStorage getStorage() {
+ @Override
+ public IStorage getStorage() {
return fStorage;
}
- public ImageDescriptor getImageDescriptor() {
+ @Override
+ public ImageDescriptor getImageDescriptor() {
return null;
}
- public String getName() {
+ @Override
+ public String getName() {
return getStorage().getName();
}
- public IPersistableElement getPersistable() {
+ @Override
+ public IPersistableElement getPersistable() {
return null;
}
- public String getToolTipText() {
+ @Override
+ public String getToolTipText() {
return getStorage().getFullPath().toOSString();
}
- public boolean equals(Object object) {
+ @Override
+ public boolean equals(Object object) {
return object instanceof StorageEditorInput &&
getStorage().equals(((StorageEditorInput)object).getStorage());
}
- public int hashCode() {
+ @Override
+ public int hashCode() {
return getStorage().hashCode();
}
- public boolean exists() {
+ @Override
+ public boolean exists() {
return fFile.exists();
}
}
@@ -828,6 +867,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe
/* (non-Javadoc)
* @see org.eclipse.ui.console.AbstractConsole#getHelpContextId()
*/
+ @Override
public String getHelpContextId() {
return IDebugHelpContextIds.PROCESS_CONSOLE;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
index df8479fe7..e4669a68d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsoleManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@ package org.eclipse.debug.internal.ui.views.console;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -47,7 +46,7 @@ public class ProcessConsoleManager implements ILaunchListener {
/**
* Console document content provider extensions, keyed by extension id
*/
- private Map fColorProviders;
+ private Map<String, IConfigurationElement> fColorProviders;
/**
* The default color provider. Used if no color provider is contributed
@@ -58,19 +57,18 @@ public class ProcessConsoleManager implements ILaunchListener {
/**
* Console line trackers; keyed by process type to list of trackers (1:N)
*/
- private Map fLineTrackers;
+ private Map<String, List<IConfigurationElement>> fLineTrackers;
/**
* Map of processes for a launch to compute removed processes
*/
- private Map fProcesses;
-
-
+ private Map<ILaunch, IProcess[]> fProcesses;
/**
* @see ILaunchListener#launchRemoved(ILaunch)
*/
- public void launchRemoved(ILaunch launch) {
+ @Override
+ public void launchRemoved(ILaunch launch) {
removeLaunch(launch);
}
@@ -123,14 +121,16 @@ public class ProcessConsoleManager implements ILaunchListener {
/**
* @see ILaunchListener#launchAdded(ILaunch)
*/
- public void launchAdded(ILaunch launch) {
+ @Override
+ public void launchAdded(ILaunch launch) {
launchChanged(launch);
}
/**
* @see ILaunchListener#launchChanged(ILaunch)
*/
- public void launchChanged(final ILaunch launch) {
+ @Override
+ public void launchChanged(final ILaunch launch) {
IProcess[] processes= launch.getProcesses();
for (int i= 0; i < processes.length; i++) {
if (getConsoleDocument(processes[i]) == null) {
@@ -149,11 +149,9 @@ public class ProcessConsoleManager implements ILaunchListener {
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{pc});
}
}
- List removed = getRemovedProcesses(launch);
+ List<IProcess> removed = getRemovedProcesses(launch);
if (removed != null) {
- Iterator iterator = removed.iterator();
- while (iterator.hasNext()) {
- IProcess p = (IProcess) iterator.next();
+ for (IProcess p : removed) {
removeProcess(p);
}
}
@@ -212,7 +210,7 @@ public class ProcessConsoleManager implements ILaunchListener {
*/
public IConsoleColorProvider getColorProvider(String type) {
if (fColorProviders == null) {
- fColorProviders = new HashMap();
+ fColorProviders = new HashMap<String, IConfigurationElement>();
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_COLOR_PROVIDERS);
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
@@ -220,7 +218,7 @@ public class ProcessConsoleManager implements ILaunchListener {
fColorProviders.put(extension.getAttribute("processType"), extension); //$NON-NLS-1$
}
}
- IConfigurationElement extension = (IConfigurationElement)fColorProviders.get(type);
+ IConfigurationElement extension = fColorProviders.get(type);
if (extension != null) {
try {
Object colorProvider = extension.createExecutableExtension("class"); //$NON-NLS-1$
@@ -229,7 +227,7 @@ public class ProcessConsoleManager implements ILaunchListener {
}
DebugUIPlugin.logErrorMessage(MessageFormat.format(
"Extension {0} must specify an instanceof IConsoleColorProvider for class attribute.", //$NON-NLS-1$
- new String[]{extension.getDeclaringExtension().getUniqueIdentifier()}));
+ new Object[] { extension.getDeclaringExtension().getUniqueIdentifier() }));
} catch (CoreException e) {
DebugUIPlugin.log(e);
}
@@ -250,36 +248,35 @@ public class ProcessConsoleManager implements ILaunchListener {
String type = process.getAttribute(IProcess.ATTR_PROCESS_TYPE);
if (fLineTrackers == null) {
- fLineTrackers = new HashMap();
+ fLineTrackers = new HashMap<String, List<IConfigurationElement>>();
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_CONSOLE_LINE_TRACKERS);
IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
for (int i = 0; i < elements.length; i++) {
IConfigurationElement extension = elements[i];
String processType = extension.getAttribute("processType"); //$NON-NLS-1$
- List list = (List)fLineTrackers.get(processType);
+ List<IConfigurationElement> list = fLineTrackers.get(processType);
if (list == null) {
- list = new ArrayList();
+ list = new ArrayList<IConfigurationElement>();
fLineTrackers.put(processType, list);
}
list.add(extension);
}
}
- ArrayList trackers = new ArrayList();
+ ArrayList<IConsoleLineTracker> trackers = new ArrayList<IConsoleLineTracker>();
if (type != null) {
- List lineTrackerExtensions = (List) fLineTrackers.get(type);
+ List<IConfigurationElement> lineTrackerExtensions = fLineTrackers.get(type);
if(lineTrackerExtensions != null) {
- for(Iterator i = lineTrackerExtensions.iterator(); i.hasNext(); ) {
- IConfigurationElement element = (IConfigurationElement) i.next();
+ for (IConfigurationElement element : lineTrackerExtensions) {
try {
- trackers.add(element.createExecutableExtension("class")); //$NON-NLS-1$
+ trackers.add((IConsoleLineTracker) element.createExecutableExtension("class")); //$NON-NLS-1$
} catch (CoreException e) {
DebugUIPlugin.log(e);
}
}
}
}
- return (IConsoleLineTracker[]) trackers.toArray(new IConsoleLineTracker[0]);
+ return trackers.toArray(new IConsoleLineTracker[0]);
}
/**
@@ -289,19 +286,19 @@ public class ProcessConsoleManager implements ILaunchListener {
* @param launch launch that has changed
* @return removed processes or <code>null</code>
*/
- private List getRemovedProcesses(ILaunch launch) {
- List removed = null;
+ private List<IProcess> getRemovedProcesses(ILaunch launch) {
+ List<IProcess> removed = null;
if (fProcesses == null) {
- fProcesses = new HashMap();
+ fProcesses = new HashMap<ILaunch, IProcess[]>();
}
- IProcess[] old = (IProcess[]) fProcesses.get(launch);
+ IProcess[] old = fProcesses.get(launch);
IProcess[] curr = launch.getProcesses();
if (old != null) {
for (int i = 0; i < old.length; i++) {
IProcess process = old[i];
if (!contains(curr, process)) {
if (removed == null) {
- removed = new ArrayList();
+ removed = new ArrayList<IProcess>();
}
removed.add(process);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
index 6fa8fdc03..4462e299e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePageParticipant.java
@@ -75,7 +75,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
* Handler to send EOF
*/
private class EOFHandler extends AbstractHandler {
- public Object execute(ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException {
IStreamsProxy proxy = getProcess().getStreamsProxy();
if (proxy instanceof IStreamsProxy2) {
IStreamsProxy2 proxy2 = (IStreamsProxy2) proxy;
@@ -92,7 +93,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsolePageParticipant#init(IPageBookViewPage, IConsole)
*/
- public void init(IPageBookViewPage page, IConsole console) {
+ @Override
+ public void init(IPageBookViewPage page, IConsole console) {
fPage = page;
fConsole = (ProcessConsole) console;
@@ -118,7 +120,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsolePageParticipant#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
DebugUITools.getDebugContextManager().getContextService(fPage.getSite().getWorkbenchWindow()).removeDebugContextListener(this);
DebugPlugin.getDefault().removeDebugEventListener(this);
if (fRemoveTerminated != null) {
@@ -158,7 +161,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- public Object getAdapter(Class required) {
+ @Override
+ public Object getAdapter(Class required) {
if (IShowInSource.class.equals(required)) {
return this;
}
@@ -179,7 +183,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.ui.part.IShowInSource#getShowInContext()
*/
- public ShowInContext getShowInContext() {
+ @Override
+ public ShowInContext getShowInContext() {
IProcess process = getProcess();
if (process == null) {
return null;
@@ -203,19 +208,22 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
*/
- public String[] getShowInTargetIds() {
+ @Override
+ public String[] getShowInTargetIds() {
return new String[] {IDebugUIConstants.ID_DEBUG_VIEW};
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
- public void handleDebugEvents(DebugEvent[] events) {
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event = events[i];
if (event.getSource().equals(getProcess())) {
Runnable r = new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (fTerminate != null) {
fTerminate.update();
}
@@ -234,7 +242,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsolePageParticipant#activated()
*/
- public void activated() {
+ @Override
+ public void activated() {
// add EOF submissions
IPageSite site = fPage.getSite();
if(fActivatedContext == null && fActivatedHandler == null) {
@@ -248,7 +257,8 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsolePageParticipant#deactivated()
*/
- public void deactivated() {
+ @Override
+ public void deactivated() {
// remove EOF submissions
IPageSite site = fPage.getSite();
IHandlerService handlerService = (IHandlerService)site.getService(IHandlerService.class);
@@ -262,6 +272,7 @@ public class ProcessConsolePageParticipant implements IConsolePageParticipant, I
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
if (fView != null && getProcess().equals(DebugUITools.getCurrentProcess())) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java
index a525977d0..478cc0eae 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessTypePropertyTester.java
@@ -25,7 +25,8 @@ public class ProcessTypePropertyTester extends PropertyTester {
/* (non-Javadoc)
* @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
*/
- public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
if (receiver instanceof TextConsole) {
TextConsole console = (TextConsole) receiver;
IProcess process = (IProcess) console.getAttribute(IDebugUIConstants.ATTR_CONSOLE_PROCESS);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java
index ff2f6a064..a13a0cfe4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardErrorAction.java
@@ -35,6 +35,7 @@ public class ShowStandardErrorAction extends ShowWhenContentChangesAction {
setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STANDARD_ERR));
}
+ @Override
protected String getKey() {
return IDebugPreferenceConstants.CONSOLE_OPEN_ON_ERR;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java
index 0bd2b96dd..71fd9fd12 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowStandardOutAction.java
@@ -35,6 +35,7 @@ public class ShowStandardOutAction extends ShowWhenContentChangesAction {
setImageDescriptor(DebugUITools.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_STANDARD_OUT));
}
+ @Override
protected String getKey() {
return IDebugPreferenceConstants.CONSOLE_OPEN_ON_OUT;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java
index bfe1825b7..fca78ddb6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ShowWhenContentChangesAction.java
@@ -38,6 +38,7 @@ public abstract class ShowWhenContentChangesAction extends Action implements IPr
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property.equals(getKey())) {
@@ -68,6 +69,7 @@ public abstract class ShowWhenContentChangesAction extends Action implements IPr
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
IPreferenceStore store = getPreferenceStore();
boolean show = isChecked();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
index b63b1c8b1..874c04be6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionDropAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -80,7 +80,8 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerDropAdapter#dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
*/
- public void dragEnter(DropTargetEvent event) {
+ @Override
+ public void dragEnter(DropTargetEvent event) {
fDropType = DROP_TYPE_DEFAULT;
event.detail = DND.DROP_NONE;
@@ -118,7 +119,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
*/
private boolean isExpressionDrop() {
IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- Iterator iterator = selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object element = iterator.next();
if (getTargetExpression(element) == null){
@@ -133,7 +134,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
*/
private boolean isVariableDrop() {
IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- Iterator iterator = selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object element = iterator.next();
if (!(element instanceof IVariable)){
@@ -149,7 +150,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
*/
private boolean isWatchAdaptableElementDrop() {
IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
- Iterator iterator = selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object element = iterator.next();
if (!(element instanceof IAdaptable &&
@@ -164,6 +165,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerDropAdapter#dragOver(org.eclipse.swt.dnd.DropTargetEvent)
*/
+ @Override
public void dragOver(DropTargetEvent event) {
super.dragOver(event);
// Allow scrolling (but not expansion)
@@ -173,7 +175,8 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
*/
- public boolean validateDrop(Object target, int operation, TransferData transferType) {
+ @Override
+ public boolean validateDrop(Object target, int operation, TransferData transferType) {
if (LocalSelectionTransfer.getTransfer().isSupportedType(transferType)) {
if (fDropType == DROP_TYPE_EXPRESSION){
return validateExpressionDrop(target);
@@ -226,7 +229,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
if (selection != null) {
size = selection.size();
IExpressionManager manager = DebugPlugin.getDefault().getExpressionManager();
- Iterator iterator = selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object element = iterator.next();
if (element instanceof IVariable){
@@ -261,7 +264,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
int size = -1;
if (selection != null) {
size = selection.size();
- Iterator iterator = selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object element = iterator.next();
if (isFactory2Enabled(element)) {
@@ -317,6 +320,7 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerDropAdapter#drop(org.eclipse.swt.dnd.DropTargetEvent)
*/
+ @Override
public void drop(DropTargetEvent event) {
fCurrentTransferType = event.currentDataType;
// Unless insert after is explicitly set, insert before
@@ -327,7 +331,8 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
*/
- public boolean performDrop(Object data) {
+ @Override
+ public boolean performDrop(Object data) {
if (LocalSelectionTransfer.getTransfer().isSupportedType(fCurrentTransferType)) {
IStructuredSelection selection = (IStructuredSelection) LocalSelectionTransfer.getTransfer().getSelection();
if (fDropType == DROP_TYPE_EXPRESSION){
@@ -379,8 +384,8 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
* @return whether the drop was successful
*/
private boolean performVariableOrWatchAdaptableDrop(IStructuredSelection selection) {
- List expressions = new ArrayList(selection.size());
- for (Iterator itr = selection.iterator(); itr.hasNext(); ) {
+ List<IExpression> expressions = new ArrayList<IExpression>(selection.size());
+ for (Iterator<?> itr = selection.iterator(); itr.hasNext();) {
Object element = itr.next();
String expressionText = createExpressionString(element);
if (expressionText != null){
@@ -400,9 +405,9 @@ public class ExpressionDropAdapter extends ViewerDropAdapter {
if (manager instanceof ExpressionManager){
IExpression targetExpression = getTargetExpression(getCurrentTarget());
if (targetExpression != null){
- ((ExpressionManager)manager).insertExpressions((IExpression[])expressions.toArray(new IExpression[expressions.size()]), targetExpression, fInsertBefore);
+ ((ExpressionManager)manager).insertExpressions(expressions.toArray(new IExpression[expressions.size()]), targetExpression, fInsertBefore);
} else {
- ((ExpressionManager)manager).addExpressions((IExpression[])expressions.toArray(new IExpression[expressions.size()]));
+ ((ExpressionManager)manager).addExpressions(expressions.toArray(new IExpression[expressions.size()]));
}
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
index 54f3d965d..d7e811e5d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
@@ -64,6 +64,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.EXPRESSION_VIEW;
}
@@ -71,6 +72,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
super.configureToolBar(tbm);
tbm.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP));
@@ -80,6 +82,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
protected void fillContextMenu(IMenuManager menu) {
menu.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP));
menu.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP));
@@ -104,6 +107,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#contextActivated(org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected void contextActivated(ISelection selection) {
if (!isAvailable() || !isVisible()) {
return;
@@ -121,6 +125,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#viewerInputUpdateComplete(IViewerInputUpdate)
*/
+ @Override
protected void viewerInputUpdateComplete(IViewerInputUpdate update) {
IStatus status = update.getStatus();
if ( (status == null || status.isOK()) && update.getElement() != null) {
@@ -134,6 +139,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
*/
+ @Override
protected String getDetailPanePreferenceKey() {
return IDebugPreferenceConstants.EXPRESSIONS_DETAIL_PANE_ORIENTATION;
}
@@ -141,6 +147,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
*/
+ @Override
protected String getToggleActionLabel() {
return VariablesViewMessages.ExpressionView_4;
}
@@ -148,6 +155,7 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
*/
+ @Override
protected String getPresentationContextId() {
return IDebugUIConstants.ID_EXPRESSION_VIEW;
}
@@ -155,7 +163,8 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#initDragAndDrop(org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer)
*/
- protected void initDragAndDrop(TreeModelViewer viewer) {
+ @Override
+ protected void initDragAndDrop(TreeModelViewer viewer) {
viewer.addDragSupport(DND.DROP_MOVE, new Transfer[] {LocalSelectionTransfer.getTransfer()}, new SelectionDragAdapter(viewer));
viewer.addDropSupport(DND.DROP_MOVE|DND.DROP_COPY, new Transfer[] {LocalSelectionTransfer.getTransfer(), TextTransfer.getInstance()}, new ExpressionDropAdapter(getSite(), viewer));
}
@@ -163,7 +172,8 @@ public class ExpressionView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#createActions()
*/
- protected void createActions() {
+ @Override
+ protected void createActions() {
super.createActions();
fPasteAction = new PasteWatchExpressionsAction(this);
configure(fPasteAction, IWorkbenchCommandConstants.EDIT_PASTE, PASTE_ACTION, ISharedImages.IMG_TOOL_PASTE);
@@ -171,7 +181,8 @@ public class ExpressionView extends VariablesView {
configure(fEditInPlaceAction, IWorkbenchCommandConstants.FILE_RENAME, ActionFactory.RENAME.getId(), null);
}
- public void dispose() {
+ @Override
+ public void dispose() {
fEditInPlaceAction.dispose();
super.dispose();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
index f24b49546..39825b009 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbDropDownAutoExpandAction.java
@@ -46,6 +46,7 @@ class BreadcrumbDropDownAutoExpandAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fLaunchView.setBreadcrumbDropDownAutoExpand(isChecked());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
index 1b458ec5c..f75f7a5cb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/BreadcrumbWorkbenchPart.java
@@ -29,14 +29,16 @@ class BreadcrumbWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
return (obj instanceof BreadcrumbWorkbenchPart);
}
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
- public int hashCode() {
+ @Override
+ public int hashCode() {
return getClass().hashCode();
}
@@ -52,65 +54,75 @@ class BreadcrumbWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
*/
- public void addPropertyListener(IPropertyListener listener) {
+ @Override
+ public void addPropertyListener(IPropertyListener listener) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
- public void createPartControl(Composite parent) {
+ @Override
+ public void createPartControl(Composite parent) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getSite()
*/
- public IWorkbenchPartSite getSite() {
+ @Override
+ public IWorkbenchPartSite getSite() {
return fSite;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getTitle()
*/
- public String getTitle() {
+ @Override
+ public String getTitle() {
return ""; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
*/
- public Image getTitleImage() {
+ @Override
+ public Image getTitleImage() {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
*/
- public String getTitleToolTip() {
+ @Override
+ public String getTitleToolTip() {
return ""; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
*/
- public void removePropertyListener(IPropertyListener listener) {
+ @Override
+ public void removePropertyListener(IPropertyListener listener) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
- public void setFocus() {
+ @Override
+ public void setFocus() {
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- public Object getAdapter(Class adapter) {
+ @Override
+ public Object getAdapter(Class adapter) {
return null;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
index 1754e348e..dd5f094f2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementAdapterFactory.java
@@ -146,7 +146,8 @@ public class DebugElementAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/
- public Object getAdapter(Object adaptableObject, Class adapterType) {
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType.isInstance(adaptableObject)) {
return adaptableObject;
}
@@ -322,7 +323,8 @@ public class DebugElementAdapterFactory implements IAdapterFactory {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
*/
- public Class[] getAdapterList() {
+ @Override
+ public Class[] getAdapterList() {
return new Class[] {
IAsynchronousLabelAdapter.class,
IAsynchronousContentAdapter.class,
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
index efafa7b7c..04acbd126 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugElementHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,204 +26,201 @@ import org.eclipse.swt.graphics.RGB;
/**
* Translates images, colors, and fonts into image descriptors, RGBs, and font
- * datas for workbench adapaters. Also provides labels.
+ * data for workbench adapters. Also provides labels.
*
* @since 3.1
*/
public class DebugElementHelper {
-
- // a model presentation that can provide images & labels for debug elements
- private static DelegatingModelPresentation fgPresenetation;
-
- // map of images to image descriptors
- private static Map fgImages = new HashMap();
-
- /**
- * Disposes this adapater
- */
- public static void dispose() {
- fgImages.clear();
- if (fgPresenetation != null) {
- fgPresenetation.dispose();
- fgPresenetation = null;
- }
- }
-
- /**
- * Returns an image descriptor for the given debug element.
- *
- * @param object object for which an image descriptor is required
- */
- public static ImageDescriptor getImageDescriptor(Object object) {
- Image image = getPresentation().getImage(object);
- return getImageDescriptor(image);
- }
-
- /**
- * Returns an image descriptor for the given debug element.
- *
- * @param presentation presentation to obtain image from
- * @param object object for which an image descriptor is required
- * @since 3.3
- */
- public static ImageDescriptor getImageDescriptor(Object object, IDebugModelPresentation presentation) {
- Image image = presentation.getImage(object);
- return getImageDescriptor(image);
- }
-
- public static ImageDescriptor getImageDescriptor(Image image)
- {
- if (image != null) {
- ImageDescriptor descriptor = (ImageDescriptor) fgImages.get(image);
- if (descriptor == null) {
- descriptor = new ImageImageDescriptor(image);
- fgImages.put(image, descriptor);
- }
- return descriptor;
- }
- return null;
- }
-
- /**
- * Returns a label for the given debug element.
- *
- * @param o object for which a label is required
- */
- public static String getLabel(Object o) {
- return getPresentation().getText(o);
- }
-
- /**
- * Returns a model presentation to use to retrieve lables & images.
- *
- * @return a model presentation to use to retrieve lables & images
- */
- public static DelegatingModelPresentation getPresentation() {
- if (fgPresenetation == null) {
- fgPresenetation = new DelegatingModelPresentation();
- }
- return fgPresenetation;
- }
-
- /**
- * Returns the RGB of the foreground color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a foreground color is required
- * @return the RGB of the foreground color for the given element, or
- * <code>null</code> if none
- */
- public static RGB getForeground(Object element) {
- Color color = getPresentation().getForeground(element);
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the foreground color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a foreground color is required
- * @param presentation presentation to obtain color from
- * @return the RGB of the foreground color for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static RGB getForeground(Object element, IDebugModelPresentation presentation) {
- Color color = null;
- if (presentation instanceof IColorProvider) {
+
+ // a model presentation that can provide images & labels for debug elements
+ private static DelegatingModelPresentation fgPresenetation;
+
+ // map of images to image descriptors
+ private static Map<Image, ImageDescriptor> fgImages = new HashMap<Image, ImageDescriptor>();
+
+ /**
+ * Disposes this adapter
+ */
+ public static void dispose() {
+ fgImages.clear();
+ if (fgPresenetation != null) {
+ fgPresenetation.dispose();
+ fgPresenetation = null;
+ }
+ }
+
+ /**
+ * Returns an image descriptor for the given debug element.
+ *
+ * @param object object for which an image descriptor is required
+ */
+ public static ImageDescriptor getImageDescriptor(Object object) {
+ Image image = getPresentation().getImage(object);
+ return getImageDescriptor(image);
+ }
+
+ /**
+ * Returns an image descriptor for the given debug element.
+ *
+ * @param presentation presentation to obtain image from
+ * @param object object for which an image descriptor is required
+ * @since 3.3
+ */
+ public static ImageDescriptor getImageDescriptor(Object object, IDebugModelPresentation presentation) {
+ Image image = presentation.getImage(object);
+ return getImageDescriptor(image);
+ }
+
+ public static ImageDescriptor getImageDescriptor(Image image) {
+ if (image != null) {
+ ImageDescriptor descriptor = fgImages.get(image);
+ if (descriptor == null) {
+ descriptor = new ImageImageDescriptor(image);
+ fgImages.put(image, descriptor);
+ }
+ return descriptor;
+ }
+ return null;
+ }
+
+ /**
+ * Returns a label for the given debug element.
+ *
+ * @param o object for which a label is required
+ */
+ public static String getLabel(Object o) {
+ return getPresentation().getText(o);
+ }
+
+ /**
+ * Returns a model presentation to use to retrieve lables & images.
+ *
+ * @return a model presentation to use to retrieve lables & images
+ */
+ public static DelegatingModelPresentation getPresentation() {
+ if (fgPresenetation == null) {
+ fgPresenetation = new DelegatingModelPresentation();
+ }
+ return fgPresenetation;
+ }
+
+ /**
+ * Returns the RGB of the foreground color for the given element, or
+ * <code>null</code> if none.
+ *
+ * @param element object for which a foreground color is required
+ * @return the RGB of the foreground color for the given element, or
+ * <code>null</code> if none
+ */
+ public static RGB getForeground(Object element) {
+ Color color = getPresentation().getForeground(element);
+ if (color != null) {
+ return color.getRGB();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the RGB of the foreground color for the given element, or
+ * <code>null</code> if none.
+ *
+ * @param element object for which a foreground color is required
+ * @param presentation presentation to obtain color from
+ * @return the RGB of the foreground color for the given element, or
+ * <code>null</code> if none
+ * @since 3.3
+ */
+ public static RGB getForeground(Object element, IDebugModelPresentation presentation) {
+ Color color = null;
+ if (presentation instanceof IColorProvider) {
IColorProvider colorProvider = (IColorProvider) presentation;
color = colorProvider.getForeground(element);
} else {
color = getPresentation().getForeground(element);
}
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the background color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a background color is required
- * @return the RGB of the background color for the given element, or
- * <code>null</code> if none
- */
- public static RGB getBackground(Object element) {
- Color color = getPresentation().getBackground(element);
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the RGB of the background color for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which a background color is required
- * @param presentation presentation to use to retrieve color
- * @return the RGB of the background color for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static RGB getBackground(Object element, IDebugModelPresentation presentation) {
- Color color = null;
- if (presentation instanceof IColorProvider) {
+ if (color != null) {
+ return color.getRGB();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the RGB of the background color for the given element, or
+ * <code>null</code> if none.
+ *
+ * @param element object for which a background color is required
+ * @return the RGB of the background color for the given element, or
+ * <code>null</code> if none
+ */
+ public static RGB getBackground(Object element) {
+ Color color = getPresentation().getBackground(element);
+ if (color != null) {
+ return color.getRGB();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the RGB of the background color for the given element, or
+ * <code>null</code> if none.
+ *
+ * @param element object for which a background color is required
+ * @param presentation presentation to use to retrieve color
+ * @return the RGB of the background color for the given element, or
+ * <code>null</code> if none
+ * @since 3.3
+ */
+ public static RGB getBackground(Object element, IDebugModelPresentation presentation) {
+ Color color = null;
+ if (presentation instanceof IColorProvider) {
IColorProvider colorProvider = (IColorProvider) presentation;
color = colorProvider.getBackground(element);
} else {
color = getPresentation().getBackground(element);
}
- if (color != null) {
- return color.getRGB();
- }
- return null;
- }
-
- /**
- * Returns the font data for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which font data is required
- * @return the font data for the given element, or
- * <code>null</code> if none
- */
- public static FontData getFont(Object element) {
- Font font = getPresentation().getFont(element);
- if (font != null) {
- return font.getFontData()[0];
- }
- return null;
- }
-
- /**
- * Returns the font data for the given element, or
- * <code>null</code> if none.
- *
- * @param element object for which font data is required
- * @param presentation presentation to obtain font from
- * @return the font data for the given element, or
- * <code>null</code> if none
- * @since 3.3
- */
- public static FontData getFont(Object element, IDebugModelPresentation presentation) {
- Font font = null;
- if (presentation instanceof IFontProvider) {
- IFontProvider provider = (IFontProvider) presentation;
- font = provider.getFont(element);
- } else {
- font = getPresentation().getFont(element);
- }
- if (font != null) {
- return font.getFontData()[0];
- }
- return null;
- }
+ if (color != null) {
+ return color.getRGB();
+ }
+ return null;
+ }
+
+ /**
+ * Returns the font data for the given element, or <code>null</code> if
+ * none.
+ *
+ * @param element object for which font data is required
+ * @return the font data for the given element, or <code>null</code> if none
+ */
+ public static FontData getFont(Object element) {
+ Font font = getPresentation().getFont(element);
+ if (font != null) {
+ return font.getFontData()[0];
+ }
+ return null;
+ }
+
+ /**
+ * Returns the font data for the given element, or <code>null</code> if
+ * none.
+ *
+ * @param element object for which font data is required
+ * @param presentation presentation to obtain font from
+ * @return the font data for the given element, or <code>null</code> if none
+ * @since 3.3
+ */
+ public static FontData getFont(Object element, IDebugModelPresentation presentation) {
+ Font font = null;
+ if (presentation instanceof IFontProvider) {
+ IFontProvider provider = (IFontProvider) presentation;
+ font = provider.getFont(element);
+ } else {
+ font = getPresentation().getFont(element);
+ }
+ if (font != null) {
+ return font.getFontData()[0];
+ }
+ return null;
+ }
/**
* Returns whether the UI thread is required for computing the label for the
@@ -235,5 +232,5 @@ public class DebugElementHelper {
public static boolean requiresUIThread(Object object) {
DelegatingModelPresentation presentation = getPresentation();
return presentation.requiresUIThread(object);
- }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java
index d47929d13..38f9c6900 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugToolBarAction.java
@@ -46,6 +46,7 @@ class DebugToolBarAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fLaunchView.setDebugToolbarInView(isChecked());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
index 3c690ffd2..712f05126 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DebugViewModeAction.java
@@ -73,6 +73,7 @@ class DebugViewModeAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fLaunchView.setViewMode(fMode, fParent);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
index 49938fd68..d44ec65a5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/DecorationManager.java
@@ -25,71 +25,68 @@ import org.eclipse.debug.core.model.IThread;
*/
public class DecorationManager {
- // map of targets to lists of active decorations
- private static Map fDecorations = new HashMap(10);
+ // map of targets to lists of active decorations
+ private static Map<IDebugTarget, List<Decoration>> fDecorations = new HashMap<IDebugTarget, List<Decoration>>(10);
- /**
- * Adds the given decoration for the given stack frame.
- *
- * @param decoration
- * @param frame
- */
- public static void addDecoration(Decoration decoration) {
- synchronized (fDecorations) {
- IDebugTarget target = decoration.getThread().getDebugTarget();
- List list = (List) fDecorations.get(target);
- if (list == null) {
- list = new ArrayList();
- fDecorations.put(target, list);
- }
- list.add(decoration);
- }
- }
+ /**
+ * Adds the given decoration for the given stack frame.
+ *
+ * @param decoration
+ * @param frame
+ */
+ public static void addDecoration(Decoration decoration) {
+ synchronized (fDecorations) {
+ IDebugTarget target = decoration.getThread().getDebugTarget();
+ List<Decoration> list = fDecorations.get(target);
+ if (list == null) {
+ list = new ArrayList<Decoration>();
+ fDecorations.put(target, list);
+ }
+ list.add(decoration);
+ }
+ }
- /**
- * Removes any decorations for the given debug target.
- *
- * @param target
- * to remove editor decorations for
- */
- public static void removeDecorations(IDebugTarget target) {
- doRemoveDecorations(target, null);
- }
-
- /**
- * Removes any decorations for the given thread
- *
- * @param thread
- * thread to remove decorations for
- */
- public static void removeDecorations(IThread thread) {
- doRemoveDecorations(thread.getDebugTarget(), thread);
- }
+ /**
+ * Removes any decorations for the given debug target.
+ *
+ * @param target to remove editor decorations for
+ */
+ public static void removeDecorations(IDebugTarget target) {
+ doRemoveDecorations(target, null);
+ }
+
+ /**
+ * Removes any decorations for the given thread
+ *
+ * @param thread thread to remove decorations for
+ */
+ public static void removeDecorations(IThread thread) {
+ doRemoveDecorations(thread.getDebugTarget(), thread);
+ }
private static void doRemoveDecorations(IDebugTarget target, IThread thread) {
- ArrayList decorationsToRemove = new ArrayList();
- synchronized (fDecorations) {
- List list = (List) fDecorations.get(target);
- if (list != null) {
- ListIterator iterator = list.listIterator();
- while (iterator.hasNext()) {
- Decoration decoration = (Decoration) iterator.next();
- if (thread == null || thread.equals(decoration.getThread())) {
- decorationsToRemove.add(decoration);
- iterator.remove();
- }
- }
- if (list.isEmpty()) {
- fDecorations.remove(target);
- }
- }
- }
- Iterator iter = decorationsToRemove.iterator();
- while (iter.hasNext())
- {
- Decoration decoration = (Decoration)iter.next();
- decoration.remove();
- }
+ ArrayList<Decoration> decorationsToRemove = new ArrayList<Decoration>();
+ synchronized (fDecorations) {
+ List<Decoration> list = fDecorations.get(target);
+ if (list != null) {
+ ListIterator<Decoration> iterator = list.listIterator();
+ while (iterator.hasNext()) {
+ Decoration decoration = iterator.next();
+ if (thread == null || thread.equals(decoration.getThread())) {
+ decorationsToRemove.add(decoration);
+ iterator.remove();
+ }
+ }
+ if (list.isEmpty()) {
+ fDecorations.remove(target);
+ }
+ }
+ }
+ Iterator<Decoration> iter = decorationsToRemove.iterator();
+ while (iter.hasNext()) {
+ Decoration decoration = iter.next();
+ decoration.remove();
+ }
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
index 57f8fb646..0caeab28c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/ImageImageDescriptor.java
@@ -31,6 +31,7 @@ public class ImageImageDescriptor extends ImageDescriptor {
/* (non-Javadoc)
* @see ImageDescriptor#getImageData()
*/
+ @Override
public ImageData getImageData() {
return fImage.getImageData();
}
@@ -38,6 +39,7 @@ public class ImageImageDescriptor extends ImageDescriptor {
/* (non-Javadoc)
* @see Object#equals(Object)
*/
+ @Override
public boolean equals(Object obj) {
return (obj != null) && getClass().equals(obj.getClass()) && fImage.equals(((ImageImageDescriptor)obj).fImage);
}
@@ -45,6 +47,7 @@ public class ImageImageDescriptor extends ImageDescriptor {
/* (non-Javadoc)
* @see Object#hashCode()
*/
+ @Override
public int hashCode() {
return fImage.hashCode();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index 3a21e0146..34b7d1f5e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -253,11 +253,11 @@ public class LaunchView extends AbstractDebugView
*
* @since 3.6
*/
- private Map fHandlers = new HashMap();
+ private Map<String, IHandler2> fHandlers = new HashMap<String, IHandler2>();
private boolean fDebugToolbarInView = true;
- private Set fDebugToolbarPerspectives = new TreeSet();
+ private Set<String> fDebugToolbarPerspectives = new TreeSet<String>();
/**
* Page-book page for the breadcrumb viewer. This page is activated in
@@ -270,21 +270,25 @@ public class LaunchView extends AbstractDebugView
LaunchViewBreadcrumb fCrumb;
Control fControl;
- public void createControl(Composite parent) {
+ @Override
+ public void createControl(Composite parent) {
fCrumb = new LaunchViewBreadcrumb(LaunchView.this, (TreeModelViewer)getViewer(), fTreeViewerDebugContextProvider);
fControl = fCrumb.createContent(parent);
}
- public void init(IPageSite pageSite) {
+ @Override
+ public void init(IPageSite pageSite) {
super.init(pageSite);
pageSite.setSelectionProvider(fCrumb.getSelectionProvider());
}
- public Control getControl() {
+ @Override
+ public Control getControl() {
return fControl;
}
- public void setFocus() {
+ @Override
+ public void setFocus() {
fCrumb.activate();
}
@@ -296,7 +300,8 @@ public class LaunchView extends AbstractDebugView
return fCrumb.getHeight();
}
- public void dispose() {
+ @Override
+ public void dispose() {
fCrumb.dispose();
}
}
@@ -310,6 +315,7 @@ public class LaunchView extends AbstractDebugView
private Visitor fVisitor = new Visitor();
class Visitor implements IModelDeltaVisitor {
+ @Override
public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & (IModelDelta.STATE | IModelDelta.CONTENT)) > 0) {
// state and/or content change
@@ -336,7 +342,7 @@ public class LaunchView extends AbstractDebugView
* @return corresponding tree path
*/
private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
+ ArrayList<Object> list = new ArrayList<Object>();
IModelDelta parentDelta = node.getParentDelta();
while (parentDelta != null) {
list.add(0, node.getElement());
@@ -360,6 +366,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.ui.contexts.IDebugContextProvider#getActiveContext()
*/
+ @Override
public synchronized ISelection getActiveContext() {
return fContext;
}
@@ -398,6 +405,7 @@ public class LaunchView extends AbstractDebugView
} else {
final DebugContextEvent finalEvent = event;
Job job = new UIJob("context change") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
// verify selection is still the same context since job was scheduled
synchronized (TreeViewerContextProvider.this) {
@@ -421,6 +429,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IModelChangedListener#modelChanged(org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta)
*/
+ @Override
public void modelChanged(IModelDelta delta, IModelProxy proxy) {
delta.accept(fVisitor);
}
@@ -464,7 +473,8 @@ public class LaunchView extends AbstractDebugView
private PageRec fDefaultPageRec = null;
private ISelectionChangedListener fTreeViewerSelectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
fTreeViewerDebugContextProvider.activate(event.getSelection());
}
};
@@ -493,7 +503,8 @@ public class LaunchView extends AbstractDebugView
}
}
- public ISelection getActiveContext() {
+ @Override
+ public ISelection getActiveContext() {
ISelection activeContext = fActiveProvider.getActiveContext();
if (activeContext != null) {
return activeContext;
@@ -501,7 +512,8 @@ public class LaunchView extends AbstractDebugView
return TreeSelection.EMPTY;
}
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
if (event.getSource().equals(fActiveProvider)) {
fire(new DebugContextEvent(this, event.getContext(), event.getFlags()));
}
@@ -521,6 +533,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.DEBUG_VIEW;
}
@@ -528,6 +541,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createActions()
*/
+ @Override
protected void createActions() {
setAction("Properties", new PropertyDialogAction(getSite(), getSite().getSelectionProvider())); //$NON-NLS-1$
fEditConfigAction = new EditLaunchConfigurationAction();
@@ -572,7 +586,7 @@ public class LaunchView extends AbstractDebugView
* @return handler or <code>null</code>
*/
public IHandler2 getHandler(String id) {
- return (IHandler2) fHandlers.get(id);
+ return fHandlers.get(id);
}
/**
@@ -602,6 +616,7 @@ public class LaunchView extends AbstractDebugView
* @since 3.5
* @see #fDefaultPageRec
*/
+ @Override
public void createPartControl(final Composite parent) {
super.createPartControl(parent);
@@ -637,9 +652,11 @@ public class LaunchView extends AbstractDebugView
// Add a resize listener for the view to activate breadcrumb as needed.
parent.addControlListener(new ControlListener() {
- public void controlMoved(ControlEvent e) {
+ @Override
+ public void controlMoved(ControlEvent e) {
}
- public void controlResized(ControlEvent e) {
+ @Override
+ public void controlResized(ControlEvent e) {
if (parent.isDisposed()) {
return;
}
@@ -677,6 +694,7 @@ public class LaunchView extends AbstractDebugView
* @since 3.5
* @see #fDefaultPageRec
*/
+ @Override
protected PageRec doCreatePage(IWorkbenchPart part) {
if (part instanceof BreadcrumbWorkbenchPart) {
fBreadcrumbPage = new BreadcrumbPage();
@@ -694,6 +712,7 @@ public class LaunchView extends AbstractDebugView
* @since 3.5
* @see #fDefaultPageRec
*/
+ @Override
protected boolean isImportant(IWorkbenchPart part) {
return part instanceof BreadcrumbWorkbenchPart;
}
@@ -705,6 +724,7 @@ public class LaunchView extends AbstractDebugView
* @since 3.5
* @see #fDefaultPageRec
*/
+ @Override
protected void showPageRec(PageRec pageRec) {
if (pageRec.page == getDefaultPage()) {
fDefaultPageRec = pageRec;
@@ -740,7 +760,8 @@ public class LaunchView extends AbstractDebugView
viewMenu.add(modeSubmenu);
modeSubmenu.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
+ @Override
+ public void menuAboutToShow(IMenuManager manager) {
modeSubmenu.add(fDebugViewModeActions[0]);
modeSubmenu.add(fDebugViewModeActions[1]);
modeSubmenu.add(fDebugViewModeActions[2]);
@@ -855,6 +876,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createViewer(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Viewer createViewer(Composite parent) {
fPresentation = new DelegatingModelPresentation();
fPresentationContext = new DebugModelPresentationContext(IDebugUIConstants.ID_DEBUG_VIEW, this, fPresentation);
@@ -918,6 +940,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite)
*/
+ @Override
public void init(IViewSite site) throws PartInitException {
super.init(site);
commonInit(site);
@@ -928,6 +951,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
*/
+ @Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
commonInit(site);
@@ -938,7 +962,8 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart)
*/
- public void partDeactivated(IWorkbenchPart part) {
+ @Override
+ public void partDeactivated(IWorkbenchPart part) {
String id = part.getSite().getId();
if (id.equals(getSite().getId())) {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@@ -963,7 +988,7 @@ public class LaunchView extends AbstractDebugView
}
StringBuffer buffer= new StringBuffer();
- for (Iterator itr = fDebugToolbarPerspectives.iterator(); itr.hasNext();) {
+ for (Iterator<String> itr = fDebugToolbarPerspectives.iterator(); itr.hasNext();) {
buffer.append(itr.next()).append(',');
}
getPreferenceStore().setValue(IDebugPreferenceConstants.DEBUG_VIEW_TOOLBAR_HIDDEN_PERSPECTIVES, buffer.toString());
@@ -982,6 +1007,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
tbm.add(new Separator(IDebugUIConstants.THREAD_GROUP));
tbm.add(new Separator(IDebugUIConstants.STEP_GROUP));
@@ -1072,6 +1098,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
fContextService.removeContextManagerListener(this);
getSite().getSelectionProvider().removeSelectionChangedListener(this);
@@ -1093,10 +1120,8 @@ public class LaunchView extends AbstractDebugView
IWorkbenchWindow window = getSite().getWorkbenchWindow();
window.removePerspectiveListener(this);
window.removePageListener(this);
- Iterator iterator = fHandlers.values().iterator();
- while (iterator.hasNext()) {
- IHandler2 hander = (IHandler2) iterator.next();
- hander.dispose();
+ for (IHandler2 handler : fHandlers.values()) {
+ handler.dispose();
}
fHandlers.clear();
super.dispose();
@@ -1127,6 +1152,7 @@ public class LaunchView extends AbstractDebugView
*
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
updateObjects();
}
@@ -1134,6 +1160,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
*/
+ @Override
public void doubleClick(DoubleClickEvent event) {
ISelection selection= event.getSelection();
if (!(selection instanceof IStructuredSelection)) {
@@ -1151,6 +1178,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
setActive(page.findView(getSite().getId()) != null);
updateObjects();
@@ -1161,6 +1189,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
*/
+ @Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
setActive(page.findView(getSite().getId()) != null);
}
@@ -1168,12 +1197,14 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener2#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, org.eclipse.ui.IWorkbenchPartReference, java.lang.String)
*/
+ @Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage)
*/
+ @Override
public void pageActivated(IWorkbenchPage page) {
if (getSite().getPage().equals(page)) {
setActive(true);
@@ -1184,18 +1215,21 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage)
*/
+ @Override
public void pageClosed(IWorkbenchPage page) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage)
*/
+ @Override
public void pageOpened(IWorkbenchPage page) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugView#getPresentation(java.lang.String)
*/
+ @Override
public IDebugModelPresentation getPresentation(String id) {
return ((DelegatingModelPresentation)fPresentation).getPresentation(id);
}
@@ -1203,6 +1237,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
+ @Override
protected void fillContextMenu(IMenuManager menu) {
TreeSelection sel = (TreeSelection) fTreeViewerDebugContextProvider.getActiveContext();
Object element = sel != null && sel.size() > 0 ? sel.getFirstElement() : null;
@@ -1257,10 +1292,11 @@ public class LaunchView extends AbstractDebugView
menu.appendToGroup(IDebugUIConstants.RENDER_GROUP, getAction(TOGGLE_STEP_FILTERS));
}
+ @Override
public void contextManagerChanged(ContextManagerEvent event) {
if (event.isActiveContextsChanged()) {
- Set oldContexts = event.getPreviouslyActiveContextIds();
- Set newContexts = event.getContextManager().getActiveContextIds();
+ Set<?> oldContexts = event.getPreviouslyActiveContextIds();
+ Set<?> newContexts = event.getContextManager().getActiveContextIds();
if (oldContexts.contains(IDebugUIConstants.DEBUG_TOOLBAR_ACTION_SET) !=
newContexts.contains(IDebugUIConstants.DEBUG_TOOLBAR_ACTION_SET))
{
@@ -1315,6 +1351,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.part.IShowInTarget#show(org.eclipse.ui.part.ShowInContext)
*/
+ @Override
public boolean show(ShowInContext context) {
ISelection selection = context.getSelection();
if (selection != null) {
@@ -1341,6 +1378,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.part.IShowInSource#getShowInContext()
*/
+ @Override
public ShowInContext getShowInContext() {
if (isActive()) {
IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
@@ -1361,6 +1399,7 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.part.IShowInTargetList#getShowInTargetIds()
*/
+ @Override
public String[] getShowInTargetIds() {
if (isActive()) {
IStructuredSelection selection = (IStructuredSelection)getViewer().getSelection();
@@ -1381,12 +1420,14 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partClosed(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partVisible(IWorkbenchPartReference partRef) {
IWorkbenchPart part = partRef.getPart(false);
if (part == this) {
@@ -1405,12 +1446,14 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partOpened(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partActivated(IWorkbenchPartReference partRef) {
// Ensure that the system property matches the debug toolbar state.
// Bug 385400
@@ -1421,30 +1464,35 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partDeactivated(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partHidden(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partInputChanged(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
*/
+ @Override
protected void becomesVisible() {
super.becomesVisible();
getViewer().refresh();
@@ -1453,7 +1501,8 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
*/
- public void updateComplete(IViewerUpdate update) {
+ @Override
+ public void updateComplete(IViewerUpdate update) {
if (!update.isCanceled()) {
if (TreePath.EMPTY.equals(update.getElementPath())) {
updateFindAction();
@@ -1465,13 +1514,15 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
*/
- public void updateStarted(IViewerUpdate update) {
+ @Override
+ public void updateStarted(IViewerUpdate update) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesBegin()
*/
- public synchronized void viewerUpdatesBegin() {
+ @Override
+ public synchronized void viewerUpdatesBegin() {
IWorkbenchSiteProgressService progressService =
(IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
if (progressService != null) {
@@ -1482,7 +1533,8 @@ public class LaunchView extends AbstractDebugView
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesComplete()
*/
- public synchronized void viewerUpdatesComplete() {
+ @Override
+ public synchronized void viewerUpdatesComplete() {
IWorkbenchSiteProgressService progressService =
(IWorkbenchSiteProgressService)getSite().getAdapter(IWorkbenchSiteProgressService.class);
if (progressService != null) {
@@ -1490,7 +1542,8 @@ public class LaunchView extends AbstractDebugView
}
}
- public void modelChanged(IModelDelta delta, IModelProxy proxy) {
+ @Override
+ public void modelChanged(IModelDelta delta, IModelProxy proxy) {
updateFindAction();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
index 3636de650..6bb242385 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewBreadcrumb.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation = bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.launch;
@@ -69,13 +70,15 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fPath = path;
}
- public boolean equals(Object obj) {
+ @Override
+ public boolean equals(Object obj) {
return obj instanceof Input &&
((fPath == null && ((Input)obj).fPath == null) ||
(fPath != null && fPath.equals( ((Input)obj).fPath )));
}
- public int hashCode() {
+ @Override
+ public int hashCode() {
return fPath == null ? 0 : fPath.hashCode();
}
}
@@ -86,19 +89,22 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
public Input fInput;
- public Object[] getChildren(TreePath parentPath) {
+ @Override
+ public Object[] getChildren(TreePath parentPath) {
if (hasChildren(parentPath)) {
return new Object[] { fInput.fPath.getSegment(parentPath.getSegmentCount()) };
}
return EMPTY_ELEMENTS_ARRAY;
}
- public TreePath[] getParents(Object element) {
+ @Override
+ public TreePath[] getParents(Object element) {
// Not supported
return new TreePath[] { TreePath.EMPTY };
}
- public boolean hasChildren(TreePath parentPath) {
+ @Override
+ public boolean hasChildren(TreePath parentPath) {
if ( parentPath.getSegmentCount() == 0) {
return fInput != null;
} else if (fInput != null &&
@@ -121,7 +127,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
return false;
}
- public Object[] getElements(Object inputElement) {
+ @Override
+ public Object[] getElements(Object inputElement) {
if (fInput != null &&
fInput.fPath != null)
{
@@ -131,11 +138,13 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
}
- public void dispose() {
+ @Override
+ public void dispose() {
fInput = null;
}
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput instanceof Input) {
fInput = ((Input)newInput);
} else {
@@ -145,7 +154,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
private class LabelProvider extends BaseLabelProvider implements ITreePathLabelProvider {
- public void updateLabel(ViewerLabel label, TreePath elementPath) {
+ @Override
+ public void updateLabel(ViewerLabel label, TreePath elementPath) {
if (fgEmptyDebugContextElement.equals(elementPath.getLastSegment())) {
label.setText(LaunchViewMessages.Breadcrumb_NoActiveContext);
label.setImage(null);
@@ -186,7 +196,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fTreeViewerContextProvider.addDebugContextListener(this);
}
- public ISelection getActiveContext() {
+ @Override
+ public ISelection getActiveContext() {
if (fBreadcrumbSelection != null && !fBreadcrumbSelection.isEmpty()) {
return fBreadcrumbSelection;
} else {
@@ -200,11 +211,13 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fTreeViewerContextProvider.removeDebugContextListener(this);
}
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
fire(new DebugContextEvent(this, getActiveContext(), event.getFlags()));
}
- public void selectionChanged(SelectionChangedEvent event) {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
ISelection oldContext = getActiveContext();
fBreadcrumbSelection = event.getSelection();
if (!getActiveContext().equals(oldContext)) {
@@ -224,10 +237,12 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fTreeViewerContextProvider.addDebugContextListener(this);
}
- protected void activateBreadcrumb() {
+ @Override
+ protected void activateBreadcrumb() {
}
- protected void deactivateBreadcrumb() {
+ @Override
+ protected void deactivateBreadcrumb() {
if (fViewer.isDropDownOpen()) {
Shell shell = fViewer.getDropDownShell();
if (shell != null && !shell.isDisposed()) {
@@ -236,9 +251,11 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
}
- protected BreadcrumbViewer createViewer(Composite parent) {
+ @Override
+ protected BreadcrumbViewer createViewer(Composite parent) {
fViewer = new BreadcrumbViewer(parent, SWT.NONE) {
- protected Control createDropDown(Composite dropDownParent, IBreadcrumbDropDownSite site, TreePath path) {
+ @Override
+ protected Control createDropDown(Composite dropDownParent, IBreadcrumbDropDownSite site, TreePath path) {
return createDropDownControl(dropDownParent, site, path);
}
};
@@ -263,7 +280,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
MenuManager menuMgr = new MenuManager("#PopUp"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
+ @Override
+ public void menuAboutToShow(IMenuManager mgr) {
fView.fillContextMenu(mgr);
}
});
@@ -276,27 +294,32 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fView.addContextMenuManager(menuMgr);
fViewer.addMenuDetectListener(new MenuDetectListener() {
- public void menuDetected(MenuDetectEvent event) {
+ @Override
+ public void menuDetected(MenuDetectEvent event) {
menu.setLocation(event.x + 10, event.y + 10);
menu.setVisible(true);
while (!menu.isDisposed() && menu.isVisible()) {
- if (!menu.getDisplay().readAndDispatch())
- menu.getDisplay().sleep();
+ if (!menu.getDisplay().readAndDispatch()) {
+ menu.getDisplay().sleep();
+ }
}
}
});
}
- protected Object getCurrentInput() {
+ @Override
+ protected Object getCurrentInput() {
return fBreadcrumbInput;
}
- protected boolean open(ISelection selection) {
+ @Override
+ protected boolean open(ISelection selection) {
// Let the drop-down control implementation itself handle activating a new context.
return false;
}
- public void dispose() {
+ @Override
+ public void dispose() {
fBreadcrumbContextProvider = null;
fTreeViewerContextProvider.removeDebugContextListener(this);
fTreeViewer.removeLabelUpdateListener(this);
@@ -305,7 +328,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
super.dispose();
}
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
if (fView.isBreadcrumbVisible()) {
fBreadcrumbInput = new Input(getPathForSelection(event.getContext()));
if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) {
@@ -321,10 +345,12 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
}
- public void labelUpdateStarted(ILabelUpdate update) {
+ @Override
+ public void labelUpdateStarted(ILabelUpdate update) {
}
- public void labelUpdateComplete(ILabelUpdate update) {
+ @Override
+ public void labelUpdateComplete(ILabelUpdate update) {
if (fBreadcrumbInput != null && fBreadcrumbInput.fPath != null) {
if (fBreadcrumbInput.fPath.startsWith(update.getElementPath(), null)) {
synchronized (this) {
@@ -334,10 +360,12 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
}
- public void labelUpdatesBegin() {
+ @Override
+ public void labelUpdatesBegin() {
}
- public void labelUpdatesComplete() {
+ @Override
+ public void labelUpdatesComplete() {
boolean refresh = false;
synchronized(this) {
refresh = fRefreshBreadcrumb;
@@ -346,7 +374,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
if (fView.isBreadcrumbVisible() && refresh) {
new UIJob(fViewer.getControl().getDisplay(), "refresh breadcrumb") { //$NON-NLS-1$
{ setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
refresh();
return Status.OK_STATUS;
}
@@ -379,7 +408,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
SubTreeModelViewer fDropDownViewer;
- protected TreeViewer createTreeViewer(Composite composite, int style, final TreePath path) {
+ @Override
+ protected TreeViewer createTreeViewer(Composite composite, int style, final TreePath path) {
fDropDownViewer = new SubTreeModelViewer(
composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.VIRTUAL | SWT.POP_UP,
fTreeViewer.getPresentationContext());
@@ -400,7 +430,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
final ModelDelta prunedDelta = new ModelDelta(launchViewInput, IModelDelta.NO_CHANGE);
stateDelta.accept(new IModelDeltaVisitor() {
ModelDelta copy = prunedDelta;
- public boolean visit(IModelDelta delta, int depth) {
+ @Override
+ public boolean visit(IModelDelta delta, int depth) {
TreePath deltaPath = getViewerTreePath(delta);
if (deltaPath.getSegmentCount() == 0) {
// skip copying the root element, only copy it's child count
@@ -423,7 +454,7 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
}
private TreePath getViewerTreePath(IModelDelta node) {
- ArrayList list = new ArrayList();
+ ArrayList<Object> list = new ArrayList<Object>();
IModelDelta parentDelta = node.getParentDelta();
while (parentDelta != null) {
list.add(0, node.getElement());
@@ -439,13 +470,18 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
fDropDownViewer.updateViewer(stateDelta);
fDropDownViewer.addLabelUpdateListener(new ILabelUpdateListener() {
- public void labelUpdateComplete(ILabelUpdate update) {}
- public void labelUpdatesBegin() {}
- public void labelUpdateStarted(ILabelUpdate update) {}
- public void labelUpdatesComplete() {
+ @Override
+ public void labelUpdateComplete(ILabelUpdate update) {}
+ @Override
+ public void labelUpdatesBegin() {}
+ @Override
+ public void labelUpdateStarted(ILabelUpdate update) {}
+ @Override
+ public void labelUpdatesComplete() {
new UIJob(fViewer.getControl().getDisplay(), "resize breadcrub dropdown") { //$NON-NLS-1$
{ setSystem(true); }
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
site.updateSize();
return Status.OK_STATUS;
}
@@ -456,7 +492,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
return fDropDownViewer;
}
- protected void openElement(ISelection selection) {
+ @Override
+ protected void openElement(ISelection selection) {
if (fTreeViewer.getControl().isDisposed()) {
return;
}
@@ -488,7 +525,8 @@ public class LaunchViewBreadcrumb extends AbstractBreadcrumb implements IDebugCo
// Add the IModelDelta.FORCE flag to override the current selection in view.
rootDelta.accept(new IModelDeltaVisitor(){
- public boolean visit(IModelDelta paramDelta, int depth) {
+ @Override
+ public boolean visit(IModelDelta paramDelta, int depth) {
if ((paramDelta.getFlags() & IModelDelta.SELECT) != 0) {
((ModelDelta)paramDelta).setFlags(paramDelta.getFlags() | IModelDelta.FORCE);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
index dbed5e238..cffa5ecb0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchViewCopyToClipboardActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Wind River Systems and others.
+ * Copyright (c) 2009, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation = bug fixing
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.launch;
@@ -36,7 +37,8 @@ import org.eclipse.swt.widgets.Widget;
*/
public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipboardActionDelegate {
- protected TreeItem[] getSelectedItems(TreeModelViewer clientViewer) {
+ @Override
+ protected TreeItem[] getSelectedItems(TreeModelViewer clientViewer) {
LaunchView view = (LaunchView)getView();
if (view.isBreadcrumbVisible()) {
ISelection selection = getSelection();
@@ -51,9 +53,9 @@ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipbo
} else {
// Return tree selection plus children.
TreeItem[] selection = clientViewer.getTree().getSelection();
- Set set = new HashSet();
+ Set<Widget> set = new HashSet<Widget>();
collectChildItems(set, selection);
- return (TreeItem[])set.toArray(new TreeItem[set.size()]);
+ return set.toArray(new TreeItem[set.size()]);
}
}
@@ -66,7 +68,7 @@ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipbo
*/
private TreeItem[] getSelectedItemsInTreeViewer(TreeModelViewer viewer, TreePath path) {
Widget item = viewer.findItem(path);
- Set set = new HashSet();
+ Set<Widget> set = new HashSet<Widget>();
if (item instanceof TreeItem) {
set.add(item);
if (((TreeItem) item).getExpanded()) {
@@ -75,10 +77,10 @@ public class LaunchViewCopyToClipboardActionDelegate extends VirtualCopyToClipbo
} else if (item instanceof Tree) {
collectChildItems(set, ((Tree)item).getItems());
}
- return (TreeItem[])set.toArray(new TreeItem[set.size()]);
+ return set.toArray(new TreeItem[set.size()]);
}
- private void collectChildItems(Set set, TreeItem[] items) {
+ private void collectChildItems(Set<Widget> set, TreeItem[] items) {
if (items == null) {
return;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java
index 78f007d56..06b9c4dea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditor.java
@@ -36,18 +36,21 @@ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor
/**
* @see org.eclipse.ui.IEditorPart#doSave(IProgressMonitor)
*/
+ @Override
public void doSave(IProgressMonitor monitor) {
}
/**
* @see org.eclipse.ui.IEditorPart#doSaveAs()
*/
+ @Override
public void doSaveAs() {
}
/**
* @see org.eclipse.ui.IEditorPart#init(IEditorSite, IEditorInput)
*/
+ @Override
public void init(IEditorSite site, IEditorInput input) {
setSite(site);
setInput(input);
@@ -56,6 +59,7 @@ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor
/**
* @see org.eclipse.ui.IEditorPart#isDirty()
*/
+ @Override
public boolean isDirty() {
return false;
}
@@ -63,6 +67,7 @@ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor
/**
* @see org.eclipse.ui.IEditorPart#isSaveAsAllowed()
*/
+ @Override
public boolean isSaveAsAllowed() {
return false;
}
@@ -70,6 +75,7 @@ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor
/**
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
fText = new Text(parent,SWT.MULTI|SWT.READ_ONLY|SWT.WRAP);
fText.setForeground(JFaceColors.getErrorText(fText.getDisplay()));
@@ -82,6 +88,7 @@ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor
/**
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
if (fText != null) {
fText.setFocus();
@@ -91,6 +98,7 @@ public class SourceNotFoundEditor extends EditorPart implements IReusableEditor
/**
* @see IReusableEditor#setInput(org.eclipse.ui.IEditorInput)
*/
+ @Override
public void setInput(IEditorInput input) {
super.setInput(input);
setPartName(input.getName());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
index daa0f90ef..6d94c489a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/SourceNotFoundEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,8 +11,6 @@
package org.eclipse.debug.internal.ui.views.launch;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IStackFrame;
@@ -23,6 +21,8 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Editor input for a stack frame for which source could not be located.
*
@@ -56,6 +56,7 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor
/**
* @see org.eclipse.ui.IEditorInput#exists()
*/
+ @Override
public boolean exists() {
return false;
}
@@ -63,6 +64,7 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor
/**
* @see org.eclipse.ui.IEditorInput#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getDefaultImageDescriptor(fFrame);
}
@@ -70,6 +72,7 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor
/**
* @see org.eclipse.ui.IEditorInput#getName()
*/
+ @Override
public String getName() {
try {
return fFrame.getName();
@@ -81,6 +84,7 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor
/**
* @see org.eclipse.ui.IEditorInput#getPersistable()
*/
+ @Override
public IPersistableElement getPersistable() {
return null;
}
@@ -88,8 +92,9 @@ public class SourceNotFoundEditorInput extends PlatformObject implements IEditor
/**
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
+ @Override
public String getToolTipText() {
- return MessageFormat.format(DebugUIViewsMessages.SourceNotFoundEditorInput_Source_not_found_for__0__2,new String[] {fFrameText});
+ return MessageFormat.format(DebugUIViewsMessages.SourceNotFoundEditorInput_Source_not_found_for__0__2, new Object[] { fFrameText });
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
index ea33cf20d..639f708ef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/StandardDecoration.java
@@ -32,6 +32,7 @@ public class StandardDecoration extends Decoration {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.launch.Decoration#remove()
*/
+ @Override
public void remove() {
fPresentation.removeAnnotations(fEditor, fThread);
}
@@ -39,6 +40,7 @@ public class StandardDecoration extends Decoration {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.launch.Decoration#getThread()
*/
+ @Override
public IThread getThread() {
return fThread;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
index ab2747bb7..09164c325 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AbstractMemoryViewPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2011 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
-
import java.util.Enumeration;
import java.util.Hashtable;
@@ -44,43 +43,43 @@ import org.eclipse.ui.ISelectionListener;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPart;
-public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, ISelectionListener, SelectionListener, IMemoryView, ISelectionChangedListener, IMemoryViewPane, IDebugContextListener, IDebugEventSetListener{
-
+public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, ISelectionListener, SelectionListener, IMemoryView, ISelectionChangedListener, IMemoryViewPane, IDebugContextListener, IDebugEventSetListener {
+
public static final String BEGINNING_POPUP = "popUpBegin"; //$NON-NLS-1$
protected static final StructuredSelection EMPTY = new StructuredSelection();
-
+
protected Composite fViewPaneCanvas;
protected StackLayout fStackLayout;
protected ViewTabEnablementManager fViewTabEnablementManager;
protected CTabFolder fEmptyTabFolder;
- protected Hashtable fTabFolderForDebugView = new Hashtable();
+ protected Hashtable<Integer, CTabFolder> fTabFolderForDebugView = new Hashtable<Integer, CTabFolder>();
protected boolean fVisible;
- protected Hashtable fRenderingInfoTable;
- protected IMemoryBlockRetrieval fKey; // store the key for current tab folder
+ protected IMemoryBlockRetrieval fKey; // store the key for current tab
+ // folder
protected ViewPaneSelectionProvider fSelectionProvider;
protected IViewPart fParent;
protected String fPaneId;
private Composite fCanvas;
protected String fLabel;
-
+
private volatile boolean fIsDisposed = false;
- public AbstractMemoryViewPane(IViewPart parent)
- {
+ public AbstractMemoryViewPane(IViewPart parent) {
super();
fParent = parent;
fSelectionProvider = new ViewPaneSelectionProvider();
}
-
+
/**
* Create the content of the view pane
+ *
* @param parent the parent composite
* @param paneId the id of the pane to create
* @param label the label for the new pane
* @return the control of the view pane
*/
- public Control createViewPane(Composite parent, String paneId, String label)
- {
+ @Override
+ public Control createViewPane(Composite parent, String paneId, String label) {
fPaneId = paneId;
fLabel = label;
fCanvas = new Composite(parent, SWT.NONE);
@@ -99,7 +98,7 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
// memory view area
Composite memoryViewAreaParent = fCanvas;
- Composite subCanvas = new Composite(memoryViewAreaParent, SWT.NONE);
+ Composite subCanvas = new Composite(memoryViewAreaParent, SWT.NONE);
fViewPaneCanvas = subCanvas;
fStackLayout = new StackLayout();
GridData memoryAreaData = new GridData();
@@ -109,196 +108,180 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
memoryAreaData.horizontalAlignment = SWT.FILL;
fViewPaneCanvas.setLayout(fStackLayout);
fViewPaneCanvas.setLayoutData(memoryAreaData);
-
+
fViewTabEnablementManager = new ViewTabEnablementManager();
-
+
fEmptyTabFolder = new CTabFolder(fViewPaneCanvas, SWT.NULL);
setTabFolder(fEmptyTabFolder);
-
+
addListeners();
-
+
Object context = DebugUITools.getPartDebugContext(fParent.getSite());
- if (context != null)
- {
+ if (context != null) {
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null)
+ if (retrieval != null) {
createFolder(retrieval);
+ }
}
-
+
fVisible = true;
-
+
return fCanvas;
}
-
- protected void addListeners()
- {
+
+ protected void addListeners() {
MemoryViewUtil.getMemoryBlockManager().addListener(this);
fParent.getViewSite().getPage().addSelectionListener(this);
DebugUITools.addPartDebugContextListener(fParent.getSite(), this);
DebugPlugin.getDefault().addDebugEventListener(this);
}
-
- protected void removeListeners()
- {
+
+ protected void removeListeners() {
MemoryViewUtil.getMemoryBlockManager().removeListener(this);
fParent.getViewSite().getPage().removeSelectionListener(this);
- DebugUITools.removePartDebugContextListener(fParent.getSite(), this);
- if (fStackLayout.topControl != null)
- {
- CTabFolder old = (CTabFolder)fStackLayout.topControl;
-
- if (!old.isDisposed())
- {
+ DebugUITools.removePartDebugContextListener(fParent.getSite(), this);
+ if (fStackLayout.topControl != null) {
+ CTabFolder old = (CTabFolder) fStackLayout.topControl;
+
+ if (!old.isDisposed()) {
old.removeSelectionListener(this);
old.removeSelectionListener(fViewTabEnablementManager);
}
}
DebugPlugin.getDefault().removeDebugEventListener(this);
}
-
- protected void setTabFolder(CTabFolder folder)
- {
- if (fStackLayout.topControl != null)
- {
- CTabFolder old = (CTabFolder)fStackLayout.topControl;
-
- if (!old.isDisposed())
- {
+
+ protected void setTabFolder(CTabFolder folder) {
+ if (fStackLayout.topControl != null) {
+ CTabFolder old = (CTabFolder) fStackLayout.topControl;
+
+ if (!old.isDisposed()) {
old.removeSelectionListener(this);
old.removeSelectionListener(fViewTabEnablementManager);
}
}
-
+
fStackLayout.topControl = folder;
-
- if (folder.getItemCount() > 0)
- {
+
+ if (folder.getItemCount() > 0) {
CTabItem selectedItem = folder.getSelection();
-
- if (selectedItem != null)
- {
+
+ if (selectedItem != null) {
Object selected = getCurrentSelection();
- if (selected != null)
- {
+ if (selected != null) {
fSelectionProvider.setSelection(new StructuredSelection(selected));
- }
- else
- {
+ } else {
fSelectionProvider.setSelection(AbstractMemoryViewPane.EMPTY);
}
}
- }
- else
- {
+ } else {
fSelectionProvider.setSelection(AbstractMemoryViewPane.EMPTY);
}
-
+
folder.addSelectionListener(this);
folder.addSelectionListener(fViewTabEnablementManager);
- }
-
-
- private void createFolder(IMemoryBlockRetrieval memRetrieval)
- {
- //if we've got a tabfolder to go with the IMemoryBlockRetrieval, display it
+ }
+
+ private void createFolder(IMemoryBlockRetrieval memRetrieval) {
+ // if we've got a tabfolder to go with the IMemoryBlockRetrieval,
+ // display it
Integer key = MemoryViewUtil.getHashCode(memRetrieval);
if (fTabFolderForDebugView.containsKey(key)) {
- if (fStackLayout.topControl != (CTabFolder)fTabFolderForDebugView.get(key)) {
- setTabFolder((CTabFolder)fTabFolderForDebugView.get(key));
+ if (fStackLayout.topControl != fTabFolderForDebugView.get(key)) {
+ setTabFolder(fTabFolderForDebugView.get(key));
fViewPaneCanvas.layout();
}
- } else { //otherwise, add a new one
+ } else { // otherwise, add a new one
fTabFolderForDebugView.put(key, new CTabFolder(fViewPaneCanvas, SWT.NULL));
- setTabFolder((CTabFolder)fTabFolderForDebugView.get(key));
+ setTabFolder(fTabFolderForDebugView.get(key));
fViewPaneCanvas.layout();
}
}
+ @Override
public IMemoryViewTab getTopMemoryTab() {
-
- if (fStackLayout.topControl instanceof CTabFolder)
- {
- CTabFolder folder = (CTabFolder)fStackLayout.topControl;
- if (!folder.isDisposed())
- {
+
+ if (fStackLayout.topControl instanceof CTabFolder) {
+ CTabFolder folder = (CTabFolder) fStackLayout.topControl;
+ if (!folder.isDisposed()) {
int index = folder.getSelectionIndex();
if (index >= 0) {
CTabItem tab = folder.getItem(index);
- return (IMemoryViewTab)tab.getData();
+ return (IMemoryViewTab) tab.getData();
}
}
}
return null;
}
-
- protected void disposeTab(CTabItem tabItem)
- {
- if (tabItem == null)
+
+ protected void disposeTab(CTabItem tabItem) {
+ if (tabItem == null) {
return;
-
- // dispose the tab item in case the view tab has not
+ }
+
+ // dispose the tab item in case the view tab has not
// cleaned up the tab item
- if (!tabItem.isDisposed())
- {
+ if (!tabItem.isDisposed()) {
tabItem.dispose();
- }
+ }
}
- protected void emptyFolder()
- {
+ protected void emptyFolder() {
setTabFolder(fEmptyTabFolder);
if (!fViewPaneCanvas.isDisposed()) {
fViewPaneCanvas.layout();
}
}
-
- public void addSelectionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
+
+ @Override
+ public void addSelectionListener(ISelectionChangedListener listener) {
+ if (fSelectionProvider == null) {
fSelectionProvider = new ViewPaneSelectionProvider();
-
+ }
+
fSelectionProvider.addSelectionChangedListener(listener);
}
-
- public void removeSelctionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
+
+ @Override
+ public void removeSelctionListener(ISelectionChangedListener listener) {
+ if (fSelectionProvider == null) {
return;
-
+ }
+
fSelectionProvider.removeSelectionChangedListener(listener);
}
-
- public ISelectionProvider getSelectionProvider()
- {
+
+ @Override
+ public ISelectionProvider getSelectionProvider() {
return fSelectionProvider;
}
- public void handleDebugEvents(DebugEvent[] events)
- {
- for (int i = 0; i < events.length; i++)
- {
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
+ for (int i = 0; i < events.length; i++) {
Object source = events[i].getSource();
- if (events[i].getKind() == DebugEvent.TERMINATE && source instanceof IMemoryBlockRetrieval)
- {
- if (isDisposed())
+ if (events[i].getKind() == DebugEvent.TERMINATE && source instanceof IMemoryBlockRetrieval) {
+ if (isDisposed()) {
return;
+ }
- //When a memory block retrieval terminates, it and its
- //tab folders should be removed from our map.
- final IMemoryBlockRetrieval ret = (IMemoryBlockRetrieval)source;
- if (ret != null)
- {
+ // When a memory block retrieval terminates, it and its
+ // tab folders should be removed from our map.
+ final IMemoryBlockRetrieval ret = (IMemoryBlockRetrieval) source;
+ if (ret != null) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
- if (isDisposed())
+ if (isDisposed()) {
return;
+ }
Integer key = MemoryViewUtil.getHashCode(ret);
Object folder = fTabFolderForDebugView.get(key);
- if (folder != null && folder != fEmptyTabFolder)
- {
- //remove the tab folder , and all contained tab items
+ if (folder != null && folder != fEmptyTabFolder) {
+ // remove the tab folder , and all contained tab
+ // items
disposeOfFolder((CTabFolder) folder);
fTabFolderForDebugView.remove(key);
}
@@ -309,53 +292,48 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
}
}
-
-
- public void dispose()
- {
- if (isDisposed())
+ @Override
+ public void dispose() {
+ if (isDisposed()) {
return;
+ }
fIsDisposed = true;
removeListeners();
-
+
// dispose empty folders
fEmptyTabFolder.dispose();
-
+
// dispose all other folders
try {
- Enumeration enumeration = fTabFolderForDebugView.elements();
+ Enumeration<CTabFolder> enumeration = fTabFolderForDebugView.elements();
- while (enumeration.hasMoreElements())
- {
- CTabFolder tabFolder = (CTabFolder)enumeration.nextElement();
+ while (enumeration.hasMoreElements()) {
+ CTabFolder tabFolder = enumeration.nextElement();
disposeOfFolder(tabFolder);
}
// Clear the table as all CTabFolder's have been dipose()d
fTabFolderForDebugView.clear();
- } catch (Exception e) {
-
+ } catch (Exception e) {
+
DebugUIPlugin.logErrorMessage("Exception occurred when the Memory View is disposed."); //$NON-NLS-1$
- }
+ }
}
/**
- * Helper method to dispose of a tab folder,
- * and of any tab items it contains.
- * Must be called from the UI thread.
+ * Helper method to dispose of a tab folder, and of any tab items it
+ * contains. Must be called from the UI thread.
+ *
* @param tabFolder the {@link CTabFolder} to dispose
* */
- private void disposeOfFolder(CTabFolder tabFolder)
- {
- if (!tabFolder.isDisposed())
- {
+ private void disposeOfFolder(CTabFolder tabFolder) {
+ if (!tabFolder.isDisposed()) {
// if tab folder is not empty, dipose view tabs
CTabItem[] tabs = tabFolder.getItems();
- for (int i=0; i<tabs.length; i++)
- {
+ for (int i = 0; i < tabs.length; i++) {
disposeTab(tabs[i]);
}
@@ -363,82 +341,95 @@ public abstract class AbstractMemoryViewPane implements IMemoryBlockListener, IS
}
}
- public void setVisible(boolean visible)
- {
+ @Override
+ public void setVisible(boolean visible) {
fVisible = visible;
-
+
IMemoryViewTab currentTab = getTopMemoryTab();
- if (currentTab != null)
+ if (currentTab != null) {
currentTab.setEnabled(visible);
+ }
}
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection selection = event.getSelection();
- selectionChanged(fParent,selection);
-
+ selectionChanged(fParent, selection);
+
fSelectionProvider.setSelection(selection);
}
-
+
/**
* @return the unique identifier of the view pane
*/
- public String getPaneId()
- {
+ public String getPaneId() {
return fPaneId;
}
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getControl()
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getControl()
*/
+ @Override
public Control getControl() {
return fCanvas;
}
-
- public boolean isVisible()
- {
+
+ @Override
+ public boolean isVisible() {
return fVisible;
}
-
- public String getLabel()
- {
+
+ public String getLabel() {
return fLabel;
}
-
- protected boolean isDisposed()
- {
+
+ protected boolean isDisposed() {
return fIsDisposed;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded
+ * (org.eclipse.debug.core.model.IMemoryBlock)
*/
- abstract public void memoryBlocksAdded(IMemoryBlock[] memoryBlocks);
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
+ @Override
+ abstract public void memoryBlocksAdded(IMemoryBlock[] memoryBlocks);
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#
+ * MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
abstract public void memoryBlocksRemoved(final IMemoryBlock[] memoryBlocks);
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
+ * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
abstract public void selectionChanged(IWorkbenchPart part, ISelection selection);
-
+
/**
* @return current selection from the view pane
*/
abstract public Object getCurrentSelection();
-
+
/**
- * retore the view pane based on current selection from the debug view
- * and the memory blocks and renderings currently exist
+ * retore the view pane based on current selection from the debug view and
+ * the memory blocks and renderings currently exist
*/
+ @Override
abstract public void restoreViewPane();
-
+
/**
* @return actions to be contributed to the view pane's toolbar
*/
+ @Override
abstract public IAction[] getActions();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
index 08dc02bd7..8d1ecc175 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryBlockAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2012 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,35 +50,32 @@ import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
-
/**
* Action for adding memory block.
*
* @since 3.0
*/
-public class AddMemoryBlockAction extends Action implements IDebugContextListener, IDebugEventSetListener{
-
+public class AddMemoryBlockAction extends Action implements IDebugContextListener, IDebugEventSetListener {
+
protected IAdaptable fCurrentContext = null;
protected IMemoryBlock fLastMemoryBlock;
private boolean fAddDefaultRenderings = true;
protected IMemoryRenderingSite fSite;
-
- public AddMemoryBlockAction(IMemoryRenderingSite site)
- {
+
+ public AddMemoryBlockAction(IMemoryRenderingSite site) {
initialize(site);
}
-
+
/**
* @param site the site to add the action to
- * @param addDefaultRenderings - specify if the action should add
- * default renderings for the new memory block when it is run
+ * @param addDefaultRenderings - specify if the action should add default
+ * renderings for the new memory block when it is run
*/
- AddMemoryBlockAction(IMemoryRenderingSite site, boolean addDefaultRenderings)
- {
+ AddMemoryBlockAction(IMemoryRenderingSite site, boolean addDefaultRenderings) {
initialize(site);
fAddDefaultRenderings = addDefaultRenderings;
}
-
+
/**
* @param site the site to initialize
*/
@@ -87,13 +84,11 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
doInitialization(site);
}
-
- public AddMemoryBlockAction(String text, int style, IMemoryRenderingSite site)
- {
+ public AddMemoryBlockAction(String text, int style, IMemoryRenderingSite site) {
super(text, style);
- doInitialization(site);
+ doInitialization(site);
}
-
+
/**
* @param site the site to initialize
*/
@@ -104,79 +99,78 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_ADD));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_MONITOR_EXPRESSION));
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".addMemoryMonitorAction_context"); //$NON-NLS-1$
-
- // listen for context changed
- DebugUITools.addPartDebugContextListener(fSite.getSite(), this);
-
+
+ // listen for context changed
+ DebugUITools.addPartDebugContextListener(fSite.getSite(), this);
+
// get current context
fCurrentContext = DebugUITools.getPartDebugContext(site.getSite());
-
+
// set up enablement based on current selection
updateAction(fCurrentContext);
-
+
DebugPlugin.getDefault().addDebugEventListener(this);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
boolean exit = false;
String prefillExp = null;
String prefillLength = null;
- while (!exit)
- {
+ while (!exit) {
exit = true;
-
+
Object elem = fCurrentContext;
-
+
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(elem);
-
- if (retrieval == null)
+
+ if (retrieval == null) {
return;
-
- Shell shell= DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ }
+
+ Shell shell = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
// create dialog to ask for expression/address to block
MonitorMemoryBlockDialog dialog = new MonitorMemoryBlockDialog(shell, retrieval, prefillExp, prefillLength);
dialog.open();
int returnCode = dialog.getReturnCode();
- if (returnCode == Window.CANCEL)
- {
+ if (returnCode == Window.CANCEL) {
return;
}
// get expression entered in dialog
String input = dialog.getExpression();
-
+
// remember expression and length
prefillExp = input;
prefillLength = dialog.getLength();
-
- ArrayList expressions = new ArrayList();
-
- if (input.length() == 0)
- {
+
+ ArrayList<String> expressions = new ArrayList<String>();
+
+ if (input.length() == 0) {
expressions.add(IInternalDebugCoreConstants.EMPTY_STRING);
- }
- else
- {
+ } else {
StringTokenizer tokenizer = new StringTokenizer(input, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens())
- {
+ while (tokenizer.hasMoreTokens()) {
expressions.add(tokenizer.nextToken());
}
- }
- final String[] expressionsArray = (String[])expressions.toArray(new String[expressions.size()]);
+ }
+ final String[] expressionsArray = expressions.toArray(new String[expressions.size()]);
exit = true;
-
+
final boolean finalExit = exit;
final Object finalElement = elem;
final IMemoryBlockRetrieval finalRetrieval = retrieval;
final MonitorMemoryBlockDialog finalDialog = dialog;
Job job = new Job("Add Memory Block") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
addMemoryBlocks(finalExit, finalElement, finalRetrieval, finalDialog, expressionsArray);
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
@@ -191,46 +185,41 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
* @return if we should exit
*/
private boolean addMemoryBlocks(boolean exit, Object elem, IMemoryBlockRetrieval standardMemRetrieval, MonitorMemoryBlockDialog dialog, final String[] expressionsArray) {
- for (int i=0; i<expressionsArray.length; i++)
- {
+ for (int i = 0; i < expressionsArray.length; i++) {
String expression = expressionsArray[i].trim();
try {
- if (standardMemRetrieval instanceof IMemoryBlockRetrievalExtension)
- {
- // if the debug session supports IMemoryBlockExtensionRetrieval
- IMemoryBlockRetrievalExtension memRetrieval = (IMemoryBlockRetrievalExtension)standardMemRetrieval;
-
+ if (standardMemRetrieval instanceof IMemoryBlockRetrievalExtension) {
+ // if the debug session supports
+ // IMemoryBlockExtensionRetrieval
+ IMemoryBlockRetrievalExtension memRetrieval = (IMemoryBlockRetrievalExtension) standardMemRetrieval;
+
// get extended memory block with the expression entered
IMemoryBlockExtension memBlock = memRetrieval.getExtendedMemoryBlock(expression, elem);
-
+
// add block to memory block manager
- if (memBlock != null)
- {
+ if (memBlock != null) {
fLastMemoryBlock = memBlock;
-
- IMemoryBlock[] memArray = new IMemoryBlock[]{memBlock};
-
+
+ IMemoryBlock[] memArray = new IMemoryBlock[] { memBlock };
+
MemoryViewUtil.getMemoryBlockManager().addMemoryBlocks(memArray);
- if (fAddDefaultRenderings)
+ if (fAddDefaultRenderings) {
addDefaultRenderings(memBlock);
- }
- else
- {
+ }
+ } else {
// open error if it failed to retrieve a memory block
MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, DebugUIMessages.AddMemoryBlockAction_noMemoryBlock, null);
exit = false;
}
- }
- else
- {
- // if the debug session does not support IMemoryBlockExtensionRetrieval
+ } else {
+ // if the debug session does not support
+ // IMemoryBlockExtensionRetrieval
expression = expression.toUpperCase();
String hexPrefix = "0X"; //$NON-NLS-1$
- if (expression.startsWith(hexPrefix))
- {
+ if (expression.startsWith(hexPrefix)) {
expression = expression.substring(hexPrefix.length());
}
-
+
// convert the expression to an address
BigInteger address = new BigInteger(expression, 16);
@@ -238,41 +227,37 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
// get the length of memory to block
String strLength = dialog.getLength();
-
+
long length = Long.parseLong(strLength);
-
+
// must monitor at least one line
- if (length <= 0)
- {
+ if (length <= 0) {
String message = DebugUIMessages.AddMemoryBlockAction_failed + "\n" + DebugUIMessages.AddMemoryBlockAction_input_invalid; //$NON-NLS-1$
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, message, null);
+ MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, message, null);
exit = false;
continue;
}
-
+
// get standard memory block
IMemoryBlock memBlock = standardMemRetrieval.getMemoryBlock(longAddress, length);
-
- // make sure the memory block returned is not an instance of IMemoryBlockExtension
- if (memBlock instanceof IMemoryBlockExtension)
- {
- Status status = new Status(IStatus.WARNING, DebugUIPlugin.getUniqueIdentifier(), 0,
- "IMemoryBlockRetrieval returns IMemoryBlockExtension. This may result in unexpected behavior.", null); //$NON-NLS-1$
+
+ // make sure the memory block returned is not an instance of
+ // IMemoryBlockExtension
+ if (memBlock instanceof IMemoryBlockExtension) {
+ Status status = new Status(IStatus.WARNING, DebugUIPlugin.getUniqueIdentifier(), 0, "IMemoryBlockRetrieval returns IMemoryBlockExtension. This may result in unexpected behavior.", null); //$NON-NLS-1$
DebugUIPlugin.log(status);
}
-
- if (memBlock != null)
- {
+
+ if (memBlock != null) {
// add memory block to memory block manager
- fLastMemoryBlock = memBlock;
- IMemoryBlock[] memArray = new IMemoryBlock[]{memBlock};
-
+ fLastMemoryBlock = memBlock;
+ IMemoryBlock[] memArray = new IMemoryBlock[] { memBlock };
+
MemoryViewUtil.getMemoryBlockManager().addMemoryBlocks(memArray);
- if (fAddDefaultRenderings)
+ if (fAddDefaultRenderings) {
addDefaultRenderings(memBlock);
- }
- else
- {
+ }
+ } else {
// otherwise open up an error doalog
MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, DebugUIMessages.AddMemoryBlockAction_noMemoryBlock, null);
exit = false;
@@ -281,107 +266,102 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
} catch (DebugException e1) {
MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, DebugUIMessages.AddMemoryBlockAction_failed, e1);
exit = false;
- }
- catch(NumberFormatException e2)
- {
+ } catch (NumberFormatException e2) {
String message = DebugUIMessages.AddMemoryBlockAction_failed + "\n" + DebugUIMessages.AddMemoryBlockAction_input_invalid; //$NON-NLS-1$
- MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, message, null);
+ MemoryViewUtil.openError(DebugUIMessages.AddMemoryBlockAction_title, message, null);
exit = false;
}
}
return exit;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse
+ * .debug.core.DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i < events.length; i++)
- handleDebugEvent(events[i]);
- }
-
- private void handleDebugEvent(DebugEvent event)
- {
+ for (int i = 0; i < events.length; i++) {
+ handleDebugEvent(events[i]);
+ }
+ }
+
+ private void handleDebugEvent(DebugEvent event) {
// update action enablement based on debug event
Object src = event.getSource();
IDebugTarget srcDT = null;
IDebugTarget selectionDT = null;
-
- if (event.getKind() == DebugEvent.TERMINATE)
- {
- if (src instanceof ITerminate && src instanceof IDebugElement)
- {
- srcDT = ((IDebugElement)src).getDebugTarget();
+
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ if (src instanceof ITerminate && src instanceof IDebugElement) {
+ srcDT = ((IDebugElement) src).getDebugTarget();
}
-
- if (fCurrentContext instanceof IDebugElement)
- {
- selectionDT = ((IDebugElement)fCurrentContext).getDebugTarget();
+
+ if (fCurrentContext instanceof IDebugElement) {
+ selectionDT = ((IDebugElement) fCurrentContext).getDebugTarget();
}
// disable action if the debug target is terminated.
- if (srcDT == selectionDT)
- {
+ if (srcDT == selectionDT) {
setEnabled(false);
}
}
// handle change event from memory block retrieval object
// to allow non-standard debug models to update the action
- else if (event.getKind() == DebugEvent.CHANGE && event.getDetail() == DebugEvent.STATE)
- {
+ else if (event.getKind() == DebugEvent.CHANGE && event.getDetail() == DebugEvent.STATE) {
Object evtSrc = event.getSource();
- if (evtSrc == MemoryViewUtil.getMemoryBlockRetrieval(fCurrentContext))
+ if (evtSrc == MemoryViewUtil.getMemoryBlockRetrieval(fCurrentContext)) {
updateAction(fCurrentContext);
+ }
}
}
-
+
/**
- * Return the last memory block added to memory block manager via this action.
+ * Return the last memory block added to memory block manager via this
+ * action.
+ *
* @return Returns the fLastMemoryBlock.
*/
public IMemoryBlock getLastMemoryBlock() {
return fLastMemoryBlock;
}
-
+
protected void dispose() {
-
+
// remove listeners
DebugPlugin.getDefault().removeDebugEventListener(this);
DebugUITools.removePartDebugContextListener(fSite.getSite(), this);
}
-
- private void addDefaultRenderings(IMemoryBlock memoryBlock)
- {
+
+ private void addDefaultRenderings(IMemoryBlock memoryBlock) {
IMemoryRenderingType primaryType = DebugUITools.getMemoryRenderingManager().getPrimaryRenderingType(memoryBlock);
IMemoryRenderingType renderingTypes[] = DebugUITools.getMemoryRenderingManager().getDefaultRenderingTypes(memoryBlock);
-
+
// create primary rendering
try {
- if (primaryType != null)
- {
+ if (primaryType != null) {
createRenderingInContainer(memoryBlock, primaryType, IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
- }
- else if (renderingTypes.length > 0)
- {
+ } else if (renderingTypes.length > 0) {
primaryType = renderingTypes[0];
createRenderingInContainer(memoryBlock, renderingTypes[0], IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
}
} catch (CoreException e1) {
- DebugUIPlugin.log(e1);
+ DebugUIPlugin.log(e1);
}
-
- for (int i = 0; i<renderingTypes.length; i++)
- {
+
+ for (int i = 0; i < renderingTypes.length; i++) {
try {
boolean create = true;
- if (primaryType != null)
- {
- if (primaryType.getId().equals(renderingTypes[i].getId()))
+ if (primaryType != null) {
+ if (primaryType.getId().equals(renderingTypes[i].getId())) {
create = false;
+ }
}
- if (create)
+ if (create) {
createRenderingInContainer(memoryBlock, renderingTypes[i], IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);
+ }
} catch (CoreException e) {
DebugUIPlugin.log(e);
}
@@ -400,33 +380,39 @@ public class AddMemoryBlockAction extends Action implements IDebugContextListene
rendering.init(container, memoryBlock);
container.addMemoryRendering(rendering);
}
-
- protected MemoryView getMemoryView()
- {
- if (fSite instanceof MemoryView)
- return (MemoryView)fSite;
+
+ protected MemoryView getMemoryView() {
+ if (fSite instanceof MemoryView) {
+ return (MemoryView) fSite;
+ }
return null;
}
-
- protected void updateAction(final Object debugContext)
- {
+
+ protected void updateAction(final Object debugContext) {
Job job = new Job("Update Add Memory Block Action") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
setEnabled(MemoryViewUtil.isValidContext(debugContext));
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener
+ * #contextEvent
+ * (org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
IAdaptable context = DebugUITools.getPartDebugContext(fSite.getSite());
updateAction(context);
- fCurrentContext = context;
+ fCurrentContext = context;
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
index ab9fe9825..c6fcd7ab6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingAction.java
@@ -22,23 +22,23 @@ import org.eclipse.ui.PlatformUI;
* Toolbar "Add Memory Rendering Action" from Memory Rendering Pane
*/
public class AddMemoryRenderingAction extends AddMemoryBlockAction {
-
+
private IMemoryRenderingContainer fContainer;
-
- public AddMemoryRenderingAction(IMemoryRenderingContainer container)
- {
- super(DebugUIMessages.AddMemoryRenderingAction_Add_renderings, AS_PUSH_BUTTON, container.getMemoryRenderingSite());
- setToolTipText(DebugUIMessages.AddMemoryRenderingAction_Add_renderings);
+
+ public AddMemoryRenderingAction(IMemoryRenderingContainer container) {
+ super(DebugUIMessages.AddMemoryRenderingAction_Add_renderings, AS_PUSH_BUTTON, container.getMemoryRenderingSite());
+ setToolTipText(DebugUIMessages.AddMemoryRenderingAction_Add_renderings);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, DebugUIPlugin.getUniqueIdentifier() + ".AddRenderingContextAction_context"); //$NON-NLS-1$
fContainer = container;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
if (fContainer instanceof RenderingViewPane)
((RenderingViewPane) fContainer).showCreateRenderingTab();
}
}
-
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
index b339883c1..b1da6ccef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingContextAction.java
@@ -17,36 +17,36 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
-
public class AddMemoryRenderingContextAction implements IViewActionDelegate {
private IMemoryRenderingSite fMemoryView;
-
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
-
- if (view instanceof IMemoryRenderingSite)
- {
- fMemoryView = (IMemoryRenderingSite)view;
- }
+
+ if (view instanceof IMemoryRenderingSite) {
+ fMemoryView = (IMemoryRenderingSite) view;
+ }
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
-
+
if (fMemoryView == null)
return;
-
+
IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container != null)
- {
+ if (container != null) {
AddMemoryRenderingAction addAction = new AddMemoryRenderingAction(container);
- addAction.run();
+ addAction.run();
addAction.dispose();
}
}
@@ -59,27 +59,28 @@ public class AddMemoryRenderingContextAction implements IViewActionDelegate {
IMemoryRenderingContainer[] viewPanes = fMemoryView.getMemoryRenderingContainers();
String actionId = action.getId();
IMemoryRenderingContainer selectedPane = null;
-
- for (int i=0; i<viewPanes.length; i++)
- {
- if (actionId.indexOf(viewPanes[i].getId()) != -1)
- {
+
+ for (int i = 0; i < viewPanes.length; i++) {
+ if (actionId.indexOf(viewPanes[i].getId()) != -1) {
selectedPane = viewPanes[i];
break;
}
}
-
+
return selectedPane;
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container instanceof RenderingViewPane)
- {
- if (!((RenderingViewPane)container).canAddRendering())
+ if (container instanceof RenderingViewPane) {
+ if (!((RenderingViewPane) container).canAddRendering())
action.setEnabled(false);
else
action.setEnabled(true);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
index 618a68b0d..38e1906d9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/AddMemoryRenderingDialog.java
@@ -68,45 +68,43 @@ import org.eclipse.ui.progress.WorkbenchJob;
* Dialog allowing user to add a memory rendering
*/
public class AddMemoryRenderingDialog extends SelectionDialog {
-
+
private IMemoryBlock[] fMemoryBlocks;
private Combo memoryBlock;
private ListViewer fViewer;
private IMemoryBlock fSelectedMemoryBlock;
private Button addNew;
-
+
private ISelectionChangedListener fSelectionChangedListener;
private SelectionListener fSelectionListener;
private SelectionAdapter fAddNewSelectionAdapter;
private IMemoryRenderingSite fSite;
-
- private IMemoryBlockListener fMemoryBlockListener = new IMemoryBlockListener(){
-
- public void memoryBlocksAdded(final IMemoryBlock[] memory)
- {
- if (memory.length > 0)
- {
+
+ private IMemoryBlockListener fMemoryBlockListener = new IMemoryBlockListener() {
+
+ @Override
+ public void memoryBlocksAdded(final IMemoryBlock[] memory) {
+ if (memory.length > 0) {
IMemoryBlock currentBlock = getMemoryBlockToSelect(memory[0]);
- if (currentBlock == null)
- {
+ if (currentBlock == null) {
addNew();
- }
- else
- {
+ } else {
populateDialog(currentBlock);
}
}
}
- public void memoryBlocksRemoved(IMemoryBlock[] memory)
- {
+
+ @Override
+ public void memoryBlocksRemoved(IMemoryBlock[] memory) {
}
};
-
- private IMemoryRenderingBindingsListener fBindingListener = new IMemoryRenderingBindingsListener()
- {
+
+ private IMemoryRenderingBindingsListener fBindingListener = new IMemoryRenderingBindingsListener() {
+ @Override
public void memoryRenderingBindingsChanged() {
- UIJob job = new UIJob("refresh"){ //$NON-NLS-1$
-
+ UIJob job = new UIJob("refresh") { //$NON-NLS-1$
+
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
fViewer.refresh();
return Status.OK_STATUS;
@@ -115,145 +113,186 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
job.setSystem(true);
job.schedule();
}
-
+
};
- class MemoryRenderingLabelProvider implements ILabelProvider
- {
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
+ class MemoryRenderingLabelProvider implements ILabelProvider {
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
- if (element instanceof IMemoryRenderingType)
- {
- String label = ((IMemoryRenderingType)element).getLabel();
+ if (element instanceof IMemoryRenderingType) {
+ String label = ((IMemoryRenderingType) element).getLabel();
return label;
}
- return element.toString();
+ return element.toString();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse
+ * .jface.viewers.ILabelProviderListener)
*/
+ @Override
public void addListener(ILabelProviderListener listener) {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java
+ * .lang.Object, java.lang.String)
*/
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse
+ * .jface.viewers.ILabelProviderListener)
*/
+ @Override
public void removeListener(ILabelProviderListener listener) {
}
}
-
- class MemoryRenderingContentProvider implements IStructuredContentProvider
- {
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
+ class MemoryRenderingContentProvider implements IStructuredContentProvider {
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IStructuredContentProvider#getElements(
+ * java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
- IMemoryRenderingType[] renderings = DebugUITools.getMemoryRenderingManager().getRenderingTypes((IMemoryBlock)inputElement);
+ IMemoryRenderingType[] renderings = DebugUITools.getMemoryRenderingManager().getRenderingTypes((IMemoryBlock) inputElement);
return renderings;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse
+ * .jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
-
+
}
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.window.Window#close()
*/
+ @Override
public boolean close() {
-
+
fViewer.removeSelectionChangedListener(fSelectionChangedListener);
memoryBlock.removeSelectionListener(fSelectionListener);
addNew.removeSelectionListener(fAddNewSelectionAdapter);
DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fMemoryBlockListener);
DebugUITools.getMemoryRenderingManager().removeListener(fBindingListener);
-
+
return super.close();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse
+ * .swt.widgets.Composite)
*/
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
getButton(IDialogConstants.OK_ID).setEnabled(false);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.dialogs.SelectionDialog#getResult()
*/
+ @Override
public Object[] getResult() {
-
+
Object[] results = super.getResult();
-
- if (results != null)
- {
- Object[] renderings = ((IStructuredSelection)results[0]).toArray();
+
+ if (results != null) {
+ Object[] renderings = ((IStructuredSelection) results[0]).toArray();
return renderings;
}
- return new Object[0];
+ return new Object[0];
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#cancelPressed()
*/
+ @Override
protected void cancelPressed() {
-
+
setResult(null);
-
+
super.cancelPressed();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
-
+
ISelection select = fViewer.getSelection();
- setSelectionResult(new Object[]{select});
-
+ setSelectionResult(new Object[] { select });
+
super.okPressed();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
+ * .Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, DebugUIPlugin.getUniqueIdentifier() + ".AddMemoryRenderingDialog_context"); //$NON-NLS-1$
@@ -262,268 +301,253 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
compositeLayout.numColumns = 3;
compositeLayout.makeColumnsEqualWidth = true;
composite.setLayout(compositeLayout);
-
- GridData comositeSpec= new GridData();
- comositeSpec.grabExcessVerticalSpace= true;
- comositeSpec.grabExcessHorizontalSpace= true;
- comositeSpec.horizontalAlignment= GridData.FILL;
- comositeSpec.verticalAlignment= GridData.CENTER;
+
+ GridData comositeSpec = new GridData();
+ comositeSpec.grabExcessVerticalSpace = true;
+ comositeSpec.grabExcessHorizontalSpace = true;
+ comositeSpec.horizontalAlignment = GridData.FILL;
+ comositeSpec.verticalAlignment = GridData.CENTER;
composite.setLayoutData(comositeSpec);
-
+
Label textLabel = new Label(composite, SWT.NONE);
- textLabel.setText(DebugUIMessages.AddMemoryRenderingDialog_Memory_Monitor);
+ textLabel.setText(DebugUIMessages.AddMemoryRenderingDialog_Memory_Monitor);
GridData textLayout = new GridData();
- textLayout.verticalAlignment=GridData.CENTER;
- textLayout.horizontalAlignment=GridData.BEGINNING;
+ textLayout.verticalAlignment = GridData.CENTER;
+ textLayout.horizontalAlignment = GridData.BEGINNING;
textLabel.setLayoutData(textLayout);
-
+
memoryBlock = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
- GridData spec= new GridData(GridData.FILL_HORIZONTAL);
- spec.grabExcessVerticalSpace= false;
- spec.grabExcessHorizontalSpace= false;
- spec.horizontalAlignment= GridData.FILL;
- spec.verticalAlignment= GridData.FILL;
+ GridData spec = new GridData(GridData.FILL_HORIZONTAL);
+ spec.grabExcessVerticalSpace = false;
+ spec.grabExcessHorizontalSpace = false;
+ spec.horizontalAlignment = GridData.FILL;
+ spec.verticalAlignment = GridData.FILL;
spec.horizontalSpan = 4;
memoryBlock.setLayoutData(spec);
-
+
Label filler = new Label(composite, SWT.NONE);
filler.setText(" "); //$NON-NLS-1$
GridData fillerData = new GridData(GridData.FILL_HORIZONTAL);
fillerData.horizontalSpan = 2;
filler.setLayoutData(fillerData);
-
+
addNew = new Button(composite, SWT.NONE);
- addNew.setText(DebugUIMessages.AddMemoryRenderingDialog_Add_New);
- GridData specButton= new GridData();
- specButton.horizontalAlignment= GridData.END;
- specButton.verticalAlignment= GridData.CENTER;
+ addNew.setText(DebugUIMessages.AddMemoryRenderingDialog_Add_New);
+ GridData specButton = new GridData();
+ specButton.horizontalAlignment = GridData.END;
+ specButton.verticalAlignment = GridData.CENTER;
addNew.setLayoutData(specButton);
-
+
fAddNewSelectionAdapter = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
RetargetAddMemoryBlockAction action = new RetargetAddMemoryBlockAction(fSite, false);
action.run();
action.dispose();
- }};
-
+ }
+ };
+
addNew.addSelectionListener(fAddNewSelectionAdapter);
-
- fSelectionListener = new SelectionListener(){
+ fSelectionListener = new SelectionListener() {
+
+ @Override
public void widgetSelected(SelectionEvent e) {
-
+
int idx = memoryBlock.getSelectionIndex();
-
+
// avoid null pointer exception
if (fMemoryBlocks == null)
return;
-
+
fSelectedMemoryBlock = fMemoryBlocks[idx];
-
- fViewer.setInput(fSelectedMemoryBlock);
-
+
+ fViewer.setInput(fSelectedMemoryBlock);
+
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
- }};
-
+ }
+ };
+
memoryBlock.addSelectionListener(fSelectionListener);
-
+
Label renderingLabel = new Label(composite, SWT.NONE);
- renderingLabel.setText(DebugUIMessages.AddMemoryRenderingDialog_Memory_renderings);
+ renderingLabel.setText(DebugUIMessages.AddMemoryRenderingDialog_Memory_renderings);
GridData renderingLayout = new GridData();
renderingLayout.horizontalAlignment = GridData.BEGINNING;
renderingLayout.verticalAlignment = GridData.CENTER;
renderingLayout.horizontalSpan = 3;
renderingLabel.setLayoutData(renderingLayout);
-
+
fViewer = new ListViewer(composite);
fViewer.setContentProvider(new MemoryRenderingContentProvider());
fViewer.setLabelProvider(new MemoryRenderingLabelProvider());
-
+
GridData listLayout = new GridData(GridData.FILL_BOTH);
listLayout.horizontalSpan = 3;
- listLayout.heightHint =140;
+ listLayout.heightHint = 140;
fViewer.getControl().setLayoutData(listLayout);
-
- fViewer.addDoubleClickListener(new IDoubleClickListener (){
+ fViewer.addDoubleClickListener(new IDoubleClickListener() {
+
+ @Override
public void doubleClick(DoubleClickEvent event) {
okPressed();
- }});
-
+ }
+ });
+
IMemoryBlock currentBlock = getMemoryBlockToSelect(null);
- if (currentBlock == null)
- {
+ if (currentBlock == null) {
addNew();
- }
- else
- {
+ } else {
populateDialog(currentBlock);
}
-
-
+
fSelectionChangedListener = new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = fViewer.getSelection();
-
- if (selection.isEmpty())
- {
+ ISelection selection = fViewer.getSelection();
+
+ if (selection.isEmpty()) {
getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else
- {
+ } else {
getButton(IDialogConstants.OK_ID).setEnabled(true);
}
- }};
-
+ }
+ };
+
fViewer.addSelectionChangedListener(fSelectionChangedListener);
-
+
DebugPlugin.getDefault().getMemoryBlockManager().addListener(fMemoryBlockListener);
DebugUITools.getMemoryRenderingManager().addListener(fBindingListener);
-
+
return composite;
}
public AddMemoryRenderingDialog(Shell parent, IMemoryRenderingSite site) {
super(parent);
- super.setTitle(DebugUIMessages.AddMemoryRenderingDialog_Add_memory_rendering);
+ super.setTitle(DebugUIMessages.AddMemoryRenderingDialog_Add_memory_rendering);
setShellStyle(getShellStyle() | SWT.RESIZE);
fSite = site;
}
-
-
- private void doPopulateDialog(Combo combo, ListViewer viewer, String[] labels, int selectionIdx, IMemoryBlock currentBlock)
- {
+
+ private void doPopulateDialog(Combo combo, ListViewer viewer, String[] labels, int selectionIdx, IMemoryBlock currentBlock) {
// clean up
combo.removeAll();
-
- for (int i=0; i<labels.length; i++)
- {
+
+ for (int i = 0; i < labels.length; i++) {
combo.add(labels[i]);
}
combo.select(selectionIdx);
fSelectedMemoryBlock = currentBlock;
-
+
viewer.setInput(currentBlock);
}
-
- private IMemoryBlock getMemoryBlockToSelect(IMemoryBlock lastAdded)
- {
+
+ private IMemoryBlock getMemoryBlockToSelect(IMemoryBlock lastAdded) {
IMemoryBlock currentBlock = null;
-
+
if (lastAdded != null)
currentBlock = lastAdded;
- else
- {
+ else {
// take Memory View's selection if possible
ISelectionProvider selectionProvider = fSite.getSite().getSelectionProvider();
ISelection selection = null;
-
+
if (selectionProvider != null)
selection = selectionProvider.getSelection();
- else // otherwise, take selection from selection service
- selection = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
-
+ else
+ // otherwise, take selection from selection service
+ selection = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
+
IMemoryBlock element = getMemoryBlock(selection);
-
- if (element == null)
- {
- IAdaptable context = DebugUITools.getPartDebugContext(fSite.getSite());
-
- if (context != null)
- {
+
+ if (element == null) {
+ IAdaptable context = DebugUITools.getPartDebugContext(fSite.getSite());
+
+ if (context != null) {
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
-
+
if (retrieval == null)
return currentBlock;
-
+
IMemoryBlock[] blocks = new IMemoryBlock[0];
-
+
if (retrieval != null)
blocks = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieval);
-
+
if (blocks.length > 0)
currentBlock = blocks[0];
}
- }
- else
- {
+ } else {
currentBlock = element;
}
}
return currentBlock;
}
-
- private String[] getLabels(IMemoryBlock[] memoryBlocks)
- {
+
+ private String[] getLabels(IMemoryBlock[] memoryBlocks) {
String[] labels = new String[memoryBlocks.length];
- for (int i=0; i<memoryBlocks.length; i++)
- {
+ for (int i = 0; i < memoryBlocks.length; i++) {
String text = IInternalDebugCoreConstants.EMPTY_STRING;
- if (memoryBlocks[i] instanceof IMemoryBlockExtension)
- {
+ if (memoryBlocks[i] instanceof IMemoryBlockExtension) {
try {
- text = ((IMemoryBlockExtension)memoryBlocks[i]).getExpression();
-
+ text = ((IMemoryBlockExtension) memoryBlocks[i]).getExpression();
+
if (text == null)
- text = DebugUIMessages.AddMemoryRenderingDialog_Unknown;
-
- if (((IMemoryBlockExtension)memoryBlocks[i]).getBigBaseAddress() != null)
- {
+ text = DebugUIMessages.AddMemoryRenderingDialog_Unknown;
+
+ if (((IMemoryBlockExtension) memoryBlocks[i]).getBigBaseAddress() != null) {
text += " : 0x"; //$NON-NLS-1$
- text += ((IMemoryBlockExtension)memoryBlocks[i]).getBigBaseAddress().toString(16);
- }
+ text += ((IMemoryBlockExtension) memoryBlocks[i]).getBigBaseAddress().toString(16);
+ }
} catch (DebugException e) {
long address = memoryBlocks[i].getStartAddress();
text = Long.toHexString(address);
}
- }
- else
- {
+ } else {
long address = memoryBlocks[i].getStartAddress();
text = Long.toHexString(address);
}
-
+
// ask decorator to decorate to ensure consistent label
- ILabelDecorator decorator = (ILabelDecorator)fMemoryBlocks[i].getAdapter(ILabelDecorator.class);
+ ILabelDecorator decorator = (ILabelDecorator) fMemoryBlocks[i].getAdapter(ILabelDecorator.class);
if (decorator != null)
text = decorator.decorateText(text, fMemoryBlocks[i]);
-
+
labels[i] = text;
}
return labels;
}
-
- private IMemoryBlock getMemoryBlock(ISelection selection)
- {
+
+ private IMemoryBlock getMemoryBlock(ISelection selection) {
if (!(selection instanceof IStructuredSelection))
return null;
- //only single selection of debug element is allowed for this action
- if (selection.isEmpty() || ((IStructuredSelection)selection).size() > 1)
- {
+ // only single selection of debug element is allowed for this action
+ if (selection.isEmpty() || ((IStructuredSelection) selection).size() > 1) {
return null;
}
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
+ Object elem = ((IStructuredSelection) selection).getFirstElement();
+
if (elem instanceof IMemoryBlock)
- return (IMemoryBlock)elem;
+ return (IMemoryBlock) elem;
else if (elem instanceof IMemoryRendering)
- return ((IMemoryRendering)elem).getMemoryBlock();
+ return ((IMemoryRendering) elem).getMemoryBlock();
else
return null;
}
-
- public IMemoryBlock getMemoryBlock()
- {
+
+ public IMemoryBlock getMemoryBlock() {
return fSelectedMemoryBlock;
}
-
+
/**
* @param currentBlock the current memory block context
*/
@@ -531,40 +555,39 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
final IMemoryBlock selectMB = currentBlock;
Job job = new Job("Populate dialog") //$NON-NLS-1$
{
+ @Override
protected IStatus run(IProgressMonitor monitor) {
- IMemoryBlockRetrieval mbRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(selectMB);
-
- if (mbRetrieval != null)
- {
+ IMemoryBlockRetrieval mbRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(selectMB);
+
+ if (mbRetrieval != null) {
fMemoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(mbRetrieval);
int selectionIdx = 0;
- for (int i=0; i<fMemoryBlocks.length; i++)
- {
- if (fMemoryBlocks[i] == selectMB)
- {
+ for (int i = 0; i < fMemoryBlocks.length; i++) {
+ if (fMemoryBlocks[i] == selectMB) {
selectionIdx = i;
break;
}
}
-
+
final String[] labels = getLabels(fMemoryBlocks);
final int idx = selectionIdx;
final IMemoryBlock selectedBlk = selectMB;
- WorkbenchJob wbJob = new WorkbenchJob("populate dialog"){ //$NON-NLS-1$
-
+ WorkbenchJob wbJob = new WorkbenchJob("populate dialog") { //$NON-NLS-1$
+
+ @Override
public IStatus runInUIThread(IProgressMonitor wbMonitor) {
- doPopulateDialog(memoryBlock, fViewer, labels, idx, selectedBlk);
+ doPopulateDialog(memoryBlock, fViewer, labels, idx, selectedBlk);
return Status.OK_STATUS;
- }};
- wbJob.setSystem(true);
- wbJob.schedule();
- }
- else
- {
- DebugUIPlugin.logErrorMessage("Unable to obtain memory block retrieval."); //$NON-NLS-1$
- }
+ }
+ };
+ wbJob.setSystem(true);
+ wbJob.schedule();
+ } else {
+ DebugUIPlugin.logErrorMessage("Unable to obtain memory block retrieval."); //$NON-NLS-1$
+ }
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
@@ -573,13 +596,15 @@ public class AddMemoryRenderingDialog extends SelectionDialog {
*
*/
private void addNew() {
- WorkbenchJob job = new WorkbenchJob("populate dialog"){ //$NON-NLS-1$
+ WorkbenchJob job = new WorkbenchJob("populate dialog") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
memoryBlock.add(DebugUIMessages.AddMemoryRenderingDialog_Add_New);
memoryBlock.select(0);
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java
index 0e9a10395..69d744617 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/CodePagesPreferencePage.java
@@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
package org.eclipse.debug.internal.ui.views.memory;
import java.io.UnsupportedEncodingException;
@@ -38,52 +37,53 @@ public class CodePagesPreferencePage extends FieldEditorPreferencePage {
setTitle(DebugUIMessages.CodePagesPrefDialog_1);
}
+ @Override
protected void createFieldEditors() {
fAsciiCodePage = new StringFieldEditor(IDebugUIConstants.PREF_DEFAULT_ASCII_CODE_PAGE, DebugUIMessages.CodePagesPrefDialog_2, getFieldEditorParent());
fAsciiCodePage.setEmptyStringAllowed(false);
addField(fAsciiCodePage);
-
+
fEbcdicCodePage = new StringFieldEditor(IDebugUIConstants.PREF_DEFAULT_EBCDIC_CODE_PAGE, DebugUIMessages.CodePagesPrefDialog_4, getFieldEditorParent());
fEbcdicCodePage.setEmptyStringAllowed(false);
addField(fEbcdicCodePage);
}
+ @Override
public boolean performOk() {
-
+
if (fAsciiCodePage == null || fEbcdicCodePage == null)
return super.performOk();
-
+
// check that the codepages are supported
String asciiCodePage = fAsciiCodePage.getStringValue();
asciiCodePage = asciiCodePage.trim();
try {
- new String(new byte[]{1}, asciiCodePage);
+ new String(new byte[] { 1 }, asciiCodePage);
} catch (UnsupportedEncodingException e) {
Shell shell = DebugUIPlugin.getShell();
- if (shell != null)
- {
- IStatus status = DebugUIPlugin.newErrorStatus(DebugUIMessages.CodePagesPrefDialog_0, e);
- ErrorDialog.openError(shell, DebugUIMessages.CodePagesPrefDialog_6, DebugUIMessages.CodePagesPrefDialog_7, status); //
+ if (shell != null) {
+ IStatus status = DebugUIPlugin.newErrorStatus(DebugUIMessages.CodePagesPrefDialog_0, e);
+ ErrorDialog.openError(shell, DebugUIMessages.CodePagesPrefDialog_6, DebugUIMessages.CodePagesPrefDialog_7, status); //
}
return false;
}
-
+
String ebcdicCodePage = fEbcdicCodePage.getStringValue();
ebcdicCodePage = ebcdicCodePage.trim();
try {
- new String(new byte[]{1}, ebcdicCodePage);
+ new String(new byte[] { 1 }, ebcdicCodePage);
} catch (UnsupportedEncodingException e) {
Shell shell = DebugUIPlugin.getShell();
- if (shell != null)
- {
- IStatus status = DebugUIPlugin.newErrorStatus(DebugUIMessages.CodePagesPrefDialog_0, e);
- ErrorDialog.openError(shell, DebugUIMessages.CodePagesPrefDialog_8, DebugUIMessages.CodePagesPrefDialog_9, status); //
+ if (shell != null) {
+ IStatus status = DebugUIPlugin.newErrorStatus(DebugUIMessages.CodePagesPrefDialog_0, e);
+ ErrorDialog.openError(shell, DebugUIMessages.CodePagesPrefDialog_8, DebugUIMessages.CodePagesPrefDialog_9, status); //
}
return false;
}
return super.performOk();
}
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, DebugUIPlugin.getUniqueIdentifier() + ".CodePagesPrefDialog_context"); //$NON-NLS-1$
return super.createContents(parent);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java
index aa0ae6580..61933c8dc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryView.java
@@ -11,28 +11,28 @@
package org.eclipse.debug.internal.ui.views.memory;
-
/**
- * Functions to allow user to control the Memory View or the Memory Rendering View
+ * Functions to allow user to control the Memory View or the Memory Rendering
+ * View
*
* @since 3.0
*/
-public interface IMemoryView
-{
+public interface IMemoryView {
/**
* @return the top view tab from the Memory View
*/
- public IMemoryViewTab getTopMemoryTab( );
-
+ public IMemoryViewTab getTopMemoryTab();
+
/**
* @return all view tabs from current tab folder
*/
public IMemoryViewTab[] getAllViewTabs();
-
+
/**
* Move specified view tab to the top
+ *
* @param viewTab
*/
public void moveToTop(IMemoryViewTab viewTab);
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java
index e7329f13d..b092ff38c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewPane.java
@@ -16,79 +16,81 @@ import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-
/**
* Represent a view pane in the memory view.
*
- * This is an internal interface for mananging the view panes within the Memory View
+ * This is an internal interface for mananging the view panes within the Memory
+ * View
+ *
* @since 3.1
*/
public interface IMemoryViewPane {
-
+
/**
- * Create the view pane with the given parent composite, and pane
- * id.
+ * Create the view pane with the given parent composite, and pane id.
+ *
* @param parent
* @param paneId
* @param label
* @return the control of the view pane
*/
public Control createViewPane(Composite parent, String paneId, String label);
-
+
/**
- * Restore view pane based on current selection from the debug view.
- * Create memory blocks or renderings that currently exist in the debug
- * session.
+ * Restore view pane based on current selection from the debug view. Create
+ * memory blocks or renderings that currently exist in the debug session.
*/
public void restoreViewPane();
-
+
/**
* Dispose the view pane
*/
public void dispose();
-
+
/**
* @return unique identifier of the view pane
*/
public String getId();
-
+
/**
- * @return array of actions to be contributed to the view pane's
- * acition bar.
+ * @return array of actions to be contributed to the view pane's acition
+ * bar.
*/
public IAction[] getActions();
-
+
/**
- * Add the given selection listener to the view pane. The selection
- * listener gets notified when the selection from the view pane
- * has changed.
+ * Add the given selection listener to the view pane. The selection listener
+ * gets notified when the selection from the view pane has changed.
+ *
* @param listener
*/
public void addSelectionListener(ISelectionChangedListener listener);
-
+
/**
- * Remove the selection listener from the view pane. The listener
- * will no longer get notified when selection is changed.
+ * Remove the selection listener from the view pane. The listener will no
+ * longer get notified when selection is changed.
+ *
* @param listener
*/
public void removeSelctionListener(ISelectionChangedListener listener);
-
+
/**
* @return the selection provider of the view pane
*/
public ISelectionProvider getSelectionProvider();
-
+
/**
* @return the control for ths memory view pane
*/
public Control getControl();
-
+
/**
* Called when the view pane becomes visible or hidden
+ *
* @param visible visibility state of teh view pane
*/
public void setVisible(boolean visible);
-
+
/**
* @return if the view pane is currently visible
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java
index c9dab6a24..0b5f388bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/IMemoryViewTab.java
@@ -9,55 +9,53 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
package org.eclipse.debug.internal.ui.views.memory;
import org.eclipse.debug.ui.memory.IMemoryRendering;
-
/**
* Represent a view tab in the Memory View or Memory Rendering View
*
- * Refer to AbstractMemoryViewTab.
- * This is an internal interface. This class is not intended to be implemented by clients.
+ * Refer to AbstractMemoryViewTab. This is an internal interface. This class is
+ * not intended to be implemented by clients.
*
* @since 3.0
*/
-public interface IMemoryViewTab
-{
+public interface IMemoryViewTab {
/**
* Remove the view tab.
*/
public void dispose();
-
+
/**
* @return if the view tab is disposed
*/
public boolean isDisposed();
-
+
/**
* @return enablement state of the view tab.
*/
public boolean isEnabled();
-
-
+
/**
* Sets the enablament state of the view tab.
+ *
* @param enabled
*/
public void setEnabled(boolean enabled);
-
+
/**
* Set view tab's label
+ *
* @param label
*/
public void setTabLabel(String label);
-
+
/**
* @return view tab's label, null if the label is not available
*/
public String getTabLabel();
-
+
/**
* @return the rendering of this view tab
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java
index 767f3c588..7af713e31 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/LinkRenderingPanesAction.java
@@ -20,35 +20,38 @@ import org.eclipse.ui.IViewPart;
/**
* Action to link/unlink rendering view panes
*/
-public class LinkRenderingPanesAction implements IViewActionDelegate{
+public class LinkRenderingPanesAction implements IViewActionDelegate {
IMemoryRenderingSite fRenderingSite;
private MemoryViewSynchronizationService fMemSyncService;
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
- public void init(IViewPart view) {
-
- if (view instanceof IMemoryRenderingSite)
- {
- fRenderingSite = (IMemoryRenderingSite)view;
-
+ @Override
+ public void init(IViewPart view) {
+
+ if (view instanceof IMemoryRenderingSite) {
+ fRenderingSite = (IMemoryRenderingSite) view;
+
IMemoryRenderingSynchronizationService syncService = fRenderingSite.getSynchronizationService();
-
+
if (syncService instanceof MemoryViewSynchronizationService)
- fMemSyncService = (MemoryViewSynchronizationService)syncService;
+ fMemSyncService = (MemoryViewSynchronizationService) syncService;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
-
+
if (fMemSyncService == null)
return;
-
+
fMemSyncService.setEnabled(!fMemSyncService.isEnabled());
updateActionState(action);
}
@@ -57,20 +60,24 @@ public class LinkRenderingPanesAction implements IViewActionDelegate{
* @param action
*/
private void updateActionState(IAction action) {
-
+
if (fMemSyncService == null)
return;
-
+
if (fMemSyncService.isEnabled())
action.setChecked(true);
else
action.setChecked(false);
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
- updateActionState(action);
+ updateActionState(action);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
index 2e4179594..0adc1a39e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryBlocksTreeViewPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,7 @@
* display memory blocks that do not reference IDebugTarget
*
*******************************************************************************/
-
+
package org.eclipse.debug.internal.ui.views.memory;
import java.util.ArrayList;
@@ -66,14 +66,13 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
-
/**
* Tree viewer for memory blocks
*/
-public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionChangedListener, IMemoryViewPane, IMemoryRenderingContainer{
-
+public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionChangedListener, IMemoryViewPane, IMemoryRenderingContainer {
+
public static final String PANE_ID = DebugUIPlugin.getUniqueIdentifier() + ".MemoryView.MemoryBlocksTreeViewPane"; //$NON-NLS-1$
-
+
private IViewPart fParent;
private IPresentationContext fPresentationContext;
private MemoryViewTreeViewer fTreeViewer;
@@ -87,85 +86,83 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
private TreeViewPaneContextListener fDebugContextListener;
private ViewPaneEventHandler fEvtHandler;
private String fLabel;
-
- class TreeViewerRemoveMemoryBlocksAction extends Action
- {
- TreeViewerRemoveMemoryBlocksAction()
- {
+
+ class TreeViewerRemoveMemoryBlocksAction extends Action {
+ TreeViewerRemoveMemoryBlocksAction() {
super();
- setText(DebugUIMessages.RemoveMemoryBlockAction_title);
+ setText(DebugUIMessages.RemoveMemoryBlockAction_title);
- setToolTipText(DebugUIMessages.RemoveMemoryBlockAction_tooltip);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY));
+ setToolTipText(DebugUIMessages.RemoveMemoryBlockAction_tooltip);
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_REMOVE_MEMORY));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_MEMORY));
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".RemoveMemoryBlockAction_context"); //$NON-NLS-1$
setEnabled(true);
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
ISelection selected = fTreeViewer.getSelection();
-
- if (selected != null && selected instanceof IStructuredSelection)
- {
- Object[] selectedMemBlks = ((IStructuredSelection)selected).toArray();
- ArrayList memoryBlocks = new ArrayList();
- for (int i=0; i<selectedMemBlks.length; i++)
- {
- if (selectedMemBlks[i] instanceof IMemoryBlock)
+
+ if (selected != null && selected instanceof IStructuredSelection) {
+ Object[] selectedMemBlks = ((IStructuredSelection) selected).toArray();
+ ArrayList<Object> memoryBlocks = new ArrayList<Object>();
+ for (int i = 0; i < selectedMemBlks.length; i++) {
+ if (selectedMemBlks[i] instanceof IMemoryBlock) {
memoryBlocks.add(selectedMemBlks[i]);
+ }
}
-
- DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks((IMemoryBlock[])memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]));
+
+ DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks(memoryBlocks.toArray(new IMemoryBlock[memoryBlocks.size()]));
}
}
}
-
- class TreeViewerRemoveAllMemoryBlocksAction extends Action
- {
- TreeViewerRemoveAllMemoryBlocksAction()
- {
+
+ class TreeViewerRemoveAllMemoryBlocksAction extends Action {
+ TreeViewerRemoveAllMemoryBlocksAction() {
super();
- setText(DebugUIMessages.MemoryBlocksTreeViewPane_2);
+ setText(DebugUIMessages.MemoryBlocksTreeViewPane_2);
- setToolTipText(DebugUIMessages.MemoryBlocksTreeViewPane_2);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_ALL));
+ setToolTipText(DebugUIMessages.MemoryBlocksTreeViewPane_2);
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_ALL));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_ALL));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_ALL));
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".RemoveAllMemoryBlocksAction_context"); //$NON-NLS-1$
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
-
- IWorkbenchWindow window= DebugUIPlugin.getActiveWorkbenchWindow();
+
+ IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
if (window == null) {
return;
}
- boolean proceed = MessageDialog.openQuestion(window.getShell(), DebugUIMessages.MemoryBlocksTreeViewPane_0, DebugUIMessages.MemoryBlocksTreeViewPane_1); //
+ boolean proceed = MessageDialog.openQuestion(window.getShell(), DebugUIMessages.MemoryBlocksTreeViewPane_0, DebugUIMessages.MemoryBlocksTreeViewPane_1); //
if (proceed) {
IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
DebugPlugin.getDefault().getMemoryBlockManager().removeMemoryBlocks(memoryBlocks);
}
- }
+ }
}
-
- class ViewPaneEventHandler implements IMemoryBlockListener, IDebugEventSetListener
- {
+
+ class ViewPaneEventHandler implements IMemoryBlockListener, IDebugEventSetListener {
private boolean fDisposed = false;
-
- public ViewPaneEventHandler()
- {
+
+ public ViewPaneEventHandler() {
DebugPlugin.getDefault().getMemoryBlockManager().addListener(this);
DebugPlugin.getDefault().addDebugEventListener(this);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
public void dispose() {
@@ -174,54 +171,67 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
DebugPlugin.getDefault().removeDebugEventListener(this);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#
+ * MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
public void memoryBlocksAdded(final IMemoryBlock[] memory) {
// if the content provider is disposed, do not handle event
- if (fDisposed)
+ if (fDisposed) {
return;
+ }
updateActionsEnablement();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#
+ * MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
public void memoryBlocksRemoved(final IMemoryBlock[] memory) {
- if (fDisposed)
+ if (fDisposed) {
return;
+ }
updateActionsEnablement();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.BasicDebugViewContentProvider#doHandleDebugEvent(org.eclipse.debug.core.DebugEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.BasicDebugViewContentProvider
+ * #doHandleDebugEvent(org.eclipse.debug.core.DebugEvent)
*/
protected void doHandleDebugEvent(DebugEvent event) {
-
+
// if the view is disposed, do not handle event
- if (fDisposed)
+ if (fDisposed) {
return;
-
- if (event.getKind() == DebugEvent.TERMINATE)
- {
- // should only handle the terminate event if the target is terminated
- if (event.getSource() instanceof IDebugTarget)
- {
+ }
+
+ if (event.getKind() == DebugEvent.TERMINATE) {
+ // should only handle the terminate event if the target is
+ // terminated
+ if (event.getSource() instanceof IDebugTarget) {
IMemoryBlockRetrieval srcRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(event.getSource());
- if (srcRetrieval == fRetrieval)
- {
+ if (srcRetrieval == fRetrieval) {
// #setInput must be done on the UI thread
- UIJob job = new UIJob("setInput"){ //$NON-NLS-1$
+ UIJob job = new UIJob("setInput") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
-
- // if viewpane is disposed, do not handle event
- if (fTreeViewer.getContentProvider() == null)
- return Status.OK_STATUS;
-
+
+ // if viewpane is disposed, do not handle event
+ if (fTreeViewer.getContentProvider() == null) {
+ return Status.OK_STATUS;
+ }
+
fTreeViewer.setInput(null);
return Status.OK_STATUS;
- }};
-
+ }
+ };
+
job.setSystem(true);
job.schedule();
}
@@ -229,37 +239,32 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
}
}
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
- for (int i=0; i<events.length; i++)
- {
+ for (int i = 0; i < events.length; i++) {
doHandleDebugEvent(events[i]);
}
}
}
-
- class TreeViewPaneContextListener implements IDebugContextListener
- {
+
+ class TreeViewPaneContextListener implements IDebugContextListener {
public void contextActivated(ISelection selection) {
-
- if (selection.isEmpty() && fRetrieval != null)
- {
+
+ if (selection.isEmpty() && fRetrieval != null) {
fRetrieval = null;
- if (fTreeViewer != null && fTreeViewer.getContentProvider() != null)
+ if (fTreeViewer != null && fTreeViewer.getContentProvider() != null) {
fTreeViewer.setInput(fRetrieval);
+ }
updateActionsEnablement();
return;
}
-
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
- if (obj instanceof IAdaptable)
- {
- IAdaptable context = (IAdaptable)obj;
+
+ if (selection instanceof IStructuredSelection) {
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
+ if (obj instanceof IAdaptable) {
+ IAdaptable context = (IAdaptable) obj;
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null && retrieval != fRetrieval &&
- fTreeViewer != null && fTreeViewer.getContentProvider() != null)
- {
+ if (retrieval != null && retrieval != fRetrieval && fTreeViewer != null && fTreeViewer.getContentProvider() != null) {
// set new setting
fRetrieval = retrieval;
fTreeViewer.setInput(fRetrieval);
@@ -269,79 +274,85 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener
+ * #contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.
+ * DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
contextActivated(event.getContext());
}
}
}
-
- public MemoryBlocksTreeViewPane(IViewPart parent)
- {
+
+ public MemoryBlocksTreeViewPane(IViewPart parent) {
fParent = parent;
fSelectionProvider = new ViewPaneSelectionProvider();
}
-
- public Control createViewPane(Composite parent, String paneId, String label)
- {
+
+ @Override
+ public Control createViewPane(Composite parent, String paneId, String label) {
fPaneId = paneId;
int style = SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.VIRTUAL;
fLabel = label;
-
+
IMemoryRenderingSite site = getMemoryRenderingSite();
fPresentationContext = new MemoryViewPresentationContext(site, this, null);
fTreeViewer = new MemoryViewTreeViewer(parent, style, fPresentationContext);
-
+
IAdaptable context = DebugUITools.getPartDebugContext(fParent.getSite());
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null)
+ if (retrieval != null) {
fTreeViewer.setInput(retrieval);
-
+ }
+
fRetrieval = retrieval;
-
+
fParent.getViewSite().getSelectionProvider().addSelectionChangedListener(this);
fParent.getViewSite().getPage().addSelectionListener(this);
-
+
fDebugContextListener = new TreeViewPaneContextListener();
DebugUITools.addPartDebugContextListener(fParent.getSite(), fDebugContextListener);
-
+
fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection treeSelected = event.getSelection();
fSelectionProvider.setSelection(treeSelected);
- }});
+ }
+ });
updateRetrieval();
fEvtHandler = new ViewPaneEventHandler();
-
+
// create context menu
MenuManager mgr = createContextMenuManager();
Menu menu = mgr.createContextMenu(fTreeViewer.getControl());
fTreeViewer.getControl().setMenu(menu);
-
+
GridData data = new GridData();
data.grabExcessHorizontalSpace = true;
data.grabExcessVerticalSpace = true;
data.horizontalAlignment = SWT.FILL;
data.verticalAlignment = SWT.FILL;
fTreeViewer.getControl().setLayoutData(data);
-
+
updateActionsEnablement();
-
+
return fTreeViewer.getControl();
}
-
-
+
/**
*
*/
private void updateRetrieval() {
-
+
Object context = DebugUITools.getPartDebugContext(fParent.getSite());
fRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
}
@@ -350,6 +361,7 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
MenuManager menuMgr = new MenuManager("#PopupMenu"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(fAddMemoryBlockAction);
manager.add(fRemoveMemoryBlockAction);
@@ -361,212 +373,238 @@ public class MemoryBlocksTreeViewPane implements ISelectionListener, ISelectionC
fParent.getSite().registerContextMenu(getId(), menuMgr, fSelectionProvider);
return menuMgr;
}
-
- public void dispose()
- {
+
+ @Override
+ public void dispose() {
fParent.getViewSite().getSelectionProvider().removeSelectionChangedListener(this);
- fParent.getViewSite().getPage().removeSelectionListener(this);
+ fParent.getViewSite().getPage().removeSelectionListener(this);
fAddMemoryBlockAction.dispose();
DebugUITools.removePartDebugContextListener(fParent.getSite(), fDebugContextListener);
- fEvtHandler.dispose();
- fPresentationContext.dispose();
+ fEvtHandler.dispose();
+ fPresentationContext.dispose();
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
+ * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
-
+ if (selection instanceof IStructuredSelection) {
+ Object obj = ((IStructuredSelection) selection).getFirstElement();
- if (selection instanceof IStructuredSelection)
- {
- Object obj = ((IStructuredSelection)selection).getFirstElement();
-
- if (obj instanceof IMemoryBlock)
- {
+ if (obj instanceof IMemoryBlock) {
// if the selection event comes from this view
- if (part == fParent)
- {
- // do not change selection if the selection is already correct
+ if (part == fParent) {
+ // do not change selection if the selection is already
+ // correct
ISelection treeSel = fTreeViewer.getSelection();
- if (treeSel instanceof IStructuredSelection)
- {
- if (((IStructuredSelection)treeSel).getFirstElement() == obj)
+ if (treeSel instanceof IStructuredSelection) {
+ if (((IStructuredSelection) treeSel).getFirstElement() == obj) {
return;
+ }
}
- // remove itself as selection listener when handling selection changed event
+ // remove itself as selection listener when handling
+ // selection changed event
removeSelctionListener(this);
fTreeViewer.setSelection(selection);
- // remove itself as selection listener when handling selection changed event
+ // remove itself as selection listener when handling
+ // selection changed event
addSelectionListener(this);
}
}
}
-
- }
+ }
-
- public String getId()
- {
+ @Override
+ public String getId() {
return fPaneId;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getActions()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getActions()
*/
+ @Override
public IAction[] getActions() {
-
- if (fAddMemoryBlockAction == null)
- fAddMemoryBlockAction = new RetargetAddMemoryBlockAction((IMemoryRenderingSite)fParent);
-
- if (fRemoveMemoryBlockAction == null)
- {
+
+ if (fAddMemoryBlockAction == null) {
+ fAddMemoryBlockAction = new RetargetAddMemoryBlockAction((IMemoryRenderingSite) fParent);
+ }
+
+ if (fRemoveMemoryBlockAction == null) {
fRemoveMemoryBlockAction = new TreeViewerRemoveMemoryBlocksAction();
}
-
- if (fRemoveAllMemoryBlocksAction == null)
- {
+
+ if (fRemoveAllMemoryBlocksAction == null) {
fRemoveAllMemoryBlocksAction = new TreeViewerRemoveAllMemoryBlocksAction();
}
-
+
updateActionsEnablement();
-
- return new IAction[]{fAddMemoryBlockAction, fRemoveMemoryBlockAction, fRemoveAllMemoryBlocksAction};
+
+ return new IAction[] {
+ fAddMemoryBlockAction, fRemoveMemoryBlockAction,
+ fRemoveAllMemoryBlocksAction };
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#addSelectionListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#
+ * addSelectionListener(org.eclipse.jface.viewers.ISelectionChangedListener)
*/
- public void addSelectionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
+ @Override
+ public void addSelectionListener(ISelectionChangedListener listener) {
+ if (fSelectionProvider == null) {
fSelectionProvider = new ViewPaneSelectionProvider();
-
+ }
+
fSelectionProvider.addSelectionChangedListener(listener);
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#removeSelctionListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#
+ * removeSelctionListener
+ * (org.eclipse.jface.viewers.ISelectionChangedListener)
*/
- public void removeSelctionListener(ISelectionChangedListener listener)
- {
- if (fSelectionProvider == null)
+ @Override
+ public void removeSelctionListener(ISelectionChangedListener listener) {
+ if (fSelectionProvider == null) {
return;
-
+ }
+
fSelectionProvider.removeSelectionChangedListener(listener);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getSelectionProvider()
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#
+ * getSelectionProvider()
*/
+ @Override
public ISelectionProvider getSelectionProvider() {
return fSelectionProvider;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#restoreViewPane()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#restoreViewPane
+ * ()
*/
+ @Override
public void restoreViewPane() {
updateRetrieval();
updateActionsEnablement();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getControl()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#getControl()
*/
+ @Override
public Control getControl() {
return fTreeViewer.getControl();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#setVisible(boolean)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#setVisible
+ * (boolean)
*/
+ @Override
public void setVisible(boolean visible) {
- if (fVisible != visible)
- {
+ if (fVisible != visible) {
fVisible = visible;
-
- if(fVisible)
- {
+
+ if (fVisible) {
fTreeViewer.refresh();
fTreeViewer.getControl().setFocus();
}
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#isVisible()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewPane#isVisible()
*/
+ @Override
public boolean isVisible() {
return fVisible;
}
-
- private void updateActionsEnablement()
- {
- if (fRemoveMemoryBlockAction == null)
+
+ private void updateActionsEnablement() {
+ if (fRemoveMemoryBlockAction == null) {
return;
-
- if (fRemoveAllMemoryBlocksAction == null)
+ }
+
+ if (fRemoveAllMemoryBlocksAction == null) {
return;
-
- if (fRetrieval != null)
- {
+ }
+
+ if (fRetrieval != null) {
IMemoryBlock[] memBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(fRetrieval);
- if(memBlocks.length > 0)
- {
+ if (memBlocks.length > 0) {
fRemoveMemoryBlockAction.setEnabled(true);
fRemoveAllMemoryBlocksAction.setEnabled(true);
- }
- else
- {
+ } else {
fRemoveMemoryBlockAction.setEnabled(false);
- fRemoveAllMemoryBlocksAction.setEnabled(false);
+ fRemoveAllMemoryBlocksAction.setEnabled(false);
}
- }
- else
- {
+ } else {
fRemoveMemoryBlockAction.setEnabled(false);
fRemoveAllMemoryBlocksAction.setEnabled(false);
}
}
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
// only handle selection changed from parent's selection provider
- if (event.getSource() == fParent.getSite().getSelectionProvider())
- {
+ if (event.getSource() == fParent.getSite().getSelectionProvider()) {
MemoryBlocksTreeViewPane.this.selectionChanged(fParent, event.getSelection());
}
}
-
- public StructuredViewer getViewer()
- {
+
+ public StructuredViewer getViewer() {
return fTreeViewer;
}
+ @Override
public IMemoryRenderingSite getMemoryRenderingSite() {
- if (fParent instanceof IMemoryRenderingSite)
- return (IMemoryRenderingSite)fParent;
+ if (fParent instanceof IMemoryRenderingSite) {
+ return (IMemoryRenderingSite) fParent;
+ }
return null;
}
+ @Override
public void addMemoryRendering(IMemoryRendering rendering) {
// do nothing
}
+ @Override
public void removeMemoryRendering(IMemoryRendering rendering) {
// do nothing
}
+ @Override
public IMemoryRendering[] getRenderings() {
return new IMemoryRendering[0];
}
+ @Override
public IMemoryRendering getActiveRendering() {
return null;
}
+ @Override
public String getLabel() {
return fLabel;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
index d6001e865..6fbf1344d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryView.java
@@ -77,34 +77,37 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
protected MemoryViewSelectionProvider fSelectionProvider;
private MemoryViewPartListener fPartListener;
-
+
private SashForm fSashForm;
- private Hashtable fViewPanes = new Hashtable();
- private Hashtable fViewPaneControls = new Hashtable();
- private ArrayList fVisibleViewPanes = new ArrayList();
+ private Hashtable<String, IMemoryViewPane> fViewPanes = new Hashtable<String, IMemoryViewPane>();
+ private Hashtable<String, ViewForm> fViewPaneControls = new Hashtable<String, ViewForm>();
+ private ArrayList<String> fVisibleViewPanes = new ArrayList<String>();
private boolean fVisible;
-
- private ArrayList fWeights = new ArrayList();
-
- private static final String VISIBILITY_PREF = IDebugUIConstants.ID_MEMORY_VIEW+".viewPanesVisibility"; //$NON-NLS-1$
+
+ private ArrayList<Integer> fWeights = new ArrayList<Integer>();
+
+ private static final String VISIBILITY_PREF = IDebugUIConstants.ID_MEMORY_VIEW + ".viewPanesVisibility"; //$NON-NLS-1$
private static final String ID_MEMORY_VIEW_CONTEXT = "org.eclipse.debug.ui.memoryview"; //$NON-NLS-1$
private static final String ID_ADD_MEMORY_BLOCK_COMMAND = "org.eclipse.debug.ui.commands.addMemoryMonitor"; //$NON-NLS-1$
private static final String ID_TOGGLE_MEMORY_MONITORS_PANE_COMMAND = "org.eclipse.debug.ui.commands.toggleMemoryMonitorsPane"; //$NON-NLS-1$
private static final String ID_NEXT_MEMORY_BLOCK_COMMAND = "org.eclipse.debug.ui.commands.nextMemoryBlock"; //$NON-NLS-1$
private static final String ID_NEW_RENDERING_COMMAND = "org.eclipse.debug.ui.commands.newRendering"; //$NON-NLS-1$
private static final String ID_CLOSE_RENDERING_COMMAND = "org.eclipse.debug.ui.commands.closeRendering"; //$NON-NLS-1$
-
- public static final String VIEW_PANE_ORIENTATION_PREF = IDebugUIConstants.ID_MEMORY_VIEW+".orientation"; //$NON-NLS-1$
+
+ public static final String VIEW_PANE_ORIENTATION_PREF = IDebugUIConstants.ID_MEMORY_VIEW + ".orientation"; //$NON-NLS-1$
public static final int HORIZONTAL_VIEW_ORIENTATION = 0;
- public static final int VERTICAL_VIEW_ORIENTATION =1;
+ public static final int VERTICAL_VIEW_ORIENTATION = 1;
+
+ private String[] defaultVisiblePaneIds = {
+ MemoryBlocksTreeViewPane.PANE_ID,
+ IDebugUIConstants.ID_RENDERING_VIEW_PANE_1 };
- private String[] defaultVisiblePaneIds ={MemoryBlocksTreeViewPane.PANE_ID, IDebugUIConstants.ID_RENDERING_VIEW_PANE_1};
-
private MemoryBlocksTreeViewPane fMemBlkViewer;
-
+
private MemoryViewSynchronizationService fSyncService;
-
- private boolean fPinMBDisplay = false; // pin memory block display, on by default
+
+ private boolean fPinMBDisplay = false; // pin memory block display, on by
+ // default
private static int fViewCnt = 0;
private AbstractHandler fAddHandler;
@@ -112,231 +115,253 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
private AbstractHandler fNextMemoryBlockHandler;
private AbstractHandler fNewRenderingHandler;
private AbstractHandler fCloseRenderingHandler;
-
+
private ViewPaneOrientationAction[] fOrientationActions;
private int fViewOrientation = HORIZONTAL_VIEW_ORIENTATION;
-
+
private String fActivePaneId;
-
- class MemoryViewSelectionProvider implements ISelectionProvider, ISelectionChangedListener
- {
- ArrayList fListeners = new ArrayList();
-
+
+ class MemoryViewSelectionProvider implements ISelectionProvider, ISelectionChangedListener {
+ ArrayList<ISelectionChangedListener> fListeners = new ArrayList<ISelectionChangedListener>();
+
IStructuredSelection fSelections = new StructuredSelection();
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener
+ * (org.eclipse.jface.viewers.ISelectionChangedListener)
*/
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
+ @Override
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
if (!fListeners.contains(listener))
fListeners.add(listener);
-
+
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
*/
- public ISelection getSelection()
- {
+ @Override
+ public ISelection getSelection() {
return fSelections;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ISelectionProvider#
+ * removeSelectionChangedListener
+ * (org.eclipse.jface.viewers.ISelectionChangedListener)
*/
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
+ @Override
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
if (fListeners.contains(listener))
fListeners.remove(listener);
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse
+ * .jface.viewers.ISelection)
*/
- public void setSelection(ISelection selection)
- {
- if (selection instanceof IStructuredSelection)
- {
+ @Override
+ public void setSelection(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
boolean fireChanged = false;
-
+
// only fire change event if the selection has really changed
- if (fSelections.getFirstElement() != ((IStructuredSelection)selection).getFirstElement())
+ if (fSelections.getFirstElement() != ((IStructuredSelection) selection).getFirstElement())
fireChanged = true;
- fSelections = (IStructuredSelection)selection;
-
+ fSelections = (IStructuredSelection) selection;
+
if (fireChanged)
fireChanged();
}
}
-
- public void fireChanged()
- {
+
+ public void fireChanged() {
SelectionChangedEvent evt = new SelectionChangedEvent(this, getSelection());
- for (int i=0; i<fListeners.size(); i++)
- {
- ((ISelectionChangedListener)fListeners.get(i)).selectionChanged(evt);
+ for (int i = 0; i < fListeners.size(); i++) {
+ fListeners.get(i).selectionChanged(evt);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged
+ * (org.eclipse.jface.viewers.SelectionChangedEvent)
*/
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
ISelection viewPaneSelection = event.getSelection();
-
- if (viewPaneSelection instanceof IStructuredSelection)
- {
- Object selected = ((IStructuredSelection)viewPaneSelection).getFirstElement();
-
- if (selected != null)
- {
- StructuredSelection strucSelection = new StructuredSelection(new Object[]{selected});
+
+ if (viewPaneSelection instanceof IStructuredSelection) {
+ Object selected = ((IStructuredSelection) viewPaneSelection).getFirstElement();
+
+ if (selected != null) {
+ StructuredSelection strucSelection = new StructuredSelection(new Object[] { selected });
setSelection(strucSelection);
- }
- else
- {
+ } else {
setSelection(viewPaneSelection);
}
}
}
}
-
- class MemoryViewPartListener implements IPartListener2
- {
+
+ class MemoryViewPartListener implements IPartListener2 {
IMemoryRenderingSite fView = null;
-
- public MemoryViewPartListener(IMemoryRenderingSite view)
- {
+
+ public MemoryViewPartListener(IMemoryRenderingSite view) {
fView = view;
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partActivated(IWorkbenchPartReference ref) {
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPartReference ref) {
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partClosed(IWorkbenchPartReference ref) {
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partDeactivated(IWorkbenchPartReference ref) {
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partHidden(IWorkbenchPartReference ref) {
-
+
IWorkbenchPart part = ref.getPart(false);
-
- if (part == fView)
- {
+
+ if (part == fView) {
setVisible(false);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partVisible(IWorkbenchPartReference ref) {
IWorkbenchPart part = ref.getPart(false);
-
- if (part == fView)
- {
+
+ if (part == fView) {
setVisible(true);
restoreView();
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.
+ * IWorkbenchPartReference)
*/
+ @Override
public void partInputChanged(IWorkbenchPartReference ref) {
}
- public void partOpened(IWorkbenchPartReference ref)
- {
+ @Override
+ public void partOpened(IWorkbenchPartReference ref) {
}
}
-
+
+ @Override
public void init(IViewSite site) throws PartInitException {
super.init(site);
-
- fViewCnt ++;
+
+ fViewCnt++;
String secondaryId = site.getSecondaryId();
if (secondaryId != null)
MemoryViewIdRegistry.registerView(secondaryId);
-
+
// only do this the first time
// not sure if there is a bug in the UI... if the view is
// not a primary view and if it's hidden, the view is not
// init and created until it becomes visible.
- if (fViewCnt == 1)
- {
+ if (fViewCnt == 1) {
// also try to find other views and register
- if (DebugUIPlugin.getActiveWorkbenchWindow() != null &&
- DebugUIPlugin.getActiveWorkbenchWindow().getActivePage() != null)
- {
+ if (DebugUIPlugin.getActiveWorkbenchWindow() != null && DebugUIPlugin.getActiveWorkbenchWindow().getActivePage() != null) {
IViewReference references[] = DebugUIPlugin.getActiveWorkbenchWindow().getActivePage().getViewReferences();
- for (int i=0; i<references.length; i++)
- {
- if (references[i].getSecondaryId() != null)
- {
+ for (int i = 0; i < references.length; i++) {
+ if (references[i].getSecondaryId() != null) {
MemoryViewIdRegistry.registerView(references[i].getSecondaryId());
}
}
}
}
-
+
fSyncService = new MemoryViewSynchronizationService();
}
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets
+ * .Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
fSashForm = new SashForm(parent, SWT.HORIZONTAL);
-
+
fSelectionProvider = new MemoryViewSelectionProvider();
-
+
// set up selection provider and listeners
getSite().setSelectionProvider(fSelectionProvider);
createMemoryBlocksTreeViewPane(fSashForm);
createRenderingViewPane(IDebugUIConstants.ID_RENDERING_VIEW_PANE_1);
createRenderingViewPane(IDebugUIConstants.ID_RENDERING_VIEW_PANE_2);
-
+
setVisible(true);
-
+
// set up weights in sashform
- Integer[] weights = (Integer[])fWeights.toArray(new Integer[fWeights.size()]);
+ Integer[] weights = fWeights.toArray(new Integer[fWeights.size()]);
int[] intWeights = new int[weights.length];
- for (int i=0; i<weights.length; i++)
- {
+ for (int i = 0; i < weights.length; i++) {
intWeights[i] = weights[i].intValue();
}
fSashForm.setWeights(intWeights);
loadViewPanesVisibility();
-
+
createOrientationActions();
loadOrientation();
-
+
fPartListener = new MemoryViewPartListener(this);
getSite().getPage().addPartListener(fPartListener);
activateHandlers();
@@ -344,45 +369,45 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
restoreView();
}
-
- public void activateHandlers() {
- ICommandService commandSupport = (ICommandService)getSite().getService(ICommandService.class);
- IHandlerService handlerService = (IHandlerService)getSite().getService(IHandlerService.class);
- IContextService contextSupport = (IContextService)getSite().getService(IContextService.class);
-
- if (commandSupport != null && handlerService != null && contextSupport != null)
- {
+ public void activateHandlers() {
+ ICommandService commandSupport = (ICommandService) getSite().getService(ICommandService.class);
+ IHandlerService handlerService = (IHandlerService) getSite().getService(IHandlerService.class);
+ IContextService contextSupport = (IContextService) getSite().getService(IContextService.class);
+
+ if (commandSupport != null && handlerService != null && contextSupport != null) {
contextSupport.activateContext(ID_MEMORY_VIEW_CONTEXT);
-
+
fAddHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IAdaptable context = DebugUITools.getPartDebugContext(getSite());
- if (context != null && MemoryViewUtil.isValidSelection(new StructuredSelection(context)))
- {
- RetargetAddMemoryBlockAction action = new RetargetAddMemoryBlockAction(MemoryView.this);
- action.run();
- action.dispose();
- }
- return null;
- }};
- handlerService.activateHandler(ID_ADD_MEMORY_BLOCK_COMMAND, fAddHandler);
-
- fToggleMonitorsHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- ToggleMemoryMonitorsAction action = new ToggleMemoryMonitorsAction();
- action.init(MemoryView.this);
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IAdaptable context = DebugUITools.getPartDebugContext(getSite());
+ if (context != null && MemoryViewUtil.isValidSelection(new StructuredSelection(context))) {
+ RetargetAddMemoryBlockAction action = new RetargetAddMemoryBlockAction(MemoryView.this);
action.run();
action.dispose();
- return null;
}
- };
-
+ return null;
+ }
+ };
+ handlerService.activateHandler(ID_ADD_MEMORY_BLOCK_COMMAND, fAddHandler);
+
+ fToggleMonitorsHandler = new AbstractHandler() {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ToggleMemoryMonitorsAction action = new ToggleMemoryMonitorsAction();
+ action.init(MemoryView.this);
+ action.run();
+ action.dispose();
+ return null;
+ }
+ };
+
handlerService.activateHandler(ID_TOGGLE_MEMORY_MONITORS_PANE_COMMAND, fToggleMonitorsHandler);
-
+
fNextMemoryBlockHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
SwitchMemoryBlockAction action = new SwitchMemoryBlockAction();
action.init(MemoryView.this);
action.run();
@@ -391,22 +416,20 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
}
};
handlerService.activateHandler(ID_NEXT_MEMORY_BLOCK_COMMAND, fNextMemoryBlockHandler);
-
+
fCloseRenderingHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
-
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
IMemoryRenderingContainer container = getContainer(fActivePaneId);
- if (container != null)
- {
+ if (container != null) {
if (container instanceof RenderingViewPane) {
if (!((RenderingViewPane) container).canRemoveRendering())
return null;
}
IMemoryRendering activeRendering = container.getActiveRendering();
- if (activeRendering != null)
- {
+ if (activeRendering != null) {
container.removeMemoryRendering(activeRendering);
}
}
@@ -415,17 +438,16 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
}
};
handlerService.activateHandler(ID_CLOSE_RENDERING_COMMAND, fCloseRenderingHandler);
-
+
fNewRenderingHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ IMemoryRenderingContainer container = getContainer(fActivePaneId);
- IMemoryRenderingContainer container = getContainer(fActivePaneId);
-
- if (container != null && container instanceof RenderingViewPane)
- {
- RenderingViewPane pane = (RenderingViewPane)container;
+ if (container != null && container instanceof RenderingViewPane) {
+ RenderingViewPane pane = (RenderingViewPane) container;
if (pane.canAddRendering())
pane.showCreateRenderingTab();
}
@@ -434,46 +456,47 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
};
handlerService.activateHandler(ID_NEW_RENDERING_COMMAND, fNewRenderingHandler);
}
- }
-
+ }
+
/**
*
*/
private void createMemoryBlocksTreeViewPane(Composite parent) {
-
+
fMemBlkViewer = new MemoryBlocksTreeViewPane(this);
fViewPanes.put(MemoryBlocksTreeViewPane.PANE_ID, fMemBlkViewer);
ViewForm viewerViewForm = new ViewForm(parent, SWT.NONE);
PlatformUI.getWorkbench().getHelpSystem().setHelp(viewerViewForm, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); //$NON-NLS-1$
fViewPaneControls.put(MemoryBlocksTreeViewPane.PANE_ID, viewerViewForm);
fWeights.add(new Integer(15));
-
+
fMemBlkViewer.addSelectionListener(fSelectionProvider);
-
+
Control viewerControl = fMemBlkViewer.createViewPane(viewerViewForm, MemoryBlocksTreeViewPane.PANE_ID, DebugUIMessages.MemoryView_Memory_monitors);
viewerViewForm.setContent(viewerControl);
-
+
ISelection selection = fMemBlkViewer.getSelectionProvider().getSelection();
if (selection != null)
- fSelectionProvider.setSelection(selection);
+ fSelectionProvider.setSelection(selection);
- ToolBarManager viewerToolBarMgr = new ToolBarManager(SWT.FLAT);
+ ToolBarManager viewerToolBarMgr = new ToolBarManager(SWT.FLAT);
IAction[] actions = fMemBlkViewer.getActions();
- for (int i=0; i<actions.length; i++)
- {
+ for (int i = 0; i < actions.length; i++) {
viewerToolBarMgr.add(actions[i]);
}
ToolBar viewerToolbar = viewerToolBarMgr.createControl(viewerViewForm);
viewerViewForm.setTopRight(viewerToolbar);
-
+
Label viewerLabel = new Label(viewerViewForm, SWT.WRAP);
- viewerLabel.setText(DebugUIMessages.MemoryView_Memory_monitors);
+ viewerLabel.setText(DebugUIMessages.MemoryView_Memory_monitors);
viewerViewForm.setTopLeft(viewerLabel);
-
+
fMemBlkViewer.getControl().addFocusListener(new FocusAdapter() {
+ @Override
public void focusGained(FocusEvent e) {
fActivePaneId = fMemBlkViewer.getId();
- }});
+ }
+ });
}
/**
@@ -482,11 +505,14 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
*/
private Listener createDeactivateListener(final IMemoryViewPane viewPane) {
Listener deactivateListener = new Listener() {
- private String id=viewPane.getId();
+ private String id = viewPane.getId();
+
+ @Override
public void handleEvent(Event event) {
if (fActivePaneId.equals(id))
viewPane.removeSelctionListener(fSelectionProvider);
- }};
+ }
+ };
return deactivateListener;
}
@@ -495,12 +521,15 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
*/
private Listener createActivateListener(final IMemoryViewPane viewPane) {
Listener activateListener = new Listener() {
- private String id=viewPane.getId();
+ private String id = viewPane.getId();
+
+ @Override
public void handleEvent(Event event) {
fActivePaneId = id;
viewPane.addSelectionListener(fSelectionProvider);
fSelectionProvider.setSelection(viewPane.getSelectionProvider().getSelection());
- }};
+ }
+ };
return activateListener;
}
@@ -508,167 +537,174 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
*
*/
public void createRenderingViewPane(final String paneId) {
- final RenderingViewPane renderingPane = new RenderingViewPane(this);
+ final RenderingViewPane renderingPane = new RenderingViewPane(this);
fViewPanes.put(paneId, renderingPane);
ViewForm renderingViewForm = new ViewForm(fSashForm, SWT.NONE);
fViewPaneControls.put(paneId, renderingViewForm);
fWeights.add(new Integer(40));
-
+
Control renderingControl = renderingPane.createViewPane(renderingViewForm, paneId, DebugUIMessages.MemoryView_Memory_renderings, true, true);
PlatformUI.getWorkbench().getHelpSystem().setHelp(renderingControl, IDebugUIConstants.PLUGIN_ID + ".MemoryView_context"); //$NON-NLS-1$
renderingViewForm.setContent(renderingControl);
-
+
Listener renderingActivateListener = createActivateListener(renderingPane);
renderingControl.addListener(SWT.Activate, renderingActivateListener);
-
+
Listener renderingDeactivateListener = createDeactivateListener(renderingPane);
renderingControl.addListener(SWT.Deactivate, renderingDeactivateListener);
}
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
if (fActivePaneId == null)
fActivePaneId = fMemBlkViewer.getId();
-
+
IMemoryViewPane pane = getViewPane(fActivePaneId);
pane.getControl().setFocus();
}
-
+
+ @Override
public void dispose() {
- getSite().getPage().removePartListener(fPartListener);
-
- Enumeration enumeration = fViewPanes.elements();
- while (enumeration.hasMoreElements())
- {
+ getSite().getPage().removePartListener(fPartListener);
+
+ Enumeration<IMemoryViewPane> enumeration = fViewPanes.elements();
+ while (enumeration.hasMoreElements()) {
Object element = enumeration.nextElement();
- if (element instanceof IMemoryViewPane)
- {
- ((IMemoryViewPane)element).dispose();
+ if (element instanceof IMemoryViewPane) {
+ ((IMemoryViewPane) element).dispose();
}
}
-
+
fViewPaneControls.clear();
-
+
IViewSite viewSite = getViewSite();
String secondaryId = viewSite.getSecondaryId();
if (secondaryId != null)
MemoryViewIdRegistry.deregisterView(secondaryId);
-
+
fSyncService.shutdown();
-
+
if (fAddHandler != null)
fAddHandler.dispose();
-
+
if (fToggleMonitorsHandler != null)
fToggleMonitorsHandler.dispose();
-
+
if (fNextMemoryBlockHandler != null)
fNextMemoryBlockHandler.dispose();
-
+
super.dispose();
}
-
- private void setVisible(boolean visible)
- {
+
+ private void setVisible(boolean visible) {
IMemoryViewPane[] viewPanes = getViewPanes();
-
- for (int i=0; i<viewPanes.length; i++)
- {
+
+ for (int i = 0; i < viewPanes.length; i++) {
// if currently visible, take view pane's visibility into account
// else force view pane to be visible if it is listed in
// "visible view panes" array list.
if (fVisible)
viewPanes[i].setVisible(visible && viewPanes[i].isVisible());
- else
- {
+ else {
if (isViewPaneVisible(viewPanes[i].getId()))
viewPanes[i].setVisible(visible);
- }
+ }
}
-
+
fVisible = visible;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#getViewPane(java.lang.String)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#getViewPane
+ * (java.lang.String)
*/
public IMemoryViewPane getViewPane(String paneId) {
- return (IMemoryViewPane)fViewPanes.get(paneId);
- }
+ return fViewPanes.get(paneId);
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#getViewPanes()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#getViewPanes
+ * ()
*/
public IMemoryViewPane[] getViewPanes() {
IMemoryViewPane[] viewPanes = new IMemoryViewPane[fViewPanes.size()];
- Enumeration enumeration = fViewPanes.elements();
- int i=0;
- while (enumeration.hasMoreElements())
- {
- viewPanes[i] = (IMemoryViewPane)enumeration.nextElement();
+ Enumeration<IMemoryViewPane> enumeration = fViewPanes.elements();
+ int i = 0;
+ while (enumeration.hasMoreElements()) {
+ viewPanes[i] = enumeration.nextElement();
i++;
}
-
+
return viewPanes;
}
-
+
/**
- * Restore each view pane from the memory view based on current
- * debug selection
+ * Restore each view pane from the memory view based on current debug
+ * selection
*/
private void restoreView() {
IMemoryViewPane[] viewPanes = getViewPanes();
- for (int i=0; i<viewPanes.length; i++)
- {
+ for (int i = 0; i < viewPanes.length; i++) {
viewPanes[i].restoreViewPane();
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#showViewPane(boolean, java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#showViewPane
+ * (boolean, java.lang.String)
*/
public void showViewPane(boolean show, String paneId) {
-
- Control viewPaneControl = (Control)fViewPaneControls.get(paneId);
-
- if (viewPaneControl != null)
- {
+
+ Control viewPaneControl = fViewPaneControls.get(paneId);
+
+ if (viewPaneControl != null) {
Control children[] = fSashForm.getChildren();
-
- for (int i=0; i<children.length; i++)
- {
- if (children[i] == viewPaneControl)
- {
+
+ for (int i = 0; i < children.length; i++) {
+ if (children[i] == viewPaneControl) {
children[i].setVisible(show);
- IMemoryViewPane viewPane = (IMemoryViewPane)fViewPanes.get(paneId);
+ IMemoryViewPane viewPane = fViewPanes.get(paneId);
if (viewPane != null)
viewPane.setVisible(show);
}
}
fSashForm.layout();
}
-
+
storeViewPaneVisibility();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#isViewPaneVisible(java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IMultipaneMemoryView#
+ * isViewPaneVisible(java.lang.String)
*/
public boolean isViewPaneVisible(String paneId) {
return fVisibleViewPanes.contains(paneId);
}
-
- private void storeViewPaneVisibility() {
+
+ private void storeViewPaneVisibility() {
fVisibleViewPanes.clear();
- StringBuffer visibleViewPanes= new StringBuffer();
-
- Enumeration enumeration = fViewPaneControls.keys();
-
+ StringBuffer visibleViewPanes = new StringBuffer();
+
+ Enumeration<String> enumeration = fViewPaneControls.keys();
+
while (enumeration.hasMoreElements()) {
- String paneId = (String)enumeration.nextElement();
-
- Control control = (Control)fViewPaneControls.get(paneId);
+ String paneId = enumeration.nextElement();
+
+ Control control = fViewPaneControls.get(paneId);
if (control.isVisible()) {
visibleViewPanes.append(paneId);
visibleViewPanes.append(","); //$NON-NLS-1$
@@ -676,7 +712,7 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
}
}
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
- if(node != null) {
+ if (node != null) {
try {
node.put(getVisibilityPrefId(), visibleViewPanes.toString());
node.flush();
@@ -685,66 +721,53 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
}
}
}
-
+
private void loadViewPanesVisibility() {
- String visiblePanes = Platform.getPreferencesService().getString(
- DebugUIPlugin.getUniqueIdentifier(),
- getVisibilityPrefId(),
- null,
- null);
-
+ String visiblePanes = Platform.getPreferencesService().getString(DebugUIPlugin.getUniqueIdentifier(), getVisibilityPrefId(), null, null);
+
if (visiblePanes != null && visiblePanes.length() > 0) {
StringTokenizer tokenizer = new StringTokenizer(visiblePanes, ","); //$NON-NLS-1$
- while (tokenizer.hasMoreTokens())
- {
+ while (tokenizer.hasMoreTokens()) {
String paneId = tokenizer.nextToken();
fVisibleViewPanes.add(paneId);
}
- }
- else {
- for (int i=0 ;i<defaultVisiblePaneIds.length; i++)
- {
+ } else {
+ for (int i = 0; i < defaultVisiblePaneIds.length; i++) {
fVisibleViewPanes.add(defaultVisiblePaneIds[i]);
}
}
-
- Enumeration enumeration = fViewPaneControls.keys();
- while (enumeration.hasMoreElements())
- {
- String paneId = (String)enumeration.nextElement();
+
+ Enumeration<String> enumeration = fViewPaneControls.keys();
+ while (enumeration.hasMoreElements()) {
+ String paneId = enumeration.nextElement();
boolean visible = false;
- if(fVisibleViewPanes.contains(paneId))
+ if (fVisibleViewPanes.contains(paneId))
visible = true;
-
- Control control = (Control)fViewPaneControls.get(paneId);
+
+ Control control = fViewPaneControls.get(paneId);
control.setVisible(visible);
-
- IMemoryViewPane viewPane = (IMemoryViewPane)fViewPanes.get(paneId);
+
+ IMemoryViewPane viewPane = fViewPanes.get(paneId);
viewPane.setVisible(visible);
}
-
+
fSashForm.layout();
}
-
+
private void loadOrientation() {
- fViewOrientation = Platform.getPreferencesService().getInt(
- DebugUIPlugin.getUniqueIdentifier(),
- getOrientationPrefId(),
- HORIZONTAL_VIEW_ORIENTATION,
- null);
-
- for (int i=0; i<fOrientationActions.length; i++) {
- if (fOrientationActions[i].getOrientation() == fViewOrientation)
- {
+ fViewOrientation = Platform.getPreferencesService().getInt(DebugUIPlugin.getUniqueIdentifier(), getOrientationPrefId(), HORIZONTAL_VIEW_ORIENTATION, null);
+
+ for (int i = 0; i < fOrientationActions.length; i++) {
+ if (fOrientationActions[i].getOrientation() == fViewOrientation) {
fOrientationActions[i].run();
}
}
updateOrientationActions();
}
-
+
private void saveOrientation() {
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
- if(node != null) {
+ if (node != null) {
try {
node.putInt(getOrientationPrefId(), fViewOrientation);
node.flush();
@@ -753,97 +776,100 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
}
}
}
-
- private void updateOrientationActions()
- {
- for (int i=0; i<fOrientationActions.length; i++)
- {
- if (fOrientationActions[i].getOrientation() == fViewOrientation)
- {
+
+ private void updateOrientationActions() {
+ for (int i = 0; i < fOrientationActions.length; i++) {
+ if (fOrientationActions[i].getOrientation() == fViewOrientation) {
fOrientationActions[i].setChecked(true);
- }
- else
- {
+ } else {
fOrientationActions[i].setChecked(false);
}
-
+
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite#getSynchronizationService()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingSite#getSynchronizationService
+ * ()
*/
+ @Override
public IMemoryRenderingSynchronizationService getSynchronizationService() {
return fSyncService;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite#getMemoryRenderingContainers()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingSite#getMemoryRenderingContainers
+ * ()
*/
+ @Override
public IMemoryRenderingContainer[] getMemoryRenderingContainers() {
- Enumeration enumeration = fViewPanes.elements();
- ArrayList containers = new ArrayList();
- while (enumeration.hasMoreElements()){
+ Enumeration<IMemoryViewPane> enumeration = fViewPanes.elements();
+ ArrayList<Object> containers = new ArrayList<Object>();
+ while (enumeration.hasMoreElements()) {
Object obj = enumeration.nextElement();
if (obj instanceof IMemoryRenderingContainer)
containers.add(obj);
}
-
- return (IMemoryRenderingContainer[])containers.toArray(new IMemoryRenderingContainer[containers.size()]);
+
+ return containers.toArray(new IMemoryRenderingContainer[containers.size()]);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite#getContainer(java.lang.String)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingSite#getContainer(java.lang
+ * .String)
*/
+ @Override
public IMemoryRenderingContainer getContainer(String id) {
- Object viewPane = fViewPanes.get(id);
-
+ Object viewPane = fViewPanes.get(id);
+
if (viewPane instanceof IMemoryRenderingContainer)
- return (IMemoryRenderingContainer)viewPane;
-
+ return (IMemoryRenderingContainer) viewPane;
+
return null;
}
public boolean isPinMBDisplay() {
return fPinMBDisplay;
}
-
public void setPinMBDisplay(boolean pinMBDisplay) {
fPinMBDisplay = pinMBDisplay;
}
-
- private String getVisibilityPrefId()
- {
+
+ private String getVisibilityPrefId() {
IViewSite vs = getViewSite();
String viewId = vs.getSecondaryId();
-
+
if (viewId != null)
return VISIBILITY_PREF + "." + viewId; //$NON-NLS-1$
return VISIBILITY_PREF;
}
-
- private String getOrientationPrefId()
- {
+
+ private String getOrientationPrefId() {
IViewSite vs = getViewSite();
String viewId = vs.getSecondaryId();
-
+
if (viewId != null)
return VIEW_PANE_ORIENTATION_PREF + "." + viewId; //$NON-NLS-1$
return VIEW_PANE_ORIENTATION_PREF;
}
-
- private void createOrientationActions()
- {
+
+ private void createOrientationActions() {
IActionBars actionBars = getViewSite().getActionBars();
IMenuManager viewMenu = actionBars.getMenuManager();
-
+
fOrientationActions = new ViewPaneOrientationAction[2];
fOrientationActions[0] = new ViewPaneOrientationAction(this, HORIZONTAL_VIEW_ORIENTATION);
fOrientationActions[1] = new ViewPaneOrientationAction(this, VERTICAL_VIEW_ORIENTATION);
-
+
viewMenu.add(new Separator());
MenuManager layoutSubMenu = new MenuManager(VariablesViewMessages.VariablesView_40);
layoutSubMenu.add(fOrientationActions[0]);
@@ -851,24 +877,23 @@ public class MemoryView extends ViewPart implements IMemoryRenderingSite2 {
viewMenu.add(layoutSubMenu);
viewMenu.add(new Separator());
}
-
- public void setViewPanesOrientation(int orientation)
- {
+
+ public void setViewPanesOrientation(int orientation) {
fViewOrientation = orientation;
if (fViewOrientation == VERTICAL_VIEW_ORIENTATION)
fSashForm.setOrientation(SWT.VERTICAL);
else
fSashForm.setOrientation(SWT.HORIZONTAL);
-
+
saveOrientation();
updateOrientationActions();
}
-
- public int getViewPanesOrientation()
- {
+
+ public int getViewPanesOrientation() {
return fViewOrientation;
}
+ @Override
public void setContainerVisible(String id, boolean visible) {
showViewPane(visible, id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java
index f26a4901e..92c3d6686 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewIdRegistry.java
@@ -14,50 +14,43 @@ import java.util.ArrayList;
/**
* Class for managing the secondary ids for Memory View
- *
+ *
*/
-public class MemoryViewIdRegistry{
-
- private static ArrayList fgRegistry;
-
- public static void registerView(String secondaryId)
- {
- ArrayList registry = getRegistry();
-
- if (!registry.contains(secondaryId))
- {
+public class MemoryViewIdRegistry {
+
+ private static ArrayList<String> fgRegistry;
+
+ public static void registerView(String secondaryId) {
+ ArrayList<String> registry = getRegistry();
+
+ if (!registry.contains(secondaryId)) {
registry.add(secondaryId);
}
}
-
- public static void deregisterView(String secondaryId)
- {
- ArrayList registry = getRegistry();
-
- if (registry.contains(secondaryId))
- {
+
+ public static void deregisterView(String secondaryId) {
+ ArrayList<String> registry = getRegistry();
+
+ if (registry.contains(secondaryId)) {
registry.remove(secondaryId);
}
}
-
- public static String getUniqueSecondaryId(String viewId)
- {
+
+ public static String getUniqueSecondaryId(String viewId) {
int cnt = 0;
String id = viewId + "." + cnt; //$NON-NLS-1$
- ArrayList registry = getRegistry();
- while (registry.contains(id))
- {
- cnt ++;
+ ArrayList<String> registry = getRegistry();
+ while (registry.contains(id)) {
+ cnt++;
id = viewId + "." + cnt; //$NON-NLS-1$
}
return id;
}
-
- private static ArrayList getRegistry()
- {
+
+ private static ArrayList<String> getRegistry() {
if (fgRegistry == null)
- fgRegistry = new ArrayList();
-
+ fgRegistry = new ArrayList<String>();
+
return fgRegistry;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
index 9b54d9fc2..8980ef6f0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewPrefAction.java
@@ -24,37 +24,41 @@ import org.eclipse.ui.IViewPart;
public class MemoryViewPrefAction implements IViewActionDelegate {
+ @Override
public void init(IViewPart view) {
}
+ @Override
public void run(IAction action) {
-
+
PreferenceManager prefManager = new PreferenceManager();
-
+
ResetMemoryBlockPreferencePage page = new ResetMemoryBlockPreferencePage();
- IPreferenceNode node = new PreferenceNode("org.eclipse.debug.ui.memory.resetMemoryBlock", page); //$NON-NLS-1$
+ IPreferenceNode node = new PreferenceNode("org.eclipse.debug.ui.memory.resetMemoryBlock", page); //$NON-NLS-1$
prefManager.addToRoot(node);
-
+
SetPaddedStringPreferencePage page2 = new SetPaddedStringPreferencePage();
- IPreferenceNode node2 = new PreferenceNode("org.eclipse.debug.ui.memory.setPaddedString", page2); //$NON-NLS-1$
+ IPreferenceNode node2 = new PreferenceNode("org.eclipse.debug.ui.memory.setPaddedString", page2); //$NON-NLS-1$
prefManager.addToRoot(node2);
CodePagesPreferencePage page3 = new CodePagesPreferencePage();
- IPreferenceNode node3 = new PreferenceNode("org.eclipse.debug.ui.memory.codePages", page3); //$NON-NLS-1$
+ IPreferenceNode node3 = new PreferenceNode("org.eclipse.debug.ui.memory.codePages", page3); //$NON-NLS-1$
prefManager.addToRoot(node3);
-
+
final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), prefManager);
BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
public void run() {
dialog.create();
dialog.open();
}
- });
+ });
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
index c99109a02..4669b9a4a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewSynchronizationService.java
@@ -27,63 +27,59 @@ import org.eclipse.swt.widgets.Display;
/**
* Synchronization service for the memory view.
+ *
* @since 3.1
*/
-public class MemoryViewSynchronizationService implements
- IMemoryRenderingSynchronizationService, IMemoryBlockListener, IPropertyChangeListener {
+public class MemoryViewSynchronizationService implements IMemoryRenderingSynchronizationService, IMemoryBlockListener, IPropertyChangeListener {
private static final int ENABLED = 0;
private static final int ENABLING = 1;
private static final int DISABLED = 2;
-
- private Hashtable fSynchronizeInfo;
+
+ private Hashtable<IMemoryBlock, SynchronizeInfo> fSynchronizeInfo;
private int fEnableState = ENABLED;
- private Hashtable fPropertyListeners;
-
+ private Hashtable<IPropertyChangeListener, PropertyListener> fPropertyListeners;
+
private IMemoryRendering fLastChangedRendering;
private IMemoryRendering fSyncServiceProvider;
private static final boolean DEBUG_SYNC_SERVICE = false;
-
- public MemoryViewSynchronizationService()
- {
- fSynchronizeInfo = new Hashtable();
- fPropertyListeners = new Hashtable();
+
+ public MemoryViewSynchronizationService() {
+ fSynchronizeInfo = new Hashtable<IMemoryBlock, SynchronizeInfo>();
+ fPropertyListeners = new Hashtable<IPropertyChangeListener, PropertyListener>();
MemoryViewUtil.getMemoryBlockManager().addListener(this);
}
/**
- * Wrapper for ISynchronizedMemoryBlockView
- * Holds a list of property filters for the view.
+ * Wrapper for ISynchronizedMemoryBlockView Holds a list of property filters
+ * for the view.
*/
- class PropertyListener
- {
+ class PropertyListener {
IPropertyChangeListener fListener;
String[] fFilters;
-
- public PropertyListener(IPropertyChangeListener listener, String[] properties)
- {
+
+ public PropertyListener(IPropertyChangeListener listener, String[] properties) {
fListener = listener;
-
- if(properties != null)
- {
+
+ if (properties != null) {
fFilters = properties;
}
}
/**
- * If the property matches one of the filters, the property
- * is valid and the view should be notified about its change.
+ * If the property matches one of the filters, the property is valid and
+ * the view should be notified about its change.
+ *
* @param property the property
* @return if the property is specified in the filter
*/
- public boolean isValidProperty(String property){
- if (fFilters == null)
+ public boolean isValidProperty(String property) {
+ if (fFilters == null) {
return true;
- for (int i=0; i<fFilters.length; i++)
- {
- if (fFilters[i].equals(property))
- {
+ }
+ for (int i = 0; i < fFilters.length; i++) {
+ if (fFilters[i].equals(property)) {
return true;
}
}
@@ -91,11 +87,12 @@ public class MemoryViewSynchronizationService implements
}
/**
- * Set property filters, indicating what property change events
- * the listener is interested in.
+ * Set property filters, indicating what property change events the
+ * listener is interested in.
+ *
* @param filters the property filters or <code>null</code>
*/
- public void setPropertyFilters(String[] filters){
+ public void setPropertyFilters(String[] filters) {
fFilters = filters;
}
@@ -106,241 +103,257 @@ public class MemoryViewSynchronizationService implements
return fListener;
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryBlockViewSynchronizer#getSynchronizedProperty(org.eclipse.debug.ui.ISynchronizedMemoryBlockView, java.lang.String)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.IMemoryBlockViewSynchronizer#getSynchronizedProperty
+ * (org.eclipse.debug.ui.ISynchronizedMemoryBlockView, java.lang.String)
*/
- public Object getSynchronizedProperty(IMemoryBlock memoryBlock, String propertyId)
- {
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memoryBlock);
-
- if (info != null)
- {
+ public Object getSynchronizedProperty(IMemoryBlock memoryBlock, String propertyId) {
+ SynchronizeInfo info = fSynchronizeInfo.get(memoryBlock);
+
+ if (info != null) {
Object value = info.getProperty(propertyId);
return value;
}
-
+
return null;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.IMemoryBlockListener#MemoryBlockAdded(org.eclipse
+ * .debug.core.model.IMemoryBlock)
*/
+ @Override
public void memoryBlocksAdded(IMemoryBlock[] memoryBlocks) {
// do nothing when a memory block is added
// create a synchronize info object when there is a fView
// tab registered to be synchronized.
-
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse
+ * .debug.core.model.IMemoryBlock)
*/
+ @Override
public void memoryBlocksRemoved(IMemoryBlock[] memoryBlocks) {
-
+
// Sync info can be null if the service is already shut down
- if (fSynchronizeInfo == null)
+ if (fSynchronizeInfo == null) {
return;
-
- for (int i=0; i<memoryBlocks.length; i++)
- {
+ }
+
+ for (int i = 0; i < memoryBlocks.length; i++) {
IMemoryBlock memory = memoryBlocks[i];
-
- if (fLastChangedRendering != null && fLastChangedRendering.getMemoryBlock() == memory)
+
+ if (fLastChangedRendering != null && fLastChangedRendering.getMemoryBlock() == memory) {
fLastChangedRendering = null;
-
- if (fSyncServiceProvider != null && fSyncServiceProvider.getMemoryBlock() == memory)
+ }
+
+ if (fSyncServiceProvider != null && fSyncServiceProvider.getMemoryBlock() == memory) {
fSyncServiceProvider = null;
-
+ }
+
// delete the info object and remove it from fSynchronizeInfo
// when the memory block is deleted
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memory);
-
- if (info != null)
- {
+ SynchronizeInfo info = fSynchronizeInfo.get(memory);
+
+ if (info != null) {
info.delete();
fSynchronizeInfo.remove(memory);
}
}
}
-
+
/**
* Clean up when the plug-in is shutdown
*/
- public void shutdown()
- {
- if (fSynchronizeInfo != null)
- {
- Enumeration enumeration = fSynchronizeInfo.elements();
-
+ public void shutdown() {
+ if (fSynchronizeInfo != null) {
+ Enumeration<SynchronizeInfo> enumeration = fSynchronizeInfo.elements();
+
// clean up all synchronize info objects
- while (enumeration.hasMoreElements()){
- SynchronizeInfo info = (SynchronizeInfo)enumeration.nextElement();
+ while (enumeration.hasMoreElements()) {
+ SynchronizeInfo info = enumeration.nextElement();
info.delete();
}
-
+
fSynchronizeInfo.clear();
fSynchronizeInfo = null;
}
MemoryViewUtil.getMemoryBlockManager().removeListener(this);
}
-
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener, java.lang.String[])
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#
+ * addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener,
+ * java.lang.String[])
*/
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener, String[] properties) {
fPropertyListeners.put(listener, new PropertyListener(listener, properties));
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#
+ * removePropertyChangeListener
+ * (org.eclipse.jface.util.IPropertyChangeListener)
*/
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
- if (fPropertyListeners.containsKey(listener))
- {
+ if (fPropertyListeners.containsKey(listener)) {
fPropertyListeners.remove(listener);
}
}
-
+
/**
* Fire property change events
+ *
* @param evt the event to fire
*/
- public void firePropertyChanged(final PropertyChangeEvent evt)
- {
+ public void firePropertyChanged(final PropertyChangeEvent evt) {
// do not fire property changed event if the synchronization
// service is disabled
- if (fEnableState == DISABLED)
+ if (fEnableState == DISABLED) {
return;
-
+ }
+
// Make sure the synchronizer does not swallow any events
// Values of the properties are updated in the syncrhonizer immediately.
// Change events are queued up on the UI Thread.
- Display.getDefault().syncExec(new Runnable()
- {
- public void run()
- {
- if (fSynchronizeInfo == null)
+ Display.getDefault().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (fSynchronizeInfo == null) {
return;
-
- IMemoryRendering rendering = (IMemoryRendering)evt.getSource();
+ }
+
+ IMemoryRendering rendering = (IMemoryRendering) evt.getSource();
String propertyId = evt.getProperty();
-
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(rendering.getMemoryBlock());
- if (info != null)
- {
+
+ SynchronizeInfo info = fSynchronizeInfo.get(rendering.getMemoryBlock());
+ if (info != null) {
Object value = info.getProperty(propertyId);
- if (value != null)
- {
- Enumeration enumeration = fPropertyListeners.elements();
-
- while(enumeration.hasMoreElements())
- {
- PropertyListener listener = (PropertyListener)enumeration.nextElement();
-
+ if (value != null) {
+ Enumeration<PropertyListener> enumeration = fPropertyListeners.elements();
+
+ while (enumeration.hasMoreElements()) {
+ PropertyListener listener = enumeration.nextElement();
+
IPropertyChangeListener origListener = listener.getListener();
-
- // if it's a valid property - valid means that it's listed in the property filters
- if (listener.isValidProperty(propertyId)){
+
+ // if it's a valid property - valid means that it's
+ // listed in the property filters
+ if (listener.isValidProperty(propertyId)) {
PropertyChangeNotifier notifier = new PropertyChangeNotifier(origListener, evt);
- SafeRunner.run(notifier);
+ SafeRunner.run(notifier);
}
}
}
}
}
});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#getProperty(org.eclipse.debug.core.model.IMemoryBlock, java.lang.String)
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#
+ * getProperty(org.eclipse.debug.core.model.IMemoryBlock, java.lang.String)
*/
+ @Override
public Object getProperty(IMemoryBlock block, String property) {
-
+
// When the synchronization service is disabled
// return null for all queries to properties
// This is to ensure that renderings are not synchronized
// to new synchronization properties when the sync service is
// disabled.
- if (!isEnabled())
+ if (!isEnabled()) {
return null;
-
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(block);
-
- if (info != null)
+ }
+
+ SynchronizeInfo info = fSynchronizeInfo.get(block);
+
+ if (info != null) {
return info.getProperty(property);
-
+ }
+
return null;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
+ * .jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
- if (event == null || !(event.getSource() instanceof IMemoryRendering))
- {
+ if (event == null || !(event.getSource() instanceof IMemoryRendering)) {
return;
}
-
+
// Do not handle any property changed event as the
// sync service is being enabled.
// Otherwise, current sync info provider may overwrite
- // sync info unexpectedly. We want to sync with the rendering
+ // sync info unexpectedly. We want to sync with the rendering
// that is last changed.
- if (fEnableState == ENABLING)
+ if (fEnableState == ENABLING) {
return;
-
- IMemoryRendering rendering = ((IMemoryRendering)event.getSource());
+ }
+
+ IMemoryRendering rendering = ((IMemoryRendering) event.getSource());
IMemoryBlock memoryBlock = rendering.getMemoryBlock();
String propertyId = event.getProperty();
Object value = event.getNewValue();
-
- if (DEBUG_SYNC_SERVICE)
- {
+
+ if (DEBUG_SYNC_SERVICE) {
DebugUIPlugin.trace("SYNC SERVICE RECEIVED CHANGED EVENT:"); //$NON-NLS-1$
DebugUIPlugin.trace("Source: " + rendering); //$NON-NLS-1$
DebugUIPlugin.trace("Property: " + propertyId); //$NON-NLS-1$
DebugUIPlugin.trace("Value: " + value); //$NON-NLS-1$
-
- if (value instanceof BigInteger)
- {
- DebugUIPlugin.trace("Value in hex: " + ((BigInteger)value).toString(16)); //$NON-NLS-1$
+
+ if (value instanceof BigInteger) {
+ DebugUIPlugin.trace("Value in hex: " + ((BigInteger) value).toString(16)); //$NON-NLS-1$
}
}
-
- if (memoryBlock == null)
+
+ if (memoryBlock == null) {
return;
-
- if (propertyId == null)
+ }
+
+ if (propertyId == null) {
return;
-
+ }
+
// find the synchronize info object for the memory block
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memoryBlock);
-
+ SynchronizeInfo info = fSynchronizeInfo.get(memoryBlock);
+
// if info is not available, need to create one to hold the property
- if (info == null)
- {
+ if (info == null) {
info = new SynchronizeInfo(memoryBlock);
fSynchronizeInfo.put(memoryBlock, info);
}
-
+
// get the value of the property
Object oldValue = info.getProperty(propertyId);
-
- if (oldValue == null)
- {
+
+ if (oldValue == null) {
// if the value has never been added to the info object
// set the property and fire a change event
info.setProperty(propertyId, value);
fLastChangedRendering = rendering;
firePropertyChanged(event);
return;
- }
- else if (!oldValue.equals(value))
- {
+ } else if (!oldValue.equals(value)) {
// if the value has changed
// set the property and fire a change event
info.setProperty(propertyId, value);
@@ -348,60 +361,57 @@ public class MemoryViewSynchronizationService implements
firePropertyChanged(event);
}
}
-
- public void setEnabled(boolean enabled)
- {
- if (enabled && fEnableState == ENABLED)
+
+ public void setEnabled(boolean enabled) {
+ if (enabled && fEnableState == ENABLED) {
return;
-
- if (!enabled && fEnableState == DISABLED)
+ }
+
+ if (!enabled && fEnableState == DISABLED) {
return;
-
- try
- {
- if (enabled)
- {
+ }
+
+ try {
+ if (enabled) {
fEnableState = ENABLING;
- // get sync info from the sync service provider
- if (fLastChangedRendering != null)
- {
+ // get sync info from the sync service provider
+ if (fLastChangedRendering != null) {
IMemoryBlock memBlock = fLastChangedRendering.getMemoryBlock();
- SynchronizeInfo info = (SynchronizeInfo)fSynchronizeInfo.get(memBlock);
+ SynchronizeInfo info = fSynchronizeInfo.get(memBlock);
String[] ids = info.getPropertyIds();
-
+
// stop handling property changed event while the
// synchronization service is being enabled
// this is to get around problem when the last changed
// rendering is not currently the sync info provider
-
- for (int i=0; i<ids.length; i++)
- {
+
+ for (int i = 0; i < ids.length; i++) {
PropertyChangeEvent evt = new PropertyChangeEvent(fLastChangedRendering, ids[i], null, info.getProperty(ids[i]));
firePropertyChanged(evt);
}
}
}
- }
- finally
- {
- if (enabled)
+ } finally {
+ if (enabled) {
fEnableState = ENABLED;
- else
+ } else {
fEnableState = DISABLED;
+ }
}
}
-
- public boolean isEnabled()
- {
+
+ public boolean isEnabled() {
return fEnableState == ENABLED;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#setSynchronizationProvider(org.eclipse.debug.ui.memory.IMemoryRendering)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#
+ * setSynchronizationProvider(org.eclipse.debug.ui.memory.IMemoryRendering)
*/
+ @Override
public void setSynchronizationProvider(IMemoryRendering rendering) {
-
+
if (DEBUG_SYNC_SERVICE) {
DebugUIPlugin.trace("SYNCHRONIZATION PROVIDER: " + rendering); //$NON-NLS-1$
}
@@ -413,11 +423,13 @@ public class MemoryViewSynchronizationService implements
}
fSyncServiceProvider = rendering;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#getSynchronizationProvider()
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.ui.memory.IMemoryRenderingSynchronizationService#
+ * getSynchronizationProvider()
*/
+ @Override
public IMemoryRendering getSynchronizationProvider() {
return fSyncServiceProvider;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
index b39cd4f10..1f7dd7c23 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTab.java
@@ -32,8 +32,9 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.progress.WorkbenchJob;
/**
- * Represents a tab in the Memory View. This is where memory renderings
- * are hosted in the Memory View.
+ * Represents a tab in the Memory View. This is where memory renderings are
+ * hosted in the Memory View.
+ *
* @since 3.1
*/
public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, Listener {
@@ -45,42 +46,42 @@ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, L
private boolean fIsDisposed = false;
private Control fControl;
private RenderingViewPane fContainer;
-
-
- public MemoryViewTab(CTabItem tabItem, IMemoryRendering rendering, RenderingViewPane container)
- {
+
+ public MemoryViewTab(CTabItem tabItem, IMemoryRendering rendering, RenderingViewPane container) {
fTabItem = tabItem;
fRendering = rendering;
fContainer = container;
-
+
// set the rendering as the synchronization provider
- // as the new rendering should be in focus and have control
+ // as the new rendering should be in focus and have control
// after it's created
-
+
if (container.getMemoryRenderingSite().getSynchronizationService() != null)
container.getMemoryRenderingSite().getSynchronizationService().setSynchronizationProvider(rendering);
Control control = createViewTab();
-
+
control.addListener(SWT.Activate, this);
control.addListener(SWT.Deactivate, this);
-
+
fTabItem.setControl(control);
fTabItem.setData(this);
fTabItem.setText(getLabel());
fTabItem.setImage(getImage());
-
+
fTabItem.addDisposeListener(fDisposeListener = new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
fTabItem.removeDisposeListener(fDisposeListener);
dispose();
- }});
+ }
+ });
}
-
- private Control createViewTab()
- {
+
+ private Control createViewTab() {
ISafeRunnable safeRunnable = new ISafeRunnable() {
+ @Override
public void handleException(Throwable exception) {
// create an error rendering to fill the view tab
ErrorRendering rendering = new ErrorRendering(fRendering.getRenderingId(), exception);
@@ -88,72 +89,80 @@ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, L
// dispose the rendering
fRendering.dispose();
-
+
fRendering = rendering;
fControl = rendering.createControl(fTabItem.getParent());
}
+ @Override
public void run() throws Exception {
fControl = fRendering.createControl(fTabItem.getParent());
fRendering.addPropertyChangeListener(getInstance());
- }};
-
+ }
+ };
+
SafeRunner.run(safeRunnable);
return fControl;
}
-
- private String getLabel()
- {
+
+ private String getLabel() {
return fRendering.getLabel();
}
-
- private Image getImage()
- {
+
+ private Image getImage() {
return fRendering.getImage();
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#dispose()
*/
+ @Override
public void dispose() {
-
+
if (fIsDisposed)
return;
-
+
fIsDisposed = true;
-
+
fRendering.removePropertyChangeListener(this);
-
- if (!fControl.isDisposed())
- {
+
+ if (!fControl.isDisposed()) {
fControl.removeListener(SWT.Activate, this);
fControl.removeListener(SWT.Deactivate, this);
}
-
+
// always deactivate rendering before disposing it.
fRendering.deactivated();
-
+
fRendering.dispose();
}
-
- public boolean isDisposed()
- {
+
+ @Override
+ public boolean isDisposed() {
return fIsDisposed;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#isEnabled()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#isEnabled()
*/
+ @Override
public boolean isEnabled() {
return fEnabled;
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#setEnabled(boolean)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#setEnabled(
+ * boolean)
*/
+ @Override
public void setEnabled(boolean enabled) {
fEnabled = enabled;
-
+
if (fEnabled)
fRendering.becomesVisible();
else
@@ -161,67 +170,73 @@ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, L
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#setTabLabel(java.lang.String)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#setTabLabel
+ * (java.lang.String)
*/
+ @Override
public void setTabLabel(String label) {
fTabItem.setText(label);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#getTabLabel()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#getTabLabel()
*/
+ @Override
public String getTabLabel() {
return fTabItem.getText();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#getRendering()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.IMemoryViewTab#getRendering()
*/
+ @Override
public IMemoryRendering getRendering() {
return fRendering;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse
+ * .jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(final PropertyChangeEvent event) {
-
+
// make sure this runs on the UI thread, otherwise, it
// will get to a swt exception
-
+
WorkbenchJob job = new WorkbenchJob("MemoryViewTab PropertyChanged") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (isDisposed())
return Status.OK_STATUS;
-
- if (event.getSource() == fRendering)
- {
- if (event.getProperty().equals(IBasicPropertyConstants.P_TEXT))
- {
+
+ if (event.getSource() == fRendering) {
+ if (event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) {
Object value = event.getNewValue();
- if (value != null && value instanceof String)
- {
- String label = (String)value;
+ if (value != null && value instanceof String) {
+ String label = (String) value;
setTabLabel(label);
- }
- else
- {
+ } else {
setTabLabel(fRendering.getLabel());
}
}
-
- if (event.getProperty().equals(IBasicPropertyConstants.P_IMAGE))
- {
+
+ if (event.getProperty().equals(IBasicPropertyConstants.P_IMAGE)) {
Object value = event.getNewValue();
- if (value != null && value instanceof Image)
- {
- Image image = (Image)value;
+ if (value != null && value instanceof Image) {
+ Image image = (Image) value;
fTabItem.setImage(image);
- }
- else
- {
+ } else {
fTabItem.setImage(fRendering.getImage());
}
}
@@ -232,23 +247,24 @@ public class MemoryViewTab implements IMemoryViewTab, IPropertyChangeListener, L
job.setSystem(true);
job.schedule();
}
-
- private MemoryViewTab getInstance()
- {
+
+ private MemoryViewTab getInstance() {
return this;
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.
+ * Event)
*/
+ @Override
public void handleEvent(Event event) {
- if (event.type == SWT.Activate)
- {
+ if (event.type == SWT.Activate) {
fRendering.activated();
fContainer.setRenderingSelection(fRendering);
}
- if (event.type == SWT.Deactivate)
- {
+ if (event.type == SWT.Deactivate) {
fRendering.deactivated();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
index 2862b623d..4eea20d3e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeModelContentProvider.java
@@ -19,22 +19,17 @@ import org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
-public class MemoryViewTreeModelContentProvider extends
- TreeModelContentProvider {
-
+public class MemoryViewTreeModelContentProvider extends TreeModelContentProvider {
+
+ @Override
protected void updateNodes(IModelDelta[] nodes, int mask) {
-
- if (getViewer() instanceof TreeModelViewer)
- {
- for (int i = 0; i < nodes.length; i++) {
+
+ if (getViewer() instanceof TreeModelViewer) {
+ for (int i = 0; i < nodes.length; i++) {
IModelDelta node = nodes[i];
int flags = node.getFlags();
- if((mask & ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS) != 0 &&
- (flags & IModelDelta.ADDED) != 0 &&
- (flags & IModelDelta.SELECT) != 0 &&
- node.getElement() instanceof IMemoryBlock)
- {
+ if ((mask & ITreeModelContentProvider.CONTROL_MODEL_DELTA_FLAGS) != 0 && (flags & IModelDelta.ADDED) != 0 && (flags & IModelDelta.SELECT) != 0 && node.getElement() instanceof IMemoryBlock) {
if ((flags & IModelDelta.SELECT) != 0) {
if (getPresentationContext().getPart() instanceof MemoryView) {
MemoryView view = (MemoryView) getPresentationContext().getPart();
@@ -54,53 +49,51 @@ public class MemoryViewTreeModelContentProvider extends
}
flags = flags & mask;
- if ((flags & IModelDelta.ADDED) != 0) {
- handleAdd(node);
- }
- if ((flags & IModelDelta.REMOVED) != 0) {
- handleRemove(node);
- }
- if ((flags & IModelDelta.CONTENT) != 0) {
- handleContent(node);
- }
- if ((flags & IModelDelta.STATE) != 0) {
- handleState(node);
- }
- if ((flags & IModelDelta.INSERTED) != 0) {
- handleInsert(node);
- }
- if ((flags & IModelDelta.REPLACED) != 0) {
- handleReplace(node);
- }
- if ((flags & IModelDelta.INSTALL) != 0) {
- handleInstall(node);
- }
- if ((flags & IModelDelta.UNINSTALL) != 0) {
- handleUninstall(node);
- }
- if ((flags & IModelDelta.EXPAND) != 0) {
- handleExpand(node);
- }
- if ((flags & IModelDelta.COLLAPSE) != 0) {
- handleCollapse(node);
- }
- if ((flags & IModelDelta.SELECT) != 0) {
- handleSelect(node);
- }
- if ((flags & IModelDelta.REVEAL) != 0) {
- handleReveal(node);
- }
- updateNodes(node.getChildDeltas(), mask);
- }
+ if ((flags & IModelDelta.ADDED) != 0) {
+ handleAdd(node);
+ }
+ if ((flags & IModelDelta.REMOVED) != 0) {
+ handleRemove(node);
+ }
+ if ((flags & IModelDelta.CONTENT) != 0) {
+ handleContent(node);
+ }
+ if ((flags & IModelDelta.STATE) != 0) {
+ handleState(node);
+ }
+ if ((flags & IModelDelta.INSERTED) != 0) {
+ handleInsert(node);
+ }
+ if ((flags & IModelDelta.REPLACED) != 0) {
+ handleReplace(node);
+ }
+ if ((flags & IModelDelta.INSTALL) != 0) {
+ handleInstall(node);
+ }
+ if ((flags & IModelDelta.UNINSTALL) != 0) {
+ handleUninstall(node);
+ }
+ if ((flags & IModelDelta.EXPAND) != 0) {
+ handleExpand(node);
+ }
+ if ((flags & IModelDelta.COLLAPSE) != 0) {
+ handleCollapse(node);
+ }
+ if ((flags & IModelDelta.SELECT) != 0) {
+ handleSelect(node);
+ }
+ if ((flags & IModelDelta.REVEAL) != 0) {
+ handleReveal(node);
+ }
+ updateNodes(node.getChildDeltas(), mask);
+ }
}
}
-
- private boolean isFirstMemoryBlock()
- {
+
+ private boolean isFirstMemoryBlock() {
Object input = getViewer().getInput();
- if (input instanceof IMemoryBlockRetrieval)
- {
- IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval)input);
+ if (input instanceof IMemoryBlockRetrieval) {
+ IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks((IMemoryBlockRetrieval) input);
if (memoryBlocks.length == 1)
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java
index e97c86ea1..2031204ee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewTreeViewer.java
@@ -17,29 +17,31 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.swt.widgets.Composite;
/**
- * Customized tree viewer for the Memory View
- * This Tree Viewer has a specialized update policy for the memory view.
- * When the model fires a ADDED delta, the update policy handles the event as follows:
- * If the ADDED delta is accompanied by SELECT, and the added element is an memory blok, then
- * the udpate policy asks the Memory View if the it is currently pinned to a memory block. If the view
- * is currently pinned, then the SELECT delta is ignored.
+ * Customized tree viewer for the Memory View This Tree Viewer has a specialized
+ * update policy for the memory view. When the model fires a ADDED delta, the
+ * update policy handles the event as follows: If the ADDED delta is accompanied
+ * by SELECT, and the added element is an memory blok, then the udpate policy
+ * asks the Memory View if the it is currently pinned to a memory block. If the
+ * view is currently pinned, then the SELECT delta is ignored.
+ *
+ * If the ADDED delta and SELECT delta are recieved in separate nodes, then the
+ * delta will be handled as-is and would not take the pinning state of the
+ * memory view into account.
*
- * If the ADDED delta and SELECT delta are recieved in separate nodes, then the delta will be handled as-is and would
- * not take the pinning state of the memory view into account.
- *
*/
public class MemoryViewTreeViewer extends TreeModelViewer {
- public MemoryViewTreeViewer(Composite parent, int style,
- IPresentationContext context) {
+ public MemoryViewTreeViewer(Composite parent, int style, IPresentationContext context) {
super(parent, style, context);
}
-
- /*
- * Need to have a customized content provider to define a special update policy for the Memory View
- * (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer#createContentProvider()
+
+ /*
+ * Need to have a customized content provider to define a special update
+ * policy for the Memory View (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.viewers.model.InternalTreeModelViewer#
+ * createContentProvider()
*/
+ @Override
protected ITreeModelContentProvider createContentProvider() {
return new MemoryViewTreeModelContentProvider();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
index 7836738b8..2957f11e4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MemoryViewUtil.java
@@ -39,69 +39,36 @@ import org.eclipse.ui.progress.UIJob;
* @since 3.0
*/
public class MemoryViewUtil {
-
- public static final int[] ignoreKeyEvents =
- {
- SWT.ARROW_UP,
- SWT.ARROW_DOWN,
- SWT.ARROW_LEFT,
- SWT.ARROW_RIGHT,
- SWT.PAGE_UP,
- SWT.PAGE_DOWN,
- SWT.HOME,
- SWT.END,
- SWT.INSERT,
- SWT.F1,
- SWT.F2,
- SWT.F3,
- SWT.F4,
- SWT.F5,
- SWT.F6,
- SWT.F7,
- SWT.F8,
- SWT.F9,
- SWT.F10,
- SWT.F11,
- SWT.F12,
- SWT.F13,
- SWT.F14,
- SWT.F15,
- SWT.HELP,
- SWT.CAPS_LOCK,
- SWT.NUM_LOCK,
- SWT.SCROLL_LOCK,
- SWT.PAUSE,
- SWT.BREAK,
- SWT.PRINT_SCREEN,
- SWT.ESC,
- SWT.CTRL,
- SWT.ALT,
- SWT.SHIFT
- };
-
- public static ArrayList MEMORY_BLOCKS_HISTORY = new ArrayList();
-
+
+ public static final int[] ignoreKeyEvents = {
+ SWT.ARROW_UP, SWT.ARROW_DOWN, SWT.ARROW_LEFT, SWT.ARROW_RIGHT,
+ SWT.PAGE_UP, SWT.PAGE_DOWN, SWT.HOME, SWT.END, SWT.INSERT, SWT.F1,
+ SWT.F2, SWT.F3, SWT.F4, SWT.F5, SWT.F6, SWT.F7, SWT.F8, SWT.F9,
+ SWT.F10, SWT.F11, SWT.F12, SWT.F13, SWT.F14, SWT.F15, SWT.HELP,
+ SWT.CAPS_LOCK, SWT.NUM_LOCK, SWT.SCROLL_LOCK, SWT.PAUSE, SWT.BREAK,
+ SWT.PRINT_SCREEN, SWT.ESC, SWT.CTRL, SWT.ALT, SWT.SHIFT };
+
+ public static ArrayList<String> MEMORY_BLOCKS_HISTORY = new ArrayList<String>();
+
/**
* @param selection
* @return true if the given selection is valid for creating a memory block
*/
static public boolean isValidSelection(ISelection selection) {
-
+
if (!(selection instanceof IStructuredSelection))
return false;
-
- //only single selection is allowed for this action
- if (selection.isEmpty() || ((IStructuredSelection)selection).size() > 1)
- {
+
+ // only single selection is allowed for this action
+ if (selection.isEmpty() || ((IStructuredSelection) selection).size() > 1) {
return false;
}
-
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
+
+ Object elem = ((IStructuredSelection) selection).getFirstElement();
+
return isValidContext(elem);
}
-
/**
* @param elem
* @return
@@ -110,78 +77,75 @@ public class MemoryViewUtil {
// if not debug element
if (!(elem instanceof IAdaptable))
return false;
-
- IMemoryBlockRetrieval memRetrieval =(IMemoryBlockRetrieval) ((IAdaptable)elem).getAdapter(IMemoryBlockRetrieval.class);
+
+ IMemoryBlockRetrieval memRetrieval = (IMemoryBlockRetrieval) ((IAdaptable) elem).getAdapter(IMemoryBlockRetrieval.class);
IDebugTarget debugTarget = null;
if (elem instanceof IDebugElement) {
- debugTarget = ((IDebugElement)elem).getDebugTarget();
+ debugTarget = ((IDebugElement) elem).getDebugTarget();
} else {
- debugTarget = (IDebugTarget)((IAdaptable)elem).getAdapter(IDebugTarget.class);
+ debugTarget = (IDebugTarget) ((IAdaptable) elem).getAdapter(IDebugTarget.class);
}
-
- if (memRetrieval == null)
- {
- // if debug element returns null from getAdapter, assume its debug target is going to retrieve memory blocks
+
+ if (memRetrieval == null) {
+ // if debug element returns null from getAdapter, assume its debug
+ // target is going to retrieve memory blocks
memRetrieval = debugTarget;
}
-
+
// not valid if the debug target is already terminated
if (debugTarget != null && (debugTarget.isTerminated() || debugTarget.isDisconnected()))
return false;
-
+
if (memRetrieval != null && memRetrieval.supportsStorageRetrieval()) {
return true;
}
-
+
return false;
- }
+ }
-
/**
* Helper function to open an error dialog.
+ *
* @param title
* @param message
* @param e
*/
- static public void openError (final String title, final String message, final Exception e)
- {
- UIJob uiJob = new UIJob("open error"){ //$NON-NLS-1$
+ static public void openError(final String title, final String message, final Exception e) {
+ UIJob uiJob = new UIJob("open error") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
-// open error for the exception
+ // open error for the exception
String detail = IInternalDebugCoreConstants.EMPTY_STRING;
if (e != null)
detail = e.getMessage();
-
+
Shell shell = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
-
- MessageDialog.openError(
- shell,
- title,
- message + "\n" + detail); //$NON-NLS-1$
+
+ MessageDialog.openError(shell, title, message + "\n" + detail); //$NON-NLS-1$
return Status.OK_STATUS;
- }};
+ }
+ };
uiJob.setSystem(true);
uiJob.schedule();
}
-
- static IMemoryBlockManager getMemoryBlockManager()
- {
+
+ static IMemoryBlockManager getMemoryBlockManager() {
return DebugPlugin.getDefault().getMemoryBlockManager();
}
-
- static public boolean isLinuxGTK()
- {
+
+ static public boolean isLinuxGTK() {
String ws = Platform.getWS();
return ws.equals(Platform.WS_GTK);
}
-
+
/**
- * Checks to see if the event is valid for activating
- * cell editing in a view tab
+ * Checks to see if the event is valid for activating cell editing in a view
+ * tab
+ *
* @param event
- * @return true if the edit event is valid for activating the cell editor
+ * @return true if the edit event is valid for activating the cell editor
*/
public static boolean isValidEditEvent(int event) {
for (int i = 0; i < MemoryViewUtil.ignoreKeyEvents.length; i++) {
@@ -190,76 +154,71 @@ public class MemoryViewUtil {
}
return true;
}
-
- public static BigInteger alignToBoundary(BigInteger integer, int numberOfUnitsPerLine)
- {
+
+ public static BigInteger alignToBoundary(BigInteger integer, int numberOfUnitsPerLine) {
BigInteger[] result = integer.divideAndRemainder(BigInteger.valueOf(numberOfUnitsPerLine));
integer = integer.subtract(result[1]);
return integer;
}
-
- public static void addHistory(String expression)
- {
+
+ public static void addHistory(String expression) {
if (!MEMORY_BLOCKS_HISTORY.contains(expression))
MEMORY_BLOCKS_HISTORY.add(0, expression);
-
+
if (MEMORY_BLOCKS_HISTORY.size() > 5)
- MEMORY_BLOCKS_HISTORY.remove(MEMORY_BLOCKS_HISTORY.size()-1);
+ MEMORY_BLOCKS_HISTORY.remove(MEMORY_BLOCKS_HISTORY.size() - 1);
}
-
- public static String[] getHistory()
- {
- return (String[])MEMORY_BLOCKS_HISTORY.toArray(new String[MEMORY_BLOCKS_HISTORY.size()]);
+
+ public static String[] getHistory() {
+ return MEMORY_BLOCKS_HISTORY.toArray(new String[MEMORY_BLOCKS_HISTORY.size()]);
}
-
+
/**
* Return the memory block retrieval of the given object
+ *
* @param object
- * @return the memory block retrieval of the given object or <code>null</code>
- * if no memory block retrieval can be found
- *
- * Returning null for the memory block retrieval will result in errors in operations
- * that follow.
- *
- * Non-standard debug models must provide a memory block retrieval via
- * <code>getAdapter(IMemoryBlockRetrieval.class</code>
+ * @return the memory block retrieval of the given object or
+ * <code>null</code> if no memory block retrieval can be found
+ *
+ * Returning null for the memory block retrieval will result in
+ * errors in operations that follow.
+ *
+ * Non-standard debug models must provide a memory block retrieval
+ * via <code>getAdapter(IMemoryBlockRetrieval.class</code>
*/
- public static IMemoryBlockRetrieval getMemoryBlockRetrieval(Object object)
- {
+ public static IMemoryBlockRetrieval getMemoryBlockRetrieval(Object object) {
IMemoryBlockRetrieval retrieval = null;
-
- // if memory block extension, retrieval must be queired throught its interface
+
+ // if memory block extension, retrieval must be queired throught its
+ // interface
if (object instanceof IMemoryBlockExtension)
- return ((IMemoryBlockExtension)object).getMemoryBlockRetrieval();
+ return ((IMemoryBlockExtension) object).getMemoryBlockRetrieval();
// check if the object can adapt to a memory block retrieval
- if (object instanceof IAdaptable)
- {
- IAdaptable adaptable = (IAdaptable)object;
- retrieval = (IMemoryBlockRetrieval)adaptable.getAdapter(IMemoryBlockRetrieval.class);
+ if (object instanceof IAdaptable) {
+ IAdaptable adaptable = (IAdaptable) object;
+ retrieval = (IMemoryBlockRetrieval) adaptable.getAdapter(IMemoryBlockRetrieval.class);
}
-
- // if cannot adapt and the object itself is already an IMemoryBlockRetrieval, return that.
- if (retrieval == null && object instanceof IMemoryBlockRetrieval)
- {
- retrieval = (IMemoryBlockRetrieval)object;
+
+ // if cannot adapt and the object itself is already an
+ // IMemoryBlockRetrieval, return that.
+ if (retrieval == null && object instanceof IMemoryBlockRetrieval) {
+ retrieval = (IMemoryBlockRetrieval) object;
}
-
+
// otherewise, default back to the debug target
- if (retrieval == null && object instanceof IDebugElement)
- {
- IDebugElement de = (IDebugElement)object;
+ if (retrieval == null && object instanceof IDebugElement) {
+ IDebugElement de = (IDebugElement) object;
retrieval = de.getDebugTarget();
}
-
+
return retrieval;
}
-
+
/**
* Returns the hash code for this object, as an Integer.
* */
- public static Integer getHashCode(Object o)
- {
+ public static Integer getHashCode(Object o) {
return new Integer(o.hashCode());
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java
index 474a6ea74..937f26044 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/MonitorMemoryBlockDialog.java
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.views.memory;
-
import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
@@ -33,7 +32,7 @@ import org.eclipse.ui.PlatformUI;
/**
* @since 3.0
*/
-public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListener{
+public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListener {
private Combo expressionInput;
private Text lengthInput;
@@ -42,30 +41,36 @@ public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListen
private boolean needLength = true;
private String fPrefillExp = null;
private String fPrefillLength = null;
-
+
/**
- * the predefined width of the wrapping label for the expression to enter combo
+ * the predefined width of the wrapping label for the expression to enter
+ * combo
+ *
* @since 3.3
*/
private static final int LABEL_WIDTH = 210;
-
+
/**
* @param parentShell
*/
public MonitorMemoryBlockDialog(Shell parentShell, IMemoryBlockRetrieval memRetrieval, String prefillExp, String prefillLength) {
super(parentShell);
-
+
if (memRetrieval instanceof IMemoryBlockRetrievalExtension)
needLength = false;
-
+
fPrefillExp = prefillExp;
fPrefillLength = prefillLength;
setShellStyle(getShellStyle() | SWT.RESIZE);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
+ * .Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite comp = (Composite) super.createDialogArea(parent);
SWTFactory.createWrapLabel(comp, DebugUIMessages.MonitorMemoryBlockDialog_EnterExpressionToMonitor, 1, LABEL_WIDTH);
@@ -74,7 +79,7 @@ public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListen
expressionInput.setText(fPrefillExp);
}
expressionInput.addModifyListener(this);
-
+
if (needLength) {
SWTFactory.createLabel(comp, DebugUIMessages.MonitorMemoryBlockDialog_NumberOfBytes, 1);
lengthInput = SWTFactory.createSingleText(comp, 1);
@@ -86,32 +91,39 @@ public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListen
PlatformUI.getWorkbench().getHelpSystem().setHelp(comp, IDebugUIConstants.PLUGIN_ID + ".MonitorMemoryBlockDialog_context"); //$NON-NLS-1$
return comp;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
+ * .Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
-
+
newShell.setText(DebugUIMessages.MonitorMemoryBlockDialog_MonitorMemory);
}
-
+
/**
* @return the entered expression
*/
public String getExpression() {
return expression;
}
-
+
/**
* @return the entered length
*/
public String getLength() {
return length;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
expression = expressionInput.getText();
@@ -125,43 +137,47 @@ public class MonitorMemoryBlockDialog extends TrayDialog implements ModifyListen
super.okPressed();
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events
+ * .ModifyEvent)
*/
+ @Override
public void modifyText(ModifyEvent e) {
updateOKButtonState();
}
private void updateOKButtonState() {
- if (needLength)
- {
+ if (needLength) {
String lengthText = lengthInput.getText();
String input = expressionInput.getText();
-
- if (input == null || input.equals(IInternalDebugCoreConstants.EMPTY_STRING) || lengthText == null || lengthText.equals(IInternalDebugCoreConstants.EMPTY_STRING))
- {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else
- {
+
+ if (input == null || input.equals(IInternalDebugCoreConstants.EMPTY_STRING) || lengthText == null || lengthText.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ } else {
getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
+ }
}
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets
+ * .Composite)
*/
+ @Override
protected Control createButtonBar(Composite parent) {
-
- Control ret = super.createButtonBar(parent);
-
+
+ Control ret = super.createButtonBar(parent);
+
if (needLength)
updateOKButtonState();
else
// always enable the OK button if we only need the expression
getButton(IDialogConstants.OK_ID).setEnabled(true);
-
+
return ret;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
index 2e62da38d..b6afd1e24 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/NewMemoryViewAction.java
@@ -30,22 +30,25 @@ import org.eclipse.ui.PartInitException;
public class NewMemoryViewAction implements IViewActionDelegate {
private MemoryView fView;
+
+ @Override
public void init(IViewPart view) {
if (view instanceof MemoryView)
- fView = (MemoryView)view;
+ fView = (MemoryView) view;
}
+ @Override
public void run(IAction action) {
-
+
String secondaryId = MemoryViewIdRegistry.getUniqueSecondaryId(IDebugUIConstants.ID_MEMORY_VIEW);
try {
IWorkbenchPage page = DebugUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart newView = page.showView(IDebugUIConstants.ID_MEMORY_VIEW, secondaryId, IWorkbenchPage.VIEW_ACTIVATE);
-
+
// set initial selection for new view
setInitialSelection(newView);
setInitialViewSettings(newView);
-
+
} catch (PartInitException e) {
// if view cannot be opened, open error
DebugUIPlugin.log(e);
@@ -54,52 +57,47 @@ public class NewMemoryViewAction implements IViewActionDelegate {
private void setInitialSelection(IViewPart newView) {
ISelection selection = fView.getSite().getSelectionProvider().getSelection();
- if (selection instanceof IStructuredSelection)
- {
- IStructuredSelection strucSel = (IStructuredSelection)selection;
-
+ if (selection instanceof IStructuredSelection) {
+ IStructuredSelection strucSel = (IStructuredSelection) selection;
+
// return if current selection is empty
if (strucSel.isEmpty())
return;
-
+
Object obj = strucSel.getFirstElement();
-
+
if (obj == null)
return;
-
- if (obj instanceof IMemoryRendering)
- {
- IMemoryBlock memBlock = ((IMemoryRendering)obj).getMemoryBlock();
+
+ if (obj instanceof IMemoryRendering) {
+ IMemoryBlock memBlock = ((IMemoryRendering) obj).getMemoryBlock();
strucSel = new StructuredSelection(memBlock);
newView.getSite().getSelectionProvider().setSelection(strucSel);
- }
- else if (obj instanceof IMemoryBlock)
- {
+ } else if (obj instanceof IMemoryBlock) {
newView.getSite().getSelectionProvider().setSelection(strucSel);
}
}
}
private void setInitialViewSettings(IViewPart newView) {
- if (fView != null && newView instanceof MemoryView)
- {
- MemoryView newMView = (MemoryView)newView;
+ if (fView != null && newView instanceof MemoryView) {
+ MemoryView newMView = (MemoryView) newView;
IMemoryViewPane[] viewPanes = fView.getViewPanes();
int orientation = fView.getViewPanesOrientation();
- for (int i=0; i<viewPanes.length; i++)
- {
+ for (int i = 0; i < viewPanes.length; i++) {
// copy view pane visibility
newMView.showViewPane(fView.isViewPaneVisible(viewPanes[i].getId()), viewPanes[i].getId());
}
-
+
// do not want to copy renderings as it could be very expensive
// create a blank view and let user creates renderings as needed
-
+
// set orientation of new view
newMView.setViewPanesOrientation(orientation);
}
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java
index 93f5fa3d3..c4ee61cb6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PinMemoryBlockAction.java
@@ -17,30 +17,34 @@ import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
/**
- * Action for pinning the display of the memory view to
- * the current memory block. The view would not change
- * selection when a new memory block is added if the diplay is pinned.
- *
+ * Action for pinning the display of the memory view to the current memory
+ * block. The view would not change selection when a new memory block is added
+ * if the diplay is pinned.
+ *
*/
public class PinMemoryBlockAction implements IViewActionDelegate {
private MemoryView fView;
+
+ @Override
public void init(IViewPart view) {
if (view instanceof MemoryView)
- fView = (MemoryView)view;
+ fView = (MemoryView) view;
}
+ @Override
public void run(IAction action) {
if (fView == null)
return;
-
+
boolean pin = !fView.isPinMBDisplay();
fView.setPinMBDisplay(pin);
-
+
action.setChecked(pin);
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java
index 4b50660d2..558cd48bd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/PropertyChangeNotifier.java
@@ -17,32 +17,37 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
/**
- * Fire properties changes events in ISafeRunnable to ensure that
- * exceptions are caught and handled.
+ * Fire properties changes events in ISafeRunnable to ensure that exceptions are
+ * caught and handled.
+ *
* @since 3.1
*/
-public class PropertyChangeNotifier implements ISafeRunnable
-{
-
+public class PropertyChangeNotifier implements ISafeRunnable {
+
IPropertyChangeListener fListener;
PropertyChangeEvent fEvt;
-
- public PropertyChangeNotifier(IPropertyChangeListener listener, PropertyChangeEvent evt)
- {
+
+ public PropertyChangeNotifier(IPropertyChangeListener listener, PropertyChangeEvent evt) {
fListener = listener;
fEvt = evt;
}
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.core.runtime.ISafeRunnable#handleException(java.lang.Throwable
+ * )
*/
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.core.runtime.ISafeRunnable#run()
*/
+ @Override
public void run() throws Exception {
fListener.propertyChange(fEvt);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java
index 0b5618cba..d0fb67ef6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveMemoryRenderingAction.java
@@ -18,60 +18,60 @@ import org.eclipse.debug.ui.memory.IMemoryRendering;
import org.eclipse.debug.ui.memory.IMemoryRenderingContainer;
import org.eclipse.jface.action.Action;
-
/**
- * Remove Memory Rendering action
- * This action serves two purposes:
- * - remove memory rendering from Memory Rendering Pane
- * - quck way to remove a memory block from Memory Rendering Pane
+ * Remove Memory Rendering action This action serves two purposes: - remove
+ * memory rendering from Memory Rendering Pane - quck way to remove a memory
+ * block from Memory Rendering Pane
+ *
+ * When user clicks on the this tool bar action, it simply removes the top view
+ * tab from Memory Rendering Pane.
*
- * When user clicks on the this tool bar action, it simply removes
- * the top view tab from Memory Rendering Pane.
* @since 3.0
*/
-public class RemoveMemoryRenderingAction extends Action
-{
+public class RemoveMemoryRenderingAction extends Action {
private IMemoryRenderingContainer fViewPane;
- public RemoveMemoryRenderingAction(IMemoryRenderingContainer viewPane)
- {
+
+ public RemoveMemoryRenderingAction(IMemoryRenderingContainer viewPane) {
// create action as drop down
- super(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering, AS_PUSH_BUTTON);
- setText(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering);
+ super(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering, AS_PUSH_BUTTON);
+ setText(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering);
- setToolTipText(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY));
+ setToolTipText(DebugUIMessages.RemoveMemoryRenderingAction_Remove_rendering);
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_REMOVE_MEMORY));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_REMOVE_MEMORY));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_REMOVE_MEMORY));
fViewPane = viewPane;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
-
+
// user has click on the RemoveMemoryRendering button
IMemoryViewTab topTab = getViewTab();
-
- if (topTab != null)
- {
+
+ if (topTab != null) {
IMemoryRendering rendering = topTab.getRendering();
-
- if (rendering != null)
- {
+
+ if (rendering != null) {
fViewPane.removeMemoryRendering(rendering);
}
}
}
- /* (non-Javadoc)
- * @see com.ibm.debug.defaultrenderings.internal.actions.AbstractMemoryAction#getViewTab()
+ /*
+ * (non-Javadoc)
+ * @see
+ * com.ibm.debug.defaultrenderings.internal.actions.AbstractMemoryAction
+ * #getViewTab()
*/
IMemoryViewTab getViewTab() {
- if (fViewPane instanceof IMemoryView)
- {
- return ((IMemoryView)fViewPane).getTopMemoryTab();
+ if (fViewPane instanceof IMemoryView) {
+ return ((IMemoryView) fViewPane).getTopMemoryTab();
}
return null;
- }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
index c908ef62b..43a741344 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RemoveRenderingContextAction.java
@@ -19,51 +19,56 @@ import org.eclipse.ui.IViewPart;
/**
* @since 3.0
- *
+ *
*/
public class RemoveRenderingContextAction implements IViewActionDelegate {
private IMemoryRenderingSite fMemoryView;
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
- if (view instanceof IMemoryRenderingSite)
- {
- fMemoryView = (IMemoryRenderingSite)view;
+ if (view instanceof IMemoryRenderingSite) {
+ fMemoryView = (IMemoryRenderingSite) view;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fMemoryView == null)
return;
-
+
IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container != null)
- {
+ if (container != null) {
RemoveMemoryRenderingAction removeAction = new RemoveMemoryRenderingAction(container);
removeAction.run();
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
IMemoryRenderingContainer container = getRenderingContainer(action);
- if (container instanceof RenderingViewPane)
- {
- if (!((RenderingViewPane)container).canRemoveRendering())
+ if (container instanceof RenderingViewPane) {
+ if (!((RenderingViewPane) container).canRemoveRendering())
action.setEnabled(false);
else
action.setEnabled(true);
}
}
-
+
/**
* @param action
* @return
@@ -72,16 +77,14 @@ public class RemoveRenderingContextAction implements IViewActionDelegate {
IMemoryRenderingContainer[] viewPanes = fMemoryView.getMemoryRenderingContainers();
String actionId = action.getId();
IMemoryRenderingContainer selectedPane = null;
-
- for (int i=0; i<viewPanes.length; i++)
- {
- if (actionId.indexOf(viewPanes[i].getId()) != -1)
- {
+
+ for (int i = 0; i < viewPanes.length; i++) {
+ if (actionId.indexOf(viewPanes[i].getId()) != -1) {
selectedPane = viewPanes[i];
break;
}
}
-
+
return selectedPane;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
index d45f55b35..3628aa755 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RenderingViewPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2010 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -62,178 +62,179 @@ import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
-
-
/**
- * Represents a rendering view pane in the Memory View.
- * This hosts the memory view tabs in the view.
+ * Represents a rendering view pane in the Memory View. This hosts the memory
+ * view tabs in the view.
+ *
* @since 3.1
- *
+ *
*/
-public class RenderingViewPane extends AbstractMemoryViewPane implements IMemoryRenderingContainer{
+public class RenderingViewPane extends AbstractMemoryViewPane implements IMemoryRenderingContainer {
public static final String RENDERING_VIEW_PANE_ID = DebugUIPlugin.getUniqueIdentifier() + ".MemoryView.RenderingViewPane"; //$NON-NLS-1$
-
- private Hashtable fTabFolderForMemoryBlock = new Hashtable();
- private Hashtable fMemoryBlockFromTabFolder = new Hashtable();
+
+ private Hashtable<IMemoryBlock, CTabFolder> fTabFolderForMemoryBlock = new Hashtable<IMemoryBlock, CTabFolder>();
+ private Hashtable<CTabFolder, IMemoryBlock> fMemoryBlockFromTabFolder = new Hashtable<CTabFolder, IMemoryBlock>();
private ViewPaneRenderingMgr fRenderingMgr;
-
+
private IMemoryRenderingSite fRenderingSite;
- private Set fAddedRenderings = new HashSet();
- private Set fAddedMemoryBlocks = new HashSet();
-
+ private Set<IMemoryRendering> fAddedRenderings = new HashSet<IMemoryRendering>();
+ private Set<IMemoryBlock> fAddedMemoryBlocks = new HashSet<IMemoryBlock>();
+
private boolean fCanAddRendering = true;
private boolean fCanRemoveRendering = true;
-
+
/**
* @param parent is the view hosting this view pane
* @param paneId is the identifier assigned by the Memory View
*
- * Pane id is assigned with the following format.
- * Rendering view pane created has its id assigned to
- * org.eclipse.debug.ui.MemoryView.RenderingViewPane.#.
- * # is a number indicating the order of which the rendering view
- * pane is created. First rendering view pane created will have its
- * id assigned to org.eclipse.debug.ui.MemoryView.RenderingViewPane.1.
- * Second rendering view pane created will have its id assigned to
- * org.eclipse.debug.ui.MemoryView.RenderingViewPane.2. and so on.
- * View pane are created from left to right by the Memory View.
+ * Pane id is assigned with the following format. Rendering view
+ * pane created has its id assigned to
+ * org.eclipse.debug.ui.MemoryView.RenderingViewPane.#. # is a
+ * number indicating the order of which the rendering view pane
+ * is created. First rendering view pane created will have its id
+ * assigned to
+ * org.eclipse.debug.ui.MemoryView.RenderingViewPane.1. Second
+ * rendering view pane created will have its id assigned to
+ * org.eclipse.debug.ui.MemoryView.RenderingViewPane.2. and so
+ * on. View pane are created from left to right by the Memory
+ * View.
*
*/
public RenderingViewPane(IViewPart parent) {
super(parent);
-
- if (parent instanceof IMemoryRenderingSite)
- fRenderingSite = (IMemoryRenderingSite)parent;
- else
- {
+
+ if (parent instanceof IMemoryRenderingSite) {
+ fRenderingSite = (IMemoryRenderingSite) parent;
+ } else {
DebugUIPlugin.logErrorMessage("Parent for the rendering view pane is invalid."); //$NON-NLS-1$
}
}
-
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded(org.eclipse.debug.core.model.IMemoryBlock)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockAdded
+ * (org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
public void memoryBlocksAdded(final IMemoryBlock[] memoryBlocks) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
-
- if (isDisposed())
+
+ if (isDisposed()) {
return;
-
+ }
+
// check condition before doing anything
- if (memoryBlocks == null || memoryBlocks.length <= 0)
+ if (memoryBlocks == null || memoryBlocks.length <= 0) {
return;
-
- for (int i=0; i<memoryBlocks.length; i++)
- {
+ }
+
+ for (int i = 0; i < memoryBlocks.length; i++) {
IMemoryBlock memory = memoryBlocks[i];
-
- if (!fTabFolderForMemoryBlock.containsKey(memory))
- {
- createFolderForMemoryBlock(memory);
- }
+
+ if (!fTabFolderForMemoryBlock.containsKey(memory)) {
+ createFolderForMemoryBlock(memory);
+ }
fAddedMemoryBlocks.add(memory);
updateToolBarActionsEnablement();
}
- }});
+ }
+ });
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.core.memory.IMemoryBlockListener#
+ * MemoryBlockRemoved(org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
public void memoryBlocksRemoved(final IMemoryBlock[] memoryBlocks) {
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
- for (int j=0; j<memoryBlocks.length; j++)
- {
+ for (int j = 0; j < memoryBlocks.length; j++) {
IMemoryBlock mbRemoved = memoryBlocks[j];
- if (fTabFolderForMemoryBlock == null)
- {
+ if (fTabFolderForMemoryBlock == null) {
return;
}
-
- // get all renderings from this memory block and remove them from the view
+
+ // get all renderings from this memory block and remove them
+ // from the view
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(mbRemoved);
-
- for (int k=0; k<renderings.length; k++)
- {
+
+ for (int k = 0; k < renderings.length; k++) {
removeMemoryRendering(renderings[k]);
}
-
+
// remove a the tab folder if the memory block is removed
- CTabFolder tabFolder =
- (CTabFolder) fTabFolderForMemoryBlock.get(mbRemoved);
-
- if (tabFolder == null)
+ CTabFolder tabFolder = fTabFolderForMemoryBlock.get(mbRemoved);
+
+ if (tabFolder == null) {
continue;
-
+ }
+
fTabFolderForMemoryBlock.remove(mbRemoved);
fMemoryBlockFromTabFolder.remove(tabFolder);
IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(mbRemoved);
- if (retrieve != null)
- {
- if (fTabFolderForDebugView.contains(tabFolder))
- {
+ if (retrieve != null) {
+ if (fTabFolderForDebugView.contains(tabFolder)) {
fTabFolderForDebugView.remove(MemoryViewUtil.getHashCode(retrieve));
}
}
-
- if (!tabFolder.isDisposed()) {
+
+ if (!tabFolder.isDisposed()) {
// dispose all view tabs belonging to the tab folder
CTabItem[] items = tabFolder.getItems();
-
- for (int i=0; i<items.length; i++)
- {
+
+ for (int i = 0; i < items.length; i++) {
disposeTab(items[i]);
}
-
+
// dispose the tab folder
- tabFolder.dispose();
-
+ tabFolder.dispose();
+
// if this is the top control
- if (tabFolder == fStackLayout.topControl)
- {
-
+ if (tabFolder == fStackLayout.topControl) {
+
// if memory view is visible and have a selection
// follow memory view's selection
-
+
ISelection selection = DebugUIPlugin.getActiveWorkbenchWindow().getSelectionService().getSelection(IDebugUIConstants.ID_MEMORY_VIEW);
IMemoryBlock mbToSelect = getMemoryBlock(selection);
-
- if (mbToSelect != null)
- {
- // memory view may not have got the event and is still displaying
+
+ if (mbToSelect != null) {
+ // memory view may not have got the event and is
+ // still displaying
// the deleted memory block
- if (mbToSelect != mbRemoved)
+ if (mbToSelect != mbRemoved) {
handleMemoryBlockSelection(null, mbToSelect);
- else if ((MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0))
- {
+ } else if ((MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0)) {
mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
- handleMemoryBlockSelection(null, mbToSelect);
- }
- else
- {
+ handleMemoryBlockSelection(null, mbToSelect);
+ } else {
emptyFolder();
}
- }
- else if (MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0)
- { // get to the next folder
+ } else if (MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve).length > 0) { // get
+ // to
+ // the
+ // next
+ // folder
mbToSelect = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve)[0];
handleMemoryBlockSelection(null, mbToSelect);
- }
- else
- {
+ } else {
emptyFolder();
-
+
}
}
-
+
// if not the top control
// no need to do anything
}
-
+
fAddedMemoryBlocks.remove(mbRemoved);
updateToolBarActionsEnablement();
}
@@ -242,112 +243,127 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
+ * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(final IWorkbenchPart part, final ISelection selection) {
- if (isDisposed())
+ if (isDisposed()) {
return;
-
+ }
+
// do not schedule job if any of these conditions are true
- if(part == RenderingViewPane.this)
+ if (part == RenderingViewPane.this) {
return;
-
- if (!(selection instanceof IStructuredSelection))
+ }
+
+ if (!(selection instanceof IStructuredSelection)) {
return;
-
- if (selection == AbstractMemoryViewPane.EMPTY)
+ }
+
+ if (selection == AbstractMemoryViewPane.EMPTY) {
return;
-
- UIJob job = new UIJob("RenderingViewPane selectionChanged"){ //$NON-NLS-1$
+ }
+
+ UIJob job = new UIJob("RenderingViewPane selectionChanged") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
try {
- if (isDisposed())
+ if (isDisposed()) {
return Status.OK_STATUS;
-
- if (selection.isEmpty())
- {
+ }
+
+ if (selection.isEmpty()) {
// if the event comes from Memory View
- // pick empty tab folder as the memory view is no longer displaying anything
- if (part.getSite().getId().equals(IDebugUIConstants.ID_MEMORY_VIEW))
- {
- if (part == getMemoryRenderingSite().getSite().getPart())
- {
+ // pick empty tab folder as the memory view is no longer
+ // displaying anything
+ if (part.getSite().getId().equals(IDebugUIConstants.ID_MEMORY_VIEW)) {
+ if (part == getMemoryRenderingSite().getSite().getPart()) {
IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (lastViewTab != null)
+
+ if (lastViewTab != null) {
lastViewTab.setEnabled(false);
-
+ }
+
emptyFolder();
}
}
-
+
// do not do anything if there is no selection
- // In the case when a debug adpater fires a debug event incorrectly, Launch View sets
- // selection to nothing. If the view tab is disabled, it erases all the "delta" information
- // in the content. This may not be desirable as it will cause memory to show up as
- // unchanged when it's actually changed. Do not disable the view tab until there is a
+ // In the case when a debug adpater fires a debug event
+ // incorrectly, Launch View sets
+ // selection to nothing. If the view tab is disabled, it
+ // erases all the "delta" information
+ // in the content. This may not be desirable as it will
+ // cause memory to show up as
+ // unchanged when it's actually changed. Do not disable
+ // the view tab until there is a
// valid selection.
-
+
return Status.OK_STATUS;
}
-
+
// back up current view tab
IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (!(selection instanceof IStructuredSelection))
+
+ if (!(selection instanceof IStructuredSelection)) {
return Status.OK_STATUS;
+ }
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IMemoryBlock)
- {
+ Object elem = ((IStructuredSelection) selection).getFirstElement();
+
+ if (elem instanceof IMemoryBlock) {
// if the selection event comes from this view
- if (part == getMemoryRenderingSite())
- {
- // find the folder associated with the given IMemoryBlockRetrieval
- IMemoryBlock memBlock = (IMemoryBlock)elem;
-
+ if (part == getMemoryRenderingSite()) {
+ // find the folder associated with the given
+ // IMemoryBlockRetrieval
+ IMemoryBlock memBlock = (IMemoryBlock) elem;
+
// should never get here... added code for safety
- if (fTabFolderForMemoryBlock == null)
- {
- if (lastViewTab != null)
+ if (fTabFolderForMemoryBlock == null) {
+ if (lastViewTab != null) {
lastViewTab.setEnabled(false);
-
+ }
+
emptyFolder();
- return Status.OK_STATUS;
+ return Status.OK_STATUS;
}
-
+
handleMemoryBlockSelection(lastViewTab, memBlock);
}
}
- }
- catch(SWTException se)
- {
+ } catch (SWTException se) {
DebugUIPlugin.log(se);
}
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
-
+
public void handleMemoryBlockSelection(final IMemoryViewTab lastViewTab, final IMemoryBlock memBlock) {
// Do not check if the debug target of mb is removed
- // We should not get into this method if the debug target of the memory block is terminated
- // Memory Block Manager gets the terminate event and would have removed all memory blocks
+ // We should not get into this method if the debug target of the memory
+ // block is terminated
+ // Memory Block Manager gets the terminate event and would have removed
+ // all memory blocks
// associated with the debug target
- // Therefore, we will never try to set a selection to a memory block whose target is terminated
+ // Therefore, we will never try to set a selection to a memory block
+ // whose target is terminated
// check current memory block
CTabFolder currentFolder = (CTabFolder) fStackLayout.topControl;
if (currentFolder != null && !currentFolder.isDisposed()) {
- IMemoryBlock currentBlk = (IMemoryBlock) fMemoryBlockFromTabFolder.get(currentFolder);
+ IMemoryBlock currentBlk = fMemoryBlockFromTabFolder.get(currentFolder);
if (currentBlk != null) {
- if (currentBlk == memBlock)
+ if (currentBlk == memBlock) {
return;
+ }
}
}
@@ -360,26 +376,26 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// if we've got a tabfolder to go with the IMemoryBlock, display
// it
if (fTabFolderForMemoryBlock.containsKey(memBlock)) {
- if (fStackLayout.topControl != (CTabFolder) fTabFolderForMemoryBlock.get(memBlock)) {
- setTabFolder((CTabFolder) fTabFolderForMemoryBlock.get(memBlock));
+ if (fStackLayout.topControl != fTabFolderForMemoryBlock.get(memBlock)) {
+ setTabFolder(fTabFolderForMemoryBlock.get(memBlock));
fViewPaneCanvas.layout();
}
} else { // otherwise, add a new one
CTabFolder folder = createTabFolder(fViewPaneCanvas);
-
+
fTabFolderForMemoryBlock.put(memBlock, folder);
fMemoryBlockFromTabFolder.put(folder, memBlock);
- setTabFolder((CTabFolder) fTabFolderForMemoryBlock.get(memBlock));
+ setTabFolder(fTabFolderForMemoryBlock.get(memBlock));
fViewPaneCanvas.layout();
fAddedMemoryBlocks.add(memBlock);
-
+
newCreateRenderingForFolder(memBlock, folder);
}
// restore view tabs
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memBlock);
CTabFolder toDisplay = (CTabFolder) fStackLayout.topControl;
-
+
// if only CreateRendering is present, restore renderings
if (isRestoreViewTabs(toDisplay)) {
restoreViewTabs(renderings);
@@ -403,80 +419,81 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
IMemoryViewTab viewTab = getTopMemoryTab();
- if (viewTab != null)
+ if (viewTab != null) {
setRenderingSelection(viewTab.getRendering());
+ }
- //set toolbar actions enabled/disabled
+ // set toolbar actions enabled/disabled
updateToolBarActionsEnablement();
}
-
- private boolean isRestoreViewTabs(CTabFolder folder)
- {
- if (canAddRendering())
+
+ private boolean isRestoreViewTabs(CTabFolder folder) {
+ if (canAddRendering()) {
return (folder.getItemCount() == 1 && getTopMemoryTab().getRendering() instanceof CreateRendering);
- else
+ } else {
return (folder.getItemCount() == 0);
+ }
}
-
- private int getIndexOfCreateRenderingTab(CTabFolder folder)
- {
- for(int i = 0; i < folder.getItemCount(); i++)
- if(folder.getItem(i).getData() instanceof MemoryViewTab &&
- ((MemoryViewTab) folder.getItem(i).getData()).getRendering() instanceof CreateRendering)
+
+ private int getIndexOfCreateRenderingTab(CTabFolder folder) {
+ for (int i = 0; i < folder.getItemCount(); i++) {
+ if (folder.getItem(i).getData() instanceof MemoryViewTab && ((MemoryViewTab) folder.getItem(i).getData()).getRendering() instanceof CreateRendering) {
return i;
-
+ }
+ }
+
return -1;
}
public void memoryBlockRenderingAdded(final IMemoryRendering rendering) {
-
+
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
-
- if (isDisposed())
+
+ if (isDisposed()) {
return;
-
- if (fAddedRenderings.contains(rendering))
+ }
+
+ if (fAddedRenderings.contains(rendering)) {
return;
+ }
IMemoryBlock memoryblk = rendering.getMemoryBlock();
- CTabFolder tabFolder = (CTabFolder) fTabFolderForMemoryBlock.get(memoryblk);
-
- if (tabFolder == null)
- {
+ CTabFolder tabFolder = fTabFolderForMemoryBlock.get(memoryblk);
+
+ if (tabFolder == null) {
tabFolder = createFolderForMemoryBlock(memoryblk);
}
-
- if (tabFolder == fStackLayout.topControl)
- {
+
+ if (tabFolder == fStackLayout.topControl) {
// disable current view tab
if (getTopMemoryTab() != null) {
deactivateRendering(getTopMemoryTab());
getTopMemoryTab().setEnabled(false);
- }
+ }
}
fAddedRenderings.add(rendering);
-
+
int index = getIndexOfCreateRenderingTab(tabFolder);
- if (index < 0)
- index = 0;
+ if (index < 0) {
+ index = 0;
+ }
CTabItem tab = createTab(tabFolder, index);
-
- MemoryViewTab viewTab = new MemoryViewTab(tab, rendering,getInstance());
+
+ MemoryViewTab viewTab = new MemoryViewTab(tab, rendering, getInstance());
tabFolder.setSelection(tabFolder.indexOf(tab));
-
- if (tabFolder == fStackLayout.topControl)
- {
+
+ if (tabFolder == fStackLayout.topControl) {
setRenderingSelection(viewTab.getRendering());
// disable top view tab if the view pane is not visible
IMemoryViewTab top = getTopMemoryTab();
- if (top != null)
+ if (top != null) {
top.setEnabled(fVisible);
- }
- else
- {
+ }
+ } else {
deactivateRendering(viewTab);
viewTab.setEnabled(false);
}
@@ -486,67 +503,64 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
});
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.core.memory.IMemoryRenderingListener#MemoryBlockRenderingRemoved(org.eclipse.debug.internal.core.memory.IMemoryRendering)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.core.memory.IMemoryRenderingListener#
+ * MemoryBlockRenderingRemoved
+ * (org.eclipse.debug.internal.core.memory.IMemoryRendering)
*/
public void memoryBlockRenderingRemoved(final IMemoryRendering rendering) {
final IMemoryBlock memory = rendering.getMemoryBlock();
-
- // need to run the following code on the UI Thread to avoid invalid thread access exception
- Display.getDefault().asyncExec(new Runnable()
- {
- public void run()
- {
- if (!fAddedRenderings.contains(rendering))
+
+ // need to run the following code on the UI Thread to avoid invalid
+ // thread access exception
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ if (!fAddedRenderings.contains(rendering)) {
return;
-
+ }
+
fAddedRenderings.remove(rendering);
-
+
CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
-
- if (tabFolder.isDisposed())
+
+ if (tabFolder.isDisposed()) {
return;
-
+ }
+
CTabItem[] tabs = tabFolder.getItems();
boolean foundTab = false;
- for (int i = 0; i < tabs.length; i++)
- {
+ for (int i = 0; i < tabs.length; i++) {
IMemoryViewTab viewTab = (IMemoryViewTab) tabs[i].getData();
-
- if (tabs[i].isDisposed())
+
+ if (tabs[i].isDisposed()) {
continue;
-
+ }
- if (viewTab.getRendering().getMemoryBlock() == memory)
- {
- if (viewTab.getRendering() == rendering)
- {
+ if (viewTab.getRendering().getMemoryBlock() == memory) {
+ if (viewTab.getRendering() == rendering) {
foundTab = true;
disposeTab(tabs[i]);
break;
}
-
+
}
}
// if a tab is not found in the current top control
// this deletion is a result of a debug target termination
// find memory from other folder and dispose the view tab
- if (!foundTab)
- {
- Enumeration enumeration = fTabFolderForMemoryBlock.elements();
- while (enumeration.hasMoreElements())
- {
- CTabFolder otherTabFolder = (CTabFolder) enumeration.nextElement();
+ if (!foundTab) {
+ Enumeration<CTabFolder> enumeration = fTabFolderForMemoryBlock.elements();
+ while (enumeration.hasMoreElements()) {
+ CTabFolder otherTabFolder = enumeration.nextElement();
tabs = otherTabFolder.getItems();
IMemoryViewTab viewTab = null;
- for (int i = 0; i < tabs.length; i++)
- {
+ for (int i = 0; i < tabs.length; i++) {
viewTab = (IMemoryViewTab) tabs[i].getData();
- if (viewTab.getRendering().getMemoryBlock() == memory)
- {
- if (viewTab.getRendering() == rendering)
- {
+ if (viewTab.getRendering().getMemoryBlock() == memory) {
+ if (viewTab.getRendering() == rendering) {
foundTab = true;
disposeTab(tabs[i]);
break;
@@ -556,199 +570,206 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
}
}
IMemoryViewTab top = getTopMemoryTab();
-
+
// update selection
- if (top != null)
+ if (top != null) {
setRenderingSelection(top.getRendering());
-
+ }
+
updateToolBarActionsEnablement();
}
});
-
- }
-
+
+ }
+
/**
* @param viewTab
*/
protected void setRenderingSelection(IMemoryRendering rendering) {
- if (rendering != null)
- {
- fSelectionProvider.setSelection(new StructuredSelection(rendering));
- }
+ if (rendering != null) {
+ fSelectionProvider.setSelection(new StructuredSelection(rendering));
+ }
}
-
- private void restoreViewTabs(IMemoryRendering[] renderings)
- {
- for (int i=0; i<renderings.length; i++)
- {
+
+ private void restoreViewTabs(IMemoryRendering[] renderings) {
+ for (int i = 0; i < renderings.length; i++) {
memoryBlockRenderingAdded(renderings[i]);
}
}
-
- private void handleDebugElementSelection(final IMemoryViewTab lastViewTab, final IAdaptable element)
- {
+
+ private void handleDebugElementSelection(final IMemoryViewTab lastViewTab, final IAdaptable element) {
// get current memory block retrieval and debug target
IMemoryBlockRetrieval currentRetrieve = null;
-
+
// get tab folder
CTabFolder tabFolder = (CTabFolder) fStackLayout.topControl;
-
+
// get memory block
- IMemoryBlock currentBlock = (IMemoryBlock)fMemoryBlockFromTabFolder.get(tabFolder);
-
- if (currentBlock != null)
- {
+ IMemoryBlock currentBlock = fMemoryBlockFromTabFolder.get(tabFolder);
+
+ if (currentBlock != null) {
currentRetrieve = MemoryViewUtil.getMemoryBlockRetrieval(currentBlock);
-
+
// backup current retrieve and tab folder
- if (currentRetrieve != null && tabFolder != null)
- {
+ if (currentRetrieve != null && tabFolder != null) {
fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(currentRetrieve), tabFolder);
}
}
-
+
// find the folder associated with the given IMemoryBlockRetrieval
IMemoryBlockRetrieval retrieve = MemoryViewUtil.getMemoryBlockRetrieval(element);
// if debug target has changed
// switch to that tab folder
- if (retrieve != null && retrieve != currentRetrieve)
- {
+ if (retrieve != null && retrieve != currentRetrieve) {
Integer key = MemoryViewUtil.getHashCode(retrieve);
- CTabFolder folder = (CTabFolder)fTabFolderForDebugView.get(key);
-
- if (folder != null)
- {
+ CTabFolder folder = fTabFolderForDebugView.get(key);
+
+ if (folder != null) {
setTabFolder(folder);
fTabFolderForDebugView.put(key, folder);
fViewPaneCanvas.layout();
- }
- else
- {
+ } else {
// find out if there is any memory block for this debug target
// and set up tab folder for the memory blocks
IMemoryBlock blocks[] = MemoryViewUtil.getMemoryBlockManager().getMemoryBlocks(retrieve);
-
- if (blocks.length > 0)
- {
+
+ if (blocks.length > 0) {
handleMemoryBlockSelection(null, blocks[0]);
- }
- else
- {
+ } else {
emptyFolder();
fTabFolderForDebugView.put(key, fEmptyTabFolder);
fViewPaneCanvas.layout();
}
}
}
-
+
// disable last view tab as it becomes hidden
IMemoryViewTab newViewTab = getTopMemoryTab();
- if (lastViewTab != null && lastViewTab != newViewTab)
- {
+ if (lastViewTab != null && lastViewTab != newViewTab) {
lastViewTab.setEnabled(false);
}
- if (newViewTab != null)
- {
+ if (newViewTab != null) {
// if new view tab is not already enabled, enable it
- if (!newViewTab.isEnabled())
- {
+ if (!newViewTab.isEnabled()) {
// if the view tab is visible, enable it
- if (fVisible)
- {
+ if (fVisible) {
newViewTab.setEnabled(fVisible);
- }
+ }
}
-
+
// should only change selection if the new view tab is different
- if (lastViewTab != newViewTab)
+ if (lastViewTab != newViewTab) {
setRenderingSelection(newViewTab.getRendering());
- }
- //set toolbar actions enabled/disabled
+ }
+ }
+ // set toolbar actions enabled/disabled
updateToolBarActionsEnablement();
}
-
+
+ @Override
protected void addListeners() {
super.addListeners();
-
- // must directly listen for selection events from parent's selection provider
- // to ensure that we get the selection event from the tree viewer pane even
+
+ // must directly listen for selection events from parent's selection
+ // provider
+ // to ensure that we get the selection event from the tree viewer pane
+ // even
// if the view does not have focuse
fParent.getSite().getSelectionProvider().addSelectionChangedListener(this);
}
+
+ @Override
protected void removeListeners() {
super.removeListeners();
fParent.getSite().getSelectionProvider().removeSelectionChangedListener(this);
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
+ * .events.SelectionEvent)
*/
+ @Override
public void widgetSelected(SelectionEvent e) {
-
- if (getTopMemoryTab() == null)
+
+ if (getTopMemoryTab() == null) {
return;
-
+ }
+
IMemoryRendering rendering = getTopMemoryTab().getRendering();
-
- if (rendering != null)
- {
+
+ if (rendering != null) {
fSelectionProvider.setSelection(new StructuredSelection(rendering));
}
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse
+ * .swt.events.SelectionEvent)
*/
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
-
+
+ @Override
public Object getCurrentSelection() {
- if (getTopMemoryTab() != null)
- if (getTopMemoryTab().getRendering() != null)
+ if (getTopMemoryTab() != null) {
+ if (getTopMemoryTab().getRendering() != null) {
return getTopMemoryTab().getRendering();
+ }
+ }
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see com.ibm.debug.extended.ui.IMemoryView#getAllViewTabs()
*/
+ @Override
public IMemoryViewTab[] getAllViewTabs() {
-
+
// otherwise, find the view tab to display
CTabFolder folder = (CTabFolder) fStackLayout.topControl;
CTabItem[] items = folder.getItems();
-
+
IMemoryViewTab[] viewTabs = new IMemoryViewTab[folder.getItemCount()];
-
- for(int i=0; i<items.length; i++){
- viewTabs[i] = (IMemoryViewTab)items[i].getData();
+
+ for (int i = 0; i < items.length; i++) {
+ viewTabs[i] = (IMemoryViewTab) items[i].getData();
}
-
+
return viewTabs;
}
- /* (non-Javadoc)
- * @see com.ibm.debug.extended.ui.IMemoryView#moveToTop(com.ibm.debug.extended.ui.IMemoryViewTab)
+ /*
+ * (non-Javadoc)
+ * @see
+ * com.ibm.debug.extended.ui.IMemoryView#moveToTop(com.ibm.debug.extended
+ * .ui.IMemoryViewTab)
*/
+ @Override
public void moveToTop(IMemoryViewTab viewTab) {
-
+
IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (viewTab == lastViewTab)
+
+ if (viewTab == lastViewTab) {
return;
-
+ }
+
// otherwise, find the view tab to display
CTabFolder folder = (CTabFolder) fStackLayout.topControl;
CTabItem[] items = folder.getItems();
for (int i = 0; i < items.length; i++) {
- IMemoryViewTab tab =
- (IMemoryViewTab) items[i].getData();
+ IMemoryViewTab tab = (IMemoryViewTab) items[i].getData();
if (viewTab == tab) {
boolean isEnabled = lastViewTab.isEnabled();
@@ -756,166 +777,166 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
// switch to that viewTab
lastViewTab.setEnabled(false);
folder.setSelection(i);
-
+
setRenderingSelection(tab.getRendering());
-
+
getTopMemoryTab().setEnabled(isEnabled && fVisible);
break;
}
}
}
-
- private CTabFolder createTabFolder(Composite parent)
- {
+
+ private CTabFolder createTabFolder(Composite parent) {
CTabFolder folder = new CTabFolder(parent, SWT.NO_REDRAW_RESIZE | SWT.NO_TRIM | SWT.FLAT);
-
+
ColorRegistry reg = JFaceResources.getColorRegistry();
Color c1 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_START"), //$NON-NLS-1$
- c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$
- folder.setSelectionBackground(new Color[] {c1, c2}, new int[] {100}, true);
+ c2 = reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_BG_END"); //$NON-NLS-1$
+ folder.setSelectionBackground(new Color[] { c1, c2 }, new int[] { 100 }, true);
folder.setSelectionForeground(reg.get("org.eclipse.ui.workbench.ACTIVE_TAB_TEXT_COLOR")); //$NON-NLS-1$
folder.setSimple(PlatformUI.getPreferenceStore().getBoolean(IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS));
folder.setBorderVisible(true);
folder.setFont(fViewPaneCanvas.getFont());
-
+
folder.addCTabFolder2Listener(new CTabFolder2Adapter() {
+ @Override
public void close(CTabFolderEvent event) {
- if(event.item.getData() instanceof MemoryViewTab)
+ if (event.item.getData() instanceof MemoryViewTab) {
RenderingViewPane.this.removeMemoryRendering(((MemoryViewTab) event.item.getData()).getRendering());
+ }
event.doit = false;
}
});
return folder;
}
+ @Override
public void restoreViewPane() {
-
+
// get current selection from memory view
-
+
ISelection selection = null;
- if (fParent.getSite().getSelectionProvider() != null)
+ if (fParent.getSite().getSelectionProvider() != null) {
selection = fParent.getSite().getSelectionProvider().getSelection();
-
+ }
+
IMemoryBlock memoryBlock = null;
- if (selection != null)
- {
+ if (selection != null) {
memoryBlock = getMemoryBlock(selection);
}
-
- if (memoryBlock == null)
- {
+
+ if (memoryBlock == null) {
// get selection from this view
selection = fSelectionProvider.getSelection();
-
- if (MemoryViewUtil.isValidSelection(selection))
- {
- Object elem = ((IStructuredSelection)selection).getFirstElement();
- if (!(elem instanceof IMemoryBlock))
+ if (MemoryViewUtil.isValidSelection(selection)) {
+ Object elem = ((IStructuredSelection) selection).getFirstElement();
+
+ if (!(elem instanceof IMemoryBlock)) {
return;
-
- memoryBlock = (IMemoryBlock)elem;
+ }
+
+ memoryBlock = (IMemoryBlock) elem;
}
}
-
- if (memoryBlock == null)
- {
+
+ if (memoryBlock == null) {
// get a memory block from current debug context
IAdaptable context = DebugUITools.getPartDebugContext(fParent.getSite());
- if (context != null)
- {
+ if (context != null) {
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
- if (retrieval != null)
- {
+ if (retrieval != null) {
IMemoryBlock[] blocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
- if (blocks.length > 0)
+ if (blocks.length > 0) {
memoryBlock = blocks[0];
+ }
}
}
}
-
- if (memoryBlock != null)
- {
- if (!fTabFolderForMemoryBlock.containsKey(memoryBlock))
- {
+
+ if (memoryBlock != null) {
+ if (!fTabFolderForMemoryBlock.containsKey(memoryBlock)) {
// create tab folder if a tab folder does not already exist
// for the memory block
CTabFolder folder = createTabFolder(fViewPaneCanvas);
-
+
fTabFolderForMemoryBlock.put(memoryBlock, folder);
fMemoryBlockFromTabFolder.put(folder, memoryBlock);
- setTabFolder((CTabFolder)fTabFolderForMemoryBlock.get(memoryBlock));
+ setTabFolder(fTabFolderForMemoryBlock.get(memoryBlock));
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memoryBlock);
- if (retrieval != null)
+ if (retrieval != null) {
fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), fTabFolderForMemoryBlock.get(memoryBlock));
- else
+ } else {
DebugUIPlugin.logErrorMessage("Memory block retrieval for memory block is null."); //$NON-NLS-1$
-
+ }
+
fViewPaneCanvas.layout();
fAddedMemoryBlocks.add(memoryBlock);
-
- // every time we create a folder, we have to create a CreateRendering
+
+ // every time we create a folder, we have to create a
+ // CreateRendering
newCreateRenderingForFolder(memoryBlock, folder);
}
-
- if (fTabFolderForMemoryBlock.containsKey(memoryBlock))
- {
- CTabFolder toDisplay = (CTabFolder)fTabFolderForMemoryBlock.get(memoryBlock);
-
- if (toDisplay != null)
- {
+
+ if (fTabFolderForMemoryBlock.containsKey(memoryBlock)) {
+ CTabFolder toDisplay = fTabFolderForMemoryBlock.get(memoryBlock);
+
+ if (toDisplay != null) {
setTabFolder(toDisplay);
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memoryBlock);
-
- if (retrieval != null)
+
+ if (retrieval != null) {
fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), toDisplay);
- else
+ } else {
DebugUIPlugin.logErrorMessage("Memory block retrieval is null for memory block."); //$NON-NLS-1$
-
+ }
+
fViewPaneCanvas.layout();
-
+
// restore view tabs
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memoryBlock);
-
+
// if only CreateRendering is present, restore renderings
- if (isRestoreViewTabs(toDisplay))
- {
+ if (isRestoreViewTabs(toDisplay)) {
restoreViewTabs(renderings);
}
}
}
-
+
// disable current storag block
-
+
IMemoryViewTab top = getTopMemoryTab();
-
- if (top != null)
+
+ if (top != null) {
top.setEnabled(fVisible);
+ }
}
}
-
+
+ @Override
public void dispose() {
super.dispose();
-
+
fTabFolderForMemoryBlock.clear();
fTabFolderForMemoryBlock = null;
-
+
fMemoryBlockFromTabFolder.clear();
fMemoryBlockFromTabFolder = null;
-
+
fRenderingMgr.dispose();
fRenderingMgr = null;
-
+
fAddedMemoryBlocks.clear();
fAddedRenderings.clear();
- }
-
+ }
+
public Control createViewPane(Composite parent, String paneId, String label, boolean canAddRendering, boolean canRemoveRendering) {
return doCreateViewPane(parent, paneId, label, canAddRendering, canRemoveRendering);
}
-
- public Control createViewPane(Composite parent, String paneId, String label) {
+
+ @Override
+ public Control createViewPane(Composite parent, String paneId, String label) {
return doCreateViewPane(parent, paneId, label, true, true);
}
@@ -927,266 +948,298 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
* @param canRemoveRendering
* @return
*/
- private Control doCreateViewPane(Composite parent, String paneId, String label, boolean canAddRendering,
- boolean canRemoveRendering) {
- Control control = super.createViewPane(parent, paneId, label);
+ private Control doCreateViewPane(Composite parent, String paneId, String label, boolean canAddRendering, boolean canRemoveRendering) {
+ Control control = super.createViewPane(parent, paneId, label);
fCanAddRendering = canAddRendering;
fCanRemoveRendering = canRemoveRendering;
fRenderingMgr = new ViewPaneRenderingMgr(this);
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".MemoryRenderingView_context"); //$NON-NLS-1$
return control;
}
-
+
+ @Override
public IAction[] getActions() {
return new IAction[0];
}
-
- // enable/disable toolbar action
- protected void updateToolBarActionsEnablement()
- {
+
+ // enable/disable toolbar action
+ protected void updateToolBarActionsEnablement() {
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.AbstractMemoryViewPane#emptyFolder()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.AbstractMemoryViewPane#emptyFolder
+ * ()
*/
+ @Override
protected void emptyFolder() {
super.emptyFolder();
updateToolBarActionsEnablement();
fSelectionProvider.setSelection(AbstractMemoryViewPane.EMPTY);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#addMemoryRendering(org.eclipse.debug.internal.ui.views.memory.IMemoryRendering)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#
+ * addMemoryRendering
+ * (org.eclipse.debug.internal.ui.views.memory.IMemoryRendering)
*/
+ @Override
public void addMemoryRendering(IMemoryRendering rendering) {
-
- if (rendering == null)
+
+ if (rendering == null) {
return;
+ }
memoryBlockRenderingAdded(rendering);
fRenderingMgr.addMemoryBlockRendering(rendering);
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#removeMemoryRendering(org.eclipse.debug.internal.ui.views.memory.IMemoryRendering)
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#
+ * removeMemoryRendering
+ * (org.eclipse.debug.internal.ui.views.memory.IMemoryRendering)
*/
+ @Override
public void removeMemoryRendering(IMemoryRendering rendering) {
-
- if (rendering == null)
+
+ if (rendering == null) {
return;
-
+ }
+
memoryBlockRenderingRemoved(rendering);
-
- if (fRenderingMgr != null)
+
+ if (fRenderingMgr != null) {
fRenderingMgr.removeMemoryBlockRendering(rendering);
-
+ }
+
}
-
- private RenderingViewPane getInstance()
- {
+
+ private RenderingViewPane getInstance() {
return this;
}
-
- private IMemoryBlock getMemoryBlock(ISelection selection)
- {
- if (!(selection instanceof IStructuredSelection))
+
+ private IMemoryBlock getMemoryBlock(ISelection selection) {
+ if (!(selection instanceof IStructuredSelection)) {
return null;
+ }
- //only single selection of PICLDebugElements is allowed for this action
- if (selection.isEmpty() || ((IStructuredSelection)selection).size() > 1)
- {
+ // only single selection of PICLDebugElements is allowed for this action
+ if (selection.isEmpty() || ((IStructuredSelection) selection).size() > 1) {
return null;
}
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IMemoryBlock)
- return (IMemoryBlock)elem;
- else if (elem instanceof IMemoryRendering)
- return ((IMemoryRendering)elem).getMemoryBlock();
- else
+ Object elem = ((IStructuredSelection) selection).getFirstElement();
+
+ if (elem instanceof IMemoryBlock) {
+ return (IMemoryBlock) elem;
+ } else if (elem instanceof IMemoryRendering) {
+ return ((IMemoryRendering) elem).getMemoryBlock();
+ } else {
return null;
+ }
}
-
- private void deactivateRendering(IMemoryViewTab viewTab)
- {
- if (viewTab == null)
+
+ private void deactivateRendering(IMemoryViewTab viewTab) {
+ if (viewTab == null) {
return;
+ }
- if (!viewTab.isDisposed())
- {
+ if (!viewTab.isDisposed()) {
viewTab.getRendering().deactivated();
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#getMemoryRenderingSite()
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.views.memory.IRenderingViewPane#
+ * getMemoryRenderingSite()
*/
+ @Override
public IMemoryRenderingSite getMemoryRenderingSite() {
return fRenderingSite;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getId()
*/
+ @Override
public String getId() {
return getPaneId();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getRenderings()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getRenderings()
*/
+ @Override
public IMemoryRendering[] getRenderings() {
return fRenderingMgr.getRenderings();
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getActiveRendering()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.memory.IMemoryRenderingContainer#getActiveRendering
+ * ()
*/
+ @Override
public IMemoryRendering getActiveRendering() {
- if (getTopMemoryTab() == null)
+ if (getTopMemoryTab() == null) {
return null;
+ }
return getTopMemoryTab().getRendering();
}
-
+
/**
* Reset the memory renderings within this view pane.
- * @param memoryBlock - reset renderings associated with the given memory block
- * @param resetVisible - reset what's currently visible if the parameter is true.
- * Otherwise, the view pane will reset all renderings associated with the given
- * memory block.
+ *
+ * @param memoryBlock - reset renderings associated with the given memory
+ * block
+ * @param resetVisible - reset what's currently visible if the parameter is
+ * true. Otherwise, the view pane will reset all renderings
+ * associated with the given memory block.
*/
- public void resetRenderings(IMemoryBlock memoryBlock, boolean resetVisible)
- {
+ public void resetRenderings(IMemoryBlock memoryBlock, boolean resetVisible) {
// if we only reset what's visible and the view pane is not visible
// do nothing.
- if (resetVisible && !isVisible())
+ if (resetVisible && !isVisible()) {
return;
-
- if(resetVisible)
- {
+ }
+
+ if (resetVisible) {
IMemoryRendering rendering = getActiveRendering();
- if (rendering != null)
- {
- if (rendering.getMemoryBlock() == memoryBlock)
- {
- if (rendering instanceof IResettableMemoryRendering)
- {
- IResettableMemoryRendering resettableRendering = (IResettableMemoryRendering)rendering;
+ if (rendering != null) {
+ if (rendering.getMemoryBlock() == memoryBlock) {
+ if (rendering instanceof IResettableMemoryRendering) {
+ IResettableMemoryRendering resettableRendering = (IResettableMemoryRendering) rendering;
try {
resettableRendering.resetRendering();
} catch (DebugException e) {
// do not pop up error message
- // error message is annoying where there are multiple rendering
+ // error message is annoying where there are
+ // multiple rendering
// panes and renderings to reset
}
}
}
}
- }
- else
- {
+ } else {
// get all renderings associated with the given memory block
IMemoryRendering[] renderings = fRenderingMgr.getRenderingsFromMemoryBlock(memoryBlock);
-
+
// back up current synchronization provider
IMemoryRendering originalProvider = null;
IMemoryRenderingSynchronizationService service = getMemoryRenderingSite().getSynchronizationService();
- if (service != null)
+ if (service != null) {
originalProvider = service.getSynchronizationProvider();
-
- for (int i=0; i<renderings.length; i++)
- {
- if (renderings[i] instanceof IResettableMemoryRendering)
- {
+ }
+
+ for (int i = 0; i < renderings.length; i++) {
+ if (renderings[i] instanceof IResettableMemoryRendering) {
try {
-
- // This is done to allow user to select multiple memory monitors and
+
+ // This is done to allow user to select multiple memory
+ // monitors and
// reset their renderings.
- // In this case, a hidden rendering will not be the sync provider to the sync
- // service. When the reset happens, the top visible address and selected
- // address is not updated in the sync service. When the rendering later
- // becomes visible, the rendering gets the sync info from the sync service
- // and will try to sync up with old information, giving user the impression
- // that the rendering was never reset. By forcing the rendering that we
- // are trying to reset as the synchronization provider, we ensure that
- // the rendering is able to update its sync info even though the rendering
+ // In this case, a hidden rendering will not be the sync
+ // provider to the sync
+ // service. When the reset happens, the top visible
+ // address and selected
+ // address is not updated in the sync service. When the
+ // rendering later
+ // becomes visible, the rendering gets the sync info
+ // from the sync service
+ // and will try to sync up with old information, giving
+ // user the impression
+ // that the rendering was never reset. By forcing the
+ // rendering that we
+ // are trying to reset as the synchronization provider,
+ // we ensure that
+ // the rendering is able to update its sync info even
+ // though the rendering
// is currently hidden.
- if (service != null)
+ if (service != null) {
service.setSynchronizationProvider(renderings[i]);
- ((IResettableMemoryRendering)renderings[i]).resetRendering();
+ }
+ ((IResettableMemoryRendering) renderings[i]).resetRendering();
} catch (DebugException e) {
// do not pop up error message
- // error message is annoying where there are multiple rendering
+ // error message is annoying where there are multiple
+ // rendering
// panes and renderings to reset
}
}
}
-
+
// restore synchronization provider
- if (service != null)
+ if (service != null) {
service.setSynchronizationProvider(originalProvider);
+ }
}
}
-
-
- public void showCreateRenderingTab()
- {
+ public void showCreateRenderingTab() {
IMemoryRendering activeRendering = RenderingViewPane.this.getActiveRendering();
- if(activeRendering == null)
+ if (activeRendering == null) {
return;
-
+ }
+
IMemoryBlock memoryblk = activeRendering.getMemoryBlock();
- final CTabFolder tabFolder = (CTabFolder) fTabFolderForMemoryBlock.get(memoryblk);
- if (tabFolder != null)
- {
+ final CTabFolder tabFolder = fTabFolderForMemoryBlock.get(memoryblk);
+ if (tabFolder != null) {
Display.getDefault().asyncExec(new Runnable() {
- public void run()
- {
+ @Override
+ public void run() {
int index = getIndexOfCreateRenderingTab(tabFolder);
- if (index >= 0)
+ if (index >= 0) {
tabFolder.setSelection(index);
+ }
}
});
}
}
public void contextActivated(final ISelection selection) {
-
- UIJob job = new UIJob("contextActivated"){ //$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor)
- {
- if (isDisposed())
+
+ UIJob job = new UIJob("contextActivated") { //$NON-NLS-1$
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ if (isDisposed()) {
return Status.OK_STATUS;
-
+ }
+
IMemoryViewTab lastViewTab = getTopMemoryTab();
-
- if (MemoryViewUtil.isValidSelection(selection))
- {
- if (!(selection instanceof IStructuredSelection))
+
+ if (MemoryViewUtil.isValidSelection(selection)) {
+ if (!(selection instanceof IStructuredSelection)) {
return Status.OK_STATUS;
+ }
- Object elem = ((IStructuredSelection)selection).getFirstElement();
-
- if (elem instanceof IAdaptable)
- {
- handleDebugElementSelection(lastViewTab, (IAdaptable)elem);
+ Object elem = ((IStructuredSelection) selection).getFirstElement();
+
+ if (elem instanceof IAdaptable) {
+ handleDebugElementSelection(lastViewTab, (IAdaptable) elem);
}
- }
- else
- {
- if (lastViewTab != null)
+ } else {
+ if (lastViewTab != null) {
lastViewTab.setEnabled(false);
-
- if (fStackLayout.topControl != fEmptyTabFolder)
+ }
+
+ if (fStackLayout.topControl != fEmptyTabFolder) {
emptyFolder();
-
+ }
+
}
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
@@ -1195,31 +1248,29 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
* @param memory
*/
private CTabFolder createFolderForMemoryBlock(IMemoryBlock memory) {
- CTabFolder folder = createTabFolder(fViewPaneCanvas);
-
- fTabFolderForMemoryBlock.put(memory, folder);
- fMemoryBlockFromTabFolder.put(folder, memory);
-
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory);
- if (retrieval != null)
- {
- fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), folder);
- }
- else {
- DebugUIPlugin.logErrorMessage("Memory block retrieval for memory block is null"); //$NON-NLS-1$
- }
-
- newCreateRenderingForFolder(memory, folder);
-
- return folder;
+ CTabFolder folder = createTabFolder(fViewPaneCanvas);
+
+ fTabFolderForMemoryBlock.put(memory, folder);
+ fMemoryBlockFromTabFolder.put(folder, memory);
+
+ IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(memory);
+ if (retrieval != null) {
+ fTabFolderForDebugView.put(MemoryViewUtil.getHashCode(retrieval), folder);
+ } else {
+ DebugUIPlugin.logErrorMessage("Memory block retrieval for memory block is null"); //$NON-NLS-1$
+ }
+
+ newCreateRenderingForFolder(memory, folder);
+
+ return folder;
}
- private void newCreateRenderingForFolder(IMemoryBlock memory,
- CTabFolder folder) {
-
- if (!canAddRendering())
+ private void newCreateRenderingForFolder(IMemoryBlock memory, CTabFolder folder) {
+
+ if (!canAddRendering()) {
return;
-
+ }
+
CTabItem newItem = new CTabItem(folder, SWT.NONE);
CreateRendering rendering = new CreateRendering(getInstance());
rendering.init(getInstance(), memory);
@@ -1227,30 +1278,33 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
folder.setSelection(0);
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener
+ * #contextEvent
+ * (org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
contextActivated(event.getContext());
- }
+ }
}
-
+
/**
* @return whether this container allows user to add rendering manually
* @since 3.4
*/
- public boolean canAddRendering()
- {
+ public boolean canAddRendering() {
return fCanAddRendering;
}
-
+
/**
* @return whether this container allows user to remove rendering manually
* @since 3.4
*/
- public boolean canRemoveRendering()
- {
+ public boolean canRemoveRendering() {
return fCanRemoveRendering;
}
@@ -1261,8 +1315,9 @@ public class RenderingViewPane extends AbstractMemoryViewPane implements IMemory
*/
private CTabItem createTab(CTabFolder tabFolder, int index) {
int swtStyle = SWT.CLOSE;
- if (!canRemoveRendering())
+ if (!canRemoveRendering()) {
swtStyle = SWT.NONE;
+ }
CTabItem tab = new CTabItem(tabFolder, swtStyle, index);
return tab;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
index ebcb6801f..04cb9bba0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockAction.java
@@ -26,26 +26,30 @@ import org.eclipse.ui.IViewActionDelegate;
import org.eclipse.ui.IViewPart;
/**
- * The popup menu action for a memory rendering used to reset the current selection
- * to the default first memory position
+ * The popup menu action for a memory rendering used to reset the current
+ * selection to the default first memory position
*
* @since 3.2.0
*/
-public class ResetMemoryBlockAction implements IViewActionDelegate{
+public class ResetMemoryBlockAction implements IViewActionDelegate {
private IViewPart fView;
- private ArrayList fSelectedMB = new ArrayList();
+ private ArrayList<Object> fSelectedMB = new ArrayList<Object>();
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView = view;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fSelectedMB.isEmpty()) {
return;
@@ -55,25 +59,29 @@ public class ResetMemoryBlockAction implements IViewActionDelegate{
if (resetPref.equals(IDebugPreferenceConstants.RESET_VISIBLE)) {
resetVisible = true;
}
- Iterator iter = fSelectedMB.iterator();
- while(iter.hasNext()) {
- IMemoryBlock mb = (IMemoryBlock)iter.next();
+ Iterator<Object> iter = fSelectedMB.iterator();
+ while (iter.hasNext()) {
+ IMemoryBlock mb = (IMemoryBlock) iter.next();
if (fView instanceof MemoryView) {
- MemoryView memView = (MemoryView)fView;
+ MemoryView memView = (MemoryView) fView;
IMemoryRenderingContainer[] containers = memView.getMemoryRenderingContainers();
-
- for (int i=0; i<containers.length; i++) {
+
+ for (int i = 0; i < containers.length; i++) {
if (containers[i] instanceof RenderingViewPane) {
- ((RenderingViewPane)containers[i]).resetRenderings(mb, resetVisible);
+ ((RenderingViewPane) containers[i]).resetRenderings(mb, resetVisible);
}
}
}
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
action.setEnabled(!selection.isEmpty());
if (selection instanceof IStructuredSelection) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java
index 1aa89987e..01dc1515b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ResetMemoryBlockPreferencePage.java
@@ -21,21 +21,27 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.PlatformUI;
-public class ResetMemoryBlockPreferencePage extends FieldEditorPreferencePage{
-
- public ResetMemoryBlockPreferencePage()
- {
+public class ResetMemoryBlockPreferencePage extends FieldEditorPreferencePage {
+
+ public ResetMemoryBlockPreferencePage() {
super(FieldEditorPreferencePage.GRID);
setPreferenceStore(DebugUITools.getPreferenceStore());
setTitle(DebugUIMessages.ResetMemoryBlockPreferencePage_0);
}
-
+ @Override
protected void createFieldEditors() {
- RadioGroupFieldEditor editor = new RadioGroupFieldEditor(IDebugPreferenceConstants.PREF_RESET_MEMORY_BLOCK, DebugUIMessages.ResetMemoryBlockPreferencePage_1, 1, new String[][] {{DebugUIMessages.ResetMemoryBlockPreferencePage_2, IDebugPreferenceConstants.RESET_VISIBLE},{DebugUIMessages.ResetMemoryBlockPreferencePage_3, IDebugPreferenceConstants.RESET_ALL}}, getFieldEditorParent());
+ RadioGroupFieldEditor editor = new RadioGroupFieldEditor(IDebugPreferenceConstants.PREF_RESET_MEMORY_BLOCK, DebugUIMessages.ResetMemoryBlockPreferencePage_1, 1, new String[][] {
+ {
+ DebugUIMessages.ResetMemoryBlockPreferencePage_2,
+ IDebugPreferenceConstants.RESET_VISIBLE },
+ {
+ DebugUIMessages.ResetMemoryBlockPreferencePage_3,
+ IDebugPreferenceConstants.RESET_ALL } }, getFieldEditorParent());
addField(editor);
}
-
+
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".resetMemoryMonitor_preference_page_context"); //$NON-NLS-1$
return super.createContents(parent);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
index a0667815d..6eaed8d30 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/RetargetAddMemoryBlockAction.java
@@ -21,94 +21,79 @@ import org.eclipse.debug.ui.actions.IAddMemoryBlocksTarget;
import org.eclipse.debug.ui.memory.IMemoryRenderingSite;
/**
- * This is the retargettable add memory block action in the Memory View.
- * All AddMemoryBlock actions in the view will use this action to make sure
- * that clients can override the "Add Memory Monitor" dialog.
- *
+ * This is the retargettable add memory block action in the Memory View. All
+ * AddMemoryBlock actions in the view will use this action to make sure that
+ * clients can override the "Add Memory Monitor" dialog.
+ *
*/
public class RetargetAddMemoryBlockAction extends AddMemoryBlockAction {
- public RetargetAddMemoryBlockAction(IMemoryRenderingSite site)
- {
+ public RetargetAddMemoryBlockAction(IMemoryRenderingSite site) {
super(site);
}
-
- public RetargetAddMemoryBlockAction(IMemoryRenderingSite site, boolean addDefaultRenderings)
- {
+
+ public RetargetAddMemoryBlockAction(IMemoryRenderingSite site, boolean addDefaultRenderings) {
super(site, addDefaultRenderings);
}
-
- public RetargetAddMemoryBlockAction(String text, int style, IMemoryRenderingSite site)
- {
+
+ public RetargetAddMemoryBlockAction(String text, int style, IMemoryRenderingSite site) {
super(text, style, site);
}
+ @Override
public void run() {
- // get current selection from Debug View
+ // get current selection from Debug View
Object debugContext = DebugUITools.getPartDebugContext(fSite.getSite());
IAddMemoryBlocksTarget target = getAddMemoryBlocksTarget(debugContext);
-
- if (target != null)
- {
+
+ if (target != null) {
try {
- if (target.supportsAddMemoryBlocks(getMemoryView()))
- {
+ if (target.supportsAddMemoryBlocks(getMemoryView())) {
target.addMemoryBlocks(getMemoryView(), getMemoryView().getSite().getSelectionProvider().getSelection());
- }
- else
+ } else
super.run();
} catch (CoreException e) {
DebugUIPlugin.errorDialog(DebugUIPlugin.getShell(), ActionMessages.RetargetAddMemoryBlockAction_0, ActionMessages.RetargetAddMemoryBlockAction_1, e);
}
- }
- else
- {
+ } else {
super.run();
}
}
+ @Override
protected void updateAction(Object debugContext) {
-
+
try {
IAddMemoryBlocksTarget target = getAddMemoryBlocksTarget(debugContext);
-
- if (target != null)
- {
- if (target.supportsAddMemoryBlocks(getMemoryView()))
- {
+
+ if (target != null) {
+ if (target.supportsAddMemoryBlocks(getMemoryView())) {
if (getMemoryView().getSite().getSelectionProvider() != null)
setEnabled(target.canAddMemoryBlocks(getMemoryView(), getMemoryView().getSite().getSelectionProvider().getSelection()));
else
super.updateAction(debugContext);
- }
- else
+ } else
super.updateAction(debugContext);
- }
- else
- {
+ } else {
super.updateAction(debugContext);
}
} catch (CoreException e) {
DebugUIPlugin.log(e);
}
}
-
- private IAddMemoryBlocksTarget getAddMemoryBlocksTarget(Object debugContext)
- {
+
+ private IAddMemoryBlocksTarget getAddMemoryBlocksTarget(Object debugContext) {
IMemoryBlockRetrieval standardMemRetrieval = MemoryViewUtil.getMemoryBlockRetrieval(debugContext);
-
+
if (standardMemRetrieval == null)
return null;
-
+
IAddMemoryBlocksTarget target = null;
-
- if (standardMemRetrieval instanceof IAddMemoryBlocksTarget)
- {
+
+ if (standardMemRetrieval instanceof IAddMemoryBlocksTarget) {
target = (IAddMemoryBlocksTarget) standardMemRetrieval;
- }
- else if (standardMemRetrieval instanceof IAdaptable)
- {
- target = (IAddMemoryBlocksTarget)((IAdaptable)standardMemRetrieval).getAdapter(IAddMemoryBlocksTarget.class);
+ } else if (standardMemRetrieval instanceof IAdaptable) {
+ target = (IAddMemoryBlocksTarget) ((IAdaptable) standardMemRetrieval).getAdapter(IAddMemoryBlocksTarget.class);
}
return target;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java
index 559c20c63..8cd837bd7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SetPaddedStringPreferencePage.java
@@ -9,7 +9,6 @@
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
package org.eclipse.debug.internal.ui.views.memory;
import org.eclipse.debug.internal.ui.DebugUIMessages;
@@ -24,17 +23,17 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.PlatformUI;
public class SetPaddedStringPreferencePage extends FieldEditorPreferencePage {
-
+
private StringFieldEditor fPaddedString;
- public SetPaddedStringPreferencePage()
- {
+ public SetPaddedStringPreferencePage() {
super(FieldEditorPreferencePage.GRID);
setPreferenceStore(DebugUITools.getPreferenceStore());
setTitle(DebugUIMessages.SetPaddedStringDialog_0);
-
+
}
+ @Override
protected void createFieldEditors() {
fPaddedString = new StringFieldEditor(IDebugUIConstants.PREF_PADDED_STR, DebugUIMessages.SetPaddedStringPreferencePage_0, getFieldEditorParent());
fPaddedString.setEmptyStringAllowed(false);
@@ -42,12 +41,14 @@ public class SetPaddedStringPreferencePage extends FieldEditorPreferencePage {
addField(fPaddedString);
}
+ @Override
protected Label createDescriptionLabel(Composite parent) {
Label label = new Label(parent, SWT.NONE);
label.setText(DebugUIMessages.SetPaddedStringDialog_1);
return label;
}
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".SetPaddedStrDialog_context"); //$NON-NLS-1$
return super.createContents(parent);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
index 3ce617599..8a07ecf15 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SwitchMemoryBlockAction.java
@@ -50,12 +50,13 @@ import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.progress.WorkbenchJob;
/**
- * The switch memory block action, used
+ * The switch memory block action, used
*/
public class SwitchMemoryBlockAction extends Action implements IViewActionDelegate, IActionDelegate2 {
/**
- * A job that updates the enablement of the of the backing action delegate in the UI thread
+ * A job that updates the enablement of the of the backing action delegate
+ * in the UI thread
*
* @since 3.3.0
*/
@@ -69,24 +70,27 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
setSystem(true);
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime
+ * .IProgressMonitor)
*/
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (fAction != null) {
IAdaptable context = getDebugContext();
if (context != null) {
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
-
+
if (retrieval != null) {
IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
fAction.setEnabled(memoryBlocks.length > 0);
return Status.OK_STATUS;
- }
- else if (getViewer() != null) {
+ } else if (getViewer() != null) {
Object input = getViewer().getInput();
if (input instanceof IMemoryBlockRetrieval) {
- retrieval = (IMemoryBlockRetrieval)input;
+ retrieval = (IMemoryBlockRetrieval) input;
IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
fAction.setEnabled(memoryBlocks.length > 0);
return Status.OK_STATUS;
@@ -98,49 +102,54 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
return Status.CANCEL_STATUS;
}
}
-
+
private IViewPart fView;
private MenuCreator fMenuCreator;
private IAction fAction;
private UpdateActionEnablementJob fUpdateJob = new UpdateActionEnablementJob();
-
+
/**
* Memoryblock listener to update action delegate enablement
*/
private IMemoryBlockListener fListener = new IMemoryBlockListener() {
+ @Override
public void memoryBlocksAdded(IMemoryBlock[] memory) {
if (fAction != null) {
fUpdateJob.schedule();
}
}
+ @Override
public void memoryBlocksRemoved(IMemoryBlock[] memory) {
if (fAction != null) {
fUpdateJob.schedule();
}
}
};
-
+
/**
* Listens for debug context changes and updates action delegate enablement
*/
private IDebugContextListener fDebugContextListener = new IDebugContextListener() {
+ @Override
public void debugContextChanged(DebugContextEvent event) {
- if (fAction != null) {
+ if (fAction != null) {
fUpdateJob.schedule();
}
}
};
-
+
/**
* Switch tab folder for fMemoryBlock to the top in Memory Rendering View
*/
class SwitchToAction extends Action {
private IMemoryBlock fMemoryblock;
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
if (fView == null) {
return;
@@ -153,89 +162,98 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
super();
if (buildLabel) {
setText(DebugUIMessages.SwitchMemoryBlockAction_4);
- Job job = new Job("SwtichToAction"){ //$NON-NLS-1$
+ Job job = new Job("SwtichToAction") { //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
getLabels(memBlk);
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
fMemoryblock = memBlk;
}
-
+
public SwitchToAction(final IMemoryBlock memBlk, String label) {
super(label);
fMemoryblock = memBlk;
}
-
+
private void getLabels(final IMemoryBlock memBlk) {
StringBuffer text = new StringBuffer(IInternalDebugCoreConstants.EMPTY_STRING);
String label = new String(IInternalDebugCoreConstants.EMPTY_STRING);
if (memBlk instanceof IMemoryBlockExtension) {
- String expression = ((IMemoryBlockExtension)memBlk).getExpression();
+ String expression = ((IMemoryBlockExtension) memBlk).getExpression();
if (expression == null) {
expression = DebugUIMessages.SwitchMemoryBlockAction_0;
}
text.append(expression);
- }
- else {
+ } else {
long address = memBlk.getStartAddress();
text.append(Long.toHexString(address));
}
-
+
label = text.toString();
label = decorateLabel(memBlk, label);
final String finalLabel = label;
WorkbenchJob job = new WorkbenchJob("SwtichToAction Update Label") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
SwitchToAction.super.setText(finalLabel);
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
job.schedule();
}
}
-
+
/**
* Menu creator for the action
*/
class MenuCreator implements IMenuCreator {
Menu dropdown;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
if (dropdown != null)
dropdown.dispose();
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
+ * .Control)
*/
+ @Override
public Menu getMenu(Control parent) {
- if (dropdown != null) {
+ if (dropdown != null) {
dropdown.dispose();
dropdown = null;
}
- if (dropdown == null) {
- dropdown = new Menu(parent);
+ if (dropdown == null) {
+ dropdown = new Menu(parent);
// get all memory blocks from tree viewer
IMemoryBlock[] allMemoryBlocks = null;
-
+
// get selection from memory view
IMemoryBlock memoryBlock = getCurrentMemoryBlock();
-
+
Object context = getDebugContext();
- IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
+ IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(context);
if (retrieval != null) {
allMemoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(retrieval);
}
if (allMemoryBlocks != null) {
- for (int i=0; i<allMemoryBlocks.length; i++) {
+ for (int i = 0; i < allMemoryBlocks.length; i++) {
SwitchToAction action = new SwitchToAction(allMemoryBlocks[i], true);
if (allMemoryBlocks[i] == memoryBlock) {
action.setChecked(true);
@@ -249,59 +267,70 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
return dropdown;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets
+ * .Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
return null;
}
-
- }
-
- /* (non-Javadoc)
+
+ }
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView = view;
DebugUITools.getDebugContextManager().getContextService(fView.getViewSite().getWorkbenchWindow()).addDebugContextListener(fDebugContextListener);
DebugPlugin.getDefault().getMemoryBlockManager().addListener(fListener);
fUpdateJob.runInUIThread(new NullProgressMonitor());
}
-
+
/**
* Returns the current memory blocks tree viewer, or <code>null</code>
+ *
* @return the memory blocks tree viewer or <code>null</code>
*/
private StructuredViewer getViewer() {
if (fView instanceof MemoryView) {
- MemoryView memView = (MemoryView)fView;
+ MemoryView memView = (MemoryView) fView;
IMemoryViewPane pane = memView.getViewPane(MemoryBlocksTreeViewPane.PANE_ID);
if (pane instanceof MemoryBlocksTreeViewPane) {
- StructuredViewer viewer = ((MemoryBlocksTreeViewPane)pane).getViewer();
+ StructuredViewer viewer = ((MemoryBlocksTreeViewPane) pane).getViewer();
return viewer;
}
}
return null;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
switchToNext();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
switchToNext();
}
- private void switchToNext() {
+ private void switchToNext() {
IAdaptable context = getDebugContext();
if (context instanceof IDebugElement) {
- IDebugElement debugContext = (IDebugElement)context;
+ IDebugElement debugContext = (IDebugElement) context;
IMemoryBlockRetrieval retrieval = MemoryViewUtil.getMemoryBlockRetrieval(debugContext);
if (retrieval != null) {
@@ -320,13 +349,13 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
IMemoryBlock current = getCurrentMemoryBlock();
int next = 0;
if (current != null) {
- for (int i=0; i<memoryBlocks.length; i++) {
+ for (int i = 0; i < memoryBlocks.length; i++) {
if (memoryBlocks[i] == current) {
- next = i+1;
+ next = i + 1;
}
}
}
- if (next > memoryBlocks.length-1) {
+ if (next > memoryBlocks.length - 1) {
next = 0;
}
SwitchToAction switchAction = new SwitchToAction(memoryBlocks[next], false);
@@ -334,14 +363,22 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (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) {}
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ }
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
fUpdateJob.runInUIThread(new NullProgressMonitor());
@@ -349,9 +386,11 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
action.setMenuCreator(fMenuCreator);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
fAction = null;
DebugPlugin.getDefault().getMemoryBlockManager().removeListener(fListener);
@@ -361,15 +400,20 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
}
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action
+ * .IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
switchToNext();
}
/**
* Returns the current memory block
+ *
* @return the current memory block or <code>null</code>
*/
private IMemoryBlock getCurrentMemoryBlock() {
@@ -378,15 +422,14 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
}
ISelection memBlkSelection = fView.getSite().getSelectionProvider().getSelection();
IMemoryBlock memoryBlock = null;
-
- if (memBlkSelection != null) {
- if (!memBlkSelection.isEmpty() && memBlkSelection instanceof IStructuredSelection) {
- Object obj = ((IStructuredSelection)memBlkSelection).getFirstElement();
- if (obj instanceof IMemoryBlock) {
- memoryBlock = (IMemoryBlock)obj;
- }
- else if (obj instanceof IMemoryRendering) {
- memoryBlock = ((IMemoryRendering)obj).getMemoryBlock();
+
+ if (memBlkSelection != null) {
+ if (!memBlkSelection.isEmpty() && memBlkSelection instanceof IStructuredSelection) {
+ Object obj = ((IStructuredSelection) memBlkSelection).getFirstElement();
+ if (obj instanceof IMemoryBlock) {
+ memoryBlock = (IMemoryBlock) obj;
+ } else if (obj instanceof IMemoryRendering) {
+ memoryBlock = ((IMemoryRendering) obj).getMemoryBlock();
}
}
}
@@ -395,12 +438,13 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
/**
* Decorate the label for the specified <code>IMemoryBlock</code>
+ *
* @param memBlk
* @param label
* @return the decorated label for the specified <code>IMemoryBlock</code>
*/
private String decorateLabel(final IMemoryBlock memBlk, String label) {
- ILabelDecorator decorator = (ILabelDecorator)memBlk.getAdapter(ILabelDecorator.class);
+ ILabelDecorator decorator = (ILabelDecorator) memBlk.getAdapter(ILabelDecorator.class);
if (decorator != null) {
label = decorator.decorateText(label, memBlk);
}
@@ -408,10 +452,10 @@ public class SwitchMemoryBlockAction extends Action implements IViewActionDelega
}
private IAdaptable getDebugContext() {
- if (fView != null) {
- return DebugUITools.getPartDebugContext(fView.getSite());
- } else {
- return DebugUITools.getDebugContext();
- }
+ if (fView != null) {
+ return DebugUITools.getPartDebugContext(fView.getSite());
+ } else {
+ return DebugUITools.getDebugContext();
+ }
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
index 974b876eb..80ea1e47e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/SynchronizeInfo.java
@@ -16,99 +16,94 @@ import java.util.Hashtable;
import org.eclipse.debug.core.model.IMemoryBlock;
-
/**
- * Stores synchronization information for a memory block
- * Each object of synchronization information contains a memory block,
- * a list of views to be synchronized and a list of properties to be syncrhonized.
- * The views are responsible for defining properties to be synchronized and notifying
- * the synchronizer of properties changes. This is only for keeping track of
- * values of synchronized properties and firing events when properties are changed.
+ * Stores synchronization information for a memory block Each object of
+ * synchronization information contains a memory block, a list of views to be
+ * synchronized and a list of properties to be syncrhonized. The views are
+ * responsible for defining properties to be synchronized and notifying the
+ * synchronizer of properties changes. This is only for keeping track of values
+ * of synchronized properties and firing events when properties are changed.
*
- * Memory block serves as a key for synchronization. Views displaying the same
- * memory block can be synchronized. Views displaying different memory block
+ * Memory block serves as a key for synchronization. Views displaying the same
+ * memory block can be synchronized. Views displaying different memory block
* cannot be synchronized.
*
* @since 3.0
*/
-public class SynchronizeInfo
-{
- private IMemoryBlock fBlock; // memory block blocked by the views
- private Hashtable fProperties; // list of properties to be synchronized
+public class SynchronizeInfo {
+ private IMemoryBlock fBlock; // memory block blocked by the views
+ private Hashtable<String, Object> fProperties; // list of properties to be
+ // synchronized
/**
* Create a new synchronization info object for the memory block
+ *
* @param block
*/
- public SynchronizeInfo(IMemoryBlock block)
- {
+ public SynchronizeInfo(IMemoryBlock block) {
fBlock = block;
- fProperties = new Hashtable();
+ fProperties = new Hashtable<String, Object>();
}
-
-
+
/**
* Set a property and its value to the info object
+ *
* @param propertyId
* @param value
*/
- public void setProperty(String propertyId, Object value)
- {
+ public void setProperty(String propertyId, Object value) {
if (propertyId == null)
return;
-
+
if (value == null)
return;
-
+
fProperties.put(propertyId, value);
}
-
+
/**
* Returns the value of the property from the info object
+ *
* @param propertyId
* @return value of the property
*/
- public Object getProperty(String propertyId)
- {
+ public Object getProperty(String propertyId) {
if (propertyId == null)
return null;
-
+
Object value = fProperties.get(propertyId);
-
- return value;
+
+ return value;
}
-
+
/**
* @return all the property ids stored in this sync info object
*/
- public String[] getPropertyIds()
- {
+ public String[] getPropertyIds() {
if (fProperties == null)
return new String[0];
-
- Enumeration enumeration = fProperties.keys();
- ArrayList ids = new ArrayList();
-
- while (enumeration.hasMoreElements())
- {
+
+ Enumeration<String> enumeration = fProperties.keys();
+ ArrayList<String> ids = new ArrayList<String>();
+
+ while (enumeration.hasMoreElements()) {
ids.add(enumeration.nextElement());
}
-
- return (String[])ids.toArray(new String[ids.size()]);
+
+ return ids.toArray(new String[ids.size()]);
}
-
+
/**
* Clean up the synchronization info object
*/
- public void delete()
- {
-
- if (fProperties != null){
+ public void delete() {
+
+ if (fProperties != null) {
fProperties.clear();
fProperties = null;
}
-
- if (fBlock != null){
+
+ if (fBlock != null) {
fBlock = null;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java
index 8595c838f..429b22e29 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleMemoryMonitorsAction.java
@@ -10,17 +10,21 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.views.memory;
-
/**
* Toggles the visiblity of a view pane.
+ *
* @since 3.1
- *
+ *
*/
public class ToggleMemoryMonitorsAction extends ToggleViewPaneAction {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.ToggleViewPaneAction#getPaneId()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.ToggleViewPaneAction#getPaneId
+ * ()
*/
+ @Override
public String getPaneId() {
return MemoryBlocksTreeViewPane.PANE_ID;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java
index 68d1474c6..bd99fa281 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleSplitPaneAction.java
@@ -14,14 +14,19 @@ import org.eclipse.debug.ui.IDebugUIConstants;
/**
* Toggles the visibility of the rendering view pane 2.
+ *
* @since 3.1
- *
+ *
*/
public class ToggleSplitPaneAction extends ToggleViewPaneAction {
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.memory.ToggleViewPaneAction#getPaneId()
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.internal.ui.views.memory.ToggleViewPaneAction#getPaneId
+ * ()
*/
+ @Override
public String getPaneId() {
return IDebugUIConstants.ID_RENDERING_VIEW_PANE_2;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java
index 645c2d706..c340b3b76 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ToggleViewPaneAction.java
@@ -24,49 +24,56 @@ import org.eclipse.ui.IViewPart;
/**
* @since 3.1
*/
-abstract public class ToggleViewPaneAction extends Action implements IViewActionDelegate, IActionDelegate2, IPropertyChangeListener {
+abstract public class ToggleViewPaneAction extends Action implements IViewActionDelegate, IActionDelegate2, IPropertyChangeListener {
MemoryView fView;
IAction fAction;
-
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
- if (view instanceof MemoryView)
- {
- fView = (MemoryView)view;
+ if (view instanceof MemoryView) {
+ fView = (MemoryView) view;
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
-
+
if (fView == null)
return;
-
+
fView.showViewPane(!fView.isViewPaneVisible(getPaneId()), getPaneId());
-
+
if (fView.isViewPaneVisible(getPaneId()))
action.setChecked(true);
else
action.setChecked(false);
-
+
}
-
+
+ @Override
public void run() {
if (fView == null)
return;
-
+
fView.showViewPane(!fView.isViewPaneVisible(getPaneId()), getPaneId());
}
- /* (non-Javadoc)
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action
+ * .IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (fView.isViewPaneVisible(getPaneId()))
action.setChecked(true);
@@ -74,28 +81,31 @@ abstract public class ToggleViewPaneAction extends Action implements IViewActio
action.setChecked(false);
}
+ @Override
public void dispose() {
DebugUITools.getPreferenceStore().removePropertyChangeListener(this);
}
+ @Override
public void init(IAction action) {
fAction = action;
DebugUITools.getPreferenceStore().addPropertyChangeListener(this);
}
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
+ @Override
public void propertyChange(PropertyChangeEvent event) {
- if (fView != null && fAction != null)
- {
+ if (fView != null && fAction != null) {
if (fView.isViewPaneVisible(getPaneId()))
fAction.setChecked(true);
else
fAction.setChecked(false);
}
}
-
- abstract public String getPaneId();
+
+ abstract public String getPaneId();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java
index 5c7f26f37..ce31a0cb5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneOrientationAction.java
@@ -19,39 +19,37 @@ import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.PlatformUI;
-class ViewPaneOrientationAction extends Action
-{
- private MemoryView fView;
- private int fOrientation;
+class ViewPaneOrientationAction extends Action {
+ private MemoryView fView;
+ private int fOrientation;
- ViewPaneOrientationAction(MemoryView view, int orientation)
- {
- super(IInternalDebugCoreConstants.EMPTY_STRING, AS_RADIO_BUTTON);
- fView = view;
- fOrientation = orientation;
-
- if (orientation == MemoryView.HORIZONTAL_VIEW_ORIENTATION) {
- setText(DebugUIMessages.ViewPaneOrientationAction_0);
- setToolTipText(DebugUIMessages.ViewPaneOrientationAction_1);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT));
- } else if (orientation == MemoryView.VERTICAL_VIEW_ORIENTATION) {
- setText(DebugUIMessages.ViewPaneOrientationAction_2);
- setToolTipText(DebugUIMessages.ViewPaneOrientationAction_3);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER));
- }
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.MEMORY_VIEW_PANE_ORIENTATION_ACTION);
- }
+ ViewPaneOrientationAction(MemoryView view, int orientation) {
+ super(IInternalDebugCoreConstants.EMPTY_STRING, AS_RADIO_BUTTON);
+ fView = view;
+ fOrientation = orientation;
- public void run() {
- fView.setViewPanesOrientation(fOrientation);
- }
-
- public int getOrientation()
- {
- return fOrientation;
+ if (orientation == MemoryView.HORIZONTAL_VIEW_ORIENTATION) {
+ setText(DebugUIMessages.ViewPaneOrientationAction_0);
+ setToolTipText(DebugUIMessages.ViewPaneOrientationAction_1);
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT));
+ setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT));
+ setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT));
+ } else if (orientation == MemoryView.VERTICAL_VIEW_ORIENTATION) {
+ setText(DebugUIMessages.ViewPaneOrientationAction_2);
+ setToolTipText(DebugUIMessages.ViewPaneOrientationAction_3);
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER));
+ setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER));
+ setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER));
}
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.MEMORY_VIEW_PANE_ORIENTATION_ACTION);
+ }
+
+ @Override
+ public void run() {
+ fView.setViewPanesOrientation(fOrientation);
+ }
+
+ public int getOrientation() {
+ return fOrientation;
}
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
index e20a18ee3..b16085334 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneRenderingMgr.java
@@ -43,185 +43,159 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
- * A View Pane Rendering Manager manages all the rendering from a view pane.
- * It is responsible for handling debug events and removing renderings
- * from the view pane as a debug session is terminated.
- * In addition, the rendering manager is responsible for persisting memory renderings.
- * Renderings need to be persisted when the memory view is disposed. If the view is
- * opened again, the same set of renderings will be created in the view pane if
- * the renderings are still valid.
+ * A View Pane Rendering Manager manages all the rendering from a view pane. It
+ * is responsible for handling debug events and removing renderings from the
+ * view pane as a debug session is terminated. In addition, the rendering
+ * manager is responsible for persisting memory renderings. Renderings need to
+ * be persisted when the memory view is disposed. If the view is opened again,
+ * the same set of renderings will be created in the view pane if the renderings
+ * are still valid.
+ *
* @since 3.1
*/
-public class ViewPaneRenderingMgr implements IDebugEventSetListener{
+public class ViewPaneRenderingMgr implements IDebugEventSetListener {
- private final ArrayList fRenderings = new ArrayList();
+ private final ArrayList<IMemoryRendering> fRenderings = new ArrayList<IMemoryRendering>();
private final IMemoryRenderingContainer fViewPane;
-
+
private static final String RENDERINGS_TAG = "persistedMemoryRenderings"; //$NON-NLS-1$
private static final String MEMORY_RENDERING_TAG = "memoryRendering"; //$NON-NLS-1$
private static final String MEMORY_BLOCK = "memoryBlock"; //$NON-NLS-1$
private static final String RENDERING_ID = "renderingId"; //$NON-NLS-1$
-
- public ViewPaneRenderingMgr(IMemoryRenderingContainer viewPane)
- {
+
+ public ViewPaneRenderingMgr(IMemoryRenderingContainer viewPane) {
fViewPane = viewPane;
loadPersistedRenderings(getPrefId());
}
- public void removeMemoryBlockRendering(IMemoryBlock mem, String renderingId)
- {
- if(fRenderings == null) {
+ public void removeMemoryBlockRendering(IMemoryBlock mem, String renderingId) {
+ if (fRenderings == null) {
return;
}
-
+
IMemoryRendering[] toRemove = getRenderings(mem, renderingId);
-
- for (int i=0; i<toRemove.length; i++)
- {
+
+ for (int i = 0; i < toRemove.length; i++) {
fRenderings.remove(toRemove[i]);
-
+
// remove listener after the last memory block has been removed
- if (fRenderings.size() == 0)
- {
+ if (fRenderings.size() == 0) {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
}
-
+
storeRenderings();
}
-
public void addMemoryBlockRendering(IMemoryRendering rendering) {
-
+
// do not allow duplicated objects
if (fRenderings.contains(rendering)) {
return;
}
-
+
fRenderings.add(rendering);
-
+
// add listener for the first memory block added
- if (fRenderings.size() == 1)
- {
+ if (fRenderings.size() == 1) {
DebugPlugin.getDefault().addDebugEventListener(this);
}
-
+
storeRenderings();
}
-
public void removeMemoryBlockRendering(IMemoryRendering rendering) {
- if(rendering == null) {
+ if (rendering == null) {
return;
}
-
- if(!fRenderings.contains(rendering)) {
+
+ if (!fRenderings.contains(rendering)) {
return;
}
-
+
fRenderings.remove(rendering);
-
+
// remove listener after the last memory block has been removed
- if (fRenderings.size() == 0)
- {
+ if (fRenderings.size() == 0) {
DebugPlugin.getDefault().removeDebugEventListener(this);
}
-
+
storeRenderings();
}
- public IMemoryRendering[] getRenderings(IMemoryBlock mem, String renderingId)
- {
- if (renderingId == null)
- {
+ public IMemoryRendering[] getRenderings(IMemoryBlock mem, String renderingId) {
+ if (renderingId == null) {
return getRenderingsFromMemoryBlock(mem);
}
-
- ArrayList ret = new ArrayList();
- for (int i=0; i<fRenderings.size(); i++)
- {
- if (fRenderings.get(i) instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)fRenderings.get(i);
- if (rendering.getMemoryBlock() == mem && renderingId.equals(rendering.getRenderingId()))
- {
+
+ ArrayList<IMemoryRendering> ret = new ArrayList<IMemoryRendering>();
+ for (int i = 0; i < fRenderings.size(); i++) {
+ if (fRenderings.get(i) != null) {
+ IMemoryRendering rendering = fRenderings.get(i);
+ if (rendering.getMemoryBlock() == mem && renderingId.equals(rendering.getRenderingId())) {
ret.add(rendering);
}
}
}
-
- return (IMemoryRendering[])ret.toArray(new IMemoryRendering[ret.size()]);
+
+ return ret.toArray(new IMemoryRendering[ret.size()]);
}
-
- public IMemoryRendering[] getRenderings()
- {
- return (IMemoryRendering[])fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
+
+ public IMemoryRendering[] getRenderings() {
+ return fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
}
- public IMemoryRendering[] getRenderingsFromDebugTarget(IDebugTarget target)
- {
- ArrayList ret = new ArrayList();
- for (int i=0; i<fRenderings.size(); i++)
- {
- if (fRenderings.get(i) instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)fRenderings.get(i);
- if (rendering.getMemoryBlock().getDebugTarget() == target)
- {
+ public IMemoryRendering[] getRenderingsFromDebugTarget(IDebugTarget target) {
+ ArrayList<IMemoryRendering> ret = new ArrayList<IMemoryRendering>();
+ for (int i = 0; i < fRenderings.size(); i++) {
+ if (fRenderings.get(i) != null) {
+ IMemoryRendering rendering = fRenderings.get(i);
+ if (rendering.getMemoryBlock().getDebugTarget() == target) {
ret.add(rendering);
}
}
}
-
- return (IMemoryRendering[])ret.toArray(new IMemoryRendering[ret.size()]);
+
+ return ret.toArray(new IMemoryRendering[ret.size()]);
}
-
-
- public IMemoryRendering[] getRenderingsFromMemoryBlock(IMemoryBlock block)
- {
- ArrayList ret = new ArrayList();
- for (int i=0; i<fRenderings.size(); i++)
- {
- if (fRenderings.get(i) instanceof IMemoryRendering)
- {
- IMemoryRendering rendering = (IMemoryRendering)fRenderings.get(i);
- if (rendering.getMemoryBlock() == block)
- {
+
+ public IMemoryRendering[] getRenderingsFromMemoryBlock(IMemoryBlock block) {
+ ArrayList<IMemoryRendering> ret = new ArrayList<IMemoryRendering>();
+ for (int i = 0; i < fRenderings.size(); i++) {
+ if (fRenderings.get(i) != null) {
+ IMemoryRendering rendering = fRenderings.get(i);
+ if (rendering.getMemoryBlock() == block) {
ret.add(rendering);
}
}
}
-
- return (IMemoryRendering[])ret.toArray(new IMemoryRendering[ret.size()]);
- }
-
-
+ return ret.toArray(new IMemoryRendering[ret.size()]);
+ }
+
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
-
- for (int i=0; i < events.length; i++) {
+
+ for (int i = 0; i < events.length; i++) {
handleDebugEvent(events[i]);
}
-
+
}
-
+
public void handleDebugEvent(DebugEvent event) {
Object obj = event.getSource();
IDebugTarget dt = null;
-
- if (event.getKind() == DebugEvent.TERMINATE)
- {
+
+ if (event.getKind() == DebugEvent.TERMINATE) {
// a terminate event could happen from an IThread or IDebugTarget
// Only handle terminate event from debug target
- if (obj instanceof IDebugTarget)
- {
- dt = ((IDebugTarget)obj);
-
+ if (obj instanceof IDebugTarget) {
+ dt = ((IDebugTarget) obj);
+
// returns empty array if dt == null
IMemoryRendering[] deletedrendering = getRenderingsFromDebugTarget(dt);
-
- for (int i=0; i<deletedrendering.length; i++)
- {
+
+ for (int i = 0; i < deletedrendering.length; i++) {
removeMemoryBlockRendering(deletedrendering[i].getMemoryBlock(), deletedrendering[i].getRenderingId());
fViewPane.removeMemoryRendering(deletedrendering[i]);
}
@@ -229,11 +203,10 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
}
}
- public void dispose()
- {
+ public void dispose() {
// remove all renderings
fRenderings.clear();
-
+
String secondaryId = getViewSiteSecondaryId();
if (secondaryId != null) {
// do not save renderings if this is not the primary rendering view
@@ -248,19 +221,18 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
}
}
}
-
+
DebugPlugin.getDefault().removeDebugEventListener(this);
}
-
+
/**
- * Store renderings as preferences. If renderings are stored, renderings
- * can be persisted even after the memory view is closed.
+ * Store renderings as preferences. If renderings are stored, renderings can
+ * be persisted even after the memory view is closed.
*/
- private void storeRenderings()
- {
- String renderingsStr= IInternalDebugCoreConstants.EMPTY_STRING;
+ private void storeRenderings() {
+ String renderingsStr = IInternalDebugCoreConstants.EMPTY_STRING;
try {
- renderingsStr= getRenderingsAsXML();
+ renderingsStr = getRenderingsAsXML();
} catch (IOException e) {
DebugUIPlugin.log(e);
} catch (ParserConfigurationException e) {
@@ -268,16 +240,15 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
} catch (TransformerException e) {
DebugUIPlugin.log(e);
}
-
+
String prefid = getPrefId();
IEclipsePreferences node = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
- if(node != null) {
+ if (node != null) {
if (renderingsStr != null) {
node.put(prefid, renderingsStr);
- }
- else {
+ } else {
IEclipsePreferences def = DefaultScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
- if(def != null) {
+ if (def != null) {
node.put(prefid, def.get(prefid, IInternalDebugCoreConstants.EMPTY_STRING));
}
}
@@ -290,47 +261,47 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
}
private String getPrefId() {
- // constructs id based on memory view's secondary id + the rendering view pane id
- // format: secondaryId:viewPaneId
+ // constructs id based on memory view's secondary id + the rendering
+ // view pane id
+ // format: secondaryId:viewPaneId
StringBuffer id = new StringBuffer();
IMemoryRenderingSite renderingSite = fViewPane.getMemoryRenderingSite();
IWorkbenchPartSite ps = renderingSite.getSite();
- if (ps instanceof IViewSite)
- {
- IViewSite vs = (IViewSite)ps;
+ if (ps instanceof IViewSite) {
+ IViewSite vs = (IViewSite) ps;
String secondaryId = vs.getSecondaryId();
- if (secondaryId != null)
- {
+ if (secondaryId != null) {
id.append(secondaryId);
id.append(":"); //$NON-NLS-1$
}
-
+
}
id.append(fViewPane.getId());
String prefId = id.toString();
return prefId;
}
-
+
/**
* Convert renderings to xml text
+ *
* @return
* @throws IOException
* @throws ParserConfigurationException
* @throws TransformerException
*/
private String getRenderingsAsXML() throws IOException, ParserConfigurationException, TransformerException {
- IMemoryRendering[] renderings= (IMemoryRendering[])fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
-
+ IMemoryRendering[] renderings = fRenderings.toArray(new IMemoryRendering[fRenderings.size()]);
+
if (renderings.length == 0) {
return null;
}
-
- Document document= LaunchManager.getDocument();
- Element rootElement= document.createElement(RENDERINGS_TAG);
+
+ Document document = LaunchManager.getDocument();
+ Element rootElement = document.createElement(RENDERINGS_TAG);
document.appendChild(rootElement);
for (int i = 0; i < renderings.length; i++) {
- IMemoryRendering rendering= renderings[i];
- Element element= document.createElement(MEMORY_RENDERING_TAG);
+ IMemoryRendering rendering = renderings[i];
+ Element element = document.createElement(MEMORY_RENDERING_TAG);
element.setAttribute(MEMORY_BLOCK, Integer.toString(rendering.getMemoryBlock().hashCode()));
element.setAttribute(RENDERING_ID, rendering.getRenderingId());
rootElement.appendChild(element);
@@ -342,11 +313,8 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
* Load renderings currently stored.
*/
private void loadPersistedRenderings(String prefId) {
- String renderingsStr = Platform.getPreferencesService().getString(
- DebugUIPlugin.getUniqueIdentifier(),
- prefId,
- "", //$NON-NLS-1$
- null);
+ String renderingsStr = Platform.getPreferencesService().getString(DebugUIPlugin.getUniqueIdentifier(), prefId, "", //$NON-NLS-1$
+ null);
if (renderingsStr.length() == 0) {
return;
}
@@ -361,53 +329,48 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
DebugUIPlugin.logErrorMessage("Invalid format encountered while loading memory renderings."); //$NON-NLS-1$
return;
}
- NodeList list= root.getChildNodes();
- boolean renderingsAdded= false;
- for (int i= 0, numItems= list.getLength(); i < numItems; i++) {
- Node node= list.item(i);
+ NodeList list = root.getChildNodes();
+ boolean renderingsAdded = false;
+ for (int i = 0, numItems = list.getLength(); i < numItems; i++) {
+ Node node = list.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
- Element element= (Element) node;
+ Element element = (Element) node;
if (!element.getNodeName().equals(MEMORY_RENDERING_TAG)) {
DebugUIPlugin.logErrorMessage("Invalid XML element encountered while loading memory rendering."); //$NON-NLS-1$
continue;
}
- String memoryBlockHashCode= element.getAttribute(MEMORY_BLOCK);
+ String memoryBlockHashCode = element.getAttribute(MEMORY_BLOCK);
String renderingId = element.getAttribute(RENDERING_ID);
-
+
IMemoryBlock[] memoryBlocks = DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks();
IMemoryBlock memoryBlock = null;
- for (int j=0; j<memoryBlocks.length; j++)
- {
+ for (int j = 0; j < memoryBlocks.length; j++) {
if (Integer.toString(memoryBlocks[j].hashCode()).equals(memoryBlockHashCode)) {
memoryBlock = memoryBlocks[j];
}
}
-
- if (memoryBlock != null)
- {
- IMemoryRenderingType[] types = DebugUITools.getMemoryRenderingManager().getRenderingTypes(memoryBlock);
+
+ if (memoryBlock != null) {
+ IMemoryRenderingType[] types = DebugUITools.getMemoryRenderingManager().getRenderingTypes(memoryBlock);
IMemoryRenderingType type = null;
- for (int k=0; k<types.length; k++)
- {
+ for (int k = 0; k < types.length; k++) {
if (types[k].getId().equals(renderingId)) {
type = types[k];
}
}
-
- // if memory block is not found, the rendering is no longer valid
+
+ // if memory block is not found, the rendering is no longer
+ // valid
// simply ignore the rendering
- if (type != null)
- {
+ if (type != null) {
try {
-
+
IMemoryRendering rendering = type.createRendering();
- if (rendering != null)
- {
+ if (rendering != null) {
rendering.init(fViewPane, memoryBlock);
- if (!fRenderings.contains(rendering))
- {
- fRenderings.add(rendering);
- renderingsAdded= true;
+ if (!fRenderings.contains(rendering)) {
+ fRenderings.add(rendering);
+ renderingsAdded = true;
}
}
} catch (CoreException e1) {
@@ -420,18 +383,16 @@ public class ViewPaneRenderingMgr implements IDebugEventSetListener{
if (renderingsAdded) {
DebugPlugin.getDefault().addDebugEventListener(this);
}
- }
-
+ }
+
/**
* @return secondary id, or null if not available
*/
- private String getViewSiteSecondaryId()
- {
+ private String getViewSiteSecondaryId() {
IMemoryRenderingSite renderingSite = fViewPane.getMemoryRenderingSite();
IWorkbenchPartSite ps = renderingSite.getSite();
- if (ps instanceof IViewSite)
- {
- IViewSite vs = (IViewSite)ps;
+ if (ps instanceof IViewSite) {
+ IViewSite vs = (IViewSite) ps;
String secondaryId = vs.getSecondaryId();
return secondaryId;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java
index c375da726..8e8c7795c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewPaneSelectionProvider.java
@@ -8,7 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
-
+
package org.eclipse.debug.internal.ui.views.memory;
import java.util.ArrayList;
@@ -18,60 +18,67 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-
/**
* Handles selection changes in a rendering view pane.
+ *
* @since 3.1
- *
+ *
*/
-public class ViewPaneSelectionProvider implements ISelectionProvider
-{
- ArrayList fListeners = new ArrayList();
+public class ViewPaneSelectionProvider implements ISelectionProvider {
+ ArrayList<ISelectionChangedListener> fListeners = new ArrayList<ISelectionChangedListener>();
ISelection fSelection;
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener
+ * (org.eclipse.jface.viewers.ISelectionChangedListener)
*/
- public void addSelectionChangedListener(ISelectionChangedListener listener)
- {
+ @Override
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
if (!fListeners.contains(listener))
fListeners.add(listener);
-
+
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
*/
- public ISelection getSelection()
- {
+ @Override
+ public ISelection getSelection() {
return fSelection;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener
+ * (org.eclipse.jface.viewers.ISelectionChangedListener)
*/
- public void removeSelectionChangedListener(ISelectionChangedListener listener)
- {
+ @Override
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
if (fListeners.contains(listener))
fListeners.remove(listener);
-
+
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse
+ * .jface.viewers.ISelection)
*/
- public void setSelection(ISelection selection)
- {
+ @Override
+ public void setSelection(ISelection selection) {
fSelection = selection;
fireChanged();
}
-
- public void fireChanged()
- {
+
+ public void fireChanged() {
SelectionChangedEvent evt = new SelectionChangedEvent(this, getSelection());
- for (int i=0; i<fListeners.size(); i++)
- {
- ((ISelectionChangedListener)fListeners.get(i)).selectionChanged(evt);
+ for (int i = 0; i < fListeners.size(); i++) {
+ fListeners.get(i).selectionChanged(evt);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
index 13631cd25..f129ae23c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/ViewTabEnablementManager.java
@@ -24,78 +24,72 @@ import org.eclipse.swt.events.SelectionListener;
*/
public class ViewTabEnablementManager implements SelectionListener {
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt
+ * .events.SelectionEvent)
*/
+ @Override
public void widgetSelected(SelectionEvent e) {
- if (e.getSource() instanceof CTabFolder)
- {
+ if (e.getSource() instanceof CTabFolder) {
handleTabFolderSelection(e);
}
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse
+ * .swt.events.SelectionEvent)
*/
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
-
-
+
}
-
- private void handleTabFolderSelection(SelectionEvent event)
- {
- CTabFolder folder = (CTabFolder)event.getSource();
-
+
+ private void handleTabFolderSelection(SelectionEvent event) {
+ CTabFolder folder = (CTabFolder) event.getSource();
+
CTabItem selectedItem = folder.getSelection();
IMemoryViewTab selectedViewTab;
-
+
// get selected view tab
- if (selectedItem != null)
- {
+ if (selectedItem != null) {
Object obj = selectedItem.getData();
-
- if (obj instanceof IMemoryViewTab)
- {
- selectedViewTab = (IMemoryViewTab)obj;
- }
- else
- {
+
+ if (obj instanceof IMemoryViewTab) {
+ selectedViewTab = (IMemoryViewTab) obj;
+ } else {
return;
}
- }
- else
- {
+ } else {
return;
}
-
+
// get all tabs
CTabItem[] allTabs = folder.getItems();
-
+
// check all tabs to make sure they are enabled/disabled properly
- for (int i=0; i<allTabs.length; i++)
- {
+ for (int i = 0; i < allTabs.length; i++) {
IMemoryViewTab viewTab;
Object obj = allTabs[i].getData();
-
- if (obj instanceof IMemoryViewTab)
- {
- viewTab = (IMemoryViewTab)obj;
-
+
+ if (obj instanceof IMemoryViewTab) {
+ viewTab = (IMemoryViewTab) obj;
+
// if view tab matches the selected item
- if (viewTab == selectedViewTab && !viewTab.isEnabled() )
- {
+ if (viewTab == selectedViewTab && !viewTab.isEnabled()) {
// if the item has been selected and this tab is not enabled
// enable it.
viewTab.setEnabled(true);
viewTab.getRendering().activated();
-
- }
- else if (viewTab != selectedViewTab && viewTab.isEnabled())
- {
+
+ } else if (viewTab != selectedViewTab && viewTab.isEnabled()) {
// if the tab is not selected, disable it
viewTab.setEnabled(false);
viewTab.getRendering().deactivated();
- }
+ }
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
index 4d2b01e90..946a2c5ad 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRendering.java
@@ -37,6 +37,7 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{
setCodePage(codepage);
}
+ @Override
public void dispose() {
super.dispose();
}
@@ -44,6 +45,7 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.AbstractMemoryRendering#getNumCharsPerByte()
*/
+ @Override
public int getNumCharsPerByte() {
return numCharsPerByte;
}
@@ -52,6 +54,7 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
+ @Override
public byte[] getBytes(
String renderingId,
BigInteger address,
@@ -76,6 +79,7 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
*/
+ @Override
public String getString(
String renderingId,
BigInteger address,
@@ -105,6 +109,7 @@ public class ASCIIRendering extends AbstractAsyncTextRendering{
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
// handle code page changed event
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java
index 73c01e051..d242860a6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ASCIIRenderingTypeDelegate.java
@@ -23,6 +23,7 @@ public class ASCIIRenderingTypeDelegate implements IMemoryRenderingTypeDelegate
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
*/
+ @Override
public IMemoryRendering createRendering(String id) throws CoreException {
return new ASCIIRendering(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java
index 7eb33d120..dda837e40 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractBaseTableRendering.java
@@ -87,6 +87,7 @@ public abstract class AbstractBaseTableRendering extends AbstractMemoryRendering
/**
* @return the label of this rendering
*/
+ @Override
abstract public String getLabel();
/**
@@ -102,6 +103,7 @@ public abstract class AbstractBaseTableRendering extends AbstractMemoryRendering
* @param address address to position cursor at
* @throws DebugException if an exception occurrs
*/
+ @Override
abstract public void goToAddress(BigInteger address) throws DebugException;
/**
@@ -109,6 +111,7 @@ public abstract class AbstractBaseTableRendering extends AbstractMemoryRendering
*
* @return the currently selected address in this rendering
*/
+ @Override
abstract public BigInteger getSelectedAddress();
/**
@@ -124,6 +127,7 @@ public abstract class AbstractBaseTableRendering extends AbstractMemoryRendering
* @return the currently selected content in array of MemoryByte.
* Returns an empty array if the selected address is out of buffered range.
*/
+ @Override
abstract public MemoryByte[] getSelectedAsBytes();
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
index 9f11c9779..a8cab1aaa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractIntegerRendering.java
@@ -29,6 +29,7 @@ public abstract class AbstractIntegerRendering extends AbstractAsyncTableRenderi
super(renderingId);
}
+ @Override
public void init(IMemoryRenderingContainer container, IMemoryBlock block) {
super.init(container, block);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java
index 8fcbf331a..b48978798 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractTableRenderingLabelProvider.java
@@ -44,6 +44,7 @@ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
fRendering = null;
super.dispose();
@@ -52,6 +53,7 @@ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider
/**
* @see ITableLabelProvider#getColumnImage(Object, int)
*/
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
if (columnIndex == 0)
@@ -78,6 +80,7 @@ abstract public class AbstractTableRenderingLabelProvider extends LabelProvider
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
*/
+ @Override
public String getColumnText(Object element, int columnIndex) {
String columnLabel = null;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
index c366b2dcc..a4f056241 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AbstractVirtualContentTableModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,70 +16,62 @@ import org.eclipse.debug.internal.ui.viewers.AsynchronousTableModel;
import org.eclipse.debug.internal.ui.viewers.AsynchronousViewer;
import org.eclipse.debug.internal.ui.viewers.ModelNode;
-abstract public class AbstractVirtualContentTableModel extends AsynchronousTableModel{
+abstract public class AbstractVirtualContentTableModel extends AsynchronousTableModel {
public AbstractVirtualContentTableModel(AsynchronousViewer viewer) {
super(viewer);
}
- public Object[] getElements()
- {
+ public Object[] getElements() {
ModelNode[] nodes = getNodes(getRootNode().getElement());
- ArrayList result = new ArrayList();
- if (nodes != null)
- {
- for (int i=0; i<nodes.length; i++)
- {
+ ArrayList<Object> result = new ArrayList<Object>();
+ if (nodes != null) {
+ for (int i = 0; i < nodes.length; i++) {
ModelNode[] children = nodes[i].getChildrenNodes();
- if (children != null)
- {
- for (int j=0; j<children.length; j++)
- {
+ if (children != null) {
+ for (int j = 0; j < children.length; j++) {
result.add(children[j].getElement());
}
}
}
-
+
return result.toArray();
}
return new Object[0];
}
-
- public Object getElement(int idx)
- {
+
+ public Object getElement(int idx) {
Object[] elements = getElements();
- if (idx >=0 && idx < elements.length)
+ if (idx >= 0 && idx < elements.length) {
return elements[idx];
+ }
return null;
}
-
- public int indexOfElement(Object element)
- {
+ public int indexOfElement(Object element) {
Object[] elements = getElements();
-
- for (int i=0; i<elements.length; i++)
- {
- if (elements[i] == element)
+
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] == element) {
return i;
+ }
}
return -1;
}
-
+
abstract public int indexOfKey(Object key);
-
+
abstract public int columnOf(Object element, Object key);
-
+
abstract public Object getKey(int idx);
-
+
abstract public Object getKey(Object element);
-
+
abstract public Object getKey(int idx, int col);
-
- public void handleViewerChanged()
- {
-
+
+ public void handleViewerChanged() {
+
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java
index 18593a7d4..854148932 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncCopyTableRenderingAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,40 +18,39 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
/**
- * Copy action for <code>AbstractAsyncTableRendering</code>. Only copy what is visible in the view.
- *
+ * Copy action for <code>AbstractAsyncTableRendering</code>. Only copy what is
+ * visible in the view.
+ *
*/
-public class AsyncCopyTableRenderingAction extends
- CopyTableRenderingToClipboardAction {
+public class AsyncCopyTableRenderingAction extends CopyTableRenderingToClipboardAction {
public AsyncCopyTableRenderingAction(AbstractBaseTableRendering rendering, StructuredViewer viewer) {
super(rendering, viewer);
}
+ @Override
protected String concatenateTableAsString(TableItem[] itemList) {
-
+
Table table = null;
if (itemList.length > 0) {
table = itemList[0].getParent();
-
+
int topIndex = table.getTopIndex();
int itemCount = table.getItemCount();
- int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
-
- ArrayList items = new ArrayList();
-
+ int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
+
+ ArrayList<TableItem> items = new ArrayList<TableItem>();
+
// start at top index until there is no more data in the table
- for (int i=topIndex; i< topIndex + numVisibleLines; i++)
- {
- if (itemList[i].getData() != null)
- {
+ for (int i = topIndex; i < topIndex + numVisibleLines; i++) {
+ if (itemList[i].getData() != null) {
items.add(itemList[i]);
- }
- else
+ } else {
break;
+ }
}
-
- return super.concatenateTableAsString((TableItem[]) items.toArray(new TableItem[items.size()]));
+
+ return super.concatenateTableAsString(items.toArray(new TableItem[items.size()]));
}
return IInternalDebugCoreConstants.EMPTY_STRING;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java
index ed3b15f22..d132fbedc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncPrintTableRenderingAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2009 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,8 +20,9 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
/**
- * Print action for <code>AbstractAsyncTableRendering</code>. Only print what is visible in the view.
- *
+ * Print action for <code>AbstractAsyncTableRendering</code>. Only print what is
+ * visible in the view.
+ *
*/
public class AsyncPrintTableRenderingAction extends PrintTableRenderingAction {
@@ -29,29 +30,28 @@ public class AsyncPrintTableRenderingAction extends PrintTableRenderingAction {
super(rendering, viewer);
}
+ @Override
protected void printTable(TableItem[] itemList, GC printGC, Printer printer) {
Table table = null;
if (itemList.length > 0) {
table = itemList[0].getParent();
-
+
int topIndex = table.getTopIndex();
int itemCount = table.getItemCount();
- int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
-
- ArrayList items = new ArrayList();
-
+ int numVisibleLines = Math.min((table.getBounds().height / table.getItemHeight()) + 2, itemCount - topIndex);
+
+ ArrayList<TableItem> items = new ArrayList<TableItem>();
+
// start at top index until there is no more data in the table
- for (int i=topIndex; i< topIndex + numVisibleLines; i++)
- {
- if (itemList[i].getData() != null)
- {
+ for (int i = topIndex; i < topIndex + numVisibleLines; i++) {
+ if (itemList[i].getData() != null) {
items.add(itemList[i]);
- }
- else
+ } else {
break;
+ }
}
-
- super.printTable((TableItem[])items.toArray(new TableItem[items.size()]), printGC, printer);
+
+ super.printTable(items.toArray(new TableItem[items.size()]), printGC, printer);
}
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
index b893ef4a8..8cc3feea2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingCellModifier.java
@@ -48,6 +48,7 @@ public class AsyncTableRenderingCellModifier implements ICellModifier {
Job job = new Job("AsyncTableRenderingCellModifier"){ //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
fMBSupportsValueModification = fRendering.getMemoryBlock().supportsValueModification();
return Status.OK_STATUS;
@@ -62,7 +63,8 @@ public class AsyncTableRenderingCellModifier implements ICellModifier {
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
* java.lang.String)
*/
- public boolean canModify(Object element, String property) {
+ @Override
+ public boolean canModify(Object element, String property) {
boolean canModify = true;
try {
if (!(element instanceof MemorySegment))
@@ -122,7 +124,8 @@ public class AsyncTableRenderingCellModifier implements ICellModifier {
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
* java.lang.String)
*/
- public Object getValue(Object element, String property) {
+ @Override
+ public Object getValue(Object element, String property) {
// give back the value of the column
@@ -160,7 +163,8 @@ public class AsyncTableRenderingCellModifier implements ICellModifier {
* @see org.eclipse.jface.viewers.ICellModifier#modify(java.lang.Object,
* java.lang.String, java.lang.Object)
*/
- public void modify(Object element, final String property, final Object value) {
+ @Override
+ public void modify(Object element, final String property, final Object value) {
MemorySegment segment = null;
if (element instanceof TableItem) {
@@ -179,6 +183,7 @@ public class AsyncTableRenderingCellModifier implements ICellModifier {
Job job = new Job("Set Values"){ //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
try {
// calculate offset to update
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
index e27c07344..3d568e8c1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingUpdatePolicy.java
@@ -35,6 +35,7 @@ import org.eclipse.ui.progress.UIJob;
*/
public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
{
+ @Override
public void modelChanged(IModelDelta node, IModelProxy proxy) {
// clear current cache as it becomes invalid when the memory block is changed
@@ -123,6 +124,7 @@ public class AsyncTableRenderingUpdatePolicy extends TableUpdatePolicy
descriptor.updateContentBaseAddress();
UIJob job = new UIJob("go to address"){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
try {
rendering.goToAddress(address);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
index 1b8736878..64c70baae 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncTableRenderingViewer.java
@@ -91,15 +91,18 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fCol = col;
}
+ @Override
public void applyEditorValue() {
fEditor.removeListener(this);
modifyValue(fRow, fCol, fEditor.getValue());
}
+ @Override
public void cancelEditor() {
fEditor.removeListener(this);
}
+ @Override
public void editorValueChanged(boolean oldValidState,
boolean newValidState) {
}
@@ -123,6 +126,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fRendering = rendering;
getTable().addMouseListener(new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
handleTableMouseEvent(e);
}});
@@ -130,6 +134,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
createCursor(getTable());
}
+ @Override
public AbstractUpdatePolicy createUpdatePolicy() {
return new AsyncTableRenderingUpdatePolicy();
}
@@ -152,6 +157,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fTableCursor.setFont(JFaceResources.getFont(IInternalDebugUIConstants.FONT_NAME));
fCursorKeyAdapter = new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e)
{
handleCursorKeyPressed(e);
@@ -161,6 +167,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fTableCursor.addKeyListener(fCursorKeyAdapter);
fCursorTraverseListener = new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
handleCursorTraverseEvt(e);
}};
@@ -168,6 +175,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fTableCursor.addTraverseListener(fCursorTraverseListener);
fCursorMouseListener = new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
handleCursorMouseEvent(e);
}};
@@ -176,6 +184,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
// cursor may be disposed before disposed is called
// remove listeners whenever the cursor is disposed
fTableCursor.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (fTableCursor == null)
return;
@@ -186,6 +195,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}});
fCursorSelectionListener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
handleCursorMoved();
}
@@ -321,6 +331,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
UIJob uiJob = new UIJob("Set Cursor Selection"){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
try {
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
@@ -465,6 +476,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
+ @Override
protected synchronized void preservingSelection(Runnable updateCode) {
Object oldTopIndexKey = null;
@@ -536,6 +548,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
}
+ @Override
public void dispose()
{
super.dispose();
@@ -571,6 +584,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
{
UIJob job = new UIJob("show table cursor"){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!fTableCursor.isDisposed())
{
@@ -725,6 +739,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
private void addListeners(Control control) {
fEditorKeyListener = new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
handleKeyEventInEditor(e);
}
@@ -741,6 +756,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
final KeyEvent e = event;
Display.getDefault().asyncExec(new Runnable()
{
+ @Override
public void run()
{
Object obj = e.getSource();
@@ -884,13 +900,16 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
* This is not a real table labe provider, only goes to the table
* to get the text at the specified row and column.
*/
+ @Override
public IBaseLabelProvider getLabelProvider() {
return new ITableLabelProvider() {
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
int idx = getVirtualContentModel().indexOfElement(element);
if (idx >= 0 )
@@ -901,16 +920,20 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
+ @Override
public void addListener(ILabelProviderListener listener) {
}
+ @Override
public void dispose() {
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
+ @Override
public void removeListener(ILabelProviderListener listener) {
}};
}
@@ -932,6 +955,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
fPendingFormatViewer = false;
preservingSelection(new Runnable() {
+ @Override
public void run() {
// causes the content of the table viewer to be replaced
// without asking content adapter for content
@@ -952,10 +976,12 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
}
+ @Override
public void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
super.handlePresentationFailure(monitor, status);
}
+ @Override
public void refresh(boolean getContent)
{
if (getContent)
@@ -964,6 +990,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
{
preservingSelection(new Runnable() {
+ @Override
public void run() {
AbstractVirtualContentTableModel model = getVirtualContentModel();
if (model != null)
@@ -976,6 +1003,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
}
+ @Override
protected void tableTopIndexSetComplete() {
if (!fTableCursor.isDisposed())
@@ -993,15 +1021,18 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.AsynchronousViewer#getModel()
*/
+ @Override
public AsynchronousModel getModel() {
return super.getModel();
}
// TODO: need pluggable model to be truly flexible
+ @Override
protected AbstractVirtualContentTableModel createVirtualContentTableModel() {
return new TableRenderingModel(this);
}
+ @Override
protected void updateComplete(IStatusMonitor monitor) {
super.updateComplete(monitor);
@@ -1016,6 +1047,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
{
preservingSelection(new Runnable() {
+ @Override
public void run() {
int[] coordinates = getCoordinatesFromKey(getSelectionKey());
@@ -1034,6 +1066,7 @@ public class AsyncTableRenderingViewer extends AsyncVirtualContentTableViewer {
}
}
+ @Override
protected void clear(Widget item) {
super.clear(item);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
index f1759b003..46ea5d76d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/AsyncVirtualContentTableViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -40,8 +40,8 @@ import org.eclipse.ui.progress.UIJob;
abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableViewer {
private Object fPendingTopIndexKey;
- private ArrayList fTopIndexQueue = new ArrayList();
-
+ private ArrayList<Object> fTopIndexQueue = new ArrayList<Object>();
+
private boolean fPendingResizeColumns;
private ListenerList fVirtualContentListeners;
private SelectionListener fScrollSelectionListener;
@@ -54,57 +54,52 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
fPresentationErrorListeners = new ListenerList();
initScrollBarListener();
}
-
- private void initScrollBarListener()
- {
+
+ private void initScrollBarListener() {
ScrollBar scroll = getTable().getVerticalBar();
fScrollSelectionListener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
handleScrollBarSelection();
- }};
+ }
+ };
scroll.addSelectionListener(fScrollSelectionListener);
}
- public void setTopIndex(Object key)
- {
+ public void setTopIndex(Object key) {
fPendingTopIndexKey = key;
attemptSetTopIndex();
}
-
- protected Object getPendingSetTopIndexKey()
- {
+
+ protected Object getPendingSetTopIndexKey() {
return fPendingTopIndexKey;
}
-
+
+ @Override
protected void handlePresentationFailure(IStatusMonitor monitor, IStatus status) {
notifyPresentationError(monitor, status);
}
-
- public void disposeColumns()
- {
+
+ public void disposeColumns() {
// clean up old columns
TableColumn[] oldColumns = getTable().getColumns();
-
- for (int i=0; i<oldColumns.length; i++)
- {
+
+ for (int i = 0; i < oldColumns.length; i++) {
oldColumns[i].dispose();
}
}
-
- public void disposeCellEditors()
- {
+
+ public void disposeCellEditors() {
// clean up old cell editors
CellEditor[] oldCellEditors = getCellEditors();
-
- if (oldCellEditors != null)
- {
- for (int i=0; i<oldCellEditors.length; i++)
- {
+
+ if (oldCellEditors != null) {
+ for (int i = 0; i < oldCellEditors.length; i++) {
oldCellEditors[i].dispose();
}
}
}
-
+
/**
* Resize column to the preferred size.
*/
@@ -112,197 +107,183 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
fPendingResizeColumns = true;
fPendingResizeColumns = attemptResizeColumnsToPreferredSize();
}
-
- private boolean attemptResizeColumnsToPreferredSize()
- {
- if (fPendingResizeColumns)
- {
- if(!hasPendingUpdates()) {
- UIJob job = new UIJob("packcolumns"){ //$NON-NLS-1$
+ private boolean attemptResizeColumnsToPreferredSize() {
+ if (fPendingResizeColumns) {
+ if (!hasPendingUpdates()) {
+ UIJob job = new UIJob("packcolumns") { //$NON-NLS-1$
+
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
Table table = getTable();
-
- if (!table.isDisposed())
- {
- // if table size is zero, the rendering has not been made visible
+
+ if (!table.isDisposed()) {
+ // if table size is zero, the rendering has not been
+ // made visible
// cannot pack until the rendering is visible
- if (table.getSize().x > 0)
- {
+ if (table.getSize().x > 0) {
TableColumn[] columns = table.getColumns();
- for (int i=0 ;i<columns.length-1; i++)
- {
+ for (int i = 0; i < columns.length - 1; i++) {
columns[i].pack();
- }
- }
- else
- {
+ }
+ } else {
fPendingResizeColumns = true;
}
}
return Status.OK_STATUS;
- }};
+ }
+ };
job.setSystem(true);
- job.schedule();
+ job.schedule();
return false;
}
}
return fPendingResizeColumns;
}
-
+
/**
* Attempts to update any pending setTopIndex
*/
protected synchronized void attemptSetTopIndex() {
if (fPendingTopIndexKey != null) {
- Object remaining = doAttemptSetTopIndex(fPendingTopIndexKey);
- if (remaining == null)
- {
- fPendingTopIndexKey = remaining;
- }
+ Object remaining = doAttemptSetTopIndex(fPendingTopIndexKey);
+ if (remaining == null) {
+ fPendingTopIndexKey = remaining;
+ }
}
}
-
- private synchronized Object doAttemptSetTopIndex(final Object topIndexKey)
- {
+
+ private synchronized Object doAttemptSetTopIndex(final Object topIndexKey) {
final int i = getVirtualContentModel().indexOfKey(topIndexKey);
- if (i >= 0)
- {
- UIJob job = new UIJob("set top index"){ //$NON-NLS-1$
-
- public IStatus runInUIThread(IProgressMonitor monitor) {
- if (getTable().isDisposed())
- {
- fTopIndexQueue.clear();
- return Status.OK_STATUS;
+ if (i >= 0) {
+ UIJob job = new UIJob("set top index") { //$NON-NLS-1$
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ if (getTable().isDisposed()) {
+ fTopIndexQueue.clear();
+ return Status.OK_STATUS;
+ }
+
+ int idx = getVirtualContentModel().indexOfKey(topIndexKey);
+ if (idx >= 0) {
+ if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
+ DebugUIPlugin.trace("actual set top index: " + ((BigInteger) topIndexKey).toString(16)); //$NON-NLS-1$
}
-
- int idx = getVirtualContentModel().indexOfKey(topIndexKey);
- if (idx >= 0)
- {
+ fPendingTopIndexKey = null;
+ setTopIndexKey(topIndexKey);
+ getTable().setTopIndex(idx);
+ tableTopIndexSetComplete();
+
+ if (getTable().getTopIndex() != idx) {
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
- DebugUIPlugin.trace("actual set top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
+ DebugUIPlugin.trace(">>> FAILED set top index : " + ((BigInteger) topIndexKey).toString(16)); //$NON-NLS-1$
}
- fPendingTopIndexKey = null;
- setTopIndexKey(topIndexKey);
- getTable().setTopIndex(idx);
- tableTopIndexSetComplete();
-
- if (getTable().getTopIndex() != idx )
- {
+
+ // only retry if we have pending updates
+ if (hasPendingUpdates()) {
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
- DebugUIPlugin.trace(">>> FAILED set top index : " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
+ DebugUIPlugin.trace(">>> Retry top index: " + ((BigInteger) topIndexKey).toString(16)); //$NON-NLS-1$
}
- // only retry if we have pending updates
- if (hasPendingUpdates())
- {
- if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
- DebugUIPlugin.trace(">>> Retry top index: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
- }
-
- fPendingTopIndexKey = topIndexKey;
- }
- }
- }
- else
- {
- if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
- DebugUIPlugin.trace("cannot find key, put it back to the queue: " + topIndexKey); //$NON-NLS-1$
+ fPendingTopIndexKey = topIndexKey;
}
- fPendingTopIndexKey = topIndexKey;
}
-
- // remove the top index key from queue when it is processed
- removeKeyFromQueue(topIndexKey);
-
+ } else {
+ if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
+ DebugUIPlugin.trace("cannot find key, put it back to the queue: " + topIndexKey); //$NON-NLS-1$
+ }
+ fPendingTopIndexKey = topIndexKey;
+ }
+
+ // remove the top index key from queue when it is processed
+ removeKeyFromQueue(topIndexKey);
+
return Status.OK_STATUS;
- }};
-
+ }
+ };
+
// set top index does not happen immediately, keep track of
// all pending set top index
addKeyToQueue(topIndexKey);
-
+
job.setSystem(true);
job.schedule();
return topIndexKey;
}
return topIndexKey;
}
-
- protected void tableTopIndexSetComplete()
- {
-
- }
-
- public void addVirtualContentListener(IVirtualContentListener listener)
- {
- fVirtualContentListeners.add(listener);
- }
-
- public void removeVirtualContentListener(IVirtualContentListener listener)
- {
- fVirtualContentListeners.remove(listener);
- }
-
- protected void notifyListenersAtBufferStart()
- {
- int topIdx = getTable().getTopIndex();
- Object[] listeners = fVirtualContentListeners.getListeners();
-
+
+ protected void tableTopIndexSetComplete() {
+
+ }
+
+ public void addVirtualContentListener(IVirtualContentListener listener) {
+ fVirtualContentListeners.add(listener);
+ }
+
+ public void removeVirtualContentListener(IVirtualContentListener listener) {
+ fVirtualContentListeners.remove(listener);
+ }
+
+ protected void notifyListenersAtBufferStart() {
+ int topIdx = getTable().getTopIndex();
+ Object[] listeners = fVirtualContentListeners.getListeners();
+
for (int i = 0; i < listeners.length; i++) {
final IVirtualContentListener listener = (IVirtualContentListener) listeners[i];
- if (topIdx < listener.getThreshold(IVirtualContentListener.BUFFER_START))
- {
+ if (topIdx < listener.getThreshold(IVirtualContentListener.BUFFER_START)) {
SafeRunner.run(new ISafeRunnable() {
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
listener.handledAtBufferStart();
}
+
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
});
}
}
- }
-
- protected void notifyListenersAtBufferEnd()
- {
+ }
+
+ protected void notifyListenersAtBufferEnd() {
Object[] listeners = fVirtualContentListeners.getListeners();
int topIdx = getTable().getTopIndex();
int bottomIdx = topIdx + getNumberOfVisibleLines();
int elementsCnt = getVirtualContentModel().getElements().length;
int numLinesLeft = elementsCnt - bottomIdx;
-
+
for (int i = 0; i < listeners.length; i++) {
final IVirtualContentListener listener = (IVirtualContentListener) listeners[i];
- if (numLinesLeft <= listener.getThreshold(IVirtualContentListener.BUFFER_END))
- {
+ if (numLinesLeft <= listener.getThreshold(IVirtualContentListener.BUFFER_END)) {
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
listener.handleAtBufferEnd();
}
+
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
});
}
}
- }
-
- protected void handleScrollBarSelection()
- {
-// ignore event if there is pending set top index in the queue
- if (!fTopIndexQueue.isEmpty())
+ }
+
+ protected void handleScrollBarSelection() {
+ // ignore event if there is pending set top index in the queue
+ if (!fTopIndexQueue.isEmpty()) {
return;
+ }
topIndexChanged();
}
-
- public void topIndexChanged()
- {
- if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING)
- {
- MemorySegment a = (MemorySegment)getTable().getItem(getTable().getTopIndex()).getData();
+
+ public void topIndexChanged() {
+ if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
+ MemorySegment a = (MemorySegment) getTable().getItem(getTable().getTopIndex()).getData();
DebugUIPlugin.trace(Thread.currentThread().getName() + " " + this + " handle scroll bar moved: top index: " + a.getAddress().toString(16)); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -311,64 +292,59 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
notifyListenersAtBufferStart();
notifyListenersAtBufferEnd();
}
-
- protected void setTopIndexKey(Object key)
- {
+
+ protected void setTopIndexKey(Object key) {
fTopIndexKey = key;
}
-
- protected Object getTopIndexKey()
- {
+
+ protected Object getTopIndexKey() {
return fTopIndexKey;
}
+ @Override
protected synchronized void preservingSelection(Runnable updateCode) {
Object oldTopIndexKey = null;
if (fPendingTopIndexKey == null) {
// preserve selection
oldTopIndexKey = getTopIndexKey();
- }
- else
- {
+ } else {
oldTopIndexKey = fPendingTopIndexKey;
}
-
+
try {
// perform the update
updateCode.run();
- } finally {
- if (oldTopIndexKey != null)
- {
+ } finally {
+ if (oldTopIndexKey != null) {
setTopIndex(oldTopIndexKey);
}
}
}
-
- public void addPresentationErrorListener(IPresentationErrorListener errorListener)
- {
+
+ public void addPresentationErrorListener(IPresentationErrorListener errorListener) {
fPresentationErrorListeners.add(errorListener);
}
-
- public void removePresentationErrorListener(IPresentationErrorListener errorListener)
- {
+
+ public void removePresentationErrorListener(IPresentationErrorListener errorListener) {
fPresentationErrorListeners.remove(errorListener);
}
-
- private void notifyPresentationError(final IStatusMonitor monitor, final IStatus status)
- {
+
+ private void notifyPresentationError(final IStatusMonitor monitor, final IStatus status) {
Object[] listeners = fPresentationErrorListeners.getListeners();
-
+
for (int i = 0; i < listeners.length; i++) {
-
- if (listeners[i] instanceof IPresentationErrorListener)
- {
- final IPresentationErrorListener listener = (IPresentationErrorListener)listeners[i];
+
+ if (listeners[i] instanceof IPresentationErrorListener) {
+ final IPresentationErrorListener listener = (IPresentationErrorListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
listener.handlePresentationFailure(monitor, status);
}
+
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
@@ -377,108 +353,104 @@ abstract public class AsyncVirtualContentTableViewer extends AsynchronousTableVi
}
}
+ @Override
protected AsynchronousModel createModel() {
return createVirtualContentTableModel();
}
-
+
abstract protected AbstractVirtualContentTableModel createVirtualContentTableModel();
-
- private void addKeyToQueue(Object topIndexKey)
- {
- synchronized(fTopIndexQueue){
+
+ private void addKeyToQueue(Object topIndexKey) {
+ synchronized (fTopIndexQueue) {
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
- DebugUIPlugin.trace(" >>> add to top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
+ DebugUIPlugin.trace(" >>> add to top index queue: " + ((BigInteger) topIndexKey).toString(16)); //$NON-NLS-1$
}
fTopIndexQueue.add(topIndexKey);
}
}
-
- private void removeKeyFromQueue(Object topIndexKey)
- {
- synchronized(fTopIndexQueue){
+
+ private void removeKeyFromQueue(Object topIndexKey) {
+ synchronized (fTopIndexQueue) {
if (DebugUIPlugin.DEBUG_DYNAMIC_LOADING) {
- DebugUIPlugin.trace(" >>> remove frome top index queue: " + ((BigInteger)topIndexKey).toString(16)); //$NON-NLS-1$
+ DebugUIPlugin.trace(" >>> remove frome top index queue: " + ((BigInteger) topIndexKey).toString(16)); //$NON-NLS-1$
}
fTopIndexQueue.remove(topIndexKey);
}
}
-
- public AbstractVirtualContentTableModel getVirtualContentModel()
- {
- if (getModel() instanceof AbstractVirtualContentTableModel)
+
+ public AbstractVirtualContentTableModel getVirtualContentModel() {
+ if (getModel() instanceof AbstractVirtualContentTableModel) {
return (AbstractVirtualContentTableModel) getModel();
+ }
return null;
}
-
- private int getNumberOfVisibleLines()
- {
+
+ private int getNumberOfVisibleLines() {
Table table = getTable();
int height = table.getSize().y;
-
+
// when table is not yet created, height is zero
- if (height == 0)
- {
+ if (height == 0) {
// make use of the table viewer to estimate table size
height = table.getParent().getSize().y;
}
-
+
// height of border
int border = table.getHeaderHeight();
-
+
// height of scroll bar
int scroll = table.getHorizontalBar().getSize().y;
- // height of table is table's area minus border and scroll bar height
- height = height-border-scroll;
+ // height of table is table's area minus border and scroll bar height
+ height = height - border - scroll;
// calculate number of visible lines
int lineHeight = getMinTableItemHeight(table);
-
- int numberOfLines = height/lineHeight;
-
- if (numberOfLines <= 0)
+
+ int numberOfLines = height / lineHeight;
+
+ if (numberOfLines <= 0) {
return 20;
-
- return numberOfLines;
+ }
+
+ return numberOfLines;
}
-
- private int getMinTableItemHeight(Table table){
-
+
+ private int getMinTableItemHeight(Table table) {
+
// Hack to get around Linux GTK problem.
// On Linux GTK, table items have variable item height as
- // carriage returns are actually shown in a cell. Some rows will be
- // taller than others. When calculating number of visible lines, we
- // need to find the smallest table item height. Otherwise, the rendering
- // underestimates the number of visible lines. As a result the rendering
+ // carriage returns are actually shown in a cell. Some rows will be
+ // taller than others. When calculating number of visible lines, we
+ // need to find the smallest table item height. Otherwise, the rendering
+ // underestimates the number of visible lines. As a result the rendering
// will not be able to get more memory as needed.
- if (MemoryViewUtil.isLinuxGTK())
- {
+ if (MemoryViewUtil.isLinuxGTK()) {
// check each of the items and find the minimum
TableItem[] items = table.getItems();
int minHeight = table.getItemHeight();
- for (int i=0; i<items.length; i++)
- {
- if (items[i].getData() != null)
+ for (int i = 0; i < items.length; i++) {
+ if (items[i].getData() != null) {
minHeight = Math.min(items[i].getBounds(0).height, minHeight);
+ }
}
-
+
return minHeight;
-
+
}
return table.getItemHeight();
}
+ @Override
protected void updateComplete(IStatusMonitor monitor) {
super.updateComplete(monitor);
attemptSetTopIndex();
- if (monitor instanceof ILabelRequestMonitor)
- {
+ if (monitor instanceof ILabelRequestMonitor) {
fPendingResizeColumns = attemptResizeColumnsToPreferredSize();
}
}
-
- protected boolean hasPendingSetTopIndex()
- {
+
+ protected boolean hasPendingSetTopIndex() {
return !fTopIndexQueue.isEmpty();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
index 86ef0dbb5..8c16264b0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BasicDebugViewContentProvider.java
@@ -30,6 +30,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
fDisposed= true;
}
@@ -46,6 +47,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
fViewer= (StructuredViewer) viewer;
}
@@ -100,6 +102,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
return;
}
Runnable r= new Runnable() {
+ @Override
public void run() {
if (!isDisposed()) {
doHandleDebugEvent(event);
@@ -113,6 +116,7 @@ public abstract class BasicDebugViewContentProvider implements IStructuredConten
/* (non-Javadoc)
* @see IDebugEventSetListener#handleDebugEvents(DebugEvent[])
*/
+ @Override
public void handleDebugEvents(DebugEvent[] events) {
for (int i=0; i < events.length; i++)
handleDebugEvent(events[i]);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java
index 94d7d154c..77e707a87 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/BigEndianAction.java
@@ -27,12 +27,14 @@ public class BigEndianAction implements IObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fRendering == null)
@@ -47,6 +49,7 @@ public class BigEndianAction implements IObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (selection == null)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
index 43ad789a6..3c5d3292c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CopyTableRenderingToClipboardAction.java
@@ -158,6 +158,7 @@ public class CopyTableRenderingToClipboardAction extends Action
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
if (fRendering == null)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
index e1f6d8479..afedc2b75 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/CreateRendering.java
@@ -83,6 +83,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object)
*/
+ @Override
public Image getImage(Object element) {
return DebugUIPlugin.getImageDescriptorRegistry().get(
DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
@@ -91,6 +92,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object)
*/
+ @Override
public String getText(Object element) {
if (element instanceof IMemoryRenderingType)
{
@@ -103,18 +105,21 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#addListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
+ @Override
public void addListener(ILabelProviderListener listener) {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#isLabelProperty(java.lang.Object, java.lang.String)
*/
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
@@ -122,6 +127,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#removeListener(org.eclipse.jface.viewers.ILabelProviderListener)
*/
+ @Override
public void removeListener(ILabelProviderListener listener) {
}
@@ -133,6 +139,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
IMemoryRenderingType[] renderings = DebugUITools.getMemoryRenderingManager().getRenderingTypes((IMemoryBlock)inputElement);
return renderings;
@@ -141,6 +148,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
@@ -148,6 +156,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
@@ -156,6 +165,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fCanvas = new Composite(parent, SWT.NONE);
GridLayout compositeLayout = new GridLayout();
@@ -205,12 +215,14 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
fViewer.addDoubleClickListener(new IDoubleClickListener (){
+ @Override
public void doubleClick(DoubleClickEvent event) {
addRenderings();
}});
// listen for enter being pressed
fViewer.getList().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
if (e.character == SWT.CR)
addRenderings();
@@ -225,10 +237,12 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
addButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
addRenderings();
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
addRenderings();
}});
@@ -290,6 +304,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#dispose()
*/
+ @Override
public void dispose() {
fViewer = null;
fCanvas = null;
@@ -301,14 +316,17 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.memory.AbstractMemoryRendering#getControl()
*/
+ @Override
public Control getControl() {
return fCanvas;
}
+ @Override
public void memoryRenderingBindingsChanged() {
if (fViewer != null)
fViewer.refresh();
}
+ @Override
public String getLabel() {
if (fTabLabel == null)
{
@@ -319,15 +337,18 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
return fTabLabel;
}
+ @Override
public Image getImage() {
return DebugUIPlugin.getImageDescriptorRegistry().get(
DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_MONITOR_EXPRESSION));
}
+ @Override
public void becomesVisible() {
// Do nothing, do not want to connect/disconnect from clients
}
+ @Override
public void becomesHidden() {
// Do nothing, do not want to connect/disconnect from clients
}
@@ -336,6 +357,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
{
Job job = new Job("Update Rendering Label"){ //$NON-NLS-1$
+ @Override
protected IStatus run(IProgressMonitor monitor) {
fLabel = CreateRendering.super.getLabel();
fTabLabel = DebugUIMessages.CreateRenderingTab_label ;
@@ -344,6 +366,7 @@ public class CreateRendering extends AbstractMemoryRendering implements IMemoryR
WorkbenchJob wbJob = new WorkbenchJob("Create Rendering Update Label"){ //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor wbMonitor) {
if (fMemoryBlockLabel != null)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java
index 1c37061ad..0445ba216 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/DefaultEndianessAction.java
@@ -31,9 +31,11 @@ public class DefaultEndianessAction implements IObjectActionDelegate {
super();
}
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
+ @Override
public void run(IAction action) {
if (fRendering != null)
{
@@ -50,6 +52,7 @@ public class DefaultEndianessAction implements IObjectActionDelegate {
}
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (selection == null)
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java
index 36743b9cd..721d86c1d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ErrorRendering.java
@@ -48,6 +48,7 @@ public class ErrorRendering extends AbstractMemoryRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fTextViewer = new TextViewer(parent, SWT.READ_ONLY);
fTextViewer.setDocument(new Document());
@@ -80,6 +81,7 @@ public class ErrorRendering extends AbstractMemoryRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.memory.AbstractMemoryRendering#getControl()
*/
+ @Override
public Control getControl() {
return fTextViewer.getControl();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java
index c3ae82db8..5e0c04565 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingAction.java
@@ -31,6 +31,7 @@ public class FormatTableRenderingAction extends Action {
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".FormatTableRenderingAction_context"); //$NON-NLS-1$
}
+ @Override
public void run() {
FormatTableRenderingDialog dialog = new FormatTableRenderingDialog(fRendering, DebugUIPlugin.getShell());
dialog.open();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
index b541a7a94..ed3705a13 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/FormatTableRenderingDialog.java
@@ -76,6 +76,7 @@ public class FormatTableRenderingDialog extends TrayDialog
fMsg = DebugUIMessages.FormatTableRenderingAction_1;
}
+ @Override
protected Control createDialogArea(Composite parent) {
getShell().setText(DebugUIMessages.FormatTableRenderingAction_0);
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".FormatTableRenderingDialog_context"); //$NON-NLS-1$
@@ -111,6 +112,7 @@ public class FormatTableRenderingDialog extends TrayDialog
fRowControl.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (fCurrentRowIdx != fRowControl.getSelectionIndex())
{
@@ -120,6 +122,7 @@ public class FormatTableRenderingDialog extends TrayDialog
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}});
@@ -141,6 +144,7 @@ public class FormatTableRenderingDialog extends TrayDialog
fColumnControl.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (fCurrentColIdx != fColumnControl.getSelectionIndex())
{
@@ -150,6 +154,7 @@ public class FormatTableRenderingDialog extends TrayDialog
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}});
@@ -174,10 +179,12 @@ public class FormatTableRenderingDialog extends TrayDialog
fDefaultButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
saveDefaults();
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}});
@@ -243,9 +250,11 @@ public class FormatTableRenderingDialog extends TrayDialog
Button restoreButton = new Button(composite, SWT.NONE);
restoreButton.setText(DebugUIMessages.FormatTableRenderingAction_6);
restoreButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent e) {
restoreDefaults();
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}});
data = new GridData();
@@ -258,6 +267,7 @@ public class FormatTableRenderingDialog extends TrayDialog
return composite;
}
+ @Override
protected void okPressed() {
int idx = fColumnControl.getSelectionIndex();
fColumnSize = fColumnSizes[idx];
@@ -521,6 +531,7 @@ public class FormatTableRenderingDialog extends TrayDialog
fCurrentRowIdx = populateControl(row, fRowSizes, fRowControl);
}
+ @Override
protected Control createButtonBar(Composite parent) {
Control ret = super.createButtonBar(parent);
if (fDisableCancel)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
index 690b788ca..bfa245303 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressAction.java
@@ -60,6 +60,7 @@ public class GoToAddressAction extends Action
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run()
{
try
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
index 59799c034..2803d37b6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/GoToAddressDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2009 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,9 +34,9 @@ import org.eclipse.ui.PlatformUI;
* @since 3.0
*/
-public class GoToAddressDialog extends TrayDialog implements ModifyListener{
+public class GoToAddressDialog extends TrayDialog implements ModifyListener {
- private static Vector history = new Vector();
+ private static Vector<String> history = new Vector<String>();
private Combo expressionInput;
private String expression;
@@ -48,18 +48,22 @@ public class GoToAddressDialog extends TrayDialog implements ModifyListener{
setShellStyle(getShellStyle() | SWT.RESIZE);
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
+ * .Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Composite comp = (Composite) super.createDialogArea(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".GoToAddressDialog_context"); //$NON-NLS-1$
comp.setLayout(new GridLayout());
- GridData spec2= new GridData();
- spec2.grabExcessVerticalSpace= true;
- spec2.grabExcessHorizontalSpace= true;
- spec2.horizontalAlignment= GridData.FILL;
- spec2.verticalAlignment= GridData.CENTER;
+ GridData spec2 = new GridData();
+ spec2.grabExcessVerticalSpace = true;
+ spec2.grabExcessHorizontalSpace = true;
+ spec2.horizontalAlignment = GridData.FILL;
+ spec2.verticalAlignment = GridData.CENTER;
comp.setLayoutData(spec2);
Label textLabel = new Label(comp, SWT.NONE);
@@ -67,81 +71,92 @@ public class GoToAddressDialog extends TrayDialog implements ModifyListener{
GridData textLayout = new GridData();
textLayout.widthHint = 280;
textLabel.setLayoutData(textLayout);
-
+
expressionInput = new Combo(comp, SWT.BORDER);
- GridData spec= new GridData();
- spec.grabExcessVerticalSpace= false;
- spec.grabExcessHorizontalSpace= true;
- spec.horizontalAlignment= GridData.FILL;
- spec.verticalAlignment= GridData.BEGINNING;
+ GridData spec = new GridData();
+ spec.grabExcessVerticalSpace = false;
+ spec.grabExcessHorizontalSpace = true;
+ spec.horizontalAlignment = GridData.FILL;
+ spec.verticalAlignment = GridData.BEGINNING;
spec.heightHint = 50;
expressionInput.setLayoutData(spec);
-
+
// add history
- String[] historyExpression = (String[])history.toArray(new String[history.size()]);
- for (int i=0; i<historyExpression.length; i++)
- {
+ String[] historyExpression = history.toArray(new String[history.size()]);
+ for (int i = 0; i < historyExpression.length; i++) {
expressionInput.add(historyExpression[i]);
}
-
+
expressionInput.addModifyListener(this);
-
+
return comp;
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
+
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets
+ * .Shell)
*/
+ @Override
protected void configureShell(Shell newShell) {
super.configureShell(newShell);
-
+
newShell.setText(DebugUIMessages.GoToAddressDialog_GoToAddress);
}
-
- public String getExpression()
- {
+
+ public String getExpression() {
return expression;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
expression = expressionInput.getText();
// add to history list
- if (!history.contains(expression))
+ if (!history.contains(expression)) {
history.insertElementAt(expression, 0);
+ }
super.okPressed();
}
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events
+ * .ModifyEvent)
*/
+ @Override
public void modifyText(ModifyEvent e) {
String input = expressionInput.getText();
-
- if (input == null || input.equals(IInternalDebugCoreConstants.EMPTY_STRING))
- {
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
- else
- {
+
+ if (input == null || input.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ } else {
getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
+ }
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets.Composite)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.jface.dialogs.Dialog#createButtonBar(org.eclipse.swt.widgets
+ * .Composite)
*/
+ @Override
protected Control createButtonBar(Composite parent) {
-
- Control ret = super.createButtonBar(parent);
+
+ Control ret = super.createButtonBar(parent);
getButton(IDialogConstants.OK_ID).setEnabled(false);
-
+
return ret;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
index 07242208b..fa2c7b7de 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRendering.java
@@ -30,6 +30,7 @@ public class HexIntegerRendering extends AbstractIntegerRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
+ @Override
public String getString(String dataType, BigInteger address,
MemoryByte[] data) {
StringBuffer strBuffer = new StringBuffer();
@@ -78,6 +79,7 @@ public class HexIntegerRendering extends AbstractIntegerRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
+ @Override
public byte[] getBytes(String dataType, BigInteger address,
MemoryByte[] currentValues, String data) {
@@ -96,6 +98,7 @@ public class HexIntegerRendering extends AbstractIntegerRendering {
return bytes;
}
+ @Override
public int getNumCharsPerByte()
{
return 2;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java
index 8ccbde884..72218e37b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexIntegerRenderingDelegate.java
@@ -19,6 +19,7 @@ public class HexIntegerRenderingDelegate implements IMemoryRenderingTypeDelegate
public HexIntegerRenderingDelegate() {
}
+ @Override
public IMemoryRendering createRendering(String id) throws CoreException {
return new HexIntegerRendering(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
index cfc2efc49..9e994e303 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRendering.java
@@ -31,6 +31,7 @@ public class HexRendering extends AbstractAsyncTableRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
+ @Override
public String getString(String dataType, BigInteger address,
MemoryByte[] data) {
StringBuffer strBuffer = new StringBuffer();
@@ -56,6 +57,7 @@ public class HexRendering extends AbstractAsyncTableRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
+ @Override
public byte[] getBytes(String dataType, BigInteger address,
MemoryByte[] currentValues, String data) {
byte[] bytes = RenderingsUtil.convertHexStringToByteArray(data, currentValues.length, getNumCharsPerByte());
@@ -63,6 +65,7 @@ public class HexRendering extends AbstractAsyncTableRendering {
return bytes;
}
+ @Override
public int getNumCharsPerByte()
{
return 2;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java
index 22ddebbd4..9d9ab492b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/HexRenderingTypeDelegate.java
@@ -23,6 +23,7 @@ public class HexRenderingTypeDelegate implements IMemoryRenderingTypeDelegate {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
*/
+ @Override
public IMemoryRendering createRendering(String id) throws CoreException {
HexRendering rendering = new HexRendering(id);
return rendering;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java
index 9bf917eb4..fa4a3e1e6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/LittleEndianAction.java
@@ -29,12 +29,14 @@ public class LittleEndianAction implements IObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fRendering == null)
@@ -49,6 +51,7 @@ public class LittleEndianAction implements IObjectActionDelegate {
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (selection == null)
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java
index ddb69da43..f9fe71143 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/MemorySegment.java
@@ -72,13 +72,13 @@ public class MemorySegment extends PlatformObject {
if (start + length > fBytes.length)
return new MemoryByte[0];
- ArrayList ret = new ArrayList();
+ ArrayList<MemoryByte> ret = new ArrayList<MemoryByte>();
for (int i=start; i< start+length; i++)
{
ret.add(fBytes[i]);
}
- return (MemoryByte[]) ret.toArray(new MemoryByte[ret.size()]);
+ return ret.toArray(new MemoryByte[ret.size()]);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
index 1cb64e414..71ebac1d2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/PrintTableRenderingAction.java
@@ -171,6 +171,7 @@ public class PrintTableRenderingAction extends Action
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
if (!(fViewer.getControl() instanceof Table))
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java
index 0324df3a5..7b4e1a53f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ReformatAction.java
@@ -34,6 +34,7 @@ public class ReformatAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fRendering.resizeColumnsToPreferredSize();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java
index 23373ebc3..1dabe2ed9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/ResetToBaseAddressAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,36 +30,37 @@ import org.eclipse.ui.PlatformUI;
*/
public class ResetToBaseAddressAction extends Action {
- private AbstractBaseTableRendering fRendering;
+ private AbstractBaseTableRendering fRendering;
- public ResetToBaseAddressAction(AbstractBaseTableRendering rendering) {
- fRendering = rendering;
- setText(DebugUIMessages.ResetMemoryBlockAction_title);
- setToolTipText(DebugUIMessages.ResetMemoryBlockAction_tootip);
+ public ResetToBaseAddressAction(AbstractBaseTableRendering rendering) {
+ fRendering = rendering;
+ setText(DebugUIMessages.ResetMemoryBlockAction_title);
+ setToolTipText(DebugUIMessages.ResetMemoryBlockAction_tootip);
- setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESET_MEMORY));
- setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_RESET_MEMORY));
- setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESET_MEMORY));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".ResetBaseAddressContextAction_context"); //$NON-NLS-1$
- }
+ setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_RESET_MEMORY));
+ setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_LCL_RESET_MEMORY));
+ setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_RESET_MEMORY));
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".ResetBaseAddressContextAction_context"); //$NON-NLS-1$
+ }
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.action.IAction#run()
- */
- public void run() {
-
- // check if client has overrode the #reset method
- // if client has overrode #reset method, call old method
- // otherwise, call new #resetRendering method
- // This is done to ensure that client's code will continue to be executed until
- // they have migrated to the new #resetRendering API
- Class renderingClass = fRendering.getClass();
- try {
- Method method = renderingClass.getMethod("reset", new Class[]{}); //$NON-NLS-1$
- if (method.getDeclaringClass().equals(AbstractTableRendering.class))
- {
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.action.IAction#run()
+ */
+ @SuppressWarnings("deprecation")
+ @Override
+ public void run() {
+
+ // check if client has overrode the #reset method
+ // if client has overrode #reset method, call old method
+ // otherwise, call new #resetRendering method
+ // This is done to ensure that client's code will continue to be
+ // executed until
+ // they have migrated to the new #resetRendering API
+ Class<? extends AbstractBaseTableRendering> renderingClass = fRendering.getClass();
+ try {
+ Method method = renderingClass.getMethod("reset", new Class[] {}); //$NON-NLS-1$
+ if (method.getDeclaringClass().equals(AbstractTableRendering.class)) {
// client has not overrode, call new method
try {
fRendering.resetRendering();
@@ -77,11 +78,10 @@ public class ResetToBaseAddressAction extends Action {
MemoryViewUtil.openError(DebugUIMessages.AbstractTableRendering_12, DebugUIMessages.AbstractTableRendering_13, e); //
}
}
-
- if(fRendering instanceof AbstractTableRendering)
- {
+
+ if (fRendering instanceof AbstractTableRendering) {
// call old method
- ((AbstractTableRendering)fRendering).reset();
+ ((AbstractTableRendering) fRendering).reset();
}
- }
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
index 9e79fba74..522f27eab 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRendering.java
@@ -136,6 +136,7 @@ public class SignedIntegerRendering extends AbstractIntegerRendering {
/* (non-Javadoc)
* @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getString(java.lang.String, java.math.BigInteger, byte[])
*/
+ @Override
public String getString(String dataType, BigInteger address, MemoryByte[] data) {
boolean invalid = false;
@@ -189,6 +190,7 @@ public class SignedIntegerRendering extends AbstractIntegerRendering {
/* (non-Javadoc)
* @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getBytes(java.lang.String, java.math.BigInteger, java.lang.String)
*/
+ @Override
public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
int columnSize = getBytesPerColumn();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java
index 9651f7ed6..4d829d340 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/SignedIntegerRenderingTypeDelegate.java
@@ -24,6 +24,7 @@ public class SignedIntegerRenderingTypeDelegate implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
*/
+ @Override
public IMemoryRendering createRendering(String id) throws CoreException {
return new SignedIntegerRendering(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java
index 0cdaa4b38..0328cfe7e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingCellModifier.java
@@ -44,7 +44,8 @@ public class TableRenderingCellModifier implements ICellModifier {
* @see org.eclipse.jface.viewers.ICellModifier#canModify(java.lang.Object,
* java.lang.String)
*/
- public boolean canModify(Object element, String property) {
+ @Override
+ public boolean canModify(Object element, String property) {
boolean canModify = true;
try {
if (!(element instanceof TableRenderingLine))
@@ -104,7 +105,8 @@ public class TableRenderingCellModifier implements ICellModifier {
* @see org.eclipse.jface.viewers.ICellModifier#getValue(java.lang.Object,
* java.lang.String)
*/
- public Object getValue(Object element, String property) {
+ @Override
+ public Object getValue(Object element, String property) {
// give back the value of the column
if (!(element instanceof TableRenderingLine))
@@ -143,7 +145,8 @@ public class TableRenderingCellModifier implements ICellModifier {
* @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) {
+ @Override
+ public void modify(Object element, String property, Object value) {
TableRenderingLine line = null;
if (!(element instanceof TableRenderingLine)) {
line = (TableRenderingLine) ((TableItem) element).getData();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
index ae9c5bf33..62bd36369 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentInput.java
@@ -188,6 +188,7 @@ public class TableRenderingContentInput extends PlatformObject {
fNumLines = numLines;
}
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == AbstractTableRendering.class)
{
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
index 5a7402e27..51d14a938 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingContentProvider.java
@@ -45,12 +45,12 @@ import org.eclipse.jface.viewers.Viewer;
public class TableRenderingContentProvider extends BasicDebugViewContentProvider {
// lines currently being displayed by the table rendering
- protected Vector lineCache;
+ protected Vector<TableRenderingLine> lineCache;
// Cache to allow the content provider to comppute change information
// Cache is taken by copying the lineCache after a suspend event
// or change event from the the memory block.
- protected Hashtable contentCache;
+ protected Hashtable<String, TableRenderingLine> contentCache;
// cache in the form of MemoryByte
// needed for reorganizing cache when the row size changes
@@ -70,8 +70,8 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
*/
public TableRenderingContentProvider()
{
- lineCache = new Vector();
- contentCache = new Hashtable();
+ lineCache = new Vector<TableRenderingLine>();
+ contentCache = new Hashtable<String, TableRenderingLine>();
initializeDynamicLoad();
DebugPlugin.getDefault().addDebugEventListener(this);
@@ -88,6 +88,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
try {
if (newInput instanceof TableRenderingContentInput)
@@ -106,6 +107,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
}
}
+ @Override
public void dispose() {
DebugPlugin.getDefault().removeDebugEventListener(this);
super.dispose();
@@ -114,6 +116,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object parent) {
// if cache is empty, get memory
@@ -132,7 +135,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
return lineCache.toArray();
// check to see if the row size has changed
- TableRenderingLine line = (TableRenderingLine)lineCache.get(0);
+ TableRenderingLine line = lineCache.get(0);
int currentRowSize = line.getByteArray().length;
int renderingRowSize = getTableRendering(fInput).getBytesPerLine();
@@ -435,7 +438,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
// if debug adapter did not return enough memory, create dummy memory
if (memoryBuffer.length < reqNumBytes)
{
- ArrayList newBuffer = new ArrayList();
+ ArrayList<MemoryByte> newBuffer = new ArrayList<MemoryByte>();
for (int i=0; i<memoryBuffer.length; i++)
{
@@ -451,7 +454,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
newBuffer.add(mb);
}
- memoryBuffer = (MemoryByte[])newBuffer.toArray(new MemoryByte[newBuffer.size()]);
+ memoryBuffer = newBuffer.toArray(new MemoryByte[newBuffer.size()]);
}
@@ -537,7 +540,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
TableRenderingLine newLine = new TableRenderingLine(tmpAddress, memory, lineCache.size(), paddedString);
- TableRenderingLine oldLine = (TableRenderingLine)contentCache.get(newLine.getAddress());
+ TableRenderingLine oldLine = contentCache.get(newLine.getAddress());
if (manageDelta)
{
@@ -620,6 +623,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
/* (non-Javadoc)
* @see org.eclipse.debug.ui.internal.views.BasicDebugViewContentProvider#doHandleDebugEvent(org.eclipse.debug.core.DebugEvent)
*/
+ @Override
protected void doHandleDebugEvent(DebugEvent event) {
if (getTableRendering(fInput).isVisible())
@@ -695,7 +699,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
public void takeContentSnapshot()
{
// cache content before getting new ones
- TableRenderingLine[] lines =(TableRenderingLine[]) lineCache.toArray(new TableRenderingLine[lineCache.size()]);
+ TableRenderingLine[] lines =lineCache.toArray(new TableRenderingLine[lineCache.size()]);
fContentCacheInBytes = convertLinesToBytes(lines);
fContentCacheStartAddress = lines[0].getAddress();
@@ -784,11 +788,11 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
*/
public void resetDeltas()
{
- Enumeration enumeration = contentCache.elements();
+ Enumeration<TableRenderingLine> enumeration = contentCache.elements();
while (enumeration.hasMoreElements())
{
- TableRenderingLine line = (TableRenderingLine)enumeration.nextElement();
+ TableRenderingLine line = enumeration.nextElement();
line.unmarkDeltas();
}
}
@@ -802,8 +806,8 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
{
if (lineCache != null && !lineCache.isEmpty())
{
- TableRenderingLine first = (TableRenderingLine)lineCache.firstElement();
- TableRenderingLine last = (TableRenderingLine) lineCache.lastElement();
+ TableRenderingLine first = lineCache.firstElement();
+ TableRenderingLine last = lineCache.lastElement();
if (first == null ||last == null)
return true;
@@ -869,7 +873,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
fDynamicLoad = dynamicLoad;
}
- private void reorganizeLines(Vector lines, int numBytesPerLine) throws DebugException
+ private void reorganizeLines(Vector<TableRenderingLine> lines, int numBytesPerLine) throws DebugException
{
if (lines == null || lines.isEmpty())
return;
@@ -878,7 +882,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
if (objs.length > 0)
{
- TableRenderingLine[] renderingLines = (TableRenderingLine[])lines.toArray(new TableRenderingLine[lines.size()]);
+ TableRenderingLine[] renderingLines = lines.toArray(new TableRenderingLine[lines.size()]);
MemoryByte[] buffer = convertLinesToBytes(renderingLines);
BigInteger lineAddress = new BigInteger(renderingLines[0].getAddress(), 16);
int numberOfLines = buffer.length / numBytesPerLine;
@@ -948,7 +952,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
DebugUIPlugin.log(e);
addressLength = 4 * IInternalDebugUIConstants.CHAR_PER_BYTE;
}
- ArrayList lines = new ArrayList();
+ ArrayList<TableRenderingLine> lines = new ArrayList<TableRenderingLine>();
String paddedString = DebugUITools.getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
for (int i=0; i<numOfLines; i++)
@@ -975,7 +979,7 @@ public class TableRenderingContentProvider extends BasicDebugViewContentProvider
address = bigInt.add(BigInteger.valueOf(addressableUnit)).toString(16);
}
- return (TableRenderingLine[])lines.toArray(new TableRenderingLine[lines.size()]);
+ return lines.toArray(new TableRenderingLine[lines.size()]);
}
private AbstractTableRendering getTableRendering(TableRenderingContentInput input)
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
index 009de7707..5623ba8ef 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProvider.java
@@ -42,6 +42,7 @@ public class TableRenderingLabelProvider extends AbstractTableRenderingLabelProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
if (fTablePresentation != null) {
fTablePresentation.dispose();
@@ -53,6 +54,7 @@ public class TableRenderingLabelProvider extends AbstractTableRenderingLabelProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
*/
+ @Override
public Color getForeground(Object element) {
if (element instanceof TableRenderingLine)
{
@@ -69,6 +71,7 @@ public class TableRenderingLabelProvider extends AbstractTableRenderingLabelProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
*/
+ @Override
public Color getBackground(Object element) {
return null;
@@ -77,6 +80,7 @@ public class TableRenderingLabelProvider extends AbstractTableRenderingLabelProv
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
*/
+ @Override
public String getColumnText(Object element, int columnIndex) {
String label = super.getColumnText(element, columnIndex);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
index 5fe5fbdaa..40f059d7b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLabelProviderEx.java
@@ -49,6 +49,7 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i
*
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
public void dispose() {
if (fFontProvider != null) {
fFontProvider = null;
@@ -66,6 +67,7 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableColorProvider#getBackground(java.lang.Object, int)
*/
+ @Override
public Color getBackground(Object element, int columnIndex) {
if (fColorProvider != null && columnIndex > 0) {
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
@@ -81,6 +83,7 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableColorProvider#getForeground(java.lang.Object, int)
*/
+ @Override
public Color getForeground(Object element, int columnIndex) {
if (fColorProvider != null && columnIndex > 0) {
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
@@ -96,6 +99,7 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
*/
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
if (fLabelProvider != null && columnIndex > 0) {
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
@@ -111,6 +115,7 @@ public class TableRenderingLabelProviderEx extends TableRenderingLabelProvider i
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ITableFontProvider#getFont(java.lang.Object, int)
*/
+ @Override
public Font getFont(Object element, int columnIndex) {
if (fFontProvider != null && columnIndex > 0) {
MemoryRenderingElement renderingElement = getMemoryRenderingElement(element, columnIndex);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
index 0652248c7..a175e55b8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingLine.java
@@ -67,13 +67,13 @@ public class TableRenderingLine extends PlatformObject {
public MemoryByte[] getBytes(int start, int end)
{
- ArrayList ret = new ArrayList();
+ ArrayList<MemoryByte> ret = new ArrayList<MemoryByte>();
for (int i=start; i<end; i++)
{
ret.add(fBytes[i]);
}
- return (MemoryByte[]) ret.toArray(new MemoryByte[ret.size()]);
+ return ret.toArray(new MemoryByte[ret.size()]);
}
public String getRawMemoryString()
@@ -279,6 +279,7 @@ public class TableRenderingLine extends PlatformObject {
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
+ @Override
public String toString()
{
StringBuffer buf = new StringBuffer();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
index d7c5a4096..6cf038350 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingModel.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,451 +33,409 @@ import org.eclipse.debug.internal.ui.viewers.ModelNode;
import org.eclipse.debug.internal.ui.views.memory.MemoryViewUtil;
import org.eclipse.debug.ui.memory.IMemoryRendering;
+public class TableRenderingModel extends AbstractVirtualContentTableModel implements IContentChangeComputer {
-public class TableRenderingModel extends AbstractVirtualContentTableModel
- implements IContentChangeComputer {
+ private Hashtable<Object, Object> fCache;
+ private Vector<Object> fOrderedCache; // needed to re-organize cache
-
- private Hashtable fCache;
- private Vector fOrderedCache; // needed to re-organize cache
-
private boolean fMBSupportsChangeManagement;
private IMemoryBlock fMemoryBlock;
class SupportsChangeMgmtJob extends Job {
-
- SupportsChangeMgmtJob()
- {
+
+ SupportsChangeMgmtJob() {
super("Support Change Management"); //$NON-NLS-1$
setSystem(true);
}
+ @Override
protected IStatus run(IProgressMonitor monitor) {
IMemoryBlock mb = getMemoryBlock();
- if (mb instanceof IMemoryBlockExtension)
- {
- IMemoryBlockExtension mbExt = (IMemoryBlockExtension)mb;
+ if (mb instanceof IMemoryBlockExtension) {
+ IMemoryBlockExtension mbExt = (IMemoryBlockExtension) mb;
fMBSupportsChangeManagement = mbExt.supportsChangeManagement();
}
return Status.OK_STATUS;
}
-
+
}
-
-
+
public TableRenderingModel(AsynchronousTableViewer viewer) {
super(viewer);
- fCache = new Hashtable();
- fOrderedCache = new Vector();
+ fCache = new Hashtable<Object, Object>();
+ fOrderedCache = new Vector<Object>();
}
-
- public int indexOfKey(Object key)
- {
- if (key instanceof BigInteger)
- {
- BigInteger address = (BigInteger)key;
+
+ @Override
+ public int indexOfKey(Object key) {
+ if (key instanceof BigInteger) {
+ BigInteger address = (BigInteger) key;
Object items[] = getElements();
-
- for (int i=0; i<items.length; i++){
- if (items[i] != null && items[i] instanceof MemorySegment)
- {
- MemorySegment line = (MemorySegment)items[i];
- if (line.containsAddress(address))
+
+ for (int i = 0; i < items.length; i++) {
+ if (items[i] != null && items[i] instanceof MemorySegment) {
+ MemorySegment line = (MemorySegment) items[i];
+ if (line.containsAddress(address)) {
return i;
+ }
}
}
}
-
+
return -1;
}
-
- public int columnOf(Object element, Object key)
- {
- if (element instanceof MemorySegment && key instanceof BigInteger)
- {
- BigInteger address = (BigInteger)key;
- MemorySegment line = (MemorySegment)element;
- if (line.containsAddress(address))
- {
- if (getAddressableUnitsPerColumn() > 0)
- {
+
+ @Override
+ public int columnOf(Object element, Object key) {
+ if (element instanceof MemorySegment && key instanceof BigInteger) {
+ BigInteger address = (BigInteger) key;
+ MemorySegment line = (MemorySegment) element;
+ if (line.containsAddress(address)) {
+ if (getAddressableUnitsPerColumn() > 0) {
BigInteger offset = address.subtract(line.getAddress());
-
+
// locate column
int colAddressableUnit = getAddressableUnitsPerColumn();
- int col = ((offset.intValue()/colAddressableUnit)+1);
-
- if (col == 0)
+ int col = ((offset.intValue() / colAddressableUnit) + 1);
+
+ if (col == 0) {
col = 1;
-
+ }
+
return col;
}
}
}
-
+
return -1;
}
-
- public Object getKey(int idx)
- {
+
+ @Override
+ public Object getKey(int idx) {
Object elmt = getElement(idx);
- if (elmt instanceof MemorySegment)
- {
- return ((MemorySegment)elmt).getAddress();
+ if (elmt instanceof MemorySegment) {
+ return ((MemorySegment) elmt).getAddress();
}
-
+
return null;
}
+ @Override
public Object getKey(Object element) {
int idx = indexOfElement(element);
- if (idx >= 0)
- {
+ if (idx >= 0) {
return getKey(idx);
}
return null;
}
-
+
+ @Override
public Object getKey(int idx, int col) {
Object element = getElement(idx);
- if (element != null && element instanceof MemorySegment)
- {
- MemorySegment segment = (MemorySegment)element;
+ if (element != null && element instanceof MemorySegment) {
+ MemorySegment segment = (MemorySegment) element;
BigInteger rowAddress = segment.getAddress();
-
+
int offset;
- if (col > 0)
- {
- // get address offset
+ if (col > 0) {
+ // get address offset
int addressableUnit = getAddressableUnitsPerColumn();
- offset = (col-1) * addressableUnit;
- }
- else
- {
+ offset = (col - 1) * addressableUnit;
+ } else {
offset = 0;
}
return rowAddress.add(BigInteger.valueOf(offset));
}
return null;
}
-
- private int getAddressableUnitsPerColumn()
- {
+
+ private int getAddressableUnitsPerColumn() {
AsynchronousTableViewer viewer = getTableViewer();
- if (viewer.getPresentationContext() instanceof MemoryViewPresentationContext)
- {
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)viewer.getPresentationContext();
- if (getTableRendering(context)!= null)
- {
+ if (viewer.getPresentationContext() instanceof MemoryViewPresentationContext) {
+ MemoryViewPresentationContext context = (MemoryViewPresentationContext) viewer.getPresentationContext();
+ if (getTableRendering(context) != null) {
return getTableRendering(context).getAddressableUnitPerColumn();
}
}
return -1;
}
+ @Override
public void cache(Object[] elements) {
- for (int i=0; i<elements.length; i++)
- {
+ for (int i = 0; i < elements.length; i++) {
Object obj = elements[i];
- if (obj instanceof MemorySegment)
- {
- cache(((MemorySegment)obj).getAddress(), obj);
+ if (obj instanceof MemorySegment) {
+ cache(((MemorySegment) obj).getAddress(), obj);
}
}
-
+
}
-
- private void cache(Object key, Object element)
- {
+
+ private void cache(Object key, Object element) {
fCache.put(key, element);
fOrderedCache.add(element);
}
+ @Override
public Object[] compare(Object[] newElements) {
-
- if (fCache.isEmpty())
+
+ if (fCache.isEmpty()) {
return newElements;
-
- for (int j=0; j<newElements.length; j++)
- {
+ }
+
+ for (int j = 0; j < newElements.length; j++) {
Object obj = newElements[j];
- if (obj instanceof MemorySegment)
- {
- MemorySegment newSegment = (MemorySegment)obj;
- MemorySegment oldSegment = (MemorySegment)fCache.get(newSegment.getAddress());
-
- if (oldSegment != null)
- {
- if (oldSegment.getNumAddressableUnits() == newSegment.getNumAddressableUnits())
- {
+ if (obj instanceof MemorySegment) {
+ MemorySegment newSegment = (MemorySegment) obj;
+ MemorySegment oldSegment = (MemorySegment) fCache.get(newSegment.getAddress());
+
+ if (oldSegment != null) {
+ if (oldSegment.getNumAddressableUnits() == newSegment.getNumAddressableUnits()) {
MemoryByte[] newBytes = newSegment.getBytes();
MemoryByte[] oldBytes = oldSegment.getBytes();
-
- for (int i=0; i<newBytes.length; i++)
- {
+
+ for (int i = 0; i < newBytes.length; i++) {
newBytes[i].setHistoryKnown(true);
-
- if (newBytes[i].isReadable() != oldBytes[i].isReadable())
- {
+
+ if (newBytes[i].isReadable() != oldBytes[i].isReadable()) {
newBytes[i].setChanged(true);
continue;
- }
+ }
- if (newBytes[i].isReadable() && oldBytes[i].isReadable() &&
- (newBytes[i].getValue() != oldBytes[i].getValue()))
+ if (newBytes[i].isReadable() && oldBytes[i].isReadable() && (newBytes[i].getValue() != oldBytes[i].getValue())) {
newBytes[i].setChanged(true);
+ }
}
}
}
}
- }
+ }
return newElements;
}
-
- public void clearCache()
- {
+
+ @Override
+ public void clearCache() {
fCache.clear();
fOrderedCache.clear();
}
+ @Override
public boolean isEmpty() {
return fCache.isEmpty();
}
+ @Override
public void handleViewerChanged() {
// viewer has changed, content manager needs to re-organize the cache
rebuildCache();
rebuildContent();
}
-
- private void rebuildCache()
- {
- if (isEmpty())
+
+ private void rebuildCache() {
+ if (isEmpty()) {
return;
-
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)getTableViewer().getPresentationContext();
+ }
+
+ MemoryViewPresentationContext context = (MemoryViewPresentationContext) getTableViewer().getPresentationContext();
AbstractAsyncTableRendering rendering = getTableRendering(context);
-
- if (rendering == null)
+
+ if (rendering == null) {
return;
-
- ArrayList segments = new ArrayList();
- Enumeration enumeration = fOrderedCache.elements();
-
- BigInteger address = ((MemorySegment)fOrderedCache.get(0)).getAddress();
- while (enumeration.hasMoreElements())
- {
+ }
+
+ ArrayList<Object> segments = new ArrayList<Object>();
+ Enumeration<Object> enumeration = fOrderedCache.elements();
+
+ BigInteger address = ((MemorySegment) fOrderedCache.get(0)).getAddress();
+ while (enumeration.hasMoreElements()) {
Object element = enumeration.nextElement();
- if (element instanceof MemorySegment)
- {
-
+ if (element instanceof MemorySegment) {
+
segments.add(element);
}
}
-
- MemoryByte[] bytes = convertSegmentsToBytes((MemorySegment[])segments.toArray(new MemorySegment[0]));
-
+
+ MemoryByte[] bytes = convertSegmentsToBytes(segments.toArray(new MemorySegment[0]));
+
int bytesPerLine = rendering.getBytesPerLine();
int numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
-
+
int addressableSize = rendering.getAddressableSize();
-
+
clearCache();
-
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
+
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) rendering.getAdapter(TableRenderingContentDescriptor.class);
boolean alignAddress = true;
- if (descriptor != null && !descriptor.isAlignAddressToBoundary())
- {
+ if (descriptor != null && !descriptor.isAlignAddressToBoundary()) {
alignAddress = descriptor.isAlignAddressToBoundary();
}
-
+
MemorySegment[] newSegments = convertMemoryBytesToSegments(address, bytes, bytesPerLine, numAddressableUnitPerLine, addressableSize, alignAddress);
- for (int i=0; i<newSegments.length; i++)
- {
+ for (int i = 0; i < newSegments.length; i++) {
cache(newSegments[i].getAddress(), newSegments[i]);
}
}
-
- private void rebuildContent()
- {
- MemoryViewPresentationContext context = (MemoryViewPresentationContext)getTableViewer().getPresentationContext();
+
+ private void rebuildContent() {
+ MemoryViewPresentationContext context = (MemoryViewPresentationContext) getTableViewer().getPresentationContext();
AbstractAsyncTableRendering rendering = getTableRendering(context);
-
- if (rendering == null)
+
+ if (rendering == null) {
return;
-
- ArrayList segments = new ArrayList();
+ }
+
+ ArrayList<Object> segments = new ArrayList<Object>();
Object[] elements = getElements();
- for (int i=0; i<elements.length; i++)
- {
+ for (int i = 0; i < elements.length; i++) {
Object element = elements[i];
- if (element instanceof MemorySegment)
- {
+ if (element instanceof MemorySegment) {
segments.add(element);
}
}
-
- MemoryByte[] bytes = convertSegmentsToBytes((MemorySegment[])segments.toArray(new MemorySegment[segments.size()]));
-
+
+ MemoryByte[] bytes = convertSegmentsToBytes(segments.toArray(new MemorySegment[segments.size()]));
+
int bytesPerLine = rendering.getBytesPerLine();
int numAddressableUnitPerLine = rendering.getAddressableUnitPerLine();
- BigInteger address = (BigInteger)getKey(0);
+ BigInteger address = (BigInteger) getKey(0);
int addressableSize = rendering.getAddressableSize();
-
- TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor)rendering.getAdapter(TableRenderingContentDescriptor.class);
+
+ TableRenderingContentDescriptor descriptor = (TableRenderingContentDescriptor) rendering.getAdapter(TableRenderingContentDescriptor.class);
boolean alignAddress = true;
- if (descriptor != null && !descriptor.isAlignAddressToBoundary())
- {
+ if (descriptor != null && !descriptor.isAlignAddressToBoundary()) {
alignAddress = descriptor.isAlignAddressToBoundary();
}
-
+
MemorySegment[] newSegments = convertMemoryBytesToSegments(address, bytes, bytesPerLine, numAddressableUnitPerLine, addressableSize, alignAddress);
remove(getElements());
add(newSegments);
}
-
- private MemoryByte[] convertSegmentsToBytes(MemorySegment[] segments)
- {
- ArrayList toReturn = new ArrayList();
- for (int i=0; i<segments.length; i++)
- {
+ private MemoryByte[] convertSegmentsToBytes(MemorySegment[] segments) {
+ ArrayList<MemoryByte> toReturn = new ArrayList<MemoryByte>();
+ for (int i = 0; i < segments.length; i++) {
MemoryByte[] temp = segments[i].getBytes();
- for (int j=0; j<temp.length; j++)
- {
+ for (int j = 0; j < temp.length; j++) {
toReturn.add(temp[j]);
}
}
- return (MemoryByte[])toReturn.toArray(new MemoryByte[0]);
+ return toReturn.toArray(new MemoryByte[0]);
}
-
+
private MemorySegment[] convertMemoryBytesToSegments(BigInteger address, MemoryByte[] bytes, int bytesPerLine, int numAddressableUnitPerLine, int addressableSize, boolean alignAddress) {
-
+
Assert.isTrue(bytesPerLine > 0);
Assert.isTrue(numAddressableUnitPerLine > 0);
-
- ArrayList segments = new ArrayList();
+
+ ArrayList<MemorySegment> segments = new ArrayList<MemorySegment>();
MemoryByte[] temp = bytes;
-
- if (alignAddress)
- {
+
+ if (alignAddress) {
BigInteger alignedAddress = MemoryViewUtil.alignToBoundary(address, numAddressableUnitPerLine);
-
- // also check that the address is properly aligned and prepend bytes if need to
- if (!address.subtract(alignedAddress).equals(BigInteger.ZERO))
- {
+
+ // also check that the address is properly aligned and prepend bytes
+ // if need to
+ if (!address.subtract(alignedAddress).equals(BigInteger.ZERO)) {
BigInteger unitsToSetBack = address.subtract(alignedAddress);
BigInteger tempAddress = address.subtract(unitsToSetBack);
// only do this if the resulted address >= 0
// do not want to have negative addresses
- if (tempAddress.compareTo(BigInteger.ZERO) >= 0)
- {
+ if (tempAddress.compareTo(BigInteger.ZERO) >= 0) {
address = alignedAddress;
int numBytesNeeded = unitsToSetBack.intValue() * addressableSize;
temp = new MemoryByte[bytes.length + numBytesNeeded];
-
- for (int i=0; i<numBytesNeeded; i++)
- {
+
+ for (int i = 0; i < numBytesNeeded; i++) {
temp[i] = new MemoryByte();
temp[i].setReadable(false);
temp[i].setWritable(false);
- temp[i].setEndianessKnown(false);
- }
-
+ temp[i].setEndianessKnown(false);
+ }
+
System.arraycopy(bytes, 0, temp, numBytesNeeded, bytes.length);
bytes = temp;
}
}
}
-
- if (bytes.length % bytesPerLine != 0)
- {
+
+ if (bytes.length % bytesPerLine != 0) {
int numBytesNeeded = bytesPerLine - (bytes.length % bytesPerLine);
temp = new MemoryByte[bytes.length + numBytesNeeded];
System.arraycopy(bytes, 0, temp, 0, bytes.length);
-
- for (int i=bytes.length; i<temp.length; i++)
- {
+
+ for (int i = bytes.length; i < temp.length; i++) {
temp[i] = new MemoryByte();
temp[i].setReadable(false);
temp[i].setWritable(false);
- temp[i].setEndianessKnown(false);
- }
+ temp[i].setEndianessKnown(false);
+ }
bytes = temp;
}
-
+
int idx = 0;
- while (idx < bytes.length && (idx + bytesPerLine)<= bytes.length)
- {
+ while (idx < bytes.length && (idx + bytesPerLine) <= bytes.length) {
MemoryByte[] newBytes = new MemoryByte[bytesPerLine];
System.arraycopy(bytes, idx, newBytes, 0, bytesPerLine);
-
+
MemorySegment segment = new MemorySegment(address, newBytes, numAddressableUnitPerLine);
segments.add(segment);
-
+
address = address.add(BigInteger.valueOf(numAddressableUnitPerLine));
idx += bytesPerLine;
}
-
- return (MemorySegment[])segments.toArray(new MemorySegment[segments.size()]);
+
+ return segments.toArray(new MemorySegment[segments.size()]);
}
-
- private AsynchronousTableViewer getTableViewer()
- {
- return (AsynchronousTableViewer)getViewer();
+
+ private AsynchronousTableViewer getTableViewer() {
+ return (AsynchronousTableViewer) getViewer();
}
- protected void setChildren(ModelNode parentNode, List kids) {
-
- if (computeChanges())
- {
+ @Override
+ protected void setChildren(ModelNode parentNode, List<Object> kids) {
+
+ if (computeChanges()) {
Object[] newContent = compare(kids.toArray());
- ArrayList newList = new ArrayList();
- for (int i=0; i<newContent.length; i++)
- {
+ ArrayList<Object> newList = new ArrayList<Object>();
+ for (int i = 0; i < newContent.length; i++) {
newList.add(newContent[i]);
}
super.setChildren(parentNode, newList);
- }
- else
+ } else {
super.setChildren(parentNode, kids);
+ }
}
-
- private boolean computeChanges()
- {
- if (isEmpty())
+
+ private boolean computeChanges() {
+ if (isEmpty()) {
return false;
-
- if (fMBSupportsChangeManagement)
- {
+ }
+
+ if (fMBSupportsChangeManagement) {
return false;
}
-
+
return true;
}
-
- private IMemoryBlock getMemoryBlock()
- {
+
+ private IMemoryBlock getMemoryBlock() {
return fMemoryBlock;
}
-
+ @Override
public void init(Object root) {
- if (root instanceof IMemoryBlock)
- {
- fMemoryBlock = (IMemoryBlock)root;
+ if (root instanceof IMemoryBlock) {
+ fMemoryBlock = (IMemoryBlock) root;
new SupportsChangeMgmtJob().schedule();
}
super.init(root);
}
-
- private AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context)
- {
+
+ private AbstractAsyncTableRendering getTableRendering(MemoryViewPresentationContext context) {
IMemoryRendering memRendering = context.getRendering();
- if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering)
- {
- return (AbstractAsyncTableRendering)memRendering;
+ if (memRendering != null && memRendering instanceof AbstractAsyncTableRendering) {
+ return (AbstractAsyncTableRendering) memRendering;
}
return null;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
index 43a2840bf..d6dc2c652 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPrefAction.java
@@ -30,6 +30,7 @@ public class TableRenderingPrefAction extends ActionDelegate implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IPreferencePage page = new TableRenderingPreferencePage(DebugUIMessages.TableRenderingPrefAction_0);
showPreferencePage("org.eclipse.debug.ui.tableRenderingPreferencepage", page); //$NON-NLS-1$
@@ -38,6 +39,7 @@ public class TableRenderingPrefAction extends ActionDelegate implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
}
@@ -49,6 +51,7 @@ public class TableRenderingPrefAction extends ActionDelegate implements IViewAct
final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager);
final boolean [] result = new boolean[] { false };
BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
public void run() {
dialog.create();
dialog.setMessage(targetNode.getLabelText());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java
index e32593f33..3ac5222c3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPreferencePage.java
@@ -49,6 +49,7 @@ public class TableRenderingPreferencePage extends PreferencePage implements
super(title);
}
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".table_renderings_preference_page_context"); //$NON-NLS-1$
@@ -109,6 +110,7 @@ public class TableRenderingPreferencePage extends PreferencePage implements
fManual.setSelection(!isAuto);
}
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(FieldEditor.VALUE))
{
@@ -161,10 +163,12 @@ public class TableRenderingPreferencePage extends PreferencePage implements
}
}
+ @Override
protected IPreferenceStore doGetPreferenceStore() {
return DebugUIPlugin.getDefault().getPreferenceStore();
}
+ @Override
public void dispose() {
fAuto.removeSelectionListener(this);
fManual.removeSelectionListener(this);
@@ -174,14 +178,17 @@ public class TableRenderingPreferencePage extends PreferencePage implements
super.dispose();
}
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
// do nothing
}
+ @Override
public void widgetSelected(SelectionEvent e) {
updateTextEditorsEnablement();
}
+ @Override
public boolean performOk() {
boolean auto = fAuto.getSelection();
boolean currentValue = getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
@@ -194,6 +201,7 @@ public class TableRenderingPreferencePage extends PreferencePage implements
return super.performOk();
}
+ @Override
protected void performDefaults() {
boolean auto = getPreferenceStore().getDefaultBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
index 0f17551fe..7e9408004 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/TableRenderingPropertiesPage.java
@@ -31,6 +31,7 @@ public class TableRenderingPropertiesPage extends PropertyPage implements
super();
}
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugUIConstants.PLUGIN_ID + ".TableRenderingPropertiesPage_context"); //$NON-NLS-1$
noDefaultAndApplyButton();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
index 2d126c515..25dde336f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRendering.java
@@ -122,6 +122,7 @@ public class UnsignedIntegerRendering extends AbstractIntegerRendering {
/* (non-Javadoc)
* @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getString(java.lang.String, java.math.BigInteger, byte[])
*/
+ @Override
public String getString(String dataType, BigInteger address, MemoryByte[] data) {
String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
@@ -173,6 +174,7 @@ public class UnsignedIntegerRendering extends AbstractIntegerRendering {
/* (non-Javadoc)
* @see com.ibm.debug.extended.ui.AbstractMemoryRenderer#getBytes(java.lang.String, java.math.BigInteger, java.lang.String)
*/
+ @Override
public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
int columnSize = getBytesPerColumn();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java
index fccbe93a5..805a8f983 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/memory/renderings/UnsignedIntegerRenderingTypeDelegate.java
@@ -24,6 +24,7 @@ public class UnsignedIntegerRenderingTypeDelegate implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingTypeDelegate#createRendering(java.lang.String)
*/
+ @Override
public IMemoryRendering createRendering(String id) throws CoreException {
return new UnsignedIntegerRendering(id);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
index 55047f0e7..ae7f4c411 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/modules/ModulesView.java
@@ -40,6 +40,7 @@ public class ModulesView extends VariablesView {
/**
* @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.MODULES_VIEW;
}
@@ -47,6 +48,7 @@ public class ModulesView extends VariablesView {
/**
* @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
tbm.add(new Separator(this.getClass().getName()));
tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
@@ -57,7 +59,8 @@ public class ModulesView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#fillContextMenu(org.eclipse.jface.action.IMenuManager)
*/
- protected void fillContextMenu( IMenuManager menu ) {
+ @Override
+ protected void fillContextMenu( IMenuManager menu ) {
menu.add( new Separator( IDebugUIConstants.EMPTY_MODULES_GROUP ) );
menu.add( new Separator( IDebugUIConstants.MODULES_GROUP ) );
menu.add(getAction(FIND_ACTION));
@@ -74,6 +77,7 @@ public class ModulesView extends VariablesView {
/**
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
*/
+ @Override
protected String getDetailPanePreferenceKey() {
return IDebugPreferenceConstants.MODULES_DETAIL_PANE_ORIENTATION;
}
@@ -81,6 +85,7 @@ public class ModulesView extends VariablesView {
/**
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
*/
+ @Override
protected String getToggleActionLabel() {
if (getViewer() != null)
@@ -103,10 +108,12 @@ public class ModulesView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
*/
+ @Override
protected String getPresentationContextId() {
return IDebugUIConstants.ID_MODULE_VIEW;
}
+ @Override
protected void setViewerInput(Object context) {
super.setViewerInput(context);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java
index d0fa27aff..d509d4f4f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/registers/RegistersView.java
@@ -25,6 +25,7 @@ public class RegistersView extends VariablesView {
/**
* @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.REGISTERS_VIEW;
}
@@ -32,6 +33,7 @@ public class RegistersView extends VariablesView {
/**
* @see org.eclipse.debug.ui.AbstractDebugView#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
super.configureToolBar(tbm);
tbm.add(new Separator(IDebugUIConstants.EMPTY_REGISTER_GROUP));
@@ -41,6 +43,7 @@ public class RegistersView extends VariablesView {
/**
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getDetailPanePreferenceKey()
*/
+ @Override
protected String getDetailPanePreferenceKey() {
return IDebugPreferenceConstants.REGISTERS_DETAIL_PANE_ORIENTATION;
}
@@ -48,6 +51,7 @@ public class RegistersView extends VariablesView {
/**
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getToggleActionLabel()
*/
+ @Override
protected String getToggleActionLabel() {
return RegistersViewMessages.RegistersView_0;
}
@@ -55,6 +59,7 @@ public class RegistersView extends VariablesView {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.VariablesView#getPresentationContextId()
*/
+ @Override
protected String getPresentationContextId() {
return IDebugUIConstants.ID_REGISTER_VIEW;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
index 62644e211..e21d3784b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/AvailableLogicalStructuresAction.java
@@ -50,6 +50,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
}
@@ -64,6 +65,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
if (fMenu != null) {
fMenu.dispose();
@@ -76,6 +78,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
*/
+ @Override
public Menu getMenu(Control parent) {
return null;
}
@@ -88,6 +91,7 @@ public class AvailableLogicalStructuresAction extends Action implements IMenuCre
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
if (fMenu != null) {
fMenu.dispose();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
index 68b16ba0d..33a0952fb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedValuePartition.java
@@ -47,6 +47,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getSize()
*/
+ @Override
public int getSize() {
return fLength;
}
@@ -54,6 +55,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getVariable(int)
*/
+ @Override
public IVariable getVariable(int offset) throws DebugException {
return fValue.getVariable(offset);
}
@@ -61,6 +63,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
return fValue.getReferenceTypeName();
}
@@ -68,6 +71,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getValueString()
*/
+ @Override
public String getValueString() {
return IInternalDebugCoreConstants.EMPTY_STRING;
}
@@ -75,6 +79,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#getVariables()
*/
+ @Override
public IVariable[] getVariables() throws DebugException {
return getVariables(fOffset, fLength);
}
@@ -82,6 +87,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#hasVariables()
*/
+ @Override
public boolean hasVariables() {
return fLength > 0;
}
@@ -89,6 +95,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValue#isAllocated()
*/
+ @Override
public boolean isAllocated() throws DebugException {
return fValue.isAllocated();
}
@@ -96,6 +103,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
+ @Override
public IDebugTarget getDebugTarget() {
return fValue.getDebugTarget();
}
@@ -103,6 +111,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
return fValue.getLaunch();
}
@@ -110,6 +119,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
+ @Override
public String getModelIdentifier() {
return fValue.getModelIdentifier();
}
@@ -117,6 +127,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
return fValue.getAdapter(adapter);
}
@@ -124,6 +135,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getVariables(int, int)
*/
+ @Override
public IVariable[] getVariables(int offset, int length) throws DebugException {
return fValue.getVariables(offset, length);
}
@@ -131,6 +143,7 @@ public class IndexedValuePartition implements IIndexedValue {
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IIndexedValue#getInitialOffset()
*/
+ @Override
public int getInitialOffset() {
return fOffset;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java
index 144f96b7e..4327e4aaf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/IndexedVariablePartition.java
@@ -65,6 +65,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getValue()
*/
+ @Override
public IValue getValue() {
return fValuePartition;
}
@@ -72,6 +73,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getName()
*/
+ @Override
public String getName() {
if (fName == null) {
StringBuffer buf = new StringBuffer();
@@ -88,6 +90,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#getReferenceTypeName()
*/
+ @Override
public String getReferenceTypeName() throws DebugException {
if (fOriginalVariable instanceof IVariable) {
IVariable variable = (IVariable) fOriginalVariable;
@@ -99,6 +102,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IVariable#hasValueChanged()
*/
+ @Override
public boolean hasValueChanged() {
return false;
}
@@ -106,6 +110,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getModelIdentifier()
*/
+ @Override
public String getModelIdentifier() {
return fOriginalValue.getModelIdentifier();
}
@@ -113,6 +118,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getDebugTarget()
*/
+ @Override
public IDebugTarget getDebugTarget() {
return fOriginalValue.getDebugTarget();
}
@@ -120,6 +126,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IDebugElement#getLaunch()
*/
+ @Override
public ILaunch getLaunch() {
return fOriginalValue.getLaunch();
}
@@ -127,6 +134,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#setValue(java.lang.String)
*/
+ @Override
public void setValue(String expression) throws DebugException {
throw new DebugException(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "Value modification not supported for indexed partitions.", null)); //$NON-NLS-1$
}
@@ -134,6 +142,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#setValue(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public void setValue(IValue value) throws DebugException {
throw new DebugException(new Status(IStatus.ERROR, IDebugUIConstants.PLUGIN_ID, IDebugUIConstants.INTERNAL_ERROR, "Value modification not supported for indexed partitions.", null)); //$NON-NLS-1$
}
@@ -141,6 +150,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#supportsValueModification()
*/
+ @Override
public boolean supportsValueModification() {
return false;
}
@@ -148,6 +158,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(java.lang.String)
*/
+ @Override
public boolean verifyValue(String expression) {
return false;
}
@@ -155,6 +166,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IValueModification#verifyValue(org.eclipse.debug.core.model.IValue)
*/
+ @Override
public boolean verifyValue(IValue value) {
return false;
}
@@ -162,6 +174,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj instanceof IndexedVariablePartition) {
IndexedVariablePartition partition = (IndexedVariablePartition)obj;
@@ -174,6 +187,7 @@ public class IndexedVariablePartition extends PlatformObject implements IVariabl
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fOriginalVariable.hashCode() + fOffset;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java
index dd72ccc30..5765ece18 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/LogicalStructureCache.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,7 +35,7 @@ public class LogicalStructureCache {
/**
* Maps a ILogicalStructureType to the cache for that type
*/
- private Map fCacheForType = new HashMap();
+ private Map<ILogicalStructureType, LogicalStructureTypeCache> fCacheForType = new HashMap<ILogicalStructureType, LogicalStructureTypeCache>();
/**
* Returns the logical value to replace the given value using the specified logical structure.
@@ -69,7 +69,7 @@ public class LogicalStructureCache {
* @return the cache associated with the logical structure type
*/
protected LogicalStructureTypeCache getCacheForType(ILogicalStructureType type){
- LogicalStructureTypeCache cache = (LogicalStructureTypeCache)fCacheForType.get(type);
+ LogicalStructureTypeCache cache = fCacheForType.get(type);
if (cache == null){
cache = new LogicalStructureTypeCache(type);
fCacheForType.put(type, cache);
@@ -88,12 +88,12 @@ public class LogicalStructureCache {
/**
* Maps a raw IValue to its calculated logical IValue
*/
- private Map fKnownValues = new HashMap();
+ private Map<IValue, IValue> fKnownValues = new HashMap<IValue, IValue>();
/**
* Set of raw IValues that logical values are currently being evaluated for.
*/
- private Set fPendingValues = new HashSet();
+ private Set<IValue> fPendingValues = new HashSet<IValue>();
public LogicalStructureTypeCache(ILogicalStructureType type){
fType = type;
@@ -110,7 +110,7 @@ public class LogicalStructureCache {
public IValue getLogicalStructure(IValue value) throws CoreException {
// Check if the value has already been evaluated
synchronized (fKnownValues) {
- IValue logical = (IValue)fKnownValues.get(value);
+ IValue logical = fKnownValues.get(value);
if (logical != null){
return logical;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
index 80bc7b284..4ef148cf0 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectLogicalStructureAction.java
@@ -45,6 +45,7 @@ public class SelectLogicalStructureAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
valueChanged();
}
@@ -54,6 +55,7 @@ public class SelectLogicalStructureAction extends Action {
return;
}
BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() {
+ @Override
public void run() {
// Checking this action sets the type to fType, unchecking it sets the type
// to null ("none selected")
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java
index f565712a9..5ccaf11cb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/SelectionDragAdapter.java
@@ -46,14 +46,16 @@ public class SelectionDragAdapter extends DragSourceAdapter implements TransferD
/* (non-Javadoc)
* @see org.eclipse.jface.util.TransferDragSourceListener#getTransfer()
*/
- public Transfer getTransfer() {
+ @Override
+ public Transfer getTransfer() {
return LocalSelectionTransfer.getTransfer();
}
/* (non-Javadoc)
* @see org.eclipse.swt.dnd.DragSourceAdapter#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
*/
- public void dragStart(DragSourceEvent event) {
+ @Override
+ public void dragStart(DragSourceEvent event) {
ISelection selection = fViewer.getSelection();
LocalSelectionTransfer.getTransfer().setSelection(selection);
LocalSelectionTransfer.getTransfer().setSelectionSetTime(event.time & 0xFFFFFFFFL);
@@ -63,7 +65,8 @@ public class SelectionDragAdapter extends DragSourceAdapter implements TransferD
/* (non-Javadoc)
* @see org.eclipse.swt.dnd.DragSourceAdapter#dragSetData(org.eclipse.swt.dnd.DragSourceEvent)
*/
- public void dragSetData(DragSourceEvent event) {
+ @Override
+ public void dragSetData(DragSourceEvent event) {
// For consistency set the data to the selection even though
// the selection is provided by the LocalSelectionTransfer
// to the drop target adapter.
@@ -73,7 +76,8 @@ public class SelectionDragAdapter extends DragSourceAdapter implements TransferD
/* (non-Javadoc)
* @see org.eclipse.swt.dnd.DragSourceAdapter#dragFinished(org.eclipse.swt.dnd.DragSourceEvent)
*/
- public void dragFinished(DragSourceEvent event) {
+ @Override
+ public void dragFinished(DragSourceEvent event) {
LocalSelectionTransfer.getTransfer().setSelection(null);
LocalSelectionTransfer.getTransfer().setSelectionSetTime(0);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
index dca133d1f..a554d56cd 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleLogicalStructureAction.java
@@ -43,12 +43,14 @@ public class ToggleLogicalStructureAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
if (!getView().isAvailable()) {
return;
}
getView().setShowLogicalStructure(isChecked());
BusyIndicator.showWhile(getView().getViewer().getControl().getDisplay(), new Runnable() {
+ @Override
public void run() {
getView().getViewer().refresh();
}
@@ -58,6 +60,7 @@ public class ToggleLogicalStructureAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#setChecked(boolean)
*/
+ @Override
public void setChecked(boolean value) {
super.setChecked(value);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
index 7dee94008..a1e7b2c38 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/ToggleShowColumnsAction.java
@@ -43,11 +43,13 @@ public class ToggleShowColumnsAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
+ @Override
public void run() {
if (fViewer.getControl().isDisposed()) {
return;
}
BusyIndicator.showWhile(fViewer.getControl().getDisplay(), new Runnable() {
+ @Override
public void run() {
fViewer.setShowColumns(isChecked());
}
@@ -57,6 +59,7 @@ public class ToggleShowColumnsAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
setEnabled(fViewer.canToggleColumns());
setChecked(fViewer.isShowColumns());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
index fee97c166..93ec5fd68 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariableViewToggleAction.java
@@ -38,6 +38,7 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
fView = view;
boolean checked = getPreferenceValue(view);
@@ -48,6 +49,7 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
fAction = action;
}
@@ -55,12 +57,14 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
@@ -68,6 +72,7 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
IPreferenceStore store = getPreferenceStore();
String key = getView().getSite().getId() + "." + getPreferenceKey(); //$NON-NLS-1$
@@ -77,6 +82,7 @@ public abstract class VariableViewToggleAction implements IViewActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index a1712a85e..90d76f8ee 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -25,8 +25,8 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -153,6 +153,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
private static class SelectionProviderWrapper implements ISelectionProvider {
private final ListenerList fListenerList = new ListenerList(ListenerList.IDENTITY);
private final ISelectionChangedListener fListener = new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
fireSelectionChanged(event);
}
@@ -193,6 +194,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/*
* @see org.eclipse.jface.viewers.ISelectionProvider#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
*/
+ @Override
public void addSelectionChangedListener(ISelectionChangedListener listener) {
fListenerList.add(listener);
}
@@ -200,6 +202,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/*
* @see org.eclipse.jface.viewers.ISelectionProvider#getSelection()
*/
+ @Override
public ISelection getSelection() {
if (fActiveProvider != null) {
return fActiveProvider.getSelection();
@@ -210,6 +213,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/*
* @see org.eclipse.jface.viewers.ISelectionProvider#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
*/
+ @Override
public void removeSelectionChangedListener(ISelectionChangedListener listener) {
fListenerList.remove(listener);
}
@@ -217,6 +221,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/*
* @see org.eclipse.jface.viewers.ISelectionProvider#setSelection(org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void setSelection(ISelection selection) {
if (fActiveProvider != null) {
fActiveProvider.setSelection(selection);
@@ -292,13 +297,14 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*/
private ViewerInputService fInputService;
- private Map fGlobalActionMap = new HashMap();
+ private Map<String, IAction> fGlobalActionMap = new HashMap<String, IAction>();
/**
* Viewer input requester used to update the viewer once the viewer input has been
* resolved.
*/
private IViewerInputRequestor fRequester = new IViewerInputRequestor() {
+ @Override
public void viewerInputComplete(IViewerInputUpdate update) {
if (!update.isCanceled()) {
viewerInputUpdateComplete(update);
@@ -323,7 +329,6 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/**
* Presentation context property.
- * TODO: make API
* @since 3.3
*/
public static final String PRESENTATION_SHOW_LOGICAL_STRUCTURES = "PRESENTATION_SHOW_LOGICAL_STRUCTURES"; //$NON-NLS-1$
@@ -357,6 +362,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelDeltaVisitor#visit(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta, int)
*/
+ @Override
public boolean visit(IModelDelta delta, int depth) {
if ((delta.getFlags() & IModelDelta.CONTENT) > 0) {
fTriggerDetails = true;
@@ -384,6 +390,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*/
private Job fTriggerDetailsJob = new UIJob("trigger details") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return Status.CANCEL_STATUS;
@@ -409,6 +416,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*
* @see IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
DebugUITools.removePartDebugContextListener(getSite(), this);
@@ -424,7 +432,9 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
fPresentationContext.dispose();
fPresentationContext = null;
}
- if (fDetailPane != null) fDetailPane.dispose();
+ if (fDetailPane != null) {
+ fDetailPane.dispose();
+ }
fInputService.dispose();
fSelectionProvider.dispose();
super.dispose();
@@ -470,6 +480,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/**
* @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String propertyName= event.getProperty();
if (propertyName.equals(IDebugUIConstants.PREF_CHANGED_DEBUG_ELEMENT_COLOR) ||
@@ -482,6 +493,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createViewer(Composite)
*/
+ @Override
public Viewer createViewer(Composite parent) {
addResizeListener(parent);
fParent = parent;
@@ -513,6 +525,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
fDetailPane = new DetailPaneProxy(this);
fDetailPane.addProperyListener(new IPropertyListener() {
+ @Override
public void propertyChanged(Object source, int propId) {
firePropertyChange(propId);
}
@@ -546,6 +559,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
*/
+ @Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
PREF_STATE_MEMENTO = PREF_STATE_MEMENTO + site.getId();
@@ -601,7 +615,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#partDeactivated(org.eclipse.ui.IWorkbenchPart)
*/
- public void partDeactivated(IWorkbenchPart part) {
+ @Override
+ public void partDeactivated(IWorkbenchPart part) {
String id = part.getSite().getId();
if (id.equals(getSite().getId())) {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
@@ -659,12 +674,14 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
final TreeModelViewer variablesViewer = new TreeModelViewer(parent, style, fPresentationContext);
variablesViewer.getControl().addFocusListener(new FocusAdapter() {
+ @Override
public void focusGained(FocusEvent e) {
fTreeHasFocus = true;
fSelectionProvider.setActiveProvider(variablesViewer);
setGlobalActions();
}
+ @Override
public void focusLost(FocusEvent e){
// Do not reset the selection provider with the provider proxy.
// This should allow toolbar actions to remain active when the view
@@ -676,6 +693,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
});
variablesViewer.getPresentationContext().addPropertyChangeListener(
new IPropertyChangeListener() {
+ @Override
public void propertyChange(PropertyChangeEvent event) {
if (IPresentationContext.PROPERTY_COLUMNS.equals(event.getProperty())) {
IAction action = getAction("ShowTypeNames"); //$NON-NLS-1$
@@ -693,12 +711,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
}
private void setGlobalActions() {
- for (Iterator entryItr = fGlobalActionMap.entrySet().iterator(); entryItr.hasNext();) {
- Map.Entry entry = (Map.Entry)entryItr.next();
- String actionID = (String)entry.getKey();
+ for (Entry<String, IAction> entry : fGlobalActionMap.entrySet()) {
+ String actionID = entry.getKey();
IAction action = getOverrideAction(actionID);
if (action == null) {
- action = (IAction)entry.getValue();
+ action = entry.getValue();
}
setAction(actionID, action);
}
@@ -706,9 +723,10 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
}
/**
- * Save the global actions from action bar so they are not overriden by
- * the detail pane.
+ * Save the global actions from action bar so they are not overridden by the
+ * detail pane.
*/
+ @Override
protected void createContextMenu(Control menuControl) {
super.createContextMenu(menuControl);
IActionBars actionBars = getViewSite().getActionBars();
@@ -724,8 +742,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
}
private void clearGlobalActions() {
- for (Iterator keyItr = fGlobalActionMap.keySet().iterator(); keyItr.hasNext();) {
- String id = (String)keyItr.next();
+ for (String id : fGlobalActionMap.keySet()) {
setAction(id, null);
}
getViewSite().getActionBars().updateActionBars();
@@ -775,14 +792,17 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.VARIABLE_VIEW;
}
private void addResizeListener(Composite parent) {
parent.addControlListener(new ControlListener() {
+ @Override
public void controlMoved(ControlEvent e) {
}
+ @Override
public void controlResized(ControlEvent e) {
if (IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_AUTO.equals(fCurrentDetailPaneOrientation)) {
setDetailPaneOrientation(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_AUTO);
@@ -799,10 +819,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
int computeOrientation() {
Point size= fParent.getSize();
if (size.x != 0 && size.y != 0) {
- if ((size.x / 3)> size.y)
+ if ((size.x / 3)> size.y) {
return SWT.HORIZONTAL;
- else
+ } else {
return SWT.VERTICAL;
+ }
}
return SWT.HORIZONTAL;
}
@@ -941,6 +962,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#createActions()
*/
+ @Override
protected void createActions() {
IAction action = new ShowTypesAction(this);
setAction("ShowTypeNames",action); //$NON-NLS-1$
@@ -978,6 +1000,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
fGlobalActionMap.put(actionID, action);
}
+ @Override
public IAction getAction(String actionID) {
// Check if model overrides the action. Global action overrides are
// checked in setGlobalActions() so skip them here.
@@ -1005,6 +1028,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
return null;
}
+ @Override
public void updateObjects() {
super.updateObjects();
if (fTreeHasFocus) {
@@ -1041,6 +1065,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
setAction("ToggleColmns", new ToggleShowColumnsAction(viewer)); //$NON-NLS-1$
layoutSubMenu.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
layoutSubMenu.add(fToggleDetailPaneActions[0]);
layoutSubMenu.add(fToggleDetailPaneActions[1]);
@@ -1074,6 +1099,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*
* @param tbm The toolbar that will be configured
*/
+ @Override
protected void configureToolBar(IToolBarManager tbm) {
tbm.add(new Separator(this.getClass().getName()));
tbm.add(new Separator(IDebugUIConstants.RENDER_GROUP));
@@ -1088,6 +1114,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*
* @param menu The menu to add the item to.
*/
+ @Override
protected void fillContextMenu(IMenuManager menu) {
menu.add(new Separator(IDebugUIConstants.EMPTY_VARIABLE_GROUP));
menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP));
@@ -1119,7 +1146,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
protected ISelectionChangedListener getTreeSelectionChangedListener() {
if (fTreeSelectionChangedListener == null) {
fTreeSelectionChangedListener = new ISelectionChangedListener() {
- public void selectionChanged(final SelectionChangedEvent event) {
+ @Override
+ public void selectionChanged(final SelectionChangedEvent event) {
if (event.getSelectionProvider().equals(getViewer())) {
clearStatusLine();
// if the detail pane is not visible, don't waste time retrieving details
@@ -1145,6 +1173,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentPaneID()
*/
+ @Override
public String getCurrentPaneID() {
return fDetailPane.getCurrentPaneID();
}
@@ -1152,6 +1181,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentSelection()
*/
+ @Override
public IStructuredSelection getCurrentSelection() {
if (getViewer() != null){
return (IStructuredSelection)getViewer().getSelection();
@@ -1162,6 +1192,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getParentComposite()
*/
+ @Override
public Composite getParentComposite() {
return fDetailsComposite;
}
@@ -1169,6 +1200,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getWorkbenchPartSite()
*/
+ @Override
public IWorkbenchPartSite getWorkbenchPartSite() {
return getSite();
}
@@ -1176,6 +1208,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
*/
+ @Override
public void refreshDetailPaneContents() {
if (isDetailPaneVisible()) {
String currentPaneID = getCurrentPaneID();
@@ -1201,9 +1234,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#paneChanged(java.lang.String)
*/
+ @Override
public void paneChanged(String newPaneID) {
if (fDetailPaneActivatedListener == null){
fDetailPaneActivatedListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
fTreeHasFocus = false;
}
@@ -1225,13 +1260,16 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#getAdapter(Class)
*/
+ @Override
public Object getAdapter(Class required) {
if (IDebugModelPresentation.class.equals(required)) {
return getModelPresentation();
}
else if (fDetailPane != null){
Object adapter = fDetailPane.getAdapter(required);
- if (adapter != null) return adapter;
+ if (adapter != null) {
+ return adapter;
+ }
}
return super.getAdapter(required);
}
@@ -1244,7 +1282,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
protected void updateAction(String actionId) {
IAction action= getAction(actionId);
if (action == null) {
- action = (IAction)fGlobalActionMap.get(actionId);
+ action = fGlobalActionMap.get(actionId);
}
if (action instanceof IUpdate) {
((IUpdate) action).update();
@@ -1261,6 +1299,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#getDefaultControl()
*/
+ @Override
protected Control getDefaultControl() {
return fSashForm;
}
@@ -1268,6 +1307,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.IDebugExceptionHandler#handleException(org.eclipse.debug.core.DebugException)
*/
+ @Override
public void handleException(DebugException e) {
showMessage(e.getMessage());
}
@@ -1275,6 +1315,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextListener#contextEvent(org.eclipse.debug.internal.ui.contexts.provisional.DebugContextEvent)
*/
+ @Override
public void debugContextChanged(DebugContextEvent event) {
if ((event.getFlags() & DebugContextEvent.ACTIVATED) > 0) {
contextActivated(event.getContext());
@@ -1301,6 +1342,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
*
* @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(DoubleClickEvent)
*/
+ @Override
public void doubleClick(DoubleClickEvent event) {
IAction action = getAction(DOUBLE_CLICK_ACTION);
if (action != null && action.isEnabled()) {
@@ -1329,6 +1371,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDebugView#getPresentation(String)
*/
+ @Override
public IDebugModelPresentation getPresentation(String id) {
if (getViewer() instanceof StructuredViewer) {
IDebugModelPresentation lp = getModelPresentation();
@@ -1378,6 +1421,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#becomesHidden()
*/
+ @Override
protected void becomesHidden() {
fInputService.resolveViewerInput(ViewerInputService.NULL_INPUT);
super.becomesHidden();
@@ -1386,6 +1430,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractDebugView#becomesVisible()
*/
+ @Override
protected void becomesVisible() {
super.becomesVisible();
ISelection selection = getDebugContext();
@@ -1411,11 +1456,13 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener#perspectiveActivated(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor)
*/
+ @Override
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {}
/* (non-Javadoc)
* @see org.eclipse.ui.IPerspectiveListener#perspectiveChanged(org.eclipse.ui.IWorkbenchPage, org.eclipse.ui.IPerspectiveDescriptor, java.lang.String)
*/
+ @Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {
if(changeId.equals(IWorkbenchPage.CHANGE_RESET)) {
setLastSashWeights(DEFAULT_SASH_WEIGHTS);
@@ -1427,6 +1474,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.provisional.IModelChangedListener#modelChanged(org.eclipse.debug.internal.ui.viewers.provisional.IModelDelta)
*/
+ @Override
public void modelChanged(IModelDelta delta, IModelProxy proxy) {
fVisitor.reset();
delta.accept(fVisitor);
@@ -1438,6 +1486,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateComplete(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
*/
+ @Override
public void updateComplete(IViewerUpdate update) {
IStatus status = update.getStatus();
if (!update.isCanceled()) {
@@ -1456,12 +1505,14 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#updateStarted(org.eclipse.debug.internal.ui.viewers.provisional.IAsynchronousRequestMonitor)
*/
+ @Override
public void updateStarted(IViewerUpdate update) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesBegin()
*/
+ @Override
public synchronized void viewerUpdatesBegin() {
fTriggerDetailsJob.cancel();
IWorkbenchSiteProgressService progressService =
@@ -1474,6 +1525,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.viewers.IViewerUpdateListener#viewerUpdatesComplete()
*/
+ @Override
public synchronized void viewerUpdatesComplete() {
if (fVisitor.isTriggerDetails()) {
fTriggerDetailsJob.schedule();
@@ -1488,6 +1540,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/**
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
boolean success = false;
if (!fTreeHasFocus && fDetailPane != null){
@@ -1501,9 +1554,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
protected ToggleDetailPaneAction getToggleDetailPaneAction(String orientation)
{
- for (int i=0; i<fToggleDetailPaneActions.length; i++)
- if (fToggleDetailPaneActions[i].getOrientation().equals(orientation))
+ for (int i=0; i<fToggleDetailPaneActions.length; i++) {
+ if (fToggleDetailPaneActions[i].getOrientation().equals(orientation)) {
return fToggleDetailPaneActions[i];
+ }
+ }
return null;
}
@@ -1511,6 +1566,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/*
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer2#setSelectionProvider(org.eclipse.jface.viewers.ISelectionProvider)
*/
+ @Override
public void setSelectionProvider(ISelectionProvider provider) {
// Workaround for legacy detail pane implementations (bug 254442)
// set selection provider wrapper again in case it got overridden by detail pane
@@ -1522,6 +1578,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void doSave(IProgressMonitor monitor) {
fDetailPane.doSave(monitor);
}
@@ -1529,6 +1586,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#doSaveAs()
*/
+ @Override
public void doSaveAs() {
fDetailPane.doSaveAs();
}
@@ -1536,6 +1594,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isDirty()
*/
+ @Override
public boolean isDirty() {
return fDetailPane.isDirty();
}
@@ -1543,6 +1602,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
*/
+ @Override
public boolean isSaveAsAllowed() {
return fDetailPane.isSaveAsAllowed();
}
@@ -1550,6 +1610,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isSaveOnCloseNeeded()
*/
+ @Override
public boolean isSaveOnCloseNeeded() {
return fDetailPane.isSaveOnCloseNeeded();
}
@@ -1558,6 +1619,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
* @see org.eclipse.ui.ISaveablePart2#promptToSaveOnClose()
* @since 3.7
*/
+ @Override
public int promptToSaveOnClose() {
return ISaveablePart2.YES;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java
index 51394aa3d..2ee374a79 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AbstractDetailPane.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,7 +13,6 @@ package org.eclipse.debug.internal.ui.views.variables.details;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -41,16 +40,17 @@ public abstract class AbstractDetailPane implements IDetailPane {
* Map of actions. Keys are strings, values
* are <code>IAction</code>.
*/
- private Map fActionMap = new HashMap();
+ private Map<String, IAction> fActionMap = new HashMap<String, IAction>();
/**
* Collection to track actions that should be updated when selection occurs.
*/
- private List fSelectionActions = new ArrayList();
+ private List<String> fSelectionActions = new ArrayList<String>();
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite)
*/
+ @Override
public void init(IWorkbenchPartSite workbench) {
fWorkbenchPartSite = workbench;
@@ -59,6 +59,7 @@ public abstract class AbstractDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#dispose()
*/
+ @Override
public void dispose() {
fActionMap.clear();
fSelectionActions.clear();
@@ -98,7 +99,9 @@ public abstract class AbstractDetailPane implements IDetailPane {
* @param actionID The ID of the action which should be updated
*/
protected void setSelectionDependantAction(String actionID){
- if (actionID != null) fSelectionActions.add(actionID);
+ if (actionID != null) {
+ fSelectionActions.add(actionID);
+ }
}
/**
@@ -108,7 +111,7 @@ public abstract class AbstractDetailPane implements IDetailPane {
* @return The action associated with the ID or null if none is found.
*/
protected IAction getAction(String actionID) {
- return (IAction) fActionMap.get(actionID);
+ return fActionMap.get(actionID);
}
/**
@@ -133,9 +136,8 @@ public abstract class AbstractDetailPane implements IDetailPane {
* before it can be updated by this method.
*/
protected void updateSelectionDependentActions() {
- Iterator iterator= fSelectionActions.iterator();
- while (iterator.hasNext()) {
- updateAction((String)iterator.next());
+ for (String string : fSelectionActions) {
+ updateAction(string);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java
index eb0700285..ca8e07c50 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/AvailableDetailPanesAction.java
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.views.variables.details;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
@@ -32,7 +31,7 @@ import org.eclipse.ui.PlatformUI;
public class AvailableDetailPanesAction extends Action implements IMenuCreator {
private Menu fMenu;
- private Set fAvailableIDs;
+ private Set<String> fAvailableIDs;
private IDetailPaneContainer fDetailPaneContainer;
/**
@@ -46,14 +45,15 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator {
private class SetDetailPaneAction extends Action {
private String fPaneID;
- private Set fPossiblePaneIDs;
+ private Set<String> fPossiblePaneIDs;
- public SetDetailPaneAction(String name, String paneID, Set possiblePaneIDs){
+ public SetDetailPaneAction(String name, String paneID, Set<String> possiblePaneIDs) {
super(name,AS_RADIO_BUTTON);
fPaneID = paneID;
fPossiblePaneIDs = possiblePaneIDs;
}
+ @Override
public void run() {
// Don't change panes unless the user is selecting a different pane than the one currently displayed
if (isChecked() && !fDetailPaneContainer.getCurrentPaneID().equals(fPaneID)){
@@ -77,12 +77,14 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
if (fMenu != null) {
fMenu.dispose();
@@ -93,6 +95,7 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
*/
+ @Override
public Menu getMenu(Control parent) {
return null;
}
@@ -105,18 +108,14 @@ public class AvailableDetailPanesAction extends Action implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
if (fMenu != null) {
fMenu.dispose();
}
-
fMenu= new Menu(parent);
-
- Iterator iter = fAvailableIDs.iterator();
int i = 0;
- while (iter.hasNext()) {
- String currentID = (String) iter.next();
-
+ for (String currentID : fAvailableIDs) {
StringBuffer name = new StringBuffer();
//add the numerical accelerator
i++;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
index bde6a9a3a..be0aa7634 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPane.java
@@ -150,6 +150,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
public int fValue;
+ @Override
public String toString() {
return String.valueOf(fValue);
}
@@ -185,9 +186,10 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
protected IStatus run(IProgressMonitor monitor) {
fMonitor = monitor;
- Iterator iterator = fElements.iterator();
+ Iterator<?> iterator = fElements.iterator();
String message = null;
while (iterator.hasNext()) {
if (monitor.isCanceled()) {
@@ -256,6 +258,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.core.runtime.jobs.Job#canceling()
*/
+ @Override
protected void canceling() {
super.canceling();
synchronized (this) {
@@ -266,6 +269,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IValueDetailListener#detailComputed(org.eclipse.debug.core.model.IValue, java.lang.String)
*/
+ @Override
public void detailComputed(IValue value, final String result) {
synchronized (this) {
fComputed = true;
@@ -281,6 +285,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
final String detail = (valueString != null) ? valueString : DetailMessages.DefaultDetailPane_3;
if (!fMonitor.isCanceled()) {
WorkbenchJob append = new WorkbenchJob("append details") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!fMonitor.isCanceled()) {
String insert = detail;
@@ -371,6 +376,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fModelPresentation = new VariablesViewModelPresentation();
@@ -414,7 +420,9 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
// Add a document listener so actions get updated when the document changes
getDetailDocument().addDocumentListener(new IDocumentListener() {
+ @Override
public void documentAboutToBeChanged(DocumentEvent event) {}
+ @Override
public void documentChanged(DocumentEvent event) {
updateSelectionDependentActions();
}
@@ -422,6 +430,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
// Add the selection listener so selection dependent actions get updated.
fSourceViewer.getSelectionProvider().addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
updateSelectionDependentActions();
}
@@ -429,6 +438,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
// Add a focus listener to update actions when details area gains focus
fSourceViewer.getControl().addFocusListener(new FocusAdapter() {
+ @Override
public void focusGained(FocusEvent e) {
setGlobalAction(IDebugView.SELECT_ALL_ACTION, getAction(DETAIL_SELECT_ALL_ACTION));
setGlobalAction(IDebugView.CUT_ACTION, getAction(DETAIL_CUT_ACTION));
@@ -446,6 +456,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
fHasFocus = true;
}
+ @Override
public void focusLost(FocusEvent e) {
setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
setGlobalAction(IDebugView.CUT_ACTION, null);
@@ -463,6 +474,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
// disposed controls don't get a FocusOut event, make sure all actions
// have been deactivated
fSourceViewer.getControl().addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
if (fHasFocus) {
setGlobalAction(IDebugView.SELECT_ALL_ACTION, null);
@@ -564,6 +576,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
MenuManager menuMgr= new MenuManager();
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager mgr) {
fillDetailContextMenu(mgr);
}
@@ -607,6 +620,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void display(IStructuredSelection selection) {
if (selection == null){
@@ -650,6 +664,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#setFocus()
*/
+ @Override
public boolean setFocus(){
if (fSourceViewer != null){
fSourceViewer.getTextWidget().setFocus();
@@ -661,11 +676,18 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.AbstractDetailPane#dispose()
*/
+ @Override
public void dispose(){
- if (fDetailJob != null) fDetailJob.cancel();
- if (fModelPresentation != null) fModelPresentation.dispose();
+ if (fDetailJob != null) {
+ fDetailJob.cancel();
+ }
+ if (fModelPresentation != null) {
+ fModelPresentation.dispose();
+ }
fDebugModelIdentifier = null; // Setting this to null makes sure the source viewer is reconfigured with the model presentation after disposal
- if (fSourceViewer != null && fSourceViewer.getControl() != null) fSourceViewer.getControl().dispose();
+ if (fSourceViewer != null && fSourceViewer.getControl() != null) {
+ fSourceViewer.getControl().dispose();
+ }
if (isInView()){
IAction action = getAction(DETAIL_ASSIGN_VALUE_ACTION);
@@ -693,6 +715,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getDescription()
*/
+ @Override
public String getDescription() {
return DESCRIPTION;
}
@@ -700,6 +723,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getID()
*/
+ @Override
public String getID() {
return ID;
}
@@ -707,6 +731,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getName()
*/
+ @Override
public String getName() {
return NAME;
}
@@ -714,6 +739,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class required) {
if (IFindReplaceTarget.class.equals(required)) {
return fSourceViewer.getFindReplaceTarget();
@@ -804,12 +830,13 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
int lineOffset= document.getLineOffset(line);
int tabWidth= styledText.getTabs();
int column= 0;
- for (int i= lineOffset; i < caret; i++)
+ for (int i= lineOffset; i < caret; i++) {
if ('\t' == document.getChar(i)) {
column += tabWidth - (tabWidth == 0 ? 0 : column % tabWidth);
} else {
column++;
}
+ }
fLineLabel.fValue= line + 1;
fColumnLabel.fValue= column + 1;
@@ -831,19 +858,24 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
if (fCursorListener == null) {
fCursorListener= new ICursorListener() {
+ @Override
public void keyPressed(KeyEvent e) {
fStatusLineItem.setText(getCursorPosition());
}
+ @Override
public void keyReleased(KeyEvent e) {
}
+ @Override
public void mouseDoubleClick(MouseEvent e) {
}
+ @Override
public void mouseDown(MouseEvent e) {
}
+ @Override
public void mouseUp(MouseEvent e) {
fStatusLineItem.setText(getCursorPosition());
}
@@ -929,14 +961,16 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
*/
private IUndoContext getUndoContext() {
IUndoManager undoManager= fSourceViewer.getUndoManager();
- if (undoManager instanceof IUndoManagerExtension)
+ if (undoManager instanceof IUndoManagerExtension) {
return ((IUndoManagerExtension)undoManager).getUndoContext();
+ }
return null;
}
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
String propertyName= event.getProperty();
if (propertyName.equals(IDebugUIConstants.PREF_DETAIL_PANE_FONT)) {
@@ -972,6 +1006,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.jface.text.IFindReplaceTarget#canPerformFind()
*/
+ @Override
public boolean canPerformFind() {
return fTarget.canPerformFind();
}
@@ -979,6 +1014,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.jface.text.IFindReplaceTarget#findAndSelect(int, java.lang.String, boolean, boolean, boolean)
*/
+ @Override
public int findAndSelect(int widgetOffset, String findString, boolean searchForward, boolean caseSensitive, boolean wholeWord) {
int position = fTarget.findAndSelect(widgetOffset, findString, searchForward, caseSensitive, wholeWord);
// Explicitly tell the widget to show the selection because the viewer thinks the text is all on one line, even if wrapping is turned on.
@@ -994,6 +1030,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.jface.text.IFindReplaceTarget#getSelection()
*/
+ @Override
public Point getSelection() {
return fTarget.getSelection();
}
@@ -1001,6 +1038,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.jface.text.IFindReplaceTarget#getSelectionText()
*/
+ @Override
public String getSelectionText() {
return fTarget.getSelectionText();
}
@@ -1008,6 +1046,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.jface.text.IFindReplaceTarget#isEditable()
*/
+ @Override
public boolean isEditable() {
return fTarget.isEditable();
}
@@ -1015,6 +1054,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/* (non-Javadoc)
* @see org.eclipse.jface.text.IFindReplaceTarget#replaceSelection(java.lang.String)
*/
+ @Override
public void replaceSelection(String text) {
fTarget.replaceSelection(text);
}
@@ -1023,6 +1063,7 @@ public class DefaultDetailPane extends AbstractDetailPane implements IDetailPane
/*
* @see org.eclipse.debug.ui.IDetailPane2#getSelectionProvider()
*/
+ @Override
public ISelectionProvider getSelectionProvider() {
return fSourceViewer.getSelectionProvider();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java
index 00275bb41..cb4ee5c0b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DefaultDetailPaneFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,6 +31,7 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#createDetailsArea(java.lang.String)
*/
+ @Override
public IDetailPane createDetailPane(String id) {
if (MessageDetailPane.ID.equals(id)) {
return new MessageDetailPane();
@@ -39,11 +40,15 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDetailsTypes(org.eclipse.jface.viewers.IStructuredSelection)
+ /*
+ * (non-Javadoc)
+ * @see
+ * org.eclipse.debug.ui.IDetailPaneFactory#getDetailPaneTypes(org.eclipse
+ * .jface.viewers.IStructuredSelection)
*/
- public Set getDetailPaneTypes(IStructuredSelection selection) {
- Set possibleIDs = new HashSet(1);
+ @Override
+ public Set<String> getDetailPaneTypes(IStructuredSelection selection) {
+ Set<String> possibleIDs = new HashSet<String>(1);
possibleIDs.add(DefaultDetailPane.ID);
return possibleIDs;
}
@@ -51,6 +56,7 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPaneFactory#getDefaultDetailPane(java.util.Set, org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public String getDefaultDetailPane(IStructuredSelection selection) {
// Return null so that any contributed detail pane can override the default
return null;
@@ -59,6 +65,7 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getName(java.lang.String)
*/
+ @Override
public String getDetailPaneName(String id) {
if (id.equals(DefaultDetailPane.ID)){
return DefaultDetailPane.NAME;
@@ -73,6 +80,7 @@ public class DefaultDetailPaneFactory implements IDetailPaneFactory {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.IDetailsFactory#getDescription(java.lang.String)
*/
+ @Override
public String getDetailPaneDescription(String id) {
if (id.equals(DefaultDetailPane.ID)){
return DefaultDetailPane.DESCRIPTION;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
index 23b1c4002..8089a2e0d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneManager.java
@@ -11,9 +11,8 @@
package org.eclipse.debug.internal.ui.views.variables.details;
import java.util.ArrayList;
-import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
@@ -75,6 +74,7 @@ public class DetailPaneManager {
* @param paneID the identifier of the detail pane to create
* @return the new detail pane or <code>null</code> if the backing {@link IDetailPaneFactory} is <code>null</code>
*/
+ @Override
public IDetailPane createDetailPane(String paneID){
if (getFactory() != null){
return getFactory().createDetailPane(paneID);
@@ -88,11 +88,12 @@ public class DetailPaneManager {
* @param selection the current view selection
* @return the set of detail pane type for the given selection or an empty set, never <code>null</code>
*/
- public Set getDetailPaneTypes(IStructuredSelection selection){
+ @Override
+ public Set<String> getDetailPaneTypes(IStructuredSelection selection) {
if (getFactory() != null){
return getFactory().getDetailPaneTypes(selection);
}
- return new HashSet(0);
+ return Collections.EMPTY_SET;
}
/**
@@ -101,6 +102,7 @@ public class DetailPaneManager {
* @param selection the current view selection
* @return the identifier of the default detail pane or <code>null</code> if the backing {@link IDetailPaneFactory} is <code>null</code>
*/
+ @Override
public String getDefaultDetailPane(IStructuredSelection selection) {
if (getFactory() != null){
return getFactory().getDefaultDetailPane(selection);
@@ -114,6 +116,7 @@ public class DetailPaneManager {
* @param paneID the detail pane identifier
* @return the name of the detail pane or <code>null</code> if the backing {@link IDetailPaneFactory} is <code>null</code>
*/
+ @Override
public String getDetailPaneName(String paneID) {
if (getFactory() != null){
return getFactory().getDetailPaneName(paneID);
@@ -127,6 +130,7 @@ public class DetailPaneManager {
* @param paneID the detail pane identifier
* @return the description of the detail pane or <code>null</code> if the backing {@link IDetailPaneFactory} is <code>null</code>
*/
+ @Override
public String getDetailPaneDescription(String paneID) {
if (getFactory() != null){
return getFactory().getDetailPaneDescription(paneID);
@@ -139,7 +143,9 @@ public class DetailPaneManager {
* @return the singleton {@link IDetailPaneFactory}
*/
private IDetailPaneFactory getFactory(){
- if (fFactory != null) return fFactory;
+ if (fFactory != null) {
+ return fFactory;
+ }
try{
Object obj = fConfigElement.createExecutableExtension(IConfigurationElementConstants.CLASS);
if(obj instanceof IDetailPaneFactory) {
@@ -168,7 +174,7 @@ public class DetailPaneManager {
}
Expression expression = getEnablementExpression();
if (expression != null) {
- List list = selection.toList();
+ List<?> list = selection.toList();
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(list);
context.addVariable("selection", list); //$NON-NLS-1$
enabled = evalEnablementExpression(context, expression);
@@ -237,17 +243,17 @@ public class DetailPaneManager {
* Maps the IDs of types of detail panes to the factory that can create them.
* There can currently only be one factory for a given type of details pane.
*/
- private Map fFactoriesByPaneID;
+ private Map<String, IDetailPaneFactory> fFactoriesByPaneID;
/**
* Maps a Set of detail pane id's to the one detail pane id that is preferred.
*/
- private Map fPreferredDetailPanes;
+ private Map<Set<String>, String> fPreferredDetailPanes;
/**
* The set of all factories that have been loaded from the extension point.
*/
- private Collection fKnownFactories;
+ private List<DetailPaneFactoryExtension> fKnownFactories;
/**
* Preference key for storing the preferred detail panes map.
@@ -257,12 +263,14 @@ public class DetailPaneManager {
public static final String PREF_DETAIL_AREAS = "preferredDetailPanes"; //$NON-NLS-1$
private DetailPaneManager(){
- fFactoriesByPaneID = new HashMap();
+ fFactoriesByPaneID = new HashMap<String, IDetailPaneFactory>();
fFactoriesByPaneID.put(MessageDetailPane.ID, new DefaultDetailPaneFactory());
}
public static DetailPaneManager getDefault(){
- if (fgSingleton == null) fgSingleton = new DetailPaneManager();
+ if (fgSingleton == null) {
+ fgSingleton = new DetailPaneManager();
+ }
return fgSingleton;
}
@@ -273,8 +281,8 @@ public class DetailPaneManager {
* @return The ID of the preferred detail pane or null
*/
public String getPreferredPaneFromSelection(IStructuredSelection selection){
- Collection possibleFactories = getEnabledFactories(selection);
- Set possiblePaneIDs = getPossiblePaneIDs(possibleFactories, selection);
+ List<IDetailPaneFactory> possibleFactories = getEnabledFactories(selection);
+ Set<String> possiblePaneIDs = getPossiblePaneIDs(possibleFactories, selection);
return chooseDetailsAreaIDInSet(possiblePaneIDs, possibleFactories, selection);
}
@@ -285,8 +293,8 @@ public class DetailPaneManager {
* @param selection The selection to display in the detail pane
* @return The set of IDs of all possible detail panes for the given selection
*/
- public Set getAvailablePaneIDs(IStructuredSelection selection){
- Collection possibleFactories = getEnabledFactories(selection);
+ public Set<String> getAvailablePaneIDs(IStructuredSelection selection) {
+ List<IDetailPaneFactory> possibleFactories = getEnabledFactories(selection);
return getPossiblePaneIDs(possibleFactories, selection);
}
@@ -301,7 +309,7 @@ public class DetailPaneManager {
* @return The instantiated pane or null
*/
public IDetailPane getDetailPaneFromID(String ID){
- IDetailPaneFactory factory = (IDetailPaneFactory)fFactoriesByPaneID.get(ID);
+ IDetailPaneFactory factory = fFactoriesByPaneID.get(ID);
if (factory != null){
return factory.createDetailPane(ID);
}
@@ -316,7 +324,7 @@ public class DetailPaneManager {
* @return The name of the details pane or null
*/
public String getNameFromID(String ID){
- IDetailPaneFactory factory = (IDetailPaneFactory)fFactoriesByPaneID.get(ID);
+ IDetailPaneFactory factory = fFactoriesByPaneID.get(ID);
if (factory != null){
return factory.getDetailPaneName(ID);
}
@@ -331,7 +339,7 @@ public class DetailPaneManager {
* @return The description of the details pane or null
*/
public String getDescriptionFromID(String ID){
- IDetailPaneFactory factory = (IDetailPaneFactory)fFactoriesByPaneID.get(ID);
+ IDetailPaneFactory factory = fFactoriesByPaneID.get(ID);
if (factory != null){
return factory.getDetailPaneDescription(ID);
}
@@ -348,12 +356,12 @@ public class DetailPaneManager {
*
* @return The factories enabled for the selection or an empty collection.
*/
- private Collection getEnabledFactories(IStructuredSelection selection){
- Collection factoriesForSelection = new ArrayList();
- if (fKnownFactories == null) initializeDetailFactories();
- Iterator iter = fKnownFactories.iterator();
- while (iter.hasNext()) {
- IDetailPaneFactory currentFactory = (IDetailPaneFactory) iter.next();
+ private List<IDetailPaneFactory> getEnabledFactories(IStructuredSelection selection) {
+ List<IDetailPaneFactory> factoriesForSelection = new ArrayList<IDetailPaneFactory>();
+ if (fKnownFactories == null) {
+ initializeDetailFactories();
+ }
+ for (IDetailPaneFactory currentFactory : fKnownFactories) {
if (currentFactory instanceof DetailPaneFactoryExtension){
if (((DetailPaneFactoryExtension)currentFactory).isEnabled(selection)){
factoriesForSelection.add(currentFactory);
@@ -371,14 +379,10 @@ public class DetailPaneManager {
* @param selection The selection to be displayed
* @return Set of pane IDs or an empty set
*/
- private Set getPossiblePaneIDs(Collection factoriesToQuery, IStructuredSelection selection){
- Set idsForSelection = new LinkedHashSet();
- Iterator factoryIter = factoriesToQuery.iterator();
- while (factoryIter.hasNext()) {
- IDetailPaneFactory currentFactory = (IDetailPaneFactory) factoryIter.next();
- Iterator detailAreaTypes = currentFactory.getDetailPaneTypes(selection).iterator();
- while (detailAreaTypes.hasNext()) {
- String currentAreaTypeID = (String) detailAreaTypes.next();
+ private Set<String> getPossiblePaneIDs(List<IDetailPaneFactory> factoriesToQuery, IStructuredSelection selection) {
+ Set<String> idsForSelection = new LinkedHashSet<String>();
+ for (IDetailPaneFactory currentFactory : factoriesToQuery) {
+ for (String currentAreaTypeID : currentFactory.getDetailPaneTypes(selection)) {
fFactoriesByPaneID.put(currentAreaTypeID, currentFactory);
idsForSelection.add(currentAreaTypeID);
}
@@ -396,7 +400,7 @@ public class DetailPaneManager {
* @param selection the current selection from the variables view
* @return The preferred detail pane ID or null
*/
- private String chooseDetailsAreaIDInSet(Set possiblePaneIDs, Collection enabledFactories, IStructuredSelection selection){
+ private String chooseDetailsAreaIDInSet(Set<String> possiblePaneIDs, List<IDetailPaneFactory> enabledFactories, IStructuredSelection selection) {
if (possiblePaneIDs == null || possiblePaneIDs.isEmpty()){
return null;
}
@@ -405,18 +409,19 @@ public class DetailPaneManager {
if (preferredID == null){
// If there is no preferred pane already set, check the factories to see there is a default pane
- Iterator factoryIterator = enabledFactories.iterator();
- while (preferredID == null && factoryIterator.hasNext()) {
- IDetailPaneFactory currentFactory = (IDetailPaneFactory) factoryIterator.next();
+ for (IDetailPaneFactory currentFactory : enabledFactories) {
preferredID = currentFactory.getDefaultDetailPane(selection);
+ if (preferredID != null) {
+ break;
+ }
}
// If the factories don't have a default, try to choose the DefaultDetailPane
if (preferredID == null){
- Iterator paneIterator = possiblePaneIDs.iterator();
+ Iterator<String> paneIterator = possiblePaneIDs.iterator();
// If the DefaultDetailPane is not in the set, just use the first in the set
- preferredID = (String)paneIterator.next();
+ preferredID = paneIterator.next();
while (paneIterator.hasNext() && preferredID != DefaultDetailPaneFactory.DEFAULT_DETAIL_PANE_ID) {
- String currentID = (String) paneIterator.next();
+ String currentID = paneIterator.next();
if (currentID.equals(DefaultDetailPaneFactory.DEFAULT_DETAIL_PANE_ID)){
preferredID = currentID;
}
@@ -433,7 +438,7 @@ public class DetailPaneManager {
*/
private synchronized void initializeDetailFactories(){
if (fKnownFactories == null){
- fKnownFactories = new ArrayList();
+ fKnownFactories = new ArrayList<DetailPaneFactoryExtension>();
IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(DebugUIPlugin.getUniqueIdentifier(), IDebugUIConstants.EXTENSION_POINT_DETAIL_FACTORIES);
IConfigurationElement[] infos = extensionPoint.getConfigurationElements();
DetailPaneFactoryExtension delegate = null;
@@ -450,11 +455,11 @@ public class DetailPaneManager {
* @param possibleDetailsAreaIDs Set of possible pane IDs
* @return The preferred ID or null
*/
- public String getUserPreferredDetailPane(Set possibleDetailsAreaIDs){
+ public String getUserPreferredDetailPane(Set<String> possibleDetailsAreaIDs) {
if (fPreferredDetailPanes == null){
loadPreferredDetailsAreas();
}
- return (String)fPreferredDetailPanes.get(possibleDetailsAreaIDs);
+ return fPreferredDetailPanes.get(possibleDetailsAreaIDs);
}
@@ -465,12 +470,14 @@ public class DetailPaneManager {
* @param possibleDetailsAreaIDs The set of possible IDs
* @param preferredDetailsAreaID The preferred ID in the set.
*/
- public void setPreferredDetailPane(Set possibleDetailsAreaIDs, String preferredDetailsAreaID){
- if (possibleDetailsAreaIDs == null) return;
+ public void setPreferredDetailPane(Set<String> possibleDetailsAreaIDs, String preferredDetailsAreaID) {
+ if (possibleDetailsAreaIDs == null) {
+ return;
+ }
if (fPreferredDetailPanes == null){
loadPreferredDetailsAreas();
}
- String currentKey = (String)fPreferredDetailPanes.get(possibleDetailsAreaIDs);
+ String currentKey = fPreferredDetailPanes.get(possibleDetailsAreaIDs);
if (currentKey == null || !currentKey.equals(preferredDetailsAreaID)){
fPreferredDetailPanes.put(possibleDetailsAreaIDs, preferredDetailsAreaID);
storePreferredDetailsAreas();
@@ -488,12 +495,8 @@ public class DetailPaneManager {
*/
private void storePreferredDetailsAreas() {
StringBuffer buffer= new StringBuffer();
- Iterator iter = fPreferredDetailPanes.entrySet().iterator();
- while (iter.hasNext()) {
- Entry entry = (Entry) iter.next();
- Iterator setIter = ((Set)entry.getKey()).iterator();
- while (setIter.hasNext()) {
- String currentID = (String) setIter.next();
+ for (Entry<Set<String>, String> entry : fPreferredDetailPanes.entrySet()) {
+ for (String currentID : entry.getKey()) {
buffer.append(currentID);
buffer.append(',');
}
@@ -519,7 +522,7 @@ public class DetailPaneManager {
* @see #storePreferredDetailsAreas()
*/
private void loadPreferredDetailsAreas() {
- fPreferredDetailPanes = new HashMap();
+ fPreferredDetailPanes = new HashMap<Set<String>, String>();
String preferenceValue = Platform.getPreferencesService().getString(DebugUIPlugin.getUniqueIdentifier(),
PREF_DETAIL_AREAS,
"", //$NON-NLS-1$
@@ -529,7 +532,7 @@ public class DetailPaneManager {
String token = entryTokenizer.nextToken();
int valueStart = token.indexOf(':');
StringTokenizer keyTokenizer = new StringTokenizer(token.substring(0,valueStart),","); //$NON-NLS-1$
- Set keys = new LinkedHashSet();
+ Set<String> keys = new LinkedHashSet<String>();
while (keyTokenizer.hasMoreTokens()){
keys.add(keyTokenizer.nextToken());
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java
index abd568775..da231f3c8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/DetailPaneProxy.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -173,7 +173,7 @@ public class DetailPaneProxy implements ISaveablePart {
* @param required the class to get the adapter for
* @return the {@link IAdaptable} for the given class or <code>null</code>
*/
- public Object getAdapter(Class required){
+ public Object getAdapter(Class<?> required) {
if (fCurrentPane != null && fCurrentPane instanceof IAdaptable){
return ((IAdaptable)fCurrentPane).getAdapter(required);
}
@@ -203,8 +203,12 @@ public class DetailPaneProxy implements ISaveablePart {
private void setupPane(String paneID, IStructuredSelection selection) {
try {
fParentContainer.getParentComposite().setRedraw(false);
- if (fCurrentPane != null) fCurrentPane.dispose();
- if (fCurrentControl != null && !fCurrentControl.isDisposed()) fCurrentControl.dispose();
+ if (fCurrentPane != null) {
+ fCurrentPane.dispose();
+ }
+ if (fCurrentControl != null && !fCurrentControl.isDisposed()) {
+ fCurrentControl.dispose();
+ }
fCurrentPane = null;
fCurrentPane = DetailPaneManager.getDefault().getDetailPaneFromID(paneID);
if (fCurrentPane != null){
@@ -223,9 +227,11 @@ public class DetailPaneProxy implements ISaveablePart {
fCurrentPane.display(selection);
if (fParentContainer instanceof IDetailPaneContainer2) {
fCurrentControl.addFocusListener(new FocusAdapter() {
+ @Override
public void focusGained(FocusEvent e) {
updateSelectionProvider(true);
}
+ @Override
public void focusLost(FocusEvent e) {
updateSelectionProvider(false);
}
@@ -233,11 +239,11 @@ public class DetailPaneProxy implements ISaveablePart {
}
} else{
createErrorLabel(DetailMessages.DetailPaneProxy_0);
- DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_2, new String[]{fCurrentPane.getID()}))));
+ DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_2, new Object[] { fCurrentPane.getID() }))));
}
} else {
createErrorLabel(DetailMessages.DetailPaneProxy_0);
- DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_3, new String[]{paneID}))));
+ DebugUIPlugin.log(new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), MessageFormat.format(DetailMessages.DetailPaneProxy_3, new Object[] { paneID }))));
}
} finally {
fParentContainer.getParentComposite().setRedraw(true);
@@ -272,8 +278,12 @@ public class DetailPaneProxy implements ISaveablePart {
* @param message The message to display
*/
private void createErrorLabel(String message){
- if (fCurrentPane != null) fCurrentPane.dispose();
- if (fCurrentControl != null && !fCurrentControl.isDisposed()) fCurrentControl.dispose();
+ if (fCurrentPane != null) {
+ fCurrentPane.dispose();
+ }
+ if (fCurrentControl != null && !fCurrentControl.isDisposed()) {
+ fCurrentControl.dispose();
+ }
fCurrentControl = SWTFactory.createComposite(fParentContainer.getParentComposite(), 1, 1, GridData.FILL_HORIZONTAL);
SWTFactory.createLabel((Composite) fCurrentControl, message, 1);
fParentContainer.getParentComposite().layout();
@@ -282,6 +292,7 @@ public class DetailPaneProxy implements ISaveablePart {
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void doSave(IProgressMonitor monitor) {
ISaveablePart saveable = getSaveable();
if (saveable != null) {
@@ -292,6 +303,7 @@ public class DetailPaneProxy implements ISaveablePart {
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#doSaveAs()
*/
+ @Override
public void doSaveAs() {
ISaveablePart saveable = getSaveable();
if (saveable != null) {
@@ -302,6 +314,7 @@ public class DetailPaneProxy implements ISaveablePart {
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isDirty()
*/
+ @Override
public boolean isDirty() {
ISaveablePart saveable = getSaveable();
if (saveable != null) {
@@ -313,6 +326,7 @@ public class DetailPaneProxy implements ISaveablePart {
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isSaveAsAllowed()
*/
+ @Override
public boolean isSaveAsAllowed() {
ISaveablePart saveable = getSaveable();
if (saveable != null) {
@@ -324,6 +338,7 @@ public class DetailPaneProxy implements ISaveablePart {
/* (non-Javadoc)
* @see org.eclipse.ui.ISaveablePart#isSaveOnCloseNeeded()
*/
+ @Override
public boolean isSaveOnCloseNeeded() {
ISaveablePart saveable = getSaveable();
if (saveable != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java
index 69fa18c3b..609ec9afb 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/details/MessageDetailPane.java
@@ -46,12 +46,14 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#init(org.eclipse.ui.IWorkbenchPartSite)
*/
+ @Override
public void init(IWorkbenchPartSite partSite) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#dispose()
*/
+ @Override
public void dispose() {
fControlParent.dispose();
}
@@ -59,6 +61,7 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fControlParent = SWTFactory.createComposite(parent, 1, 1, GridData.FILL_BOTH);
fControlParent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
@@ -69,6 +72,7 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#setFocus()
*/
+ @Override
public boolean setFocus() {
return false;
}
@@ -76,6 +80,7 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#display(org.eclipse.jface.viewers.IStructuredSelection)
*/
+ @Override
public void display(IStructuredSelection selection) {
// re-create controls if the layout has changed
if (selection != null && selection.size() == 1) {
@@ -95,6 +100,7 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getID()
*/
+ @Override
public String getID() {
return ID;
}
@@ -102,6 +108,7 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getName()
*/
+ @Override
public String getName() {
return NAME;
}
@@ -109,6 +116,7 @@ public class MessageDetailPane implements IDetailPane {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IDetailPane#getDescription()
*/
+ @Override
public String getDescription() {
return DESCRIPTION;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
index 8c1b2ad45..913984ff8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractBreakpointOrganizerDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,14 +35,16 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public void addBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
// do noting, not supported by default
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
- public void addPropertyChangeListener(IPropertyChangeListener listener) {
+ @Override
+ public void addPropertyChangeListener(IPropertyChangeListener listener) {
fListeners.add(listener);
}
@@ -53,7 +55,8 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
*
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canAdd(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public boolean canAdd(IBreakpoint breakpoint, IAdaptable category) {
return category instanceof OtherBreakpointCategory;
}
@@ -64,28 +67,32 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
*
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#canRemove(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public boolean canRemove(IBreakpoint breakpoint, IAdaptable category) {
return category instanceof OtherBreakpointCategory;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#dispose()
*/
- public void dispose() {
+ @Override
+ public void dispose() {
fListeners = new ListenerList();
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removeBreakpoint(org.eclipse.debug.core.model.IBreakpoint, org.eclipse.core.runtime.IAdaptable)
*/
- public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
+ @Override
+ public void removeBreakpoint(IBreakpoint breakpoint, IAdaptable category) {
// do nothing, not supported by default
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
- public void removePropertyChangeListener(IPropertyChangeListener listener) {
+ @Override
+ public void removePropertyChangeListener(IPropertyChangeListener listener) {
fListeners.remove(listener);
}
@@ -103,10 +110,12 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
for (int i = 0; i < listeners.length; i++) {
final IPropertyChangeListener listener = (IPropertyChangeListener) listeners[i];
ISafeRunnable runnable = new ISafeRunnable() {
- public void handleException(Throwable exception) {
+ @Override
+ public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
- public void run() throws Exception {
+ @Override
+ public void run() throws Exception {
listener.propertyChange(event);
}
};
@@ -117,7 +126,8 @@ public abstract class AbstractBreakpointOrganizerDelegate implements IBreakpoint
/* (non-Javadoc)
* @see org.eclipse.debug.ui.IBreakpointOrganizerDelegate#getCategories()
*/
- public IAdaptable[] getCategories() {
+ @Override
+ public IAdaptable[] getCategories() {
return null;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
index efc12b3cf..92a41dd97 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractDebugView.java
@@ -12,9 +12,9 @@ package org.eclipse.debug.ui;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -113,19 +113,19 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
* Map of actions. Keys are strings, values
* are <code>IAction</code>.
*/
- private Map fActionMap = null;
+ private Map<String, IAction> fActionMap = null;
/**
* Map of actions. Keys are strings, values
* are <code>IAction</code>.
*/
- private List fUpdateables = null;
+ private List<IUpdate> fUpdateables = null;
/**
* The collection of menu managers that are
* relevant for this view.
*/
- private List fContextMenuManagers;
+ private List<IMenuManager> fContextMenuManagers;
/**
* The memento that was used to persist the state of this view.
@@ -151,9 +151,9 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*/
private String fEarlyMessage= null;
- private static Set fgGlobalActionIds;
+ private static Set<String> fgGlobalActionIds;
static {
- fgGlobalActionIds = new HashSet();
+ fgGlobalActionIds = new HashSet<String>();
fgGlobalActionIds.add(SELECT_ALL_ACTION);
fgGlobalActionIds.add(COPY_ACTION);
fgGlobalActionIds.add(CUT_ACTION);
@@ -173,6 +173,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*
* @see org.eclipse.ui.IPartListener2#partVisible(IWorkbenchPartReference)
*/
+ @Override
public void partVisible(IWorkbenchPartReference ref) {
IWorkbenchPart part= ref.getPart(false);
if (part == AbstractDebugView.this) {
@@ -183,6 +184,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see org.eclipse.ui.IPartListener2#partHidden(IWorkbenchPartReference)
*/
+ @Override
public void partHidden(IWorkbenchPartReference ref) {
IWorkbenchPart part= ref.getPart(false);
if (part == AbstractDebugView.this) {
@@ -193,36 +195,42 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see org.eclipse.ui.IPartListener2#partActivated(IWorkbenchPartReference)
*/
+ @Override
public void partActivated(IWorkbenchPartReference ref) {
}
/**
* @see org.eclipse.ui.IPartListener2#partBroughtToTop(IWorkbenchPartReference)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPartReference ref) {
}
/**
* @see org.eclipse.ui.IPartListener2#partClosed(IWorkbenchPartReference)
*/
+ @Override
public void partClosed(IWorkbenchPartReference ref) {
}
/**
* @see org.eclipse.ui.IPartListener2#partDeactivated(IWorkbenchPartReference)
*/
+ @Override
public void partDeactivated(IWorkbenchPartReference ref) {
}
/**
* @see org.eclipse.ui.IPartListener2#partOpened(IWorkbenchPartReference)
*/
+ @Override
public void partOpened(IWorkbenchPartReference ref) {
}
/**
* @see org.eclipse.ui.IPartListener2#partInputChanged(IWorkbenchPartReference)
*/
+ @Override
public void partInputChanged(IWorkbenchPartReference ref){
}
@@ -232,8 +240,8 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
* Constructs a new debug view.
*/
public AbstractDebugView() {
- fActionMap = new HashMap(5);
- fUpdateables= new ArrayList(3);
+ fActionMap = new HashMap<String, IAction>(5);
+ fUpdateables = new ArrayList<IUpdate>(3);
}
/**
@@ -244,6 +252,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
* @see IDebugView
*/
+ @Override
public Object getAdapter(Class adapter) {
if (adapter == IDebugView.class) {
return this;
@@ -268,6 +277,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IPage#createControl(Composite)
*/
+ @Override
public void createControl(Composite parent) {
Viewer viewer = createViewer(parent);
setViewer(viewer);
@@ -276,6 +286,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IPage#getControl()
*/
+ @Override
public Control getControl() {
return getDefaultControl();
}
@@ -283,6 +294,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IPage#setFocus()
*/
+ @Override
public void setFocus() {
Viewer viewer= getViewer();
if (viewer != null) {
@@ -316,6 +328,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
* @see AbstractDebugView#getHelpContextId()
* @see AbstractDebugView#fillContextMenu(IMenuManager)
*/
+ @Override
public void createPartControl(Composite parent) {
registerPartListener();
super.createPartControl(parent);
@@ -331,6 +344,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
}
if (viewer != null) {
getViewer().getControl().addKeyListener(new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
handleKeyPressed(e);
}
@@ -355,6 +369,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*
* @see PageBookView#createDefaultPage(PageBook)
*/
+ @Override
protected IPage createDefaultPage(PageBook book) {
ViewerPage page = new ViewerPage();
page.createControl(book);
@@ -391,6 +406,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
saveAllCheckedActionStates();
deregisterPartListener();
@@ -466,6 +482,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IDebugView#getViewer()
*/
+ @Override
public Viewer getViewer() {
return fViewer;
}
@@ -501,6 +518,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IDebugView#getPresentation(String)
*/
+ @Override
public IDebugModelPresentation getPresentation(String id) {
if (getViewer() instanceof StructuredViewer) {
IBaseLabelProvider lp = ((StructuredViewer)getViewer()).getLabelProvider();
@@ -533,6 +551,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
MenuManager menuMgr= new MenuManager("#PopUp"); //$NON-NLS-1$
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager mgr) {
fillContextMenu(mgr);
}
@@ -552,6 +571,8 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*
* @deprecated @see AbstractDebugView.getContextMenuManagers()
*/
+ @Deprecated
+ @Override
public IMenuManager getContextMenuManager() {
if (fContextMenuManagers != null) {
fContextMenuManagers.get(fContextMenuManagers.size() - 1);
@@ -565,7 +586,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
* @return the context menu managers relevant to this view
* @since 2.1
*/
- public List getContextMenuManagers() {
+ public List<IMenuManager> getContextMenuManagers() {
return fContextMenuManagers;
}
@@ -598,6 +619,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
// This is done in a runnable to be run after this view's pane
// is created
Runnable r = new Runnable() {
+ @Override
public void run() {
if (!isAvailable()) {
return;
@@ -644,6 +666,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IViewPart#init(IViewSite, IMemento)
*/
+ @Override
public void init(IViewSite site, IMemento memento) throws PartInitException {
super.init(site, memento);
//store the memento to be used when this view is created.
@@ -673,6 +696,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IDebugView#setAction(String, IAction)
*/
+ @Override
public void setAction(String actionID, IAction action) {
if (action == null) {
Object removedAction= fActionMap.remove(actionID);
@@ -680,7 +704,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
} else {
fActionMap.put(actionID, action);
if (action instanceof IUpdate) {
- fUpdateables.add(action);
+ fUpdateables.add((IUpdate) action);
}
}
if (fgGlobalActionIds.contains(actionID)) {
@@ -692,17 +716,17 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IDebugView#getAction(String)
*/
+ @Override
public IAction getAction(String actionID) {
- return (IAction) fActionMap.get(actionID);
+ return fActionMap.get(actionID);
}
/**
* Updates all the registered updatables.
*/
public void updateObjects() {
- Iterator actions = fUpdateables.iterator();
- while (actions.hasNext()) {
- ((IUpdate)actions.next()).update();
+ for (IUpdate update : fUpdateables) {
+ update.update();
}
}
@@ -728,6 +752,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*
* @see IDoubleClickListener#doubleClick(DoubleClickEvent)
*/
+ @Override
public void doubleClick(DoubleClickEvent event) {
IAction action = getAction(DOUBLE_CLICK_ACTION);
if (action != null && !event.getSelection().isEmpty() && action.isEnabled()) {
@@ -808,6 +833,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see PageBookView#isImportant(IWorkbenchPart)
*/
+ @Override
protected boolean isImportant(IWorkbenchPart part) {
return false;
}
@@ -815,6 +841,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see PageBookView#doCreatePage(IWorkbenchPart)
*/
+ @Override
protected PageRec doCreatePage(IWorkbenchPart part) {
return null;
}
@@ -822,12 +849,14 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
*/
+ @Override
protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
}
/**
* @see PageBookView#getBootstrapPart()
*/
+ @Override
protected IWorkbenchPart getBootstrapPart() {
return null;
}
@@ -908,6 +937,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IDebugView#add(IUpdate)
*/
+ @Override
public void add(IUpdate updatable) {
if (!fUpdateables.contains(updatable)) {
fUpdateables.add(updatable);
@@ -917,6 +947,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
/**
* @see IDebugView#remove(IUpdate)
*/
+ @Override
public void remove(IUpdate updatable) {
fUpdateables.remove(updatable);
}
@@ -929,7 +960,7 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
*/
public void addContextMenuManager(IMenuManager contextMenuManager) {
if (fContextMenuManagers == null) {
- fContextMenuManagers= new ArrayList();
+ fContextMenuManagers = new ArrayList<IMenuManager>();
}
fContextMenuManagers.add(contextMenuManager);
}
@@ -993,14 +1024,14 @@ public abstract class AbstractDebugView extends PageBookView implements IDebugVi
* presentation in this view associated with the given debug model
* @since 3.0
*/
- public Map getPresentationAttributes(String modelId) {
+ public Map<String, Object> getPresentationAttributes(String modelId) {
IDebugModelPresentation presentation = getPresentation(modelId);
if (presentation instanceof DelegatingModelPresentation) {
return ((DelegatingModelPresentation)presentation).getAttributeMap();
} else if (presentation instanceof LazyModelPresentation) {
return ((LazyModelPresentation)presentation).getAttributeMap();
}
- return new HashMap();
+ return Collections.EMPTY_MAP;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
index dd4e4456c..e2dbb3a50 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -118,6 +118,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
/**
* @see ILaunchConfigurationTab#getControl()
*/
+ @Override
public Control getControl() {
return fControl;
}
@@ -134,6 +135,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
/**
* @see ILaunchConfigurationTab#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
return fErrorMessage;
}
@@ -142,6 +144,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
* @see ILaunchConfigurationTab2#getWarningMessage()
* @since 3.9
*/
+ @Override
public String getWarningMessage() {
return fWarningMessage;
}
@@ -149,6 +152,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
/**
* @see ILaunchConfigurationTab#getMessage()
*/
+ @Override
public String getMessage() {
return fMessage;
}
@@ -162,12 +166,15 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
* than the launch dialog, this method cannot be relied upon for launching
* functionality.
*/
+ @Deprecated
+ @Override
public void launched(ILaunch launch) {
}
/**
* @see ILaunchConfigurationTab#setLaunchConfigurationDialog(ILaunchConfigurationDialog)
*/
+ @Override
public void setLaunchConfigurationDialog(ILaunchConfigurationDialog dialog) {
fLaunchConfigurationDialog = dialog;
}
@@ -214,6 +221,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
*
* @see ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
}
@@ -273,6 +281,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
/**
* @see ILaunchConfigurationTab#canSave()
*/
+ @Override
public boolean canSave() {
return true;
}
@@ -280,6 +289,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
/**
* @see ILaunchConfigurationTab#isValid(ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
return true;
}
@@ -310,6 +320,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
/**
* @see ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return null;
}
@@ -395,6 +406,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
* @since 3.0
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
initializeFrom(workingCopy);
}
@@ -415,6 +427,7 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
* @since 3.0
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
performApply(workingCopy);
}
@@ -452,12 +465,14 @@ public abstract class AbstractLaunchConfigurationTab implements ILaunchConfigura
*/
protected Job createUpdateJob() {
return new WorkbenchJob(getControl().getDisplay(), "Update LCD") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (!getControl().isDisposed()) {
updateLaunchConfigurationDialog();
}
return Status.OK_STATUS;
}
+ @Override
public boolean shouldRun() {
return !getControl().isDisposed();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
index d1e873e1d..970ac29dc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/AbstractLaunchConfigurationTabGroup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -36,6 +36,7 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
/**
* @see ILaunchConfigurationTabGroup#getTabs()
*/
+ @Override
public ILaunchConfigurationTab[] getTabs() {
return fTabs;
}
@@ -54,6 +55,7 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
*
* @see ILaunchConfigurationTabGroup#dispose()
*/
+ @Override
public void dispose() {
ILaunchConfigurationTab[] tabs = getTabs();
if (tabs != null) {
@@ -68,6 +70,7 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
*
* @see ILaunchConfigurationTabGroup#setDefaults(ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
ILaunchConfigurationTab[] tabs = getTabs();
for (int i = 0; i < tabs.length; i++) {
@@ -80,6 +83,7 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
*
* @see ILaunchConfigurationTabGroup#initializeFrom(ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
ILaunchConfigurationTab[] tabs = getTabs();
for (int i = 0; i < tabs.length; i++) {
@@ -92,6 +96,7 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
*
* @see ILaunchConfigurationTabGroup#performApply(ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
ILaunchConfigurationTab[] tabs = getTabs();
for (int i = 0; i < tabs.length; i++) {
@@ -108,6 +113,8 @@ public abstract class AbstractLaunchConfigurationTabGroup implements ILaunchConf
* than the launch dialog, this method cannot be relied upon for launching
* functionality.
*/
+ @Deprecated
+ @Override
public void launched(ILaunch launch) {
ILaunchConfigurationTab[] tabs = getTabs();
for (int i = 0; i < tabs.length; i++) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
index 1ce0c4672..9fcb97e15 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/BreakpointTypeCategory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -64,6 +64,7 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object object) {
if (object instanceof BreakpointTypeCategory) {
BreakpointTypeCategory type = (BreakpointTypeCategory) object;
@@ -75,6 +76,7 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return getName().hashCode();
}
@@ -82,6 +84,7 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getChildren(java.lang.Object)
*/
+ @Override
public Object[] getChildren(Object o) {
return null;
}
@@ -89,6 +92,7 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return fImageDescriptor;
}
@@ -96,6 +100,7 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
+ @Override
public String getLabel(Object o) {
return getName();
}
@@ -103,10 +108,12 @@ public class BreakpointTypeCategory extends PlatformObject implements IBreakpoin
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getParent(java.lang.Object)
*/
+ @Override
public Object getParent(Object o) {
return null;
}
+ @Override
public String toString() {
return fName;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
index a74e76b11..fdac516a5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/CommonTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,6 @@ import java.nio.charset.Charset;
import java.nio.charset.IllegalCharsetNameException;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -141,6 +140,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
* Modify listener that simply updates the owning launch configuration dialog.
*/
private ModifyListener fBasicModifyListener = new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent evt) {
scheduleUpdateJob();
}
@@ -157,6 +157,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
@@ -202,6 +203,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fFavoritesTable.setContentProvider(new FavoritesContentProvider());
fFavoritesTable.setLabelProvider(new FavoritesLabelProvider());
fFavoritesTable.addCheckStateListener(new ICheckStateListener() {
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
updateLaunchConfigurationDialog();
}
@@ -222,12 +224,14 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fLocalRadioButton.setLayoutData(gd);
fSharedRadioButton = createRadioButton(comp, LaunchConfigurationsMessages.CommonTab_S_hared_4);
fSharedRadioButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleSharedRadioButtonSelected();
}
});
fSharedLocationText = SWTFactory.createSingleText(comp, 1);
fSharedLocationText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ @Override
public void getName(AccessibleEvent e) {
e.result = LaunchConfigurationsMessages.CommonTab_S_hared_4;
}
@@ -235,6 +239,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fSharedLocationText.addModifyListener(fBasicModifyListener);
fSharedLocationButton = createPushButton(comp, LaunchConfigurationsMessages.CommonTab__Browse_6, null);
fSharedLocationButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
handleSharedLocationButtonSelected();
}
@@ -259,7 +264,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
gd.horizontalSpan = 5;
fConsoleOutput.setLayoutData(gd);
fConsoleOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
@@ -267,14 +273,16 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fFileOutput = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_6);
fFileOutput.setLayoutData(new GridData(SWT.BEGINNING, SWT.NORMAL, false, false));
fFileOutput.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
enableOuputCaptureWidgets(fFileOutput.getSelection());
updateLaunchConfigurationDialog();
}
});
fFileText = SWTFactory.createSingleText(comp, 4);
fFileText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
+ @Override
+ public void getName(AccessibleEvent e) {
e.result = LaunchConfigurationsMessages.CommonTab_6;
}
});
@@ -286,7 +294,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
ld.marginWidth = 0;
fWorkspaceBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_12, null);
fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getShell(), new WorkbenchLabelProvider(), new WorkbenchContentProvider());
dialog.setTitle(LaunchConfigurationsMessages.CommonTab_13);
dialog.setMessage(LaunchConfigurationsMessages.CommonTab_14);
@@ -305,7 +314,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
});
fFileBrowse = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_7, null);
fFileBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
String filePath = fFileText.getText();
FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
filePath = dialog.open();
@@ -316,7 +326,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
});
fVariables = createPushButton(bcomp, LaunchConfigurationsMessages.CommonTab_9, null);
fVariables.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
String variable = dialog.getVariableExpression();
@@ -324,14 +335,16 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fFileText.insert(variable);
}
}
- public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {}
});
fAppend = createCheckButton(comp, LaunchConfigurationsMessages.CommonTab_11);
gd = new GridData(SWT.LEFT, SWT.TOP, true, false);
gd.horizontalSpan = 4;
fAppend.setLayoutData(gd);
fAppend.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
@@ -394,19 +407,21 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fEncodingCombo = new Combo(group, SWT.NONE);
fEncodingCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
fEncodingCombo.setFont(parent.getFont());
- List allEncodings = IDEEncoding.getIDEEncodings();
- String[] encodingArray = (String[]) allEncodings.toArray(new String[0]);
+ List<String> allEncodings = IDEEncoding.getIDEEncodings();
+ String[] encodingArray = allEncodings.toArray(new String[0]);
fEncodingCombo.setItems(encodingArray);
if (encodingArray.length > 0) {
fEncodingCombo.select(0);
}
fEncodingCombo.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent e) {
+ @Override
+ public void getName(AccessibleEvent e) {
e.result = LaunchConfigurationsMessages.CommonTab_3;
}
});
SelectionListener listener = new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
if(e.getSource() instanceof Button) {
Button button = (Button)e.getSource();
if(button.getSelection()) {
@@ -428,6 +443,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
*
* @see org.eclipse.swt.events.KeyListener#keyReleased(org.eclipse.swt.events.KeyEvent)
*/
+ @Override
public void keyReleased(KeyEvent e) {
scheduleUpdateJob();
}
@@ -464,6 +480,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
fLaunchInBackgroundButton.setLayoutData(data);
fLaunchInBackgroundButton.setFont(parent.getFont());
fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
@@ -547,6 +564,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
boolean isShared = !configuration.isLocal();
fSharedRadioButton.setSelection(isShared);
@@ -615,7 +633,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
} catch (CoreException e) {
}
String defaultEncoding = getDefaultEncoding(configuration);
- fDefaultEncodingButton.setText(MessageFormat.format(LaunchConfigurationsMessages.CommonTab_2, new String[]{defaultEncoding}));
+ fDefaultEncodingButton.setText(MessageFormat.format(LaunchConfigurationsMessages.CommonTab_2, new Object[] { defaultEncoding }));
fDefaultEncodingButton.pack();
if (encoding != null) {
fAltEncodingButton.setSelection(true);
@@ -649,11 +667,12 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
* Updates the favorites selections from the local configuration
* @param config the local configuration
*/
+ @SuppressWarnings("deprecation")
private void updateFavoritesFromConfig(ILaunchConfiguration config) {
fFavoritesTable.setInput(config);
fFavoritesTable.setCheckedElements(new Object[]{});
try {
- List groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, new ArrayList());
+ List<String> groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, new ArrayList<String>());
if (groups.isEmpty()) {
// check old attributes for backwards compatible
if (config.getAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, false)) {
@@ -664,10 +683,8 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
}
}
if (!groups.isEmpty()) {
- List list = new ArrayList();
- Iterator iterator = groups.iterator();
- while (iterator.hasNext()) {
- String id = (String)iterator.next();
+ List<LaunchGroupExtension> list = new ArrayList<LaunchGroupExtension>();
+ for (String id : groups) {
LaunchGroupExtension extension = getLaunchConfigurationManager().getLaunchGroup(id);
if (extension != null) {
list.add(extension);
@@ -716,6 +733,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
* and will be missing for older configurations.
* @param config the configuration to update
*/
+ @SuppressWarnings("deprecation")
private void updateConfigFromFavorites(ILaunchConfigurationWorkingCopy config) {
try {
Object[] checked = fFavoritesTable.getCheckedElements();
@@ -723,7 +741,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
boolean run = config.getAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, false);
if (debug || run) {
// old attributes
- List groups = new ArrayList();
+ List<LaunchGroupExtension> groups = new ArrayList<LaunchGroupExtension>();
int num = 0;
if (debug) {
groups.add(getLaunchConfigurationManager().getLaunchGroup(IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP));
@@ -749,11 +767,11 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
}
config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
- List groups = null;
+ List<String> groups = null;
for (int i = 0; i < checked.length; i++) {
LaunchGroupExtension group = (LaunchGroupExtension)checked[i];
if (groups == null) {
- groups = new ArrayList();
+ groups = new ArrayList<String>();
}
groups.add(group.getIdentifier());
}
@@ -774,6 +792,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration config) {
setMessage(null);
setErrorMessage(null);
@@ -834,6 +853,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
config.setContainer(null);
setAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND, config, true, true);
@@ -842,6 +862,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
updateConfigFromLocalShared(configuration);
updateConfigFromFavorites(configuration);
@@ -881,6 +902,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return LaunchConfigurationsMessages.CommonTab__Common_15;
}
@@ -890,6 +912,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.debug.ui.commonTab"; //$NON-NLS-1$
}
@@ -897,6 +920,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
*/
+ @Override
public boolean canSave() {
return validateLocalShared();
}
@@ -904,6 +928,7 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB);
}
@@ -911,11 +936,13 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
/**
@@ -923,9 +950,10 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
*/
class FavoritesContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- List possibleGroups = new ArrayList();
+ List<ILaunchGroup> possibleGroups = new ArrayList<ILaunchGroup>();
ILaunchConfiguration configuration = (ILaunchConfiguration)inputElement;
for (int i = 0; i < groups.length; i++) {
ILaunchGroup extension = groups[i];
@@ -937,8 +965,10 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
return possibleGroups.toArray();
}
+ @Override
public void dispose() {}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
}
@@ -949,10 +979,11 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
*/
class FavoritesLabelProvider implements ITableLabelProvider {
- private Map fImages = new HashMap();
+ private Map<Object, Image> fImages = new HashMap<Object, Image>();
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
- Image image = (Image)fImages.get(element);
+ Image image = fImages.get(element);
if (image == null) {
ImageDescriptor descriptor = ((LaunchGroupExtension)element).getImageDescriptor();
if (descriptor != null) {
@@ -963,23 +994,26 @@ public class CommonTab extends AbstractLaunchConfigurationTab {
return image;
}
+ @Override
public String getColumnText(Object element, int columnIndex) {
String label = ((LaunchGroupExtension)element).getLabel();
return DebugUIPlugin.removeAccelerators(label);
}
+ @Override
public void addListener(ILabelProviderListener listener) {}
+ @Override
public void dispose() {
- Iterator images = fImages.values().iterator();
- while (images.hasNext()) {
- Image image = (Image)images.next();
+ for (Image image : fImages.values()) {
image.dispose();
}
}
+ @Override
public boolean isLabelProperty(Object element, String property) {return false;}
+ @Override
public void removeListener(ILabelProviderListener listener) {}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
index fed8d2b4c..6de7015f5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugElementWorkbenchAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,40 +31,46 @@ import org.eclipse.ui.model.IWorkbenchAdapter2;
* {@link IWorkbenchAdapter}. Custom content is currently supported
* by a provisional internal viewer framework.
*/
+@Deprecated
public abstract class DebugElementWorkbenchAdapter implements IWorkbenchAdapter, IWorkbenchAdapter2 {
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getImageDescriptor(java.lang.Object)
*/
- public ImageDescriptor getImageDescriptor(Object object) {
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
return DebugElementHelper.getImageDescriptor(object);
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter#getLabel(java.lang.Object)
*/
- public String getLabel(Object o) {
+ @Override
+ public String getLabel(Object o) {
return DebugElementHelper.getLabel(o);
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getForeground(java.lang.Object)
*/
- public RGB getForeground(Object element) {
+ @Override
+ public RGB getForeground(Object element) {
return DebugElementHelper.getForeground(element);
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getBackground(java.lang.Object)
*/
- public RGB getBackground(Object element) {
+ @Override
+ public RGB getBackground(Object element) {
return DebugElementHelper.getBackground(element);
}
/* (non-Javadoc)
* @see org.eclipse.ui.model.IWorkbenchAdapter2#getFont(java.lang.Object)
*/
- public FontData getFont(Object element) {
+ @Override
+ public FontData getFont(Object element) {
return DebugElementHelper.getFont(element);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
index 442eb0da2..5d3709a4c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugPopup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.ui;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -31,6 +29,8 @@ import org.eclipse.ui.handlers.IHandlerActivation;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.keys.IBindingService;
+import com.ibm.icu.text.MessageFormat;
+
/**
* A <code>PopupDialog</code> that is automatically positioned relative
* to a specified anchor point. The popup can be dismissed in the same
@@ -85,7 +85,8 @@ public abstract class DebugPopup extends PopupDialog {
String infoText = null;
if (formattedBinding != null) {
- infoText = MessageFormat.format(DebugUIViewsMessages.InspectPopupDialog_1, new String[] { formattedBinding, getActionText()});
+ infoText = MessageFormat.format(DebugUIViewsMessages.InspectPopupDialog_1, new Object[] {
+ formattedBinding, getActionText() });
}
return infoText;
}
@@ -138,7 +139,8 @@ public abstract class DebugPopup extends PopupDialog {
* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
- protected abstract Control createDialogArea(Composite parent);
+ @Override
+ protected abstract Control createDialogArea(Composite parent);
/**
@@ -152,7 +154,8 @@ public abstract class DebugPopup extends PopupDialog {
* <code>getInitialSize</code>.
* @return the initial location of the shell
*/
- protected Point getInitialLocation(Point initialSize) {
+ @Override
+ protected Point getInitialLocation(Point initialSize) {
if (fAnchor == null) {
return super.getInitialLocation(initialSize);
}
@@ -171,7 +174,8 @@ public abstract class DebugPopup extends PopupDialog {
* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#getDialogSettings()
*/
- protected IDialogSettings getDialogSettings() {
+ @Override
+ protected IDialogSettings getDialogSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
return settings;
}
@@ -180,12 +184,14 @@ public abstract class DebugPopup extends PopupDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#open()
*/
- public int open() {
+ @Override
+ public int open() {
IWorkbench workbench = PlatformUI.getWorkbench();
String commandId = getCommandId();
if (commandId != null) {
IHandler fCloseHandler = new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
persist();
close();
return null;
@@ -197,8 +203,9 @@ public abstract class DebugPopup extends PopupDialog {
}
String infoText = getInfoText();
- if (infoText != null)
- setInfoText(infoText);
+ if (infoText != null) {
+ setInfoText(infoText);
+ }
return super.open();
}
@@ -206,9 +213,11 @@ public abstract class DebugPopup extends PopupDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#close()
*/
- public boolean close() {
- if (fActivation != null)
- fHandlerService.deactivateHandler(fActivation);
+ @Override
+ public boolean close() {
+ if (fActivation != null) {
+ fHandlerService.deactivateHandler(fActivation);
+ }
return super.close();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
index 5c1b10395..ab92b7437 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DebugUITools.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -286,11 +286,13 @@ public class DebugUITools {
IMarker[] markers= new IMarker[breakpoints.length];
int markerCount;
for (markerCount= 0; markerCount < breakpoints.length; markerCount++) {
- if (!breakpoints[markerCount].isRegistered())
+ if (!breakpoints[markerCount].isRegistered()) {
break;
+ }
markers[markerCount]= breakpoints[markerCount].getMarker();
- if (markers[markerCount] == null)
+ if (markers[markerCount] == null) {
break;
+ }
}
// We only offer undo support if all breakpoints are registered and have associated markers
@@ -300,15 +302,18 @@ public class DebugUITools {
if (allowUndo) {
- for (int i= 0; i < markers.length; i++)
+ for (int i= 0; i < markers.length; i++) {
markers[i].setAttribute(DebugPlugin.ATTR_BREAKPOINT_IS_DELETED, true);
+ }
IAdaptable context= null;
if (shell != null) {
context= new IAdaptable() {
+ @Override
public Object getAdapter(Class adapter) {
- if (adapter == Shell.class)
+ if (adapter == Shell.class) {
return shell;
+ }
return null;
}
};
@@ -506,6 +511,7 @@ public class DebugUITools {
* to specify the launch group that the dialog should be opened on. This method will open
* on the launch group with the specified mode and a <code>null</code> category
*/
+ @Deprecated
public static int openLaunchConfigurationDialog(Shell shell, IStructuredSelection selection, String mode) {
ILaunchGroup[] groups = getLaunchGroups();
for (int i = 0; i < groups.length; i++) {
@@ -585,6 +591,7 @@ public class DebugUITools {
/**
* @see java.lang.Runnable#run()
*/
+ @Override
public void run() {
LaunchConfigurationsDialog dialog = (LaunchConfigurationsDialog) LaunchConfigurationsDialog.getCurrentlyVisibleLaunchConfigurationDialog();
if (dialog != null) {
@@ -711,6 +718,7 @@ public class DebugUITools {
* @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
* of resources that are only involved in the current launch, no longer the entire workspace
*/
+ @Deprecated
public static boolean saveAndBuildBeforeLaunch() {
return DebugUIPlugin.saveAndBuild();
}
@@ -732,6 +740,7 @@ public class DebugUITools {
* @deprecated Saving has been moved to the launch delegate <code>LaunchConfigurationDelegate</code> to allow for scoped saving
* of resources that are only involved in the current launch, no longer the entire workspace
*/
+ @Deprecated
public static boolean saveBeforeLaunch() {
return DebugUIPlugin.preLaunchSave();
}
@@ -811,7 +820,7 @@ public class DebugUITools {
*
* @since 3.3
*/
- public static String getLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes) {
+ public static String getLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes) {
return DebugUIPlugin.getDefault().getPerspectiveManager().getLaunchPerspective(type, modes, delegate);
}
@@ -849,7 +858,7 @@ public class DebugUITools {
*
* @since 3.3
*/
- public static void setLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set modes, String perspectiveid) {
+ public static void setLaunchPerspective(ILaunchConfigurationType type, ILaunchDelegate delegate, Set<String> modes, String perspectiveid) {
DebugUIPlugin.getDefault().getPerspectiveManager().setLaunchPerspective(type, modes, delegate, perspectiveid);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
index c3083bf8b..393cdfab6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/DeferredDebugElementWorkbenchAdapter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@ import org.eclipse.ui.progress.IElementCollector;
* {@link IDeferredWorkbenchAdapter}. Deferred custom content is currently supported
* by a provisional internal viewer framework.
*/
+@Deprecated
public abstract class DeferredDebugElementWorkbenchAdapter extends DebugElementWorkbenchAdapter implements IDeferredWorkbenchAdapter {
/**
@@ -40,20 +41,23 @@ public abstract class DeferredDebugElementWorkbenchAdapter extends DebugElementW
/* (non-Javadoc)
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#isContainer()
*/
- public boolean isContainer() {
+ @Override
+ public boolean isContainer() {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#getRule(java.lang.Object)
*/
- public ISchedulingRule getRule(Object object) {
+ @Override
+ public ISchedulingRule getRule(Object object) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.ui.progress.IDeferredWorkbenchAdapter#fetchDeferredChildren(java.lang.Object, org.eclipse.ui.progress.IElementCollector, org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void fetchDeferredChildren(Object object, IElementCollector collector, IProgressMonitor monitor) {
if (monitor.isCanceled()) {
return;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
index eb748fa2b..6f312f47c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/EnvironmentTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 Keith Seitz and others.
+ * Copyright (c) 2000, 2013 Keith Seitz and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@ import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.TreeMap;
import org.eclipse.core.runtime.CoreException;
@@ -108,12 +109,13 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* Content provider for the environment table
*/
protected class EnvironmentVariableContentProvider implements IStructuredContentProvider {
+ @Override
public Object[] getElements(Object inputElement) {
EnvironmentVariable[] elements = new EnvironmentVariable[0];
ILaunchConfiguration config = (ILaunchConfiguration) inputElement;
- Map m;
+ Map<String, String> m;
try {
- m = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
+ m = config.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map<String, String>) null);
} catch (CoreException e) {
DebugUIPlugin.log(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), IStatus.ERROR, "Error reading configuration", e)); //$NON-NLS-1$
return elements;
@@ -123,13 +125,15 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
String[] varNames = new String[m.size()];
m.keySet().toArray(varNames);
for (int i = 0; i < m.size(); i++) {
- elements[i] = new EnvironmentVariable(varNames[i], (String) m.get(varNames[i]));
+ elements[i] = new EnvironmentVariable(varNames[i], m.get(varNames[i]));
}
}
return elements;
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput == null){
return;
@@ -140,6 +144,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
return;
}
tableViewer.setComparator(new ViewerComparator() {
+ @Override
public int compare(Viewer iviewer, Object e1, Object e2) {
if (e1 == null) {
return -1;
@@ -158,6 +163,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* Label provider for the environment table
*/
public class EnvironmentVariableLabelProvider extends LabelProvider implements ITableLabelProvider {
+ @Override
public String getColumnText(Object element, int columnIndex) {
String result = null;
if (element != null) {
@@ -169,10 +175,13 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
case 1: // value
result = var.getValue();
break;
+ default:
+ break;
}
}
return result;
}
+ @Override
public Image getColumnImage(Object element, int columnIndex) {
if (columnIndex == 0) {
return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENV_VAR);
@@ -191,6 +200,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
// Create main composite
Composite mainComposite = SWTFactory.createComposite(parent, 2, 1, GridData.FILL_HORIZONTAL);
@@ -214,6 +224,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
Composite comp = SWTFactory.createComposite(parent, 1, 2, GridData.FILL_HORIZONTAL);
appendEnvironment= createRadioButton(comp, LaunchConfigurationsMessages.EnvironmentTab_16);
appendEnvironment.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
@@ -254,11 +265,13 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
environmentTable.setLabelProvider(new EnvironmentVariableLabelProvider());
environmentTable.setColumnProperties(new String[] {P_VARIABLE, P_VALUE});
environmentTable.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
handleTableSelectionChanged(event);
}
});
environmentTable.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
if (!environmentTable.getSelection().isEmpty()) {
handleEnvEditButtonSelected();
@@ -273,6 +286,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
final Table tref = table;
final Composite comp = tableComposite;
tableComposite.addControlListener(new ControlAdapter() {
+ @Override
public void controlResized(ControlEvent e) {
Rectangle area = comp.getClientArea();
Point size = tref.computeSize(SWT.DEFAULT, SWT.DEFAULT);
@@ -317,18 +331,21 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
// Create buttons
envAddButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_New_4, null);
envAddButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
handleEnvAddButtonSelected();
}
});
envSelectButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_18, null);
envSelectButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
handleEnvSelectButtonSelected();
}
});
envEditButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_Edit_5, null);
envEditButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
handleEnvEditButtonSelected();
}
@@ -336,6 +353,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
envEditButton.setEnabled(false);
envRemoveButton = createPushButton(buttonComposite, LaunchConfigurationsMessages.EnvironmentTab_Remove_6, null);
envRemoveButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
handleEnvRemoveButtonSelected();
}
@@ -377,7 +395,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
for (int i = 0; i < items.length; i++) {
EnvironmentVariable existingVariable = (EnvironmentVariable) items[i].getData();
if (existingVariable.getName().equals(name)) {
- boolean overWrite= MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_13, new String[] {name})); //
+ boolean overWrite = MessageDialog.openQuestion(getShell(), LaunchConfigurationsMessages.EnvironmentTab_12, MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_13, new Object[] { name })); //
if (!overWrite) {
return false;
}
@@ -396,7 +414,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
*/
private void handleEnvSelectButtonSelected() {
//get Environment Variables from the OS
- Map envVariables = getNativeEnvironment();
+ Map<String, EnvironmentVariable> envVariables = getNativeEnvironment();
//get Environment Variables from the table
TableItem[] items = environmentTable.getTable().getItems();
@@ -424,13 +442,11 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* Gets native environment variable from the LaunchManager. Creates EnvironmentVariable objects.
* @return Map of name - EnvironmentVariable pairs based on native environment.
*/
- private Map getNativeEnvironment() {
- Map stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
- HashMap vars = new HashMap();
- for (Iterator i = stringVars.keySet().iterator(); i.hasNext(); ) {
- String key = (String) i.next();
- String value = (String) stringVars.get(key);
- vars.put(key, new EnvironmentVariable(key, value));
+ private Map<String, EnvironmentVariable> getNativeEnvironment() {
+ Map<String, String> stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironmentCasePreserved();
+ HashMap<String, EnvironmentVariable> vars = new HashMap<String, EnvironmentVariable>();
+ for (Entry<String, String> entry : stringVars.entrySet()) {
+ vars.put(entry.getKey(), new EnvironmentVariable(entry.getKey(), entry.getValue()));
}
return vars;
}
@@ -476,12 +492,15 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
*/
private void handleEnvRemoveButtonSelected() {
IStructuredSelection sel = (IStructuredSelection) environmentTable.getSelection();
- environmentTable.getControl().setRedraw(false);
- for (Iterator i = sel.iterator(); i.hasNext(); ) {
- EnvironmentVariable var = (EnvironmentVariable) i.next();
- environmentTable.remove(var);
+ try {
+ environmentTable.getControl().setRedraw(false);
+ for (Iterator<?> i = sel.iterator(); i.hasNext();) {
+ EnvironmentVariable var = (EnvironmentVariable) i.next();
+ environmentTable.remove(var);
+ }
+ } finally {
+ environmentTable.getControl().setRedraw(true);
}
- environmentTable.getControl().setRedraw(true);
updateAppendReplace();
updateLaunchConfigurationDialog();
}
@@ -497,6 +516,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.removeAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES);
}
@@ -504,6 +524,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
boolean append= true;
try {
@@ -526,18 +547,18 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
* Stores the environment in the given configuration
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
// Convert the table's items into a Map so that this can be saved in the
// configuration's attributes.
TableItem[] items = environmentTable.getTable().getItems();
- Map map = new HashMap(items.length);
- for (int i = 0; i < items.length; i++)
- {
+ Map<String, String> map = new HashMap<String, String>(items.length);
+ for (int i = 0; i < items.length; i++) {
EnvironmentVariable var = (EnvironmentVariable) items[i].getData();
map.put(var.getName(), var.getValue());
}
if (map.size() == 0) {
- configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map) null);
+ configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, (Map<String, String>) null);
} else {
configuration.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map);
}
@@ -566,6 +587,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return LaunchConfigurationsMessages.EnvironmentTab_Environment_7;
}
@@ -575,6 +597,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
*
* @since 3.3
*/
+ @Override
public String getId() {
return "org.eclipse.debug.ui.environmentTab"; //$NON-NLS-1$
}
@@ -582,6 +605,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
}
@@ -589,6 +613,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when activated
}
@@ -596,6 +621,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing when deactivated
}
@@ -617,6 +643,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
+ @Override
protected String getDialogSettingsId() {
return IDebugUIConstants.PLUGIN_ID + ".ENVIRONMENT_TAB.NATIVE_ENVIROMENT_DIALOG"; //$NON-NLS-1$
}
@@ -624,6 +651,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
*/
+ @Override
protected String getHelpContextId() {
return IDebugHelpContextIds.SELECT_NATIVE_ENVIRONMENT_DIALOG;
}
@@ -631,6 +659,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
+ @Override
protected Object getViewerInput() {
return fInput;
}
@@ -638,6 +667,7 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerLabel()
*/
+ @Override
protected String getViewerLabel() {
return LaunchConfigurationsMessages.EnvironmentTab_19;
}
@@ -645,22 +675,30 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getLabelProvider()
*/
+ @Override
protected IBaseLabelProvider getLabelProvider() {
return new ILabelProvider() {
+ @Override
public Image getImage(Object element) {
return DebugPluginImages.getImage(IDebugUIConstants.IMG_OBJS_ENVIRONMENT);
}
+ @Override
public String getText(Object element) {
EnvironmentVariable var = (EnvironmentVariable) element;
- return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7, new String[] {var.getName(), var.getValue()});
+ return MessageFormat.format(LaunchConfigurationsMessages.EnvironmentTab_7, new Object[] {
+ var.getName(), var.getValue() });
}
+ @Override
public void addListener(ILabelProviderListener listener) {
}
+ @Override
public void dispose() {
}
+ @Override
public boolean isLabelProperty(Object element, String property) {
return false;
}
+ @Override
public void removeListener(ILabelProviderListener listener) {
}
};
@@ -669,31 +707,36 @@ public class EnvironmentTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getContentProvider()
*/
+ @Override
protected IContentProvider getContentProvider() {
return new IStructuredContentProvider() {
+ @Override
public Object[] getElements(Object inputElement) {
EnvironmentVariable[] elements = null;
if (inputElement instanceof HashMap) {
- Comparator comparator = new Comparator() {
+ Comparator<Object> comparator = new Comparator<Object>() {
+ @Override
public int compare(Object o1, Object o2) {
- String s1 = (String)o1;
- String s2 = (String)o2;
+ String s1 = (String) o1;
+ String s2 = (String) o2;
return s1.compareTo(s2);
}
};
- TreeMap envVars = new TreeMap(comparator);
- envVars.putAll((Map)inputElement);
+ TreeMap<Object, Object> envVars = new TreeMap<Object, Object>(comparator);
+ envVars.putAll((Map<?, ?>) inputElement);
elements = new EnvironmentVariable[envVars.size()];
int index = 0;
- for (Iterator iterator = envVars.keySet().iterator(); iterator.hasNext(); index++) {
+ for (Iterator<Object> iterator = envVars.keySet().iterator(); iterator.hasNext(); index++) {
Object key = iterator.next();
elements[index] = (EnvironmentVariable) envVars.get(key);
}
}
return elements;
}
+ @Override
public void dispose() {
}
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
index cdcbc3c5f..3477185c4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugModelPresentation.java
@@ -111,6 +111,7 @@ public interface IDebugModelPresentation extends ILabelProvider, ISourcePresenta
* image should be used
* @see ILabelProvider
*/
+ @Override
public Image getImage(Object element);
/**
* Returns a label for the element, or <code>null</code> if a default
@@ -121,6 +122,7 @@ public interface IDebugModelPresentation extends ILabelProvider, ISourcePresenta
* label should be used
* @see ILabelProvider
*/
+ @Override
public String getText(Object element);
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
index 6dff487e1..59913787e 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
@@ -194,6 +194,7 @@ public interface IDebugUIConstants {
* @since 2.0
* @deprecated no longer used
*/
+ @Deprecated
public static final String PREF_SHOW_TYPE_NAMES = PLUGIN_ID + ".show_type_names"; //$NON-NLS-1$
/**
@@ -204,6 +205,7 @@ public interface IDebugUIConstants {
* @since 2.0
* @deprecated no longer used
*/
+ @Deprecated
public static final String PREF_SHOW_DETAIL_PANE = PLUGIN_ID + ".show_detail_pane"; //$NON-NLS-1$
/**
@@ -289,6 +291,7 @@ public interface IDebugUIConstants {
* @deprecated Use org.eclipse.ui.console.IConsoleConstants.ID_CONSOLE_VIEW
* @since 3.0
*/
+ @Deprecated
public static final String ID_CONSOLE_VIEW= "org.eclipse.debug.ui.ConsoleView"; //$NON-NLS-1$
// Console stream identifiers
@@ -337,6 +340,7 @@ public interface IDebugUIConstants {
/** Clear action image identifier.
* @deprecated use the platform shared image for clear - {@link ISharedImages#IMG_ETOOL_CLEAR}*/
+ @Deprecated
public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
/** Display variable type names action image identifier. */
@@ -854,6 +858,7 @@ public interface IDebugUIConstants {
* @deprecated Since 3.0, this launch configuration attribute is no longer supported.
* Use <code>DebugUITools.setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective)</code>.
*/
+ @Deprecated
public static final String ATTR_TARGET_RUN_PERSPECTIVE = PLUGIN_ID + ".target_run_perspective"; //$NON-NLS-1$
/**
@@ -867,6 +872,7 @@ public interface IDebugUIConstants {
* @deprecated Since 3.0, this launch configuration attribute is no longer supported.
* Use <code>DebugUITools.setLaunchPerspective(ILaunchConfigurationType type, String mode, String perspective)</code>.
*/
+ @Deprecated
public static final String ATTR_TARGET_DEBUG_PERSPECTIVE = PLUGIN_ID + ".target_debug_perspective"; //$NON-NLS-1$
/**
@@ -896,6 +902,7 @@ public interface IDebugUIConstants {
* @since 2.0
* @deprecated use <code>ATTR_FAVORITE_GROUPS</code> instead
*/
+ @Deprecated
public static final String ATTR_DEBUG_FAVORITE = PLUGIN_ID + ".debugFavorite"; //$NON-NLS-1$
/**
@@ -906,6 +913,7 @@ public interface IDebugUIConstants {
* @since 2.0
* @deprecated use <code>ATTR_FAVORITE_GROUPS</code> instead
*/
+ @Deprecated
public static final String ATTR_RUN_FAVORITE = PLUGIN_ID + ".runFavorite"; //$NON-NLS-1$
/**
@@ -941,6 +949,7 @@ public interface IDebugUIConstants {
* @since 3.1
* @deprecated in 3.3 Please use DebugPlugin.ATTR_CONSOLE_ENCODING instead.
*/
+ @Deprecated
public static final String ATTR_CONSOLE_ENCODING = DebugPlugin.ATTR_CONSOLE_ENCODING;
/**
@@ -986,6 +995,7 @@ public interface IDebugUIConstants {
* @deprecated The Debug Action Groups extension point no longer exists. Product
* vendors should use Activities instead.
*/
+ @Deprecated
public static final String EXTENSION_POINT_DEBUG_ACTION_GROUPS= "debugActionGroups"; //$NON-NLS-1$
/**
@@ -1074,7 +1084,8 @@ public interface IDebugUIConstants {
* @since 3.1
* @deprecated As of release 3.4, replaced by {@link #EXTENSION_POINT_MEMORY_RENDERINGS}
*/
- public static final String EXTENSION_POINT_MEMORY_RENDERIGNS = "memoryRenderings"; //$NON-NLS-1$
+ @Deprecated
+ public static final String EXTENSION_POINT_MEMORY_RENDERIGNS = "memoryRenderings"; //$NON-NLS-1$
/**
* Memory renderings extension point identifier (value
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
index da04b4d78..d6e6b6b45 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -173,5 +173,6 @@ public interface IDebugView extends IViewPart {
* @return the context menu manager for this view, or <code>null</code> if none
* @deprecated See AbstractDebugView#getContextMenuManagers()
*/
+ @Deprecated
public IMenuManager getContextMenuManager();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
index 2dbfdfbdd..c92e41e32 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDetailPaneFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -45,7 +45,7 @@ public interface IDetailPaneFactory {
* @param selection The current selection
* @return Set of String IDs for possible detail pane types, possibly empty
*/
- public Set getDetailPaneTypes(IStructuredSelection selection);
+ public Set<String> getDetailPaneTypes(IStructuredSelection selection);
/**
* Returns the identifier of the default detail pane type to use for the given
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
index e279452ee..8505b0344 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -35,6 +35,7 @@ public interface ILaunchConfigurationDialog extends IRunnableContext {
* @deprecated the launch dialog no longer supports launching without
* opening - this constant will never be returned by the dialog
*/
+ @Deprecated
public static final int LAUNCHED_BEFORE_OPENING = 2;
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
index e7256f5bc..e13d55995 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -201,6 +201,7 @@ public interface ILaunchConfigurationTab {
* than the launch dialog, this method cannot be relied upon for launching
* functionality.
*/
+ @Deprecated
public void launched(ILaunch launch);
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
index 1f4f117a2..340629abe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/ILaunchConfigurationTabGroup.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -153,6 +153,7 @@ public interface ILaunchConfigurationTabGroup {
* than the launch dialog, this method cannot be relied upon for launching
* functionality.
*/
+ @Deprecated
public void launched(ILaunch launch);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
index c0c71c341..0531e322f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/InspectPopupDialog.java
@@ -94,7 +94,8 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.DebugPopup#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
- protected Control createDialogArea(Composite parent) {
+ @Override
+ protected Control createDialogArea(Composite parent) {
Composite composite = new Composite(parent, parent.getStyle());
GridLayout layout = new GridLayout();
composite.setLayout(layout);
@@ -125,10 +126,12 @@ public class InspectPopupDialog extends DebugPopup {
fTree = fViewer.getTree();
fTree.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
fDetailPane.display((IStructuredSelection)fViewer.getSelection());
}
- public void widgetDefaultSelected(SelectionEvent e) {}
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {}
});
initSashWeights();
@@ -147,12 +150,16 @@ public class InspectPopupDialog extends DebugPopup {
TreeRoot treeRoot = new TreeRoot();
// add update listener to auto-select and display details of root expression
fViewer.addViewerUpdateListener(new IViewerUpdateListener() {
+ @Override
public void viewerUpdatesComplete() {
}
+ @Override
public void viewerUpdatesBegin() {
}
+ @Override
public void updateStarted(IViewerUpdate update) {
}
+ @Override
public void updateComplete(IViewerUpdate update) {
if (update instanceof IChildrenUpdate) {
TreeSelection selection = new TreeSelection(new TreePath(new Object[]{fExpression}));
@@ -191,7 +198,8 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#saveDialogBounds(org.eclipse.swt.widgets.Shell)
*/
- protected void saveDialogBounds(Shell shell) {
+ @Override
+ protected void saveDialogBounds(Shell shell) {
super.saveDialogBounds(shell);
if (fSashForm != null && !fSashForm.isDisposed()){
int[] weights = fSashForm.getWeights();
@@ -219,12 +227,14 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildCount(java.lang.Object, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected int getChildCount(Object element, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return 1;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#getChildren(java.lang.Object, int, int, org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext)
*/
+ @Override
protected Object[] getChildren(Object parent, int index, int length, IPresentationContext context, IViewerUpdate monitor) throws CoreException {
return new Object[] { fExpression };
}
@@ -232,6 +242,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.elements.ElementContentProvider#supportsContextId(java.lang.String)
*/
+ @Override
protected boolean supportsContextId(String id) {
return true;
}
@@ -261,7 +272,8 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.DebugPopup#close()
*/
- public boolean close() {
+ @Override
+ public boolean close() {
if (!wasPersisted()) {
fExpression.dispose();
}
@@ -273,14 +285,16 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.DebugPopup#getActionText()
*/
- protected String getActionText() {
+ @Override
+ protected String getActionText() {
return DebugUIViewsMessages.InspectPopupDialog_0;
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.DebugPopup#persist()
*/
- protected void persist() {
+ @Override
+ protected void persist() {
super.persist();
DebugPlugin.getDefault().getExpressionManager().addExpression(fExpression);
@@ -300,7 +314,8 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#getInitialSize()
*/
- protected Point getInitialSize() {
+ @Override
+ protected Point getInitialSize() {
Point initialSize = super.getInitialSize();
initialSize.x = Math.max(initialSize.x, MIN_WIDTH);
initialSize.y = Math.max(initialSize.y, MIN_HEIGHT);
@@ -310,8 +325,9 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.PopupDialog#getBackgroundColorExclusions()
*/
- protected List getBackgroundColorExclusions() {
- List list = super.getBackgroundColorExclusions();
+ @Override
+ protected List<Control> getBackgroundColorExclusions() {
+ List<Control> list = super.getBackgroundColorExclusions();
list.add(fSashForm);
return list;
}
@@ -325,6 +341,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentPaneID()
*/
+ @Override
public String getCurrentPaneID() {
return fDetailPane.getCurrentPaneID();
}
@@ -332,6 +349,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getCurrentSelection()
*/
+ @Override
public IStructuredSelection getCurrentSelection() {
return (IStructuredSelection)fViewer.getSelection();
}
@@ -339,6 +357,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#refreshDetailPaneContents()
*/
+ @Override
public void refreshDetailPaneContents() {
fDetailPane.display(getCurrentSelection());
}
@@ -346,6 +365,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getParentComposite()
*/
+ @Override
public Composite getParentComposite() {
return fDetailPaneComposite;
}
@@ -353,6 +373,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#getWorkbenchPartSite()
*/
+ @Override
public IWorkbenchPartSite getWorkbenchPartSite() {
return null;
}
@@ -360,6 +381,7 @@ public class InspectPopupDialog extends DebugPopup {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.views.variables.details.IDetailPaneContainer#paneChanged(java.lang.String)
*/
+ @Override
public void paneChanged(String newPaneID) {
if (newPaneID.equals(DefaultDetailPane.ID)){
Display display = getShell().getDisplay();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
index a816dc8f2..3f7c9bff8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/RefreshTab.java
@@ -99,6 +99,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite mainComposite = new Composite(parent, SWT.NONE);
setControl(mainComposite);
@@ -112,6 +113,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
fRefreshButton = createCheckButton(mainComposite, StringSubstitutionMessages.RefreshTab_31);
fRefreshButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateEnabledState();
updateLaunchConfigurationDialog();
@@ -129,6 +131,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
fGroup.setLayoutData(gd);
SelectionAdapter adapter = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (((Button)e.getSource()).getSelection()) {
updateEnabledState();
@@ -171,6 +174,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
gd = (GridData)fSelectButton.getLayoutData();
gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
fSelectButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
selectResources();
}
@@ -212,6 +216,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
data.horizontalSpan = 2;
fRecursiveButton.setLayoutData(data);
fRecursiveButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
@@ -221,12 +226,14 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
}
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
updateRefresh(configuration);
updateRecursive(configuration);
@@ -307,6 +314,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
if (fRefreshButton.getSelection()) {
String scope = generateScopeMemento();
@@ -347,6 +355,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return StringSubstitutionMessages.RefreshTab_6;
}
@@ -372,10 +381,12 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_OBJS_REFRESH_TAB);
}
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
@@ -477,6 +488,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing on activation
}
@@ -484,6 +496,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing on deactivation
}
@@ -493,6 +506,7 @@ public class RefreshTab extends AbstractLaunchConfigurationTab {
*
* @since 3.5
*/
+ @Override
public String getId() {
return "org.eclipse.debug.ui.refreshTab"; //$NON-NLS-1$
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
index 1065f1769..6cb8e7aab 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/StringVariableSelectionDialog.java
@@ -22,10 +22,10 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.debug.internal.ui.preferences.StringVariablePreferencePage;
-import org.eclipse.debug.ui.stringsubstitution.IArgumentSelector;
import org.eclipse.debug.internal.ui.stringsubstitution.StringSubstitutionMessages;
import org.eclipse.debug.internal.ui.stringsubstitution.StringVariableLabelProvider;
import org.eclipse.debug.internal.ui.stringsubstitution.StringVariablePresentationManager;
+import org.eclipse.debug.ui.stringsubstitution.IArgumentSelector;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.preference.IPreferenceNode;
import org.eclipse.jface.preference.PreferenceDialog;
@@ -87,7 +87,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
}
//no filtering by default
- private ArrayList fFilters = new ArrayList();
+ private ArrayList<VariableFilter> fFilters = new ArrayList<VariableFilter>();
//when filtering is on, do not show all by default
private boolean fShowAllSelected = false;
@@ -160,9 +160,11 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
private void updateElements() {
final Display display = DebugUIPlugin.getStandardDisplay();
BusyIndicator.showWhile(display, new Runnable() {
+ @Override
public void run() {
final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager().getVariables();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
setListElements(elements);
}
@@ -181,15 +183,16 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
}
}
+ @Override
protected void setListElements(Object[] elements) {
- ArrayList filtered = new ArrayList();
+ ArrayList<Object> filtered = new ArrayList<Object>();
filtered.addAll(Arrays.asList(elements));
if(!fFilters.isEmpty() && !fShowAllSelected) {
for (int i = 0; i < elements.length; i++) {
if(elements[i] instanceof IDynamicVariable) {
boolean bFiltered = false;
for (int j = 0; (j < fFilters.size()) && !bFiltered; j++) {
- VariableFilter filter = (VariableFilter)fFilters.get(j);
+ VariableFilter filter = fFilters.get(j);
if(filter.isFiltered((IDynamicVariable)elements[i])) {
filtered.remove(elements[i]);
bFiltered = true;
@@ -204,6 +207,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
Control ctrl = super.createContents(parent);
PlatformUI.getWorkbench().getHelpSystem().setHelp(ctrl, IDebugHelpContextIds.VARIABLE_SELECTION_DIALOG);
@@ -213,6 +217,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
Control control = super.createDialogArea(parent);
createArgumentArea((Composite)control);
@@ -235,7 +240,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
for (int i = 0;(i < elements.length) && !bNeedShowAll; i++) {
if(elements[i] instanceof IDynamicVariable) {
for (int j = 0; (j < fFilters.size()) && !bNeedShowAll; j++) {
- VariableFilter filter = (VariableFilter)fFilters.get(j);
+ VariableFilter filter = fFilters.get(j);
if(filter.isFiltered((IDynamicVariable)elements[i])) {
bNeedShowAll = true;
}
@@ -248,6 +253,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
updateDescription();
fShowAllButton = SWTFactory.createCheckButton(btnContainer, StringSubstitutionMessages.StringVariableSelectionDialog_9, null, fShowAllSelected, 1);
fShowAllButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
fShowAllSelected = fShowAllButton.getSelection();
updateDescription();
@@ -262,6 +268,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
Button editButton = SWTFactory.createPushButton(btnContainer, StringSubstitutionMessages.StringVariableSelectionDialog_0, null, GridData.HORIZONTAL_ALIGN_END);
editButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
editVariables();
}
@@ -277,6 +284,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
fArgumentButton = SWTFactory.createPushButton(args, StringSubstitutionMessages.StringVariableSelectionDialog_7, null);
fArgumentButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
configureArgument();
}
@@ -299,12 +307,14 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
protected void editVariables() {
final Display display = DebugUIPlugin.getStandardDisplay();
BusyIndicator.showWhile(display, new Runnable() {
+ @Override
public void run() {
// show the preference page in a new dialog rather than using the utility method to re-use a
// preference page, in case this dialog is being opened from a preference page
if (showVariablesPage()) {
final IStringVariable[] elements = VariablesPlugin.getDefault().getStringVariableManager().getVariables();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
setListElements(elements);
}
@@ -328,6 +338,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
final PreferenceDialog dialog = new PreferenceDialog(DebugUIPlugin.getShell(), manager);
final boolean [] result = new boolean[] { false };
BusyIndicator.showWhile(DebugUIPlugin.getStandardDisplay(), new Runnable() {
+ @Override
public void run() {
dialog.create();
dialog.setMessage(targetNode.getLabelText());
@@ -355,6 +366,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
*
* @see org.eclipse.ui.dialogs.AbstractElementListSelectionDialog#handleSelectionChanged()
*/
+ @Override
protected void handleSelectionChanged() {
super.handleSelectionChanged();
Object[] objects = getSelectedElements();
@@ -381,6 +393,7 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
fArgumentValue = fArgumentText.getText().trim();
super.okPressed();
@@ -398,7 +411,8 @@ public class StringVariableSelectionDialog extends ElementListSelectionDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getDialogSettingsSectionName());
if (section == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
index 7eb6c942d..6ec72b8de 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/WorkingDirectoryBlock.java
@@ -74,9 +74,11 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
* A listener to update for text changes and widget selection
*/
private class WidgetListener extends SelectionAdapter implements ModifyListener {
+ @Override
public void modifyText(ModifyEvent e) {
scheduleUpdateJob();
}
+ @Override
public void widgetSelected(SelectionEvent e) {
Object source= e.getSource();
if (source == fWorkspaceButton) {
@@ -142,6 +144,7 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public final void createControl(Composite parent) {
Font font = parent.getFont();
Group group = SWTFactory.createGroup(parent, DebugUIMessages.WorkingDirectoryBlock_12, 2, 1, GridData.FILL_HORIZONTAL);
@@ -315,6 +318,7 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration config) {
setErrorMessage(null);
setMessage(null);
@@ -353,6 +357,7 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
*
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
config.setAttribute(workingDirectoryAttribteName, (String)null);
}
@@ -360,6 +365,7 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
setLaunchConfiguration(configuration);
try {
@@ -377,6 +383,7 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
if(fUseDefaultDirButton.getSelection()) {
configuration.setAttribute(workingDirectoryAttribteName, (String)null);
@@ -389,6 +396,7 @@ public abstract class WorkingDirectoryBlock extends AbstractLaunchConfigurationT
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return DebugUIMessages.WorkingDirectoryBlock_Working_Directory_8;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
index ae21582b3..4ec985181 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -106,9 +106,11 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
* @since 3.3
*/
private ILaunchLabelChangedListener fLabelListener = new ILaunchLabelChangedListener() {
+ @Override
public ILaunchGroup getLaunchGroup() {
return fLaunchGroup;
}
+ @Override
public void labelChanged() {
updateTooltip();
}
@@ -215,7 +217,8 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
} else {
label= ActionMessages.AbstractLaunchHistoryAction_4;
}
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
+ return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new Object[] {
+ label, launchName });
}
/**
@@ -225,7 +228,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
* @return the string for the tool tip
*/
private String getToolTip() {
- String launchName = getLaunchingResourceManager().getLaunchLabel(fLaunchGroup);
+ String launchName = DebugUIPlugin.getDefault().getLaunchingResourceManager().getLaunchLabel(fLaunchGroup);
if(launchName == null) {
return DebugUIPlugin.removeAccelerators(internalGetHistory().getLaunchGroup().getLabel());
}
@@ -241,16 +244,18 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
label = ActionMessages.AbstractLaunchHistoryAction_4;
}
if(IInternalDebugCoreConstants.EMPTY_STRING.equals(launchName)) {
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_5, new String[] {label});
+ return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_5, new Object[] { label });
}
else {
- return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
+ return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new Object[] {
+ label, launchName });
}
}
/**
* @see ILaunchHistoryChangedListener#launchHistoryChanged()
*/
+ @Override
public void launchHistoryChanged() {
fRecreateMenu = true;
}
@@ -258,10 +263,11 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {
setMenu(null);
getLaunchConfigurationManager().removeLaunchHistoryListener(this);
- getLaunchingResourceManager().removeLaunchLabelChangedListener(fLabelListener);
+ DebugUIPlugin.getDefault().getLaunchingResourceManager().removeLaunchLabelChangedListener(fLabelListener);
}
/**
@@ -277,6 +283,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
/**
* @see org.eclipse.ui.IWorkbenchWindowPulldownDelegate#getMenu(org.eclipse.swt.widgets.Control)
*/
+ @Override
public Menu getMenu(Control parent) {
setMenu(new Menu(parent));
fillMenu(fMenu);
@@ -287,6 +294,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowPulldownDelegate2#getMenu(org.eclipse.swt.widgets.Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
setMenu(new Menu(parent));
fillMenu(fMenu);
@@ -301,6 +309,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
// Add listener to re-populate the menu each time
// it is shown because of dynamic history list
fMenu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
if (fRecreateMenu) {
Menu m = (Menu)e.widget;
@@ -378,6 +387,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
// do nothing - this is just a menu
}
@@ -386,6 +396,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
* @since 3.6
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
if(((event.stateMask & SWT.MOD1) > 0) && (event.type != SWT.KeyDown)) {
ILaunchConfiguration configuration = null;
@@ -395,7 +406,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
} else {
configuration = getLaunchConfigurationManager().getFilteredLastLaunch(groupid);
}
- ArrayList configs = new ArrayList(1);
+ ArrayList<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>(1);
if (configuration != null){
configs.add(configuration);
}
@@ -418,21 +429,16 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
private ILaunchConfiguration resolveContextConfiguration() {
SelectedResourceManager srm = SelectedResourceManager.getDefault();
IStructuredSelection selection = srm.getCurrentSelection();
- List shortcuts = null;
+ List<LaunchShortcutExtension> shortcuts = null;
IResource resource = srm.getSelectedResource();
- shortcuts = getLaunchingResourceManager().getShortcutsForSelection(
- selection,
- getMode());
+ LaunchingResourceManager lrm = DebugUIPlugin.getDefault().getLaunchingResourceManager();
+ shortcuts = lrm.getShortcutsForSelection(selection, getMode());
if(resource == null) {
- resource = getLaunchingResourceManager().getLaunchableResource(shortcuts, selection);
+ resource = lrm.getLaunchableResource(shortcuts, selection);
}
- List configs = getLaunchingResourceManager().getParticipatingLaunchConfigurations(
- selection,
- resource,
- shortcuts,
- getMode());
+ List<ILaunchConfiguration> configs = lrm.getParticipatingLaunchConfigurations(selection, resource, shortcuts, getMode());
if(configs.size() == 1) {
- return (ILaunchConfiguration) configs.get(0);
+ return configs.get(0);
} else if(configs.size() > 1) {
// launch most recently launched config
ILaunchConfiguration config = getLaunchConfigurationManager().getMRUConfiguration(configs, fLaunchGroup, resource);
@@ -455,7 +461,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
}
return null;
} else if(shortcuts.size() == 1) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) shortcuts.get(0);
+ LaunchShortcutExtension ext = shortcuts.get(0);
return createConfigurationFromTypes(ext.getAssociatedConfigurationTypes());
}
return getLaunchConfigurationManager().getFilteredLastLaunch(getLaunchGroupIdentifier());
@@ -467,7 +473,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
* @return a new {@link ILaunchConfiguration}
* @since 3.6
*/
- private ILaunchConfiguration createConfigurationFromTypes(Set types) {
+ private ILaunchConfiguration createConfigurationFromTypes(Set<String> types) {
//context launching always takes the first type, so we do that here as well
if(types != null && types.size() > 0) {
try {
@@ -486,6 +492,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
* @since 3.6
*/
+ @Override
public void init(IAction action) {
// do nothing by default
}
@@ -493,6 +500,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection){
if (fAction == null) {
initialize(action);
@@ -502,9 +510,10 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
if (this instanceof AbstractLaunchToolbarAction) {
- getLaunchingResourceManager().addLaunchLabelUpdateListener(fLabelListener);
+ DebugUIPlugin.getDefault().getLaunchingResourceManager().addLaunchLabelUpdateListener(fLabelListener);
}
}
@@ -516,6 +525,7 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
* for clients of the debug platform. Instead, use <code>getHistory()</code>,
* <code>getFavorites()</code>, and <code>getLastLaunch()</code>.
*/
+ @Deprecated
protected LaunchHistory getLaunchHistory() {
return getLaunchConfigurationManager().getLaunchHistory(getLaunchGroupIdentifier());
}
@@ -577,15 +587,6 @@ public abstract class AbstractLaunchHistoryAction implements IActionDelegate2, I
}
/**
- * Returns the <code>ContextualLaunchingResourceManager</code>
- *
- * @return <code>ContextualLaunchingResourceManager</code>
- */
- private LaunchingResourceManager getLaunchingResourceManager() {
- return DebugUIPlugin.getDefault().getLaunchingResourceManager();
- }
-
- /**
* Returns the identifier of the launch group this action is associated
* with.
*
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
index 78a5a0508..aed6e70ae 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchToolbarAction.java
@@ -49,6 +49,7 @@ public class AbstractLaunchToolbarAction extends AbstractLaunchHistoryAction {
*
* @param menu the menu to fill
*/
+ @Override
protected void fillMenu(Menu menu) {
super.fillMenu(menu);
// Separator between history and common actions
@@ -74,6 +75,7 @@ public class AbstractLaunchToolbarAction extends AbstractLaunchHistoryAction {
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
//always ignore external tools during context launching
if(LaunchingResourceManager.isContextLaunchEnabled(getLaunchGroupIdentifier())) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
index a8a447d3b..bd3ef6b95 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AddMemoryRenderingActionDelegate.java
@@ -81,6 +81,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
fRenderingType = renderingType;
}
+ @Override
public void runWithEvent(Event event) {
if (fActionDelegate != null)
{
@@ -96,17 +97,21 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
private class AddMemoryRenderingMenuCreator implements IMenuCreator
{
+ @Override
public void dispose() {
}
+ @Override
public Menu getMenu(Control parent) {
return null;
}
+ @Override
public Menu getMenu(Menu parent) {
Menu menu = new Menu(parent);
menu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
@@ -145,6 +150,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
updateAction(fAction, fCurrentSelection);
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
contextActivated(event.getContext());
}
@@ -202,6 +208,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
bindPart(view);
}
@@ -209,6 +216,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
// do nothing
}
@@ -216,6 +224,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
fCurrentSelection = selection;
@@ -271,6 +280,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
*/
+ @Override
public void setActiveEditor(IAction action, IEditorPart targetEditor) {
bindPart(targetEditor);
@@ -283,6 +293,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
bindPart(targetPart);
@@ -295,6 +306,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
if (action != null) {
bindAction(action);
@@ -309,6 +321,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
// remove as debug context listener
fAction = null;
@@ -323,6 +336,7 @@ public class AddMemoryRenderingActionDelegate extends Action implements IViewAct
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
// do nothing
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java
index b744b40d4..b11185ad2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/BreakpointTypesContribution.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems and others.
+ * Copyright (c) 2012, 2013 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
@@ -7,11 +7,11 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.ui.actions;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -68,15 +68,17 @@ import org.eclipse.ui.services.IServiceLocator;
public class BreakpointTypesContribution extends CompoundContributionItem implements IWorkbenchContribution {
private class SelectTargetAction extends Action {
- private final Set fPossibleIDs;
+ private final Set<String> fPossibleIDs;
private final String fID;
- SelectTargetAction(String name, Set possibleIDs, String ID) {
+
+ SelectTargetAction(String name, Set<String> possibleIDs, String ID) {
super(name, AS_RADIO_BUTTON);
fID = ID;
fPossibleIDs = possibleIDs;
}
- public void run() {
+ @Override
+ public void run() {
if (isChecked()) {
// Note: setPreferredTarget is not declared on the
// IToggleBreakpontsTargetManager interface.
@@ -89,12 +91,14 @@ public class BreakpointTypesContribution extends CompoundContributionItem implem
private static IContributionItem[] NO_BREAKPOINT_TYPES_CONTRIBUTION_ITEMS = new IContributionItem[] {
new ContributionItem() {
+ @Override
public void fill(Menu menu, int index) {
MenuItem item = new MenuItem(menu, SWT.NONE);
item.setEnabled(false);
item.setText(Messages.BreakpointTypesContribution_0);
}
+ @Override
public boolean isEnabled() {
return false;
}
@@ -104,7 +108,8 @@ public class BreakpointTypesContribution extends CompoundContributionItem implem
/* (non-Javadoc)
* @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
*/
- protected IContributionItem[] getContributionItems() {
+ @Override
+ protected IContributionItem[] getContributionItems() {
IWorkbenchPart part = null;
ISelection selection = null;
@@ -125,12 +130,11 @@ public class BreakpointTypesContribution extends CompoundContributionItem implem
// Get breakpoint toggle target IDs.
IToggleBreakpointsTargetManager manager = DebugUITools.getToggleBreakpointsTargetManager();
- Set enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(part, selection);
+ Set<String> enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(part, selection);
String preferredId = manager.getPreferredToggleBreakpointsTargetID(part, selection);
- List actions = new ArrayList(enabledIDs.size());
- for (Iterator i = enabledIDs.iterator(); i.hasNext();) {
- String id = (String) i.next();
+ List<Action> actions = new ArrayList<Action>(enabledIDs.size());
+ for (String id : enabledIDs) {
Action action = new SelectTargetAction(manager.getToggleBreakpointsTargetName(id), enabledIDs, id);
if (id.equals(preferredId)) {
action.setChecked(true);
@@ -144,7 +148,7 @@ public class BreakpointTypesContribution extends CompoundContributionItem implem
IContributionItem[] items = new IContributionItem[enabledIDs.size()];
for (int i = 0; i < actions.size(); i++) {
- items[i] = new ActionContributionItem((Action) actions.get(i));
+ items[i] = new ActionContributionItem(actions.get(i));
}
return items;
}
@@ -152,7 +156,8 @@ public class BreakpointTypesContribution extends CompoundContributionItem implem
/* (non-Javadoc)
* @see org.eclipse.ui.menus.IWorkbenchContribution#initialize(org.eclipse.ui.services.IServiceLocator)
*/
- public void initialize(IServiceLocator serviceLocator) {
+ @Override
+ public void initialize(IServiceLocator serviceLocator) {
fServiceLocator = serviceLocator;
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
index 429248693..61f658dba 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ContextualLaunchAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,7 +15,6 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
@@ -71,7 +70,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
// default launch group for this mode (null category)
private ILaunchGroup fGroup = null;
// map of launch groups by (non-null) categories, for this mode
- private Map fGroupsByCategory = null;
+ private Map<String, ILaunchGroup> fGroupsByCategory = null;
// whether to re-fill the menu (reset on selection change)
private boolean fFillMenu = true;
@@ -83,7 +82,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
public ContextualLaunchAction(String mode) {
fMode = mode;
ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
- fGroupsByCategory = new HashMap(3);
+ fGroupsByCategory = new HashMap<String, ILaunchGroup>(3);
for (int i = 0; i < groups.length; i++) {
ILaunchGroup group = groups[i];
if (group.getMode().equals(mode)) {
@@ -99,18 +98,21 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
/*
* @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
// We don't have a need for the active part.
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
// nothing to do
}
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
*/
+ @Override
public Menu getMenu(Control parent) {
// never called
return null;
@@ -118,6 +120,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
//Create the new menu. The menu will get filled when it is about to be shown. see fillMenu(Menu).
Menu menu = new Menu(parent);
@@ -127,6 +130,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
* doesn't dispose pull-down ActionContribution items for each popup menu.
*/
menu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
if (fFillMenu) {
Menu m = (Menu)e.widget;
@@ -145,6 +149,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
/*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
// Never called because we become a menu.
}
@@ -152,6 +157,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
/*
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
// if the selection is an IResource, save it and enable our action
if (selection instanceof IStructuredSelection) {
@@ -195,16 +201,7 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
}
catch (CoreException ce) {}
}
-
- List allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts();
- Iterator iter = allShortCuts.iterator();
- List filteredShortCuts = new ArrayList(10);
-
- //create a context
- List selection = ss.toList();
- //in 3.4 we are correctly passing the IEditorPart and ISelection, so we have to perform
- //some sneekyness to make sure the IEditorInput is passed to the eval expressions
- //for backwards compatibility
+ List<Object> selection = ss.toList();
Object o = ss.getFirstElement();
if(o instanceof IEditorPart) {
selection.set(0, ((IEditorPart)o).getEditorInput());
@@ -212,8 +209,11 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
IEvaluationContext context = DebugUIPlugin.createEvaluationContext(selection);
context.setAllowPluginActivation(true);
context.addVariable("selection", selection); //$NON-NLS-1$
+ List<LaunchShortcutExtension> allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts();
+ List<LaunchShortcutExtension> filteredShortCuts = new ArrayList<LaunchShortcutExtension>();
+ Iterator<LaunchShortcutExtension> iter = allShortCuts.iterator();
while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
+ LaunchShortcutExtension ext = iter.next();
try {
if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
filteredShortCuts.add(ext);
@@ -225,19 +225,14 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
iter.remove();
}
}
- iter = filteredShortCuts.iterator();
//we need a separator iff the shared config entry has been added and there are following shortcuts
if(menu.getItemCount() > 0 && filteredShortCuts.size() > 0) {
new MenuItem(menu, SWT.SEPARATOR);
}
- List categories = new ArrayList();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- Set modes = ext.getModes(); // supported launch modes
- Iterator modeIter = modes.iterator();
- while (modeIter.hasNext()) {
- String mode = (String) modeIter.next();
+ List<String> categories = new ArrayList<String>();
+ for(LaunchShortcutExtension ext : filteredShortCuts) {
+ for(String mode : ext.getModes()) {
if (mode.equals(fMode)) {
String category = ext.getCategory();
// NOTE: category can be null
@@ -259,13 +254,10 @@ public abstract class ContextualLaunchAction implements IObjectActionDelegate, I
item.fill(menu, -1);
} else {
boolean addedSep = false;
- iter = categories.iterator();
- while (iter.hasNext()) {
- // NOTE: category can be null
- String category = (String) iter.next();
+ for (String category : categories) {
ILaunchGroup group = fGroup;
if (category != null) {
- group = (ILaunchGroup) fGroupsByCategory.get(category);
+ group = fGroupsByCategory.get(category);
}
if (group != null) {
if (accelerator > 1 && !addedSep) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
index 3423222e1..163b2cbd8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugAction.java
@@ -33,6 +33,7 @@ public final class DebugAction extends ExecutionAction {
/**
* @see ExecutionAction#getMode()
*/
+ @Override
protected String getMode() {
return ILaunchManager.DEBUG_MODE;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
index e69e1829d..33267b8b1 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -80,7 +80,8 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
private IAction fAction;
private IEnabledTarget fEnabledTarget = new IEnabledTarget() {
- public void setEnabled(boolean enabled) {
+ @Override
+ public void setEnabled(boolean enabled) {
DebugCommandAction.this.setEnabled(enabled);
}
};
@@ -91,8 +92,9 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
public DebugCommandAction() {
super();
String helpContextId = getHelpContextId();
- if (helpContextId != null)
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, helpContextId);
+ if (helpContextId != null) {
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, helpContextId);
+ }
setEnabled(false);
}
@@ -118,7 +120,8 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
return fUpdateService.executeCommand(
getCommandType(), targets,
new ICommandParticipant() {
- public void requestDone(org.eclipse.debug.core.IRequest request) {
+ @Override
+ public void requestDone(org.eclipse.debug.core.IRequest request) {
DebugCommandAction.this.postExecute(request, targets);
}
});
@@ -145,19 +148,21 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
*
* @see org.eclipse.debug.core.commands.IDebugCommandHandler
*/
- abstract protected Class getCommandType();
+ abstract protected Class<?> getCommandType();
/**
* @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
*/
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
fUpdateService.postUpdateCommand(getCommandType(), fEnabledTarget);
}
/**
* @see org.eclipse.jface.action.Action#setEnabled(boolean)
*/
- public void setEnabled(boolean enabled) {
+ @Override
+ public void setEnabled(boolean enabled) {
synchronized (this) {
if (!fInitialized) {
fInitialized = true;
@@ -240,7 +245,8 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#run()
*/
- public void run() {
+ @Override
+ public void run() {
synchronized (this) {
if (!fInitialized) {
try {
@@ -263,7 +269,8 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
*/
- public void runWithEvent(Event event) {
+ @Override
+ public void runWithEvent(Event event) {
run();
}
@@ -302,37 +309,43 @@ public abstract class DebugCommandAction extends Action implements IDebugContext
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getId()
*/
- public abstract String getId();
+ @Override
+ public abstract String getId();
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getText()
*/
- public abstract String getText();
+ @Override
+ public abstract String getText();
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getToolTipText()
*/
- public abstract String getToolTipText();
+ @Override
+ public abstract String getToolTipText();
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getDisabledImageDescriptor()
*/
- public abstract ImageDescriptor getDisabledImageDescriptor();
+ @Override
+ public abstract ImageDescriptor getDisabledImageDescriptor();
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getHoverImageDescriptor()
*/
- public abstract ImageDescriptor getHoverImageDescriptor();
+ @Override
+ public abstract ImageDescriptor getHoverImageDescriptor();
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.Action#getImageDescriptor()
*/
- public abstract ImageDescriptor getImageDescriptor();
+ @Override
+ public abstract ImageDescriptor getImageDescriptor();
/**
* Returns the workbench proxy associated with this action or <code>null</code>
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
index c209730f9..9cc8c4c25 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/DebugCommandHandler.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2011 IBM Corporation and others.
+ * Copyright (c) 2006, 2013 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
@@ -7,11 +7,11 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.ui.actions;
-import java.util.Iterator;
import java.util.Map;
import java.util.WeakHashMap;
@@ -77,7 +77,8 @@ public abstract class DebugCommandHandler extends AbstractHandler {
getContextService(fWindow).addDebugContextListener(this);
}
- public void setEnabled(boolean enabled) {
+ @Override
+ public void setEnabled(boolean enabled) {
boolean oldEnabled = fEnabled;
fEnabled = enabled;
if (fEnabled != oldEnabled && fCurrentEnabledTarget == this) {
@@ -85,7 +86,8 @@ public abstract class DebugCommandHandler extends AbstractHandler {
}
}
- public void debugContextChanged(DebugContextEvent event) {
+ @Override
+ public void debugContextChanged(DebugContextEvent event) {
DebugCommandService.getService(fWindow).postUpdateCommand(getCommandType(), this);
}
@@ -108,21 +110,25 @@ public abstract class DebugCommandHandler extends AbstractHandler {
*/
private IWindowListener fWindowListener = new IWindowListener() {
- public void windowOpened(IWorkbenchWindow w) {
+ @Override
+ public void windowOpened(IWorkbenchWindow w) {
}
- public void windowDeactivated(IWorkbenchWindow w) {
+ @Override
+ public void windowDeactivated(IWorkbenchWindow w) {
}
- public void windowClosed(IWorkbenchWindow w) {
- EnabledTarget enabledTarget = (EnabledTarget)fEnabledTargetsMap.get(w);
+ @Override
+ public void windowClosed(IWorkbenchWindow w) {
+ EnabledTarget enabledTarget = fEnabledTargetsMap.get(w);
if (enabledTarget != null) {
enabledTarget.dispose();
}
}
- public void windowActivated(IWorkbenchWindow w) {
- fCurrentEnabledTarget = (EnabledTarget)fEnabledTargetsMap.get(w);
+ @Override
+ public void windowActivated(IWorkbenchWindow w) {
+ fCurrentEnabledTarget = fEnabledTargetsMap.get(w);
fireHandlerChanged(new HandlerEvent(DebugCommandHandler.this, true, false));
}
};
@@ -130,7 +136,7 @@ public abstract class DebugCommandHandler extends AbstractHandler {
/**
* Map of enabled targets keyed by workbench window.
*/
- private Map fEnabledTargetsMap = new WeakHashMap();
+ private Map<IWorkbenchWindow, EnabledTarget> fEnabledTargetsMap = new WeakHashMap<IWorkbenchWindow, EnabledTarget>();
/**
* The current enabled target, based on the active
@@ -149,7 +155,8 @@ public abstract class DebugCommandHandler extends AbstractHandler {
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#setEnabled(java.lang.Object)
*/
- public void setEnabled(Object evaluationContext) {
+ @Override
+ public void setEnabled(Object evaluationContext) {
// This method is called with the current evaluation context
// just prior to the isEnabled() being called. Check the active
// window and update the current enabled target based on it
@@ -169,7 +176,8 @@ public abstract class DebugCommandHandler extends AbstractHandler {
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#isEnabled()
*/
- public boolean isEnabled() {
+ @Override
+ public boolean isEnabled() {
if (fCurrentEnabledTarget == null) {
return false;
}
@@ -177,7 +185,7 @@ public abstract class DebugCommandHandler extends AbstractHandler {
}
private EnabledTarget getEnabledTarget(IWorkbenchWindow window) {
- EnabledTarget target = (EnabledTarget)fEnabledTargetsMap.get(window);
+ EnabledTarget target = fEnabledTargetsMap.get(window);
if (target == null) {
target = new EnabledTarget(window);
fEnabledTargetsMap.put(window, target);
@@ -188,7 +196,8 @@ public abstract class DebugCommandHandler extends AbstractHandler {
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
if (window == null) {
throw new ExecutionException("No active workbench window."); //$NON-NLS-1$
@@ -222,7 +231,8 @@ public abstract class DebugCommandHandler extends AbstractHandler {
return service.executeCommand(
getCommandType(), targets,
new ICommandParticipant() {
- public void requestDone(org.eclipse.debug.core.IRequest request) {
+ @Override
+ public void requestDone(org.eclipse.debug.core.IRequest request) {
DebugCommandHandler.this.postExecute(request, targets);
}
});
@@ -249,7 +259,7 @@ public abstract class DebugCommandHandler extends AbstractHandler {
*
* @see org.eclipse.debug.core.commands.IDebugCommandHandler
*/
- abstract protected Class getCommandType();
+ abstract protected Class<?> getCommandType();
/**
@@ -266,10 +276,10 @@ public abstract class DebugCommandHandler extends AbstractHandler {
/**
* Clean up when removing
*/
- public void dispose() {
- PlatformUI.getWorkbench().removeWindowListener(fWindowListener);
- for (Iterator itr = fEnabledTargetsMap.values().iterator(); itr.hasNext();) {
- EnabledTarget target = (EnabledTarget)itr.next();
+ @Override
+ public void dispose() {
+ PlatformUI.getWorkbench().removeWindowListener(fWindowListener);
+ for(EnabledTarget target : fEnabledTargetsMap.values()) {
if (!target.isDisposed()) {
target.dispose();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
index 3cbd7d829..46a64f53a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ExportBreakpointsOperation.java
@@ -17,6 +17,7 @@ import java.io.OutputStreamWriter;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.reflect.InvocationTargetException;
+import java.util.Map.Entry;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
@@ -83,6 +84,7 @@ public class ExportBreakpointsOperation implements IRunnableWithProgress {
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(IProgressMonitor monitor) throws InvocationTargetException {
SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ExportOperation_0, fBreakpoints.length);
XMLMemento memento = XMLMemento.createWriteRoot(IImportExportConstants.IE_NODE_BREAKPOINTS);
@@ -114,9 +116,9 @@ public class ExportBreakpointsOperation implements IRunnableWithProgress {
root.putString(IImportExportConstants.CHARSTART, (val != null) ? val.toString() : null);
String value = null;
boolean wsattrib = false;
- for(java.util.Iterator iter = marker.getAttributes().keySet().iterator(); iter.hasNext();) {
- String iterval = iter.next().toString();
- value = marker.getAttribute(iterval).toString();
+ for (Entry<String, Object> entry : marker.getAttributes().entrySet()) {
+ String iterval = entry.getKey();
+ value = entry.getValue().toString();
if(!iterval.equals(IMarker.LINE_NUMBER)) {
child = root.createChild(IImportExportConstants.IE_NODE_ATTRIB);
if(iterval.equals(IInternalDebugUIConstants.WORKING_SET_NAME)) {
@@ -145,8 +147,7 @@ public class ExportBreakpointsOperation implements IRunnableWithProgress {
} catch (CoreException e) {
throw new InvocationTargetException(e);
} catch (IOException e) {
- throw new InvocationTargetException(e,
- MessageFormat.format("There was a problem writing file: {0}", new String[] {fFileName})); //$NON-NLS-1$
+ throw new InvocationTargetException(e, MessageFormat.format("There was a problem writing file: {0}", new Object[] { fFileName })); //$NON-NLS-1$
}
finally {
localmonitor.done();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
index a12ca764e..61025767b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Wind River Systems and others.
+ * Copyright (c) 2008, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -73,7 +73,7 @@ public interface IToggleBreakpointsTargetFactory {
* @return Set of <code>String</code> IDs for possible toggle breakpoint
* targets, possibly empty
*/
- public Set getToggleTargets(IWorkbenchPart part, ISelection selection);
+ public Set<String> getToggleTargets(IWorkbenchPart part, ISelection selection);
/**
* Returns the identifier of the default toggle breakpoints target to use
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManager.java
index fb8e69af6..f768c2880 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/IToggleBreakpointsTargetManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Wind River Systems and others.
+ * Copyright (c) 2012, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Wind River Systems - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.debug.ui.actions;
@@ -47,7 +48,7 @@ public interface IToggleBreakpointsTargetManager {
* @param selection active selection in part
* @return Set of toggle target IDs or an empty set
*/
- public Set getEnabledToggleBreakpointsTargetIDs(IWorkbenchPart part, ISelection selection);
+ public Set<String> getEnabledToggleBreakpointsTargetIDs(IWorkbenchPart part, ISelection selection);
/**
* Returns the ID of the calculated preferred toggle breakpoints target for the
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
index 5e94b9d18..06b25b443 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ImportBreakpointsOperation.java
@@ -23,30 +23,18 @@ import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
-
-import com.ibm.icu.text.MessageFormat;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
+import java.util.Map.Entry;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
-
-import org.eclipse.jface.operation.IRunnableWithProgress;
-
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetManager;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.XMLMemento;
-
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IBreakpointImportParticipant;
@@ -54,8 +42,15 @@ import org.eclipse.debug.internal.core.BreakpointManager;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.importexport.breakpoints.IImportExportConstants;
import org.eclipse.debug.internal.ui.importexport.breakpoints.ImportExportMessages;
-
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IWorkingSet;
+import org.eclipse.ui.IWorkingSetManager;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.XMLMemento;
+
+import com.ibm.icu.text.MessageFormat;
/**
* Imports breakpoints from a file or string buffer into the workspace.
@@ -73,7 +68,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
private boolean fCreateWorkingSets = false;
- private ArrayList fAdded = new ArrayList();
+ private ArrayList<IBreakpoint> fAdded = new ArrayList<IBreakpoint>();
private String fCurrentWorkingSetProperty = null;
@@ -162,6 +157,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
/* (non-Javadoc)
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException {
SubMonitor localmonitor = SubMonitor.convert(monitor, ImportExportMessages.ImportOperation_0, 1);
Reader reader = null;
@@ -175,7 +171,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
IMemento[] nodes = memento.getChildren(IImportExportConstants.IE_NODE_BREAKPOINT);
IWorkspaceRoot workspace = ResourcesPlugin.getWorkspace().getRoot();
localmonitor.setWorkRemaining(nodes.length);
- Map attributes = null;
+ Map<String, Object> attributes = null;
IBreakpointImportParticipant[] participants = null;
for(int i = 0; i < nodes.length; i++) {
if(localmonitor.isCanceled()) {
@@ -218,20 +214,20 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
localmonitor.worked(1);
}
if(fAdded.size() > 0 && fImportBreakpoints) {
- fManager.addBreakpoints((IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]));
+ fManager.addBreakpoints(fAdded.toArray(new IBreakpoint[fAdded.size()]));
}
}
catch(FileNotFoundException e) {
throw new InvocationTargetException(e,
- MessageFormat.format("Breakpoint import file not found: {0}", new String[]{fFileName})); //$NON-NLS-1$
+ MessageFormat.format("Breakpoint import file not found: {0}", new Object[] { fFileName })); //$NON-NLS-1$
}
catch (UnsupportedEncodingException e) {
throw new InvocationTargetException(e,
- MessageFormat.format("The import file was written in non-UTF-8 encoding.", new String[]{fFileName})); //$NON-NLS-1$
+ MessageFormat.format("The import file was written in non-UTF-8 encoding.", new Object[] { fFileName })); //$NON-NLS-1$
}
catch(CoreException ce) {
throw new InvocationTargetException(ce,
- MessageFormat.format("There was a problem importing breakpoints from: {0}", new String[] {fFileName})); //$NON-NLS-1$
+ MessageFormat.format("There was a problem importing breakpoints from: {0}", new Object[] { fFileName })); //$NON-NLS-1$
}
finally {
localmonitor.done();
@@ -253,7 +249,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
* @return the marker for an existing breakpoint or <code>null</code> if one could not be located
* @since 3.5
*/
- protected IMarker findExistingMarker(Map attributes, IBreakpointImportParticipant[] participants) {
+ protected IMarker findExistingMarker(Map<String, Object> attributes, IBreakpointImportParticipant[] participants) {
IBreakpoint[] bps = fManager.getBreakpoints();
for(int i = 0; i < bps.length; i++) {
for(int j = 0; j < participants.length; j++) {
@@ -280,8 +276,8 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
* @return a new map of all of the breakpoint attributes from the given memento.
* @since 3.5
*/
- protected Map collectBreakpointProperties(IMemento memento) {
- HashMap map = new HashMap();
+ protected Map<String, Object> collectBreakpointProperties(IMemento memento) {
+ HashMap<String, Object> map = new HashMap<String, Object>();
//collect attributes from the 'breakpoint' node
map.put(IImportExportConstants.IE_BP_ENABLED, memento.getBoolean(IImportExportConstants.IE_BP_ENABLED));
@@ -310,7 +306,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
* @param memento the memento to read a name / value attribute from
* @param map the map to add the read attribute to
*/
- private void readAttribute(IMemento memento, Map map) {
+ private void readAttribute(IMemento memento, Map<String, Object> map) {
String name = memento.getString(IImportExportConstants.IE_NODE_NAME),
value = memento.getString(IImportExportConstants.IE_NODE_VALUE);
if (value != null && name != null) {
@@ -339,14 +335,12 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
* @param participants the list of participants used to verify the restored breakpoint
* @since 3.5
*/
- protected void restoreBreakpoint(IMarker marker, final Map attributes, IBreakpointImportParticipant[] participants) {
- String key = null;
- for(Iterator iter = attributes.keySet().iterator(); iter.hasNext();) {
- key = (String) iter.next();
+ protected void restoreBreakpoint(IMarker marker, final Map<String, Object> attributes, IBreakpointImportParticipant[] participants) {
+ for (Entry<String, Object> entry : attributes.entrySet()) {
try {
- marker.setAttribute(key, attributes.get(key));
+ marker.setAttribute(entry.getKey(), entry.getValue());
+ } catch (CoreException ce) {
}
- catch(CoreException ce) {}
}
IBreakpoint breakpoint = null;
try {
@@ -386,14 +380,13 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
*/
private void updateWorkingSets(String[] wsnames, IBreakpoint breakpoint) {
IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
- IWorkingSet set = null;
- ArrayList sets = new ArrayList();
+ ArrayList<IWorkingSet> sets = new ArrayList<IWorkingSet>();
collectContainingWorkingsets(breakpoint, sets);
for (int i = 0; i < wsnames.length; i++) {
if("".equals(wsnames[i])) { //$NON-NLS-1$
continue;
}
- set = mgr.getWorkingSet(wsnames[i]);
+ IWorkingSet set = mgr.getWorkingSet(wsnames[i]);
if(set == null) {
//create working set
set = mgr.createWorkingSet(wsnames[i], new IAdaptable[] {});
@@ -409,12 +402,11 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
}
sets.remove(set);
}
- ArrayList items = null;
- for(Iterator iter = sets.iterator(); iter.hasNext();) {
- set = (IWorkingSet) iter.next();
- items = new ArrayList(Arrays.asList(set.getElements()));
+ ArrayList<IAdaptable> items = null;
+ for (IWorkingSet set : sets) {
+ items = new ArrayList<IAdaptable>(Arrays.asList(set.getElements()));
if(items.remove(breakpoint)) {
- set.setElements((IAdaptable[]) items.toArray(new IAdaptable[items.size()]));
+ set.setElements(items.toArray(new IAdaptable[items.size()]));
}
}
}
@@ -427,7 +419,7 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
* @param collector the list to collect containing working sets in
* @since 3.5
*/
- private void collectContainingWorkingsets(IBreakpoint breakpoint, List collector) {
+ private void collectContainingWorkingsets(IBreakpoint breakpoint, List<IWorkingSet> collector) {
IWorkingSetManager mgr = PlatformUI.getWorkbench().getWorkingSetManager();
IWorkingSet[] sets = mgr.getWorkingSets();
for (int i = 0; i < sets.length; i++) {
@@ -462,6 +454,6 @@ public class ImportBreakpointsOperation implements IRunnableWithProgress {
* @since 3.5
*/
public IBreakpoint[] getImportedBreakpoints() {
- return (IBreakpoint[])fAdded.toArray(new IBreakpoint[fAdded.size()]);
+ return fAdded.toArray(new IBreakpoint[fAdded.size()]);
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
index 220f6addf..ccbfff59f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ package org.eclipse.debug.ui.actions;
import java.util.ArrayList;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.runtime.CoreException;
@@ -21,6 +20,8 @@ import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.debug.internal.ui.actions.ActionMessages;
+import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.debug.ui.ILaunchGroup;
import org.eclipse.jface.action.Action;
@@ -31,8 +32,6 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.launchConfigurations.LaunchHistory;
import com.ibm.icu.text.MessageFormat;
@@ -76,6 +75,7 @@ public class LaunchAction extends Action {
/**
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
DebugUITools.launch(fConfiguration, fMode);
}
@@ -86,6 +86,7 @@ public class LaunchAction extends Action {
*
* @see org.eclipse.jface.action.IAction#runWithEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(Event event) {
if ((event.stateMask & SWT.MOD1) > 0 && (event.stateMask & SWT.MOD2) > 0){
ILaunchGroup[] groups = getAllGroupsForConfiguration(fConfiguration);
@@ -95,7 +96,7 @@ public class LaunchAction extends Action {
if(store.getBoolean(IInternalDebugUIConstants.PREF_REMOVE_FROM_LAUNCH_HISTORY)) {
MessageDialogWithToggle mdwt = MessageDialogWithToggle.openYesNoQuestion(DebugUIPlugin.getShell(),
ActionMessages.LaunchAction_0,
- MessageFormat.format(ActionMessages.LaunchAction_1, new String[] {fConfiguration.getName()}),
+ MessageFormat.format(ActionMessages.LaunchAction_1, new Object[] { fConfiguration.getName() }),
ActionMessages.LaunchAction_2,
false,
null,
@@ -140,7 +141,7 @@ public class LaunchAction extends Action {
if(history != null) {
history.removeFromHistory(fConfiguration);
} else {
- DebugUIPlugin.logErrorMessage(MessageFormat.format("Unable to remove configuration [{0}] from launch history. The launch history for mode [{1}] does not exist.", new String[] {config.getName(), groups[i].getMode()})); //$NON-NLS-1$
+ DebugUIPlugin.logErrorMessage(MessageFormat.format("Unable to remove configuration [{0}] from launch history. The launch history for mode [{1}] does not exist.", new Object[] { config.getName(), groups[i].getMode() })); //$NON-NLS-1$
}
}
}
@@ -153,15 +154,13 @@ public class LaunchAction extends Action {
* @since 3.4
*/
private ILaunchGroup[] getAllGroupsForConfiguration(ILaunchConfiguration config) {
- ArrayList list = new ArrayList();
+ ArrayList<ILaunchGroup> list = new ArrayList<ILaunchGroup>();
try {
ILaunchConfigurationType type = config.getType();
- Set modes = type.getSupportedModeCombinations();
+ Set<Set<String>> modes = type.getSupportedModeCombinations();
String mode = null;
ILaunchGroup group = null;
- Set modesets = null;
- for(Iterator iter = modes.iterator(); iter.hasNext();) {
- modesets = (Set) iter.next();
+ for (Set<String> modesets : modes) {
if(modesets.size() == 1) {
mode = (String) modesets.toArray()[0];
group = DebugUITools.getLaunchGroup(config, mode);
@@ -172,7 +171,6 @@ public class LaunchAction extends Action {
}
}
catch(CoreException ce) {}
- return (ILaunchGroup[]) list.toArray(new ILaunchGroup[list.size()]);
+ return list.toArray(new ILaunchGroup[list.size()]);
}
-
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
index 12a9f09bf..5f563daea 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchAsAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
package org.eclipse.debug.ui.actions;
-import java.util.Iterator;
import java.util.List;
import org.eclipse.debug.core.DebugPlugin;
@@ -50,6 +49,7 @@ import org.eclipse.ui.activities.WorkbenchActivityHelper;
* menus. Use <code>LaunchShorcutsAction</code> instead.
* @noextend This class is not intended to be subclassed by clients.
*/
+@Deprecated
public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
/**
@@ -93,6 +93,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see IAction#run()
*/
+ @Override
public void run() {
//do nothing, this action just creates a cascading menu.
}
@@ -114,6 +115,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
if (getCreatedMenu() != null) {
getCreatedMenu().dispose();
@@ -123,6 +125,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see IMenuCreator#getMenu(Control)
*/
+ @Override
public Menu getMenu(Control parent) {
return null;
}
@@ -130,6 +133,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see IMenuCreator#getMenu(Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
if (getCreatedMenu() != null) {
getCreatedMenu().dispose();
@@ -142,7 +146,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
private void fillMenu() {
//Retrieve the current perspective and the registered shortcuts
- List shortcuts = null;
+ List<LaunchShortcutExtension> shortcuts = null;
String activePerspID = getActivePerspectiveID();
if (activePerspID != null) {
shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(activePerspID, getCategory());
@@ -155,11 +159,8 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
}
int menuCount = 1;
-
- Iterator iter = shortcuts.iterator();
String mode = getMode();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
+ for (LaunchShortcutExtension ext : shortcuts) {
if (ext.getModes().contains(mode) && !WorkbenchActivityHelper.filterItem(ext)) {
populateMenu(mode, ext, getCreatedMenu(), menuCount);
menuCount++;
@@ -174,6 +175,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
// Add listener to re-populate the menu each time
// it is shown to reflect changes in selection or active perspective
fCreatedMenu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
@@ -262,6 +264,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {
// if (window instanceof WorkbenchWindow) {
// fKeyBindingService= ((WorkbenchWindow)window).getKeyBindingService();
@@ -271,6 +274,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
// do nothing - this is just a menu
}
@@ -278,6 +282,7 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (fAction == null) {
initialize(action);
@@ -302,10 +307,8 @@ public class LaunchAsAction extends Action implements IMenuCreator, IWorkbenchWi
* the mode of this action
*/
private boolean existsShortcutsForMode() {
- List shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(getCategory());
- Iterator iter = shortcuts.iterator();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
+ List<LaunchShortcutExtension> shortcuts = getLaunchConfigurationManager().getLaunchShortcuts(getCategory());
+ for (LaunchShortcutExtension ext : shortcuts) {
if (ext.getModes().contains(getMode())) {
return true;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
index b30159f4d..b184ebee9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/LaunchShortcutsAction.java
@@ -14,7 +14,6 @@ package org.eclipse.debug.ui.actions;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import org.eclipse.core.expressions.Expression;
import org.eclipse.core.expressions.IEvaluationContext;
@@ -46,6 +45,7 @@ import org.eclipse.swt.events.MenuEvent;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
@@ -100,6 +100,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
/**
* @see IAction#run()
*/
+ @Override
public void run() {
//do nothing, this action just creates a cascading menu.
}
@@ -107,6 +108,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
/**
* @see IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
if (fCreatedMenu != null) {
fCreatedMenu.dispose();
@@ -116,6 +118,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
/**
* @see IMenuCreator#getMenu(Control)
*/
+ @Override
public Menu getMenu(Control parent) {
return null;
}
@@ -123,6 +126,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
/**
* @see IMenuCreator#getMenu(Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
if (fCreatedMenu != null) {
fCreatedMenu.dispose();
@@ -138,7 +142,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
private IEvaluationContext createContext() {
IStructuredSelection ss = SelectedResourceManager.getDefault().getCurrentSelection();
Object o = ss.getFirstElement();
- List list = new ArrayList(0);
+ List<IEditorInput> list = new ArrayList<IEditorInput>(0);
if(o instanceof IEditorPart) {
list.add(((IEditorPart)o).getEditorInput());
}
@@ -157,11 +161,11 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
private void fillMenu() {
IEvaluationContext context = createContext();
int accelerator = 1;
- List allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts(fGroup.getCategory());
- Iterator iter = allShortCuts.iterator();
- List filteredShortCuts = new ArrayList(10);
+ List<LaunchShortcutExtension> allShortCuts = getLaunchConfigurationManager().getLaunchShortcuts(fGroup.getCategory());
+ Iterator<LaunchShortcutExtension> iter = allShortCuts.iterator();
+ List<LaunchShortcutExtension> filteredShortCuts = new ArrayList<LaunchShortcutExtension>(10);
while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
+ LaunchShortcutExtension ext = iter.next();
try {
if (!WorkbenchActivityHelper.filterItem(ext) && isApplicable(ext, context)) {
filteredShortCuts.add(ext);
@@ -187,13 +191,8 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
}
catch(CoreException ce) {DebugUIPlugin.log(ce);}
//second add the launch shortcuts if any
- iter = filteredShortCuts.iterator();
- while (iter.hasNext()) {
- LaunchShortcutExtension ext = (LaunchShortcutExtension) iter.next();
- Set modes = ext.getModes(); // supported launch modes
- Iterator modeIter = modes.iterator();
- while (modeIter.hasNext()) {
- String modee = (String) modeIter.next();
+ for (LaunchShortcutExtension ext : filteredShortCuts) {
+ for (String modee : ext.getModes()) {
if (modee.equals(mode)) {
populateMenuItem(modee, ext, fCreatedMenu, accelerator++);
}
@@ -215,7 +214,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
* @since 3.3
*/
private Object getSelection(IEvaluationContext context) {
- List list = (List) context.getVariable("selection"); //$NON-NLS-1$
+ List<?> list = (List<?>) context.getVariable("selection"); //$NON-NLS-1$
return (list.isEmpty() ? null : list.get(0));
}
@@ -269,6 +268,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
// Add listener to re-populate the menu each time
// it is shown to reflect changes in selection or active perspective
fCreatedMenu.addMenuListener(new MenuAdapter() {
+ @Override
public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
@@ -301,11 +301,13 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {}
/**
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
// do nothing - this is just a menu
}
@@ -313,6 +315,7 @@ public class LaunchShortcutsAction extends Action implements IMenuCreator, IWork
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
if (!fInitialized) {
action.setEnabled(existsConfigTypesForMode());
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
index 7f97c39cb..649542dfe 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/OpenLaunchDialogAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -60,7 +60,7 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(fIdentifier);
if(group != null) {
String lbl = group.getLabel();
- String actionLabel = MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new String[] {lbl});
+ String actionLabel = MessageFormat.format(ActionMessages.OpenLaunchDialogAction_1, new Object[] { lbl });
setText(DebugUIPlugin.adjustDBCSAccelerator(actionLabel));
}
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.OPEN_LAUNCH_CONFIGURATION_ACTION);
@@ -69,6 +69,7 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
/**
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
LaunchHistory history = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchHistory(fIdentifier);
ILaunchConfiguration configuration = history.getRecentLaunch();
@@ -85,6 +86,7 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run();
}
@@ -92,6 +94,7 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
run();
}
@@ -99,11 +102,13 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
/**
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose() {}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
if(action != null) {
action.setEnabled(existsConfigTypesForMode());
@@ -131,11 +136,13 @@ public class OpenLaunchDialogAction extends Action implements IActionDelegate2,
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window) {}
/**
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
index 42df05e34..b58ccae6f 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RelaunchLastAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,6 +59,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
/* (non-Javadoc)
* @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent)
*/
+ @Override
public void preferenceChange(PreferenceChangeEvent event) {
if(event.getKey().equals(IInternalDebugUIConstants.PREF_USE_CONTEXTUAL_LAUNCH)) {
initialize(fAction);
@@ -73,6 +74,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
*/
+ @Override
public void dispose(){
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
if(prefs != null) {
@@ -83,6 +85,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
+ @Override
public void init(IWorkbenchWindow window){
fWorkbenchWindow = window;
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(DebugUIPlugin.getUniqueIdentifier());
@@ -94,6 +97,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action){
if(LaunchingResourceManager.isContextLaunchEnabled()) {
ILaunchGroup group = DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(getLaunchGroupId());
@@ -108,7 +112,8 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
} else {
String configName = configuration.getName();
String title = ActionMessages.RelaunchLastAction_Cannot_relaunch_1;
- String message = MessageFormat.format(ActionMessages.RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2, new String[] {configName, getMode()});
+ String message = MessageFormat.format(ActionMessages.RelaunchLastAction_Cannot_relaunch___0___because_it_does_not_support__2__mode_2, new Object[] {
+ configName, getMode() });
MessageDialog.openError(getShell(), title, message);
}
} else {
@@ -136,6 +141,7 @@ public abstract class RelaunchLastAction implements IWorkbenchWindowActionDelega
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection){
if (fAction == null) {
initialize(action);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
index 6612a9e8f..c48abc8d4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -20,6 +20,7 @@ import org.eclipse.jface.action.Action;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.source.Annotation;
import org.eclipse.jface.text.source.IAnnotationModel;
import org.eclipse.jface.text.source.IVerticalRulerInfo;
import org.eclipse.ui.texteditor.ITextEditor;
@@ -59,11 +60,11 @@ public abstract class RulerBreakpointAction extends Action {
IAnnotationModel annotationModel = fEditor.getDocumentProvider().getAnnotationModel(fEditor.getEditorInput());
IDocument document = fEditor.getDocumentProvider().getDocument(fEditor.getEditorInput());
if (annotationModel != null) {
- Iterator iterator = annotationModel.getAnnotationIterator();
+ Iterator<Annotation> iterator = annotationModel.getAnnotationIterator();
while (iterator.hasNext()) {
- Object object = iterator.next();
- if (object instanceof SimpleMarkerAnnotation) {
- SimpleMarkerAnnotation markerAnnotation = (SimpleMarkerAnnotation) object;
+ Annotation annot = iterator.next();
+ if (annot instanceof SimpleMarkerAnnotation) {
+ SimpleMarkerAnnotation markerAnnotation = (SimpleMarkerAnnotation) annot;
IMarker marker = markerAnnotation.getMarker();
try {
if (marker.isSubtypeOf(IBreakpoint.BREAKPOINT_MARKER)) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
index eda0b060d..b09b9fdbf 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerBreakpointTypesActionDelegate.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2012 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -8,10 +8,9 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Wind River Systems - adapted action to use for breakpoint types
-******************************************************************************/
+ ******************************************************************************/
package org.eclipse.debug.ui.actions;
-import java.util.Iterator;
import java.util.Set;
import org.eclipse.debug.internal.ui.actions.ToggleBreakpointsTargetManager;
@@ -75,6 +74,7 @@ import org.eclipse.ui.texteditor.ITextEditorExtension;
*
* @deprecated Should use BreakpointTypesContribution instead.
*/
+@Deprecated
public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate, IMenuListener, IMenuCreator {
private ITextEditor fEditor = null;
private IAction fCallerAction = null;
@@ -87,15 +87,17 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
private Menu fMenu;
private class SelectTargetAction extends Action {
- private final Set fPossibleIDs;
+ private final Set<String> fPossibleIDs;
private final String fID;
- SelectTargetAction(String name, Set possibleIDs, String ID) {
+
+ SelectTargetAction(String name, Set<String> possibleIDs, String ID) {
super(name, AS_RADIO_BUTTON);
fID = ID;
fPossibleIDs = possibleIDs;
}
- public void run() {
+ @Override
+ public void run() {
if (isChecked()) {
ToggleBreakpointsTargetManager.getDefault().setPreferredTarget(fPossibleIDs, fID);
}
@@ -103,18 +105,21 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
}
- public void selectionChanged(IAction action, ISelection selection) {
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
// In the editor we're not using the selection.
}
- public void run(IAction action) {
+ @Override
+ public void run(IAction action) {
// Do nothing, this is a pull-down menu.
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
*/
- public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
+ @Override
+ public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
// Clean up old editor data.
if (fCallerAction != null) {
fCallerAction.setMenuCreator(null);
@@ -140,7 +145,8 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
}
- public void dispose() {
+ @Override
+ public void dispose() {
if (fCallerAction != null) {
fCallerAction.setMenuCreator(null);
}
@@ -150,7 +156,8 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
fRulerInfo = null;
}
- public void menuAboutToShow(IMenuManager manager) {
+ @Override
+ public void menuAboutToShow(IMenuManager manager) {
fSelection = StructuredSelection.EMPTY;
if (fEditor != null && fRulerInfo != null) {
@@ -166,7 +173,7 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
}
}
ToggleBreakpointsTargetManager toggleTargetManager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = toggleTargetManager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
+ Set<String> enabledIDs = toggleTargetManager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
fCallerAction.setEnabled(enabledIDs.size() > 0);
} else {
fCallerAction.setEnabled(false);
@@ -186,14 +193,16 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
fMenu = menu;
}
- public Menu getMenu(Menu parent) {
+ @Override
+ public Menu getMenu(Menu parent) {
setMenu(new Menu(parent));
fillMenu(fMenu);
initMenu();
return fMenu;
}
- public Menu getMenu(Control parent) {
+ @Override
+ public Menu getMenu(Control parent) {
setMenu(new Menu(parent));
fillMenu(fMenu);
initMenu();
@@ -207,17 +216,13 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
*/
private void fillMenu(Menu menu) {
ToggleBreakpointsTargetManager manager = ToggleBreakpointsTargetManager.getDefault();
- Set enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
+ Set<String> enabledIDs = manager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection);
String preferredId = manager.getPreferredToggleBreakpointsTargetID(fEditor, fSelection);
-
- for (Iterator itr = enabledIDs.iterator(); itr.hasNext();) {
- String id = (String)itr.next();
+ for (String id : enabledIDs) {
SelectTargetAction action= new SelectTargetAction(manager.getToggleBreakpointsTargetName(id), enabledIDs, id);
-
if (id.equals(preferredId)){
action.setChecked(true);
}
-
ActionContributionItem item= new ActionContributionItem(action);
item.fill(menu, -1);
}
@@ -230,7 +235,8 @@ public class RulerBreakpointTypesActionDelegate implements IEditorActionDelegate
// Add listener to re-populate the menu each time
// it is shown because of dynamic history list
fMenu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
+ @Override
+ public void menuShown(MenuEvent e) {
Menu m = (Menu)e.widget;
MenuItem[] items = m.getItems();
for (int i=0; i < items.length; i++) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
index 0b17e2a89..b41960f02 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerEnableDisableBreakpointActionDelegate.java
@@ -48,6 +48,7 @@ public class RulerEnableDisableBreakpointActionDelegate extends AbstractRulerAct
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
*/
+ @Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
return new RulerEnableDisableBreakpointAction(editor, rulerInfo);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
index ff93f5af1..fba8e40ce 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RulerToggleBreakpointActionDelegate.java
@@ -79,6 +79,7 @@ public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.AbstractRulerActionDelegate#createAction(org.eclipse.ui.texteditor.ITextEditor, org.eclipse.jface.text.source.IVerticalRulerInfo)
*/
+ @Override
protected IAction createAction(ITextEditor editor, IVerticalRulerInfo rulerInfo) {
fDelegate = new ToggleBreakpointAction(editor, null, rulerInfo);
return fDelegate;
@@ -87,6 +88,7 @@ public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
*/
+ @Override
public void setActiveEditor(IAction callerAction, IEditorPart targetEditor) {
if (fEditor != null) {
if (fDelegate != null) {
@@ -101,12 +103,14 @@ public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
if (fDelegate != null) {
fDelegate.dispose();
@@ -118,6 +122,7 @@ public class RulerToggleBreakpointActionDelegate extends AbstractRulerActionDele
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
if(fDelegate != null) {
fDelegate.runWithEvent(event);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
index 32145272f..ed3a12692 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunAction.java
@@ -34,6 +34,7 @@ public final class RunAction extends ExecutionAction {
/**
* @see ExecutionAction#getMode()
*/
+ @Override
protected String getMode() {
return ILaunchManager.RUN_MODE;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
index e7513285b..d735d34c4 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineActionDelegate.java
@@ -76,6 +76,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
update();
}
+ @Override
public void debugContextChanged(DebugContextEvent event) {
contextActivated(event.getContext());
}
@@ -85,6 +86,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
/*(non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#dispose()
*/
+ @Override
public void dispose() {
DebugUITools.getDebugContextManager().getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener);
fActivePart = null;
@@ -94,6 +96,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
+ @Override
public void run(IAction action) {
if (fPartTarget != null && fTargetElement != null) {
try {
@@ -106,6 +109,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
public void selectionChanged(IAction action, ISelection selection) {
this.fAction = action;
update();
@@ -119,6 +123,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
return;
}
Runnable r = new Runnable() {
+ @Override
public void run() {
boolean enabled = false;
if (fPartTarget != null && fTargetElement != null) {
@@ -140,6 +145,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction)
*/
+ @Override
public void init(IAction action) {
this.fAction = action;
if (action != null) {
@@ -151,12 +157,14 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
/* (non-Javadoc)
* @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(IAction action, Event event) {
run(action);
}
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart)
*/
+ @Override
public void setActiveEditor(IAction action, IEditorPart targetEditor) {
init(action);
bindTo(targetEditor);
@@ -165,6 +173,7 @@ public class RunToLineActionDelegate implements IEditorActionDelegate, IActionDe
/* (non-Javadoc)
* @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart)
*/
+ @Override
public void init(IViewPart view) {
bindTo(view);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
index d0d5dd1e4..4db1b058c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/RunToLineHandler.java
@@ -65,7 +65,8 @@ public class RunToLineHandler implements IDebugEventSetListener, IBreakpointMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(org.eclipse.debug.core.DebugEvent[])
*/
- public void handleDebugEvents(DebugEvent[] events) {
+ @Override
+ public void handleDebugEvents(DebugEvent[] events) {
for (int i = 0; i < events.length; i++) {
DebugEvent event= events[i];
Object source= event.getSource();
@@ -91,7 +92,8 @@ public class RunToLineHandler implements IDebugEventSetListener, IBreakpointMana
/* (non-Javadoc)
* @see org.eclipse.debug.core.IBreakpointManagerListener#breakpointManagerEnablementChanged(boolean)
*/
- public void breakpointManagerEnablementChanged(boolean enabled) {
+ @Override
+ public void breakpointManagerEnablementChanged(boolean enabled) {
// if the user changes the breakpoint manager enablement, don't restore it
fAutoSkip = false;
}
@@ -123,7 +125,8 @@ public class RunToLineHandler implements IDebugEventSetListener, IBreakpointMana
/* (non-Javadoc)
* @see org.eclipse.core.resources.IWorkspaceRunnable#run(org.eclipse.core.runtime.IProgressMonitor)
*/
- public void run(IProgressMonitor monitor) throws CoreException {
+ @Override
+ public void run(IProgressMonitor monitor) throws CoreException {
getDebugPlugin().addDebugEventListener(this);
IBreakpointManager breakpointManager = getBreakpointManager();
fAutoSkip = DebugUITools.getPreferenceStore().getBoolean(IDebugUIConstants.PREF_SKIP_BREAKPOINTS_DURING_RUN_TO_LINE) && breakpointManager.isEnabled();
@@ -132,7 +135,8 @@ public class RunToLineHandler implements IDebugEventSetListener, IBreakpointMana
breakpointManager.addBreakpointManagerListener(this);
}
Job job = new Job(ActionMessages.RunToLineHandler_0) {
- protected IStatus run(IProgressMonitor jobMonitor) {
+ @Override
+ protected IStatus run(IProgressMonitor jobMonitor) {
if (!jobMonitor.isCanceled()) {
fTarget.breakpointAdded(fBreakpoint);
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
index 0a0aadd0e..8a4c9c8a6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleBreakpointAction.java
@@ -50,7 +50,8 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
private IDocument fDocument;
private IVerticalRulerInfo fRulerInfo;
private IToggleBreakpointsTargetManagerListener fListener = new IToggleBreakpointsTargetManagerListener() {
- public void preferredTargetsChanged() {
+ @Override
+ public void preferredTargetsChanged() {
update();
}
};
@@ -78,6 +79,7 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
doIt(null);
}
@@ -85,6 +87,7 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.jface.action.Action#runWithEvent(org.eclipse.swt.widgets.Event)
*/
+ @Override
public void runWithEvent(Event event) {
doIt(event);
}
@@ -186,6 +189,7 @@ public class ToggleBreakpointAction extends Action implements IUpdate {
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
IDocument document= getDocument();
if (document != null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
index 4b3db6ff7..aeed58b01 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleMethodBreakpointActionDelegate.java
@@ -31,6 +31,7 @@ public class ToggleMethodBreakpointActionDelegate extends ToggleBreakpointObject
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointObjectActionDelegate#performAction(org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTarget, org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException {
target.toggleMethodBreakpoints(part, selection);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
index c5ebd55ec..ac1bdd8a3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/ToggleWatchpointActionDelegate.java
@@ -31,6 +31,7 @@ public class ToggleWatchpointActionDelegate extends ToggleBreakpointObjectAction
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.actions.ToggleBreakpointObjectActionDelegate#performAction(org.eclipse.debug.internal.ui.actions.IToggleBreakpointsTarget, org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
*/
+ @Override
protected void performAction(IToggleBreakpointsTarget target, IWorkbenchPart part, ISelection selection) throws CoreException {
target.toggleWatchpoints(part, selection);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
index 27ca96d60..62b9b5e13 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/ConsoleColorProvider.java
@@ -34,6 +34,7 @@ public class ConsoleColorProvider implements IConsoleColorProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleColorProvider#connect(org.eclipse.debug.core.model.IProcess, org.eclipse.debug.ui.console.IConsole)
*/
+ @Override
public void connect(IProcess process, IConsole console) {
fProcess = process;
fConsole = console;
@@ -46,6 +47,7 @@ public class ConsoleColorProvider implements IConsoleColorProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleColorProvider#disconnect()
*/
+ @Override
public void disconnect() {
fConsole = null;
fProcess = null;
@@ -54,6 +56,7 @@ public class ConsoleColorProvider implements IConsoleColorProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleColorProvider#isReadOnly()
*/
+ @Override
public boolean isReadOnly() {
return fProcess == null || fProcess.isTerminated();
}
@@ -61,6 +64,7 @@ public class ConsoleColorProvider implements IConsoleColorProvider {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleColorProvider#getColor(java.lang.String)
*/
+ @Override
public Color getColor(String streamIdentifer) {
if (IDebugUIConstants.ID_STANDARD_OUTPUT_STREAM.equals(streamIdentifer)) {
return DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_OUT_COLOR);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
index 5bf3cc8a9..aa3d73139 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/FileLink.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -41,6 +41,7 @@ import org.eclipse.ui.texteditor.ITextEditor;
* @since 2.1
* @noextend This class is not intended to be subclassed by clients.
*/
+@SuppressWarnings("deprecation")
public class FileLink implements IConsoleHyperlink {
private IFile fFile;
@@ -72,6 +73,7 @@ public class FileLink implements IConsoleHyperlink {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkActivated()
*/
+ @Override
public void linkActivated() {
IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
if (window != null) {
@@ -123,12 +125,14 @@ public class FileLink implements IConsoleHyperlink {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkEntered()
*/
+ @Override
public void linkEntered() {
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.console.IConsoleHyperlink#linkExited()
*/
+ @Override
public void linkExited() {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
index 522de7e7d..55f46ec24 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsole.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -64,6 +64,7 @@ public interface IConsole {
* @param length the length of the associated hyperlink text
* @deprecated replaced with addLink(IHyperlink link, int offset, int length)
*/
+ @Deprecated
public void addLink(IConsoleHyperlink link, int offset, int length);
/**
@@ -91,6 +92,7 @@ public interface IConsole {
* @return region of text associated with the hyperlink, or <code>null</code>
* @deprecated replaced with getRegion(IHyperlink link) instead
*/
+ @Deprecated
public IRegion getRegion(IConsoleHyperlink link);
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
index b735fac78..bf7ccf74c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/console/IConsoleHyperlink.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,10 +19,13 @@ import org.eclipse.ui.console.IHyperlink;
* Clients may implement this interface.
* </p>
* <p>
- * Since 3.1, this interface now extends {@link org.eclipse.ui.console.IHyperlink}.
+ * Since 3.1, this interface now extends
+ * {@link org.eclipse.ui.console.IHyperlink}.
* </p>
+ *
* @since 2.1
* @deprecated replaced by org.eclipse.ui.console.IHyperlink
*/
+@Deprecated
public interface IConsoleHyperlink extends IHyperlink {
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
index ec983e352..15c18d638 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/contexts/AbstractDebugContextProvider.java
@@ -47,6 +47,7 @@ public abstract class AbstractDebugContextProvider implements IDebugContextProvi
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#addDebugContextEventListener(org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener)
*/
+ @Override
public void addDebugContextListener(IDebugContextListener listener) {
fListeners.add(listener);
}
@@ -54,6 +55,7 @@ public abstract class AbstractDebugContextProvider implements IDebugContextProvi
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#getPart()
*/
+ @Override
public IWorkbenchPart getPart() {
return fPart;
}
@@ -61,6 +63,7 @@ public abstract class AbstractDebugContextProvider implements IDebugContextProvi
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextProvider#removeDebugContextEventListener(org.eclipse.debug.internal.ui.contexts.provisional.IDebugContextEventListener)
*/
+ @Override
public void removeDebugContextListener(IDebugContextListener listener) {
fListeners.remove(listener);
}
@@ -75,9 +78,11 @@ public abstract class AbstractDebugContextProvider implements IDebugContextProvi
for (int i = 0; i < listeners.length; i++) {
final IDebugContextListener listener = (IDebugContextListener) listeners[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
listener.debugContextChanged(event);
}
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
index a6227f6bf..cb4f4823d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRendering.java
@@ -73,6 +73,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
setSystem(true);
}
+ @Override
protected IStatus run(IProgressMonitor monitor) {
fRunnable.run();
return Status.OK_STATUS;
@@ -100,6 +101,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#init(org.eclipse.debug.ui.memory.IMemoryRenderingSite, org.eclipse.debug.core.model.IMemoryBlock)
*/
+ @Override
public void init(IMemoryRenderingContainer container, IMemoryBlock block) {
fContainer = container;
fMemoryBlock = block;
@@ -110,12 +112,14 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#dispose()
*/
+ @Override
public void dispose()
{
// disconnect from memory block when rendering is disposed
if (fMemoryBlock instanceof IMemoryBlockExtension)
{
Runnable runnable = new Runnable(){
+ @Override
public void run() {
((IMemoryBlockExtension)fMemoryBlock).disconnect(AbstractMemoryRendering.this);
}};
@@ -137,6 +141,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#activated()
*/
+ @Override
public void activated() {
if (fContainer.getMemoryRenderingSite().getSynchronizationService() != null)
fContainer.getMemoryRenderingSite().getSynchronizationService().setSynchronizationProvider(this);
@@ -145,6 +150,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#deactivated()
*/
+ @Override
public void deactivated() {
// do nothing when deactivated
// we do not want to set the sync provider from rendering site
@@ -156,12 +162,14 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesVisible()
*/
+ @Override
public void becomesVisible() {
fVisible = true;
if (fMemoryBlock instanceof IMemoryBlockExtension)
{
Runnable runnable = new Runnable(){
+ @Override
public void run() {
((IMemoryBlockExtension)fMemoryBlock).connect(AbstractMemoryRendering.this);
}};
@@ -172,11 +180,13 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
*/
+ @Override
public void becomesHidden() {
fVisible = false;
if (fMemoryBlock instanceof IMemoryBlockExtension)
{
Runnable runnable = new Runnable(){
+ @Override
public void run() {
((IMemoryBlockExtension)fMemoryBlock).disconnect(AbstractMemoryRendering.this);
}};
@@ -187,6 +197,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#getMemoryBlock()
*/
+ @Override
public IMemoryBlock getMemoryBlock() {
return fMemoryBlock;
}
@@ -194,6 +205,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#getRenderingId()
*/
+ @Override
public String getRenderingId()
{
return fRenderingId;
@@ -202,6 +214,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#addPropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener) {
if (fPropertyListeners == null)
@@ -213,6 +226,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
if (fPropertyListeners == null)
@@ -223,6 +237,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#getImage()
*/
+ @Override
public Image getImage() {
return decorateImage(null);
}
@@ -243,6 +258,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#getLabel()
*/
+ @Override
public String getLabel()
{
if (fMemoryBlock == null)
@@ -341,6 +357,7 @@ public abstract class AbstractMemoryRendering extends PlatformObject implements
ISelectionProvider selProvider = site.getSite().getSelectionProvider();
fMenuListener = new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
index 7c1c50675..aaec45a6d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractMemoryRenderingBindingsProvider.java
@@ -31,6 +31,7 @@ public abstract class AbstractMemoryRenderingBindingsProvider implements IMemory
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#addListener(org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener)
*/
+ @Override
public void addListener(IMemoryRenderingBindingsListener listener) {
if (fListeners == null) {
fListeners = new ListenerList();
@@ -40,6 +41,7 @@ public abstract class AbstractMemoryRenderingBindingsProvider implements IMemory
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRenderingBindingsProvider#removeListener(org.eclipse.debug.ui.memory.IMemoryRenderingBindingsListener)
*/
+ @Override
public void removeListener(IMemoryRenderingBindingsListener listener) {
if (fListeners != null) {
fListeners.remove(listener);
@@ -60,9 +62,11 @@ public abstract class AbstractMemoryRenderingBindingsProvider implements IMemory
if (listeners[i] instanceof IMemoryRenderingBindingsListener) {
final IMemoryRenderingBindingsListener listener = (IMemoryRenderingBindingsListener)listeners[i];
ISafeRunnable runnable = new ISafeRunnable () {
+ @Override
public void handleException(Throwable exception) {
DebugUIPlugin.log(exception);
}
+ @Override
public void run() throws Exception {
listener.memoryRenderingBindingsChanged();
}};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
index b46a29be9..2db7b143b 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTableRendering.java
@@ -268,6 +268,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fIsShowAddressColumn = !fIsShowAddressColumn;
resizeColumnsToPreferredSize();
@@ -296,6 +297,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".NextPageAction_context"); //$NON-NLS-1$
}
+ @Override
public void run() {
BigInteger address = fContentInput.getLoadAddress();
address = address.add(BigInteger.valueOf(getPageSizeInUnits()));
@@ -312,6 +314,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugUIConstants.PLUGIN_ID + ".PrevPageAction_context"); //$NON-NLS-1$
}
+ @Override
public void run() {
BigInteger address = fContentInput.getLoadAddress();
address = address.subtract(BigInteger.valueOf(getPageSizeInUnits()));
@@ -331,6 +334,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
// if memory view table font has changed
if (event.getProperty().equals(IInternalDebugUIConstants.FONT_NAME))
@@ -365,12 +369,14 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
// do not handle event if the rendering is displaying an error
- if (isDisplayingError())
+ if (isDisplayingError()) {
return;
+ }
// do not handle property change event if the rendering is not visible
- if (!isVisible())
+ if (!isVisible()) {
return;
+ }
if (event.getProperty().equals(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM)) {
handleDyanicLoadChanged();
@@ -396,18 +402,21 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
return;
}
- if (evtSrc == this)
+ if (evtSrc == this) {
return;
+ }
- if (!(evtSrc instanceof IMemoryRendering))
+ if (!(evtSrc instanceof IMemoryRendering)) {
return;
+ }
IMemoryRendering rendering = (IMemoryRendering)evtSrc;
IMemoryBlock memoryBlock = rendering.getMemoryBlock();
// do not handle event from renderings displaying other memory blocks
- if (memoryBlock != getMemoryBlock())
+ if (memoryBlock != getMemoryBlock()) {
return;
+ }
String propertyName = event.getProperty();
Object value = event.getNewValue();
@@ -428,8 +437,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
if (needMoreLines())
{
- if (isDynamicLoad())
+ if (isDynamicLoad()) {
reloadTable(getTopVisibleAddress(), false);
+ }
}
topVisibleAddressChanged((BigInteger)value, false);
}
@@ -453,8 +463,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
else
{
BigInteger pageStart = (BigInteger)getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
- if (pageStart == null)
+ if (pageStart == null) {
pageStart = fTopRowAddress;
+ }
handlePageStartAddressChanged(pageStart);
}
}
@@ -496,14 +507,16 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// continue to handle event if caller decides to force the rendering
// to move to the top visible address even when the rendering
// is not visible
- if (!isVisible() && !force)
+ if (!isVisible() && !force) {
return;
+ }
// do not handle event if the base address of the memory
// block has changed, wait for debug event to update to
// new location
- if (isBaseAddressChanged())
+ if (isBaseAddressChanged()) {
return;
+ }
if (!address.equals(fTopRowAddress))
{
@@ -532,10 +545,11 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
setTopIndex(table, index);
}
- if (isAddressVisible(fSelectedAddress))
+ if (isAddressVisible(fSelectedAddress)) {
fTableCursor.setVisible(true);
- else
+ } else {
fTableCursor.setVisible(false);
+ }
}
@@ -547,8 +561,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
Object evtLockClient = new Object();
try
{
- if (!fEvtHandleLock.acquireLock(evtLockClient))
+ if (!fEvtHandleLock.acquireLock(evtLockClient)) {
return;
+ }
if (!isAddressOutOfRange(address))
{
@@ -572,18 +587,20 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
else
{
- if (isDynamicLoad() && getBufferThreshold(BUFFER_START) > 0)
+ if (isDynamicLoad() && getBufferThreshold(BUFFER_START) > 0) {
reloadTable(address, false);
- else
+ } else {
setTopIndex(table, index);
+ }
}
}
else if ((numInBuffer-(index+getNumberOfVisibleLines())) <= getBufferThreshold(BUFFER_END))
{
- if (!isAtBottomLimit() && isDynamicLoad() && getBufferThreshold(BUFFER_END) > 0)
+ if (!isAtBottomLimit() && isDynamicLoad() && getBufferThreshold(BUFFER_END) > 0) {
reloadTable(address, false);
- else
+ } else {
setTopIndex(table, index);
+ }
}
}
}
@@ -593,11 +610,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
reloadTable(address, false);
}
- if (isAddressVisible(fSelectedAddress))
+ if (isAddressVisible(fSelectedAddress)) {
fTableCursor.setVisible(true);
- else
+ } else {
fTableCursor.setVisible(false);
}
+ }
finally
{
fEvtHandleLock.releaseLock(evtLockClient);
@@ -612,17 +630,19 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// do not handle event if the base address of the memory
// block has changed, wait for debug event to update to
// new location
- if (isBaseAddressChanged())
+ if (isBaseAddressChanged()) {
return;
+ }
try {
// do not handle event if the event is out of range and the
// rendering is in non-dynamic-load mode, otherwise, will
// cause rendering to continue to scroll when it shouldn't
- if (isDynamicLoad())
+ if (isDynamicLoad()) {
goToAddress(value);
- else if (!isAddressOutOfRange(value))
+ } else if (!isAddressOutOfRange(value)) {
goToAddress(value);
+ }
} catch (DebugException e) {
// do nothing
}
@@ -631,23 +651,28 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private void handlePageStartAddressChanged(BigInteger address)
{
// do not handle if in dynamic mode
- if (isDynamicLoad())
+ if (isDynamicLoad()) {
return;
+ }
- if (fContentInput == null)
+ if (fContentInput == null) {
return;
+ }
- if (!(getMemoryBlock() instanceof IMemoryBlockExtension))
+ if (!(getMemoryBlock() instanceof IMemoryBlockExtension)) {
return;
+ }
// do not handle event if the base address of the memory
// block has changed, wait for debug event to update to
// new location
- if (isBaseAddressChanged())
+ if (isBaseAddressChanged()) {
return;
+ }
- if(fContentProvider.getBufferTopAddress().equals(address))
+ if(fContentProvider.getBufferTopAddress().equals(address)) {
return;
+ }
BigInteger start = fContentInput.getStartAddress();
BigInteger end = fContentInput.getEndAddress();
@@ -655,8 +680,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// smaller than start address, load at start address
if (address.compareTo(start) < 0)
{
- if (isAtTopLimit())
+ if (isAtTopLimit()) {
return;
+ }
address = start;
}
@@ -664,8 +690,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// bigger than end address, no need to load, already at top
if (address.compareTo(end) > 0)
{
- if (isAtBottomLimit())
+ if (isAtBottomLimit()) {
return;
+ }
address = end.subtract(BigInteger.valueOf(getPageSizeInUnits()));
}
@@ -696,6 +723,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public Control createControl(Composite parent) {
fPageBook = new PageBook(parent, SWT.NONE);
@@ -719,10 +747,11 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fTableViewer= new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.HIDE_SELECTION | SWT.BORDER);
TableRenderingLabelProvider labelProvider;
- if (hasCustomizedDecorations())
+ if (hasCustomizedDecorations()) {
labelProvider = new TableRenderingLabelProviderEx(this);
- else
+ } else {
labelProvider = new TableRenderingLabelProvider(this);
+ }
fTableViewer.setLabelProvider(labelProvider);
@@ -743,8 +772,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// set up addressable size and figure out number of bytes required per line
fAddressableSize = -1;
try {
- if (getMemoryBlock() instanceof IMemoryBlockExtension)
+ if (getMemoryBlock() instanceof IMemoryBlockExtension) {
fAddressableSize = ((IMemoryBlockExtension)getMemoryBlock()).getAddressableSize();
+ }
} catch (DebugException e1) {
// log error and default to 1
fAddressableSize = 1;
@@ -752,8 +782,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
return;
}
- if (getAddressableSize() < 1)
+ if (getAddressableSize() < 1) {
fAddressableSize = 1;
+ }
// set up initial format
setupInitialFormat();
@@ -774,6 +805,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
// add listener to reload when we know the number of lines to load
fTableViewer.getTable().addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
fTableViewer.getTable().removePaintListener(this);
fContentInput.setNumLines(getNumberOfVisibleLines());
@@ -818,6 +850,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// set up table cursor
createCursor(fTableViewer.getTable(), fSelectedAddress);
fTableViewer.getTable().addMouseListener(new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
handleTableMouseEvent(e);
}});
@@ -828,6 +861,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
createPopupMenu(fTableCursor);
fMenuListener = new IMenuListener() {
+ @Override
public void menuAboutToShow(IMenuManager manager) {
fillContextMenu(manager);
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
@@ -863,6 +897,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
JFaceResources.getFontRegistry().addListener(this);
fScrollbarSelectionListener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent event) {
handleScrollBarSelection();
@@ -1007,8 +1042,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
if (elmt != null)
{
- if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL))
+ if (elmt.supportsProperty(this, IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL)) {
defaultColSize = getDefaultFromPersistableElement(IDebugPreferenceConstants.PREF_COL_SIZE_BY_MODEL);
+ }
}
if (defaultColSize <= 0)
@@ -1017,8 +1053,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
defaultColSize = getDefaultColumnSizeByModel(getMemoryBlock().getModelIdentifier());
}
- if (defaultColSize > 0)
+ if (defaultColSize > 0) {
columnSize = defaultColSize * getAddressableSize();
+ }
}
return columnSize;
}
@@ -1052,12 +1089,14 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
}
- if (defaultRowSize <= 0)
+ if (defaultRowSize <= 0) {
// no synchronized property, ask preference store by id
defaultRowSize = getDefaultRowSizeByModel(getMemoryBlock().getModelIdentifier());
+ }
- if (defaultRowSize > 0)
+ if (defaultRowSize > 0) {
bytePerLine = defaultRowSize * getAddressableSize();
+ }
}
return bytePerLine;
}
@@ -1107,6 +1146,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fTableCursor.setVisible(true);
fCursorKeyAdapter = new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e)
{
handleCursorKeyPressed(e);
@@ -1115,6 +1155,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fTableCursor.addKeyListener(fCursorKeyAdapter);
fCursorTraverseListener = new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
handleCursorTraverseEvt(e);
}};
@@ -1122,6 +1163,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fTableCursor.addTraverseListener(fCursorTraverseListener);
fCursorMouseListener = new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
handleCursorMouseEvent(e);
}};
@@ -1130,9 +1172,11 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// cursor may be disposed before disposed is called
// remove listeners whenever the cursor is disposed
fTableCursor.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
- if (fTableCursor == null)
+ if (fTableCursor == null) {
return;
+ }
fTableCursor.removeTraverseListener(fCursorTraverseListener);
fTableCursor.removeKeyListener(fCursorKeyAdapter);
fTableCursor.removeMouseListener(fCursorMouseListener);
@@ -1140,10 +1184,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}});
fCursorSelectionListener = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
- if (!fEvtHandleLock.acquireLock(this))
+ if (!fEvtHandleLock.acquireLock(this)) {
return;
+ }
handleCursorMoved();
@@ -1161,8 +1207,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private void handleCursorTraverseEvt(TraverseEvent e){
- if (fTableCursor.getRow() == null)
+ if (fTableCursor.getRow() == null) {
return;
+ }
Table table = (Table)fTableCursor.getParent();
int row = table.indexOf(fTableCursor.getRow());
@@ -1191,8 +1238,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
Object evtLockClient = new Object();
- if (!fEvtHandleLock.acquireLock(evtLockClient))
+ if (!fEvtHandleLock.acquireLock(evtLockClient)) {
return;
+ }
handleCursorMoved();
@@ -1206,8 +1254,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void handleCursorMoved()
{
- if (fIsDisposed)
+ if (fIsDisposed) {
return;
+ }
BigInteger selectedAddress = getSelectedAddressFromCursor(fTableCursor);
@@ -1220,8 +1269,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// now check to see if the cursor is approaching buffer limit
TableItem item = fTableCursor.getRow();
- if (item == null)
+ if (item == null) {
return;
+ }
if (getMemoryBlock() instanceof IMemoryBlockExtension)
{
@@ -1296,8 +1346,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
private BigInteger getAddressFromTableItem(TableItem row, int col) {
- if (row == null)
+ if (row == null) {
return null;
+ }
// get row address
String temp = ((TableRenderingLine)row.getData()).getAddress();
@@ -1326,12 +1377,14 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private boolean setCursorAtAddress(BigInteger address)
{
- if (fContentProvider.getBufferTopAddress() == null)
+ if (fContentProvider.getBufferTopAddress() == null) {
return false;
+ }
// selected address is out of range, simply return false
- if (address.compareTo(fContentProvider.getBufferTopAddress()) < 0)
+ if (address.compareTo(fContentProvider.getBufferTopAddress()) < 0) {
return false;
+ }
// calculate selected row address
int addressableUnit = getAddressableUnitPerLine();
@@ -1353,8 +1406,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
int colAddressableUnit = getAddressableUnitPerColumn();
int col = ((offset.intValue()/colAddressableUnit)+1);
- if (col == 0)
+ if (col == 0) {
col = 1;
+ }
fTableCursor.setSelection(row, col);
@@ -1370,6 +1424,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* @return true if format is successful, false, otherwise
*
*/
+ @Override
public boolean format(int bytesPerLine, int columnSize)
{
@@ -1398,17 +1453,20 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fColumnSize = columnSize;
Object evtLockClient = new Object();
- if (!fEvtHandleLock.acquireLock(evtLockClient))
+ if (!fEvtHandleLock.acquireLock(evtLockClient)) {
return false;
+ }
// if the tab is already created and is being reformatted
if (fIsCreated)
{
- if (fTableViewer == null)
+ if (fTableViewer == null) {
return false;
+ }
- if (fTableViewer.getTable() == null)
+ if (fTableViewer.getTable() == null) {
return false;
+ }
// clean up old columns
TableColumn[] oldColumns = fTableViewer.getTable().getColumns();
@@ -1441,8 +1499,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
// check that column labels are not null
- if (columnLabels == null)
+ if (columnLabels == null) {
columnLabels = new String[0];
+ }
for (int i=0;i<byteColumns.length; i++)
{
@@ -1520,12 +1579,14 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// for Linux GTK, this must happen after table viewer is refreshed
int i = findAddressIndex(fTopRowAddress);
- if (i >= 0)
+ if (i >= 0) {
setTopIndex(fTableViewer.getTable(), i);
+ }
- if (isAddressVisible(selectedAddress))
+ if (isAddressVisible(selectedAddress)) {
// after refresh, make sure the cursor is at the correct position
- setCursorAtAddress(selectedAddress);
+ setCursorAtAddress(selectedAddress);
+ }
}
fEvtHandleLock.releaseLock(evtLockClient);
@@ -1572,8 +1633,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
styleText = fTextViewer.getTextWidget();
- if (styleText != null)
+ if (styleText != null) {
styleText.setText(DebugUIMessages.AbstractTableRendering_3 + e.getMessage());
+ }
fPageBook.showPage(fTextViewer.getControl());
// clear content cache if we need to display error
@@ -1593,6 +1655,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#getControl()
*/
+ @Override
public Control getControl() {
return fPageBook;
}
@@ -1602,6 +1665,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return the addressable size of this rendering's memory block in bytes
*/
+ @Override
public int getAddressableSize() {
return fAddressableSize;
}
@@ -1610,8 +1674,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
- if (syncService == null)
+ if (syncService == null) {
return null;
+ }
return syncService.getProperty(getMemoryBlock(), propertyId);
}
@@ -1623,8 +1688,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private int getNumberOfVisibleLines()
{
- if(fTableViewer == null)
+ if(fTableViewer == null) {
return -1;
+ }
Table table = fTableViewer.getTable();
int height = fTableViewer.getTable().getSize().y;
@@ -1677,8 +1743,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
- if (syncService == null)
+ if (syncService == null) {
return;
+ }
syncService.addPropertyChangeListener(this, null);
@@ -1686,8 +1753,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// do not update sync property in this case
if (!isDisplayingError())
{
- if (syncService.getSynchronizationProvider() == null)
+ if (syncService.getSynchronizationProvider() == null) {
syncService.setSynchronizationProvider(this);
+ }
// check if there is already synchronization info available
Object selectedAddress =getSynchronizedProperty( AbstractTableRendering.PROPERTY_SELECTED_ADDRESS);
@@ -1698,8 +1766,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
if (!isDynamicLoad())
{
Object pageStartAddress = getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
- if (pageStartAddress == null)
+ if (pageStartAddress == null) {
updateSyncPageStartAddress();
+ }
}
// if info is available, some other view tab has already been
@@ -1733,8 +1802,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
BigInteger pageStart = (BigInteger)getSynchronizedProperty(IInternalDebugUIConstants.PROPERTY_PAGE_START_ADDRESS);
if (pageStart != null && fContentInput != null && fContentInput.getLoadAddress() != null)
{
- if (!fContentInput.getLoadAddress().equals(pageStart))
+ if (!fContentInput.getLoadAddress().equals(pageStart)) {
handlePageStartAddressChanged(pageStart);
+ }
}
else if (pageStart != null)
{
@@ -1781,6 +1851,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/**
* Resize column to the preferred size.
*/
+ @Override
public void resizeColumnsToPreferredSize() {
// pack columns
Table table = fTableViewer.getTable();
@@ -1802,8 +1873,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void updateSyncSelectedAddress() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_SELECTED_ADDRESS, null, fSelectedAddress);
firePropertyChangedEvent(event);
}
@@ -1813,8 +1885,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void updateSyncColSize() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_COL_SIZE, null, new Integer(fColumnSize));
firePropertyChangedEvent(event);
@@ -1825,8 +1898,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void updateSyncRowSize() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_ROW_SIZE, null, new Integer(fBytePerLine));
firePropertyChangedEvent(event);
@@ -1837,8 +1911,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void updateSyncTopAddress() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
PropertyChangeEvent event = new PropertyChangeEvent(this, AbstractTableRendering.PROPERTY_TOP_ADDRESS, null, fTopRowAddress);
firePropertyChangedEvent(event);
@@ -1846,11 +1921,13 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private void updateSyncPageStartAddress() {
- if (!fIsCreated)
+ if (!fIsCreated) {
return;
+ }
- if (isBaseAddressChanged())
+ if (isBaseAddressChanged()) {
return;
+ }
BigInteger pageStart;
if (isDynamicLoad())
@@ -1910,6 +1987,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return number of addressable units per row
*/
+ @Override
public int getAddressableUnitPerLine() {
return fBytePerLine / getAddressableSize();
}
@@ -1919,6 +1997,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return number of addressable units per column
*/
+ @Override
public int getAddressableUnitPerColumn() {
return fColumnSize / getAddressableSize();
}
@@ -1928,6 +2007,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return the number of bytes displayed in a single column cell
*/
+ @Override
public int getBytesPerColumn()
{
return fColumnSize;
@@ -1938,6 +2018,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return the number of bytes displayed in a row
*/
+ @Override
public int getBytesPerLine()
{
return fBytePerLine;
@@ -1946,6 +2027,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/**
* Updates labels of this rendering.
*/
+ @Override
public void updateLabels()
{
// update tab labels
@@ -1964,9 +2046,11 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return label of this rendering
*/
+ @Override
public String getLabel() {
- if (fLabel == null)
+ if (fLabel == null) {
fLabel = buildLabel(true);
+ }
return fLabel;
}
@@ -1996,7 +2080,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
if (label.startsWith("&")) //$NON-NLS-1$
+ {
label = "&" + label; //$NON-NLS-1$
+ }
try {
if (showAddress && ((IMemoryBlockExtension)getMemoryBlock()).getBigBaseAddress() != null)
@@ -2017,7 +2103,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
String preName = DebugUITools.getMemoryRenderingManager().getRenderingType(getRenderingId()).getLabel();
if (preName != null)
+ {
label += " <" + preName + ">"; //$NON-NLS-1$ //$NON-NLS-2$
+ }
return decorateLabel(label);
}
@@ -2033,8 +2121,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
// check that column labels returned are not null
- if (columnLabels == null)
+ if (columnLabels == null) {
columnLabels = new String[0];
+ }
int numByteColumns = fBytePerLine/fColumnSize;
@@ -2071,6 +2160,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* Refresh the table viewer with the current top visible address.
* Update labels in the memory rendering.
*/
+ @Override
public void refresh()
{
// refresh at start address of this memory block
@@ -2112,10 +2202,11 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
else
{
// reload at top of table
- if (isDynamicLoad())
+ if (isDynamicLoad()) {
address = getTopVisibleAddress();
- else
+ } else {
address = fContentInput.getLoadAddress();
+ }
reloadTable(address, true);
}
} catch (DebugException e) {
@@ -2132,18 +2223,20 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
synchronized private void reloadTable(BigInteger topAddress, boolean updateDelta){
- if (fTableViewer == null)
+ if (fTableViewer == null) {
return;
+ }
try
{
Table table = (Table)fTableViewer.getControl();
TableRenderingContentInput input;
- if (isDynamicLoad())
+ if (isDynamicLoad()) {
input = new TableRenderingContentInput(this, fPreBuffer, fPostBuffer, topAddress, getNumberOfVisibleLines(), updateDelta, null);
- else
+ } else {
input = new TableRenderingContentInput(this, fContentInput.getPreBuffer(), fContentInput.getPostBuffer(), topAddress, fPageSize, updateDelta, null);
+ }
fContentInput = input;
fTableViewer.setInput(fContentInput);
@@ -2161,8 +2254,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
// cursor needs to be refreshed after reload
- if (isAddressVisible(fSelectedAddress))
+ if (isAddressVisible(fSelectedAddress)) {
setCursorAtAddress(fSelectedAddress);
+ }
}
else
{
@@ -2184,8 +2278,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private BigInteger getTopVisibleAddress() {
- if (fTableViewer == null)
+ if (fTableViewer == null) {
return BigInteger.valueOf(0);
+ }
Table table = fTableViewer.getTable();
int topIndex = getTopVisibleIndex(table);
@@ -2276,20 +2371,24 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#dispose()
*/
+ @Override
public void dispose() {
try {
// prevent rendering from being disposed again
- if (fIsDisposed)
+ if (fIsDisposed) {
return;
+ }
fIsDisposed = true;
- if (fContentProvider != null)
+ if (fContentProvider != null) {
fContentProvider.dispose();
+ }
ScrollBar scroll = ((Table)fTableViewer.getControl()).getVerticalBar();
- if (scroll != null && !scroll.isDisposed())
+ if (scroll != null && !scroll.isDisposed()) {
scroll.removeSelectionListener(fScrollbarSelectionListener);
+ }
if (!fTableCursor.isDisposed())
{
@@ -2315,8 +2414,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// remove the view tab from the synchronizer
IMemoryRenderingSynchronizationService syncService = getMemoryRenderingContainer().getMemoryRenderingSite().getSynchronizationService();
- if (syncService != null)
+ if (syncService != null) {
syncService.removePropertyChangeListener(this);
+ }
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
@@ -2371,12 +2471,14 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* @param address address to position cursor at
* @throws DebugException if an exception occurs
*/
+ @Override
public void goToAddress(BigInteger address) throws DebugException {
Object evtLockClient = new Object();
try
{
- if (!fEvtHandleLock.acquireLock(evtLockClient))
+ if (!fEvtHandleLock.acquireLock(evtLockClient)) {
return;
+ }
// if address is within the range, highlight
if (!isAddressOutOfRange(address))
@@ -2468,8 +2570,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
// if view tab is not yet created
// cursor should always be visible
- if (!fIsCreated)
+ if (!fIsCreated) {
return true;
+ }
BigInteger topVisible = getTopVisibleAddress();
int addressableUnit = getAddressableUnitPerLine();
@@ -2513,8 +2616,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
Object evtLockClient = new Object();
try
{
- if (fIsDisposed)
+ if (fIsDisposed) {
return;
+ }
BigInteger address = getTopVisibleAddress();
@@ -2524,8 +2628,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
updateSyncTopAddress();
}
- if (!fEvtHandleLock.acquireLock(evtLockClient))
+ if (!fEvtHandleLock.acquireLock(evtLockClient)) {
return;
+ }
if (getMemoryBlock() instanceof IMemoryBlockExtension)
{
@@ -2551,8 +2656,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
else if (getBufferThreshold(BUFFER_END) != 0 &&
(numInBuffer-(index+getNumberOfVisibleLines())) <= getBufferThreshold(BUFFER_END))
{
- if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0)
+ if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0) {
reloadTable(address, false);
+ }
}
}
else
@@ -2562,10 +2668,11 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
}
- if (isAddressVisible(fSelectedAddress))
+ if (isAddressVisible(fSelectedAddress)) {
fTableCursor.setVisible(true);
- else
+ } else {
fTableCursor.setVisible(false);
+ }
}
}
finally
@@ -2583,8 +2690,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
BigInteger startBufferAddress = fContentProvider.getBufferTopAddress();
startBufferAddress = MemoryViewUtil.alignToBoundary(startBufferAddress, getAddressableUnitPerLine());
- if (startAddress.compareTo(startBufferAddress) == 0)
+ if (startAddress.compareTo(startBufferAddress) == 0) {
return true;
+ }
return false;
}
@@ -2597,8 +2705,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
BigInteger endBufferAddress = fContentProvider.getBufferEndAddress();
endBufferAddress = MemoryViewUtil.alignToBoundary(endBufferAddress, getAddressableUnitPerLine());
- if (endAddress.compareTo(endBufferAddress) == 0)
+ if (endAddress.compareTo(endBufferAddress) == 0) {
return true;
+ }
return false;
}
@@ -2611,8 +2720,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
TableItem firstItem = table.getItem(0);
TableItem lastItem = table.getItem(table.getItemCount()-1);
- if (firstItem == null || lastItem == null)
+ if (firstItem == null || lastItem == null) {
return true;
+ }
TableRenderingLine first = (TableRenderingLine)firstItem.getData();
TableRenderingLine last = (TableRenderingLine) lastItem.getData();
@@ -2640,16 +2750,18 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
BigInteger numTopLine = topVisibleAddress.subtract(startAddress).divide(BigInteger.valueOf(addressableUnit));
if (numTopLine.compareTo(BigInteger.valueOf(getBufferThreshold(BUFFER_START))) <= 0 && (startAddress.compareTo(BigInteger.valueOf(0)) != 0))
{
- if (!isAtTopLimit() && getBufferThreshold(BUFFER_START) > 0)
+ if (!isAtTopLimit() && getBufferThreshold(BUFFER_START) > 0) {
return true;
+ }
}
// if there are only 3 lines left at the bottom, refresh
BigInteger numBottomLine = lastAddress.subtract(lastVisibleAddrss).divide(BigInteger.valueOf(addressableUnit));
if (numBottomLine.compareTo(BigInteger.valueOf(getBufferThreshold(BUFFER_END))) <= 0)
{
- if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0)
+ if (!isAtBottomLimit() && getBufferThreshold(BUFFER_END) > 0) {
return true;
+ }
}
return false;
@@ -2681,8 +2793,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
// if column position cannot be determined, return
- if (colNum < 1)
+ if (colNum < 1) {
return;
+ }
// handle user mouse click onto table
// move cursor to new position
@@ -2706,10 +2819,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void columnSizeChanged(final int newColumnSize) {
// ignore event if view tab is disabled
- if (!isVisible())
+ if (!isVisible()) {
return;
+ }
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
format(getBytesPerLine(), newColumnSize);
}
@@ -2722,17 +2837,20 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private void rowSizeChanged(final int newRowSize)
{
// ignore event if view tab is disabled
- if (!isVisible())
+ if (!isVisible()) {
return;
+ }
int bytesPerLine = newRowSize;
int col = getBytesPerColumn();
- if (bytesPerLine < getBytesPerColumn())
+ if (bytesPerLine < getBytesPerColumn()) {
col = bytesPerLine;
+ }
final int columnSize = col;
final int rowSize = bytesPerLine;
Display.getDefault().asyncExec(new Runnable() {
+ @Override
public void run() {
format(rowSize, columnSize);
}
@@ -2743,8 +2861,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
if (e.button == 1)
{
int col = fTableCursor.getColumn();
- if (col > 0 && col <= (getNumCol()))
+ if (col > 0 && col <= (getNumCol())) {
activateCellEditor(null);
+ }
}
}
@@ -2758,8 +2877,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
int col = fTableCursor.getColumn();
int row = findAddressIndex(fSelectedAddress);
- if (row < 0)
+ if (row < 0) {
return;
+ }
// do not allow user to edit address column
if (col == 0 || col > getNumCol())
{
@@ -2790,8 +2910,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
boolean canEdit = cellModifier.canModify(element, (String)property);
((TableRenderingCellModifier)cellModifier).setEditActionInvoked(false);
- if (!canEdit)
+ if (!canEdit) {
return;
+ }
// activate based on current cursor position
TextCellEditor selectedEditor = (TextCellEditor)fTableViewer.getCellEditors()[col];
@@ -2844,6 +2965,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*/
private void addListeners(Text text) {
fEditorFocusListener = new FocusAdapter() {
+ @Override
public void focusLost(FocusEvent e)
{
handleTableEditorFocusLost(e);
@@ -2852,6 +2974,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
text.addFocusListener(fEditorFocusListener);
fEditorKeyListener = new KeyAdapter() {
+ @Override
public void keyPressed(KeyEvent e) {
handleKeyEventInEditor(e);
}
@@ -2875,6 +2998,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run()
{
try
@@ -2913,6 +3037,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
final KeyEvent e = event;
Display.getDefault().asyncExec(new Runnable()
{
+ @Override
public void run()
{
Text text = (Text)e.getSource();
@@ -2926,8 +3051,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
case SWT.ARROW_UP :
// move text editor box up one row
- if (row-1 < 0)
+ if (row-1 < 0) {
return;
+ }
// modify value for current cell
modifyValue(row, col, text.getText());
@@ -2946,8 +3072,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
// move text editor box down one row
- if (row+1 >= fTableViewer.getTable().getItemCount())
+ if (row+1 >= fTableViewer.getTable().getItemCount()) {
return;
+ }
// modify value for current cell
modifyValue(row, col, text.getText());
@@ -3081,6 +3208,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesHidden()
*/
+ @Override
public void becomesHidden() {
if (isVisible() == false)
@@ -3107,6 +3235,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IMemoryRendering#becomesVisible()
*/
+ @Override
public void becomesVisible() {
// do not do anything if already visible
@@ -3120,11 +3249,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
super.becomesVisible();
boolean value = DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugPreferenceConstants.PREF_DYNAMIC_LOAD_MEM);
- if (value != isDynamicLoad())
+ if (value != isDynamicLoad()) {
// this call will cause a reload
handleDyanicLoadChanged();
- else
+ } else {
refresh();
+ }
synchronize();
updateRenderingLabel(true);
@@ -3138,6 +3268,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @deprecated use <code>resetRendering</code> to reset this rendering.
*/
+ @Deprecated
public void reset()
{
try {
@@ -3176,6 +3307,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return the currently selected address in this rendering
*/
+ @Override
public BigInteger getSelectedAddress() {
return fSelectedAddress;
}
@@ -3185,10 +3317,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
*
* @return the currently selected content in this rendering
*/
+ @Override
public String getSelectedAsString() {
- if (isAddressOutOfRange(fSelectedAddress))
+ if (isAddressOutOfRange(fSelectedAddress)) {
return IInternalDebugCoreConstants.EMPTY_STRING;
+ }
int col = fTableCursor.getColumn();
TableItem rowItem = fTableCursor.getRow();
@@ -3216,10 +3350,12 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* @return the currently selected content in array of MemoryByte.
* Returns an empty array if the selected address is out of buffered range.
*/
+ @Override
public MemoryByte[] getSelectedAsBytes()
{
- if (isAddressOutOfRange(fSelectedAddress))
+ if (isAddressOutOfRange(fSelectedAddress)) {
return new MemoryByte[0];
+ }
int col = fTableCursor.getColumn();
TableItem rowItem = fTableCursor.getRow();
@@ -3231,8 +3367,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
}
Object data = rowItem.getData();
- if (data == null || !(data instanceof TableRenderingLine))
+ if (data == null || !(data instanceof TableRenderingLine)) {
return new MemoryByte[0];
+ }
TableRenderingLine line = (TableRenderingLine)data;
int offset = (col-1)*(getAddressableUnitPerColumn()*getAddressableSize());
@@ -3255,6 +3392,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* @return the number of characters a byte will convert to
* or -1 if unknown
*/
+ @Override
public int getNumCharsPerByte()
{
return -1;
@@ -3288,37 +3426,46 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
- if (adapter == IColorProvider.class)
+ if (adapter == IColorProvider.class) {
return getColorProviderAdapter();
+ }
- if (adapter == ILabelProvider.class)
+ if (adapter == ILabelProvider.class) {
return getLabelProviderAdapter();
+ }
- if (adapter == IFontProvider.class)
+ if (adapter == IFontProvider.class) {
return getFontProviderAdapter();
+ }
- if (adapter == IMemoryBlockTablePresentation.class)
+ if (adapter == IMemoryBlockTablePresentation.class) {
return getTablePresentationAdapter();
+ }
if (adapter == IWorkbenchAdapter.class)
{
// needed workbench adapter to fill the title of property page
if (fWorkbenchAdapter == null) {
fWorkbenchAdapter = new IWorkbenchAdapter() {
+ @Override
public Object[] getChildren(Object o) {
return new Object[0];
}
+ @Override
public ImageDescriptor getImageDescriptor(Object object) {
return null;
}
+ @Override
public String getLabel(Object o) {
return AbstractTableRendering.this.getLabel();
}
+ @Override
public Object getParent(Object o) {
return null;
}
@@ -3330,6 +3477,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
if (adapter == IMemoryBlockConnection.class) {
if (fConnection == null) {
fConnection = new IMemoryBlockConnection() {
+ @Override
public void update() {
try {
fContentProvider.takeContentSnapshot();
@@ -3346,13 +3494,14 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fContentInput.setLoadAddress(address);
}
fContentProvider.loadContentForExtendedMemoryBlock();
- }
- else
+ } else {
fContentProvider.loadContentForSimpleMemoryBlock();
+ }
// update UI asynchronously
Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
updateLabels();
@@ -3375,8 +3524,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
fTableCursor.setVisible(false);
}
- if (!isDynamicLoad())
+ if (!isDynamicLoad()) {
updateSyncPageStartAddress();
+ }
updateSyncTopAddress();
}
@@ -3397,8 +3547,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
if (getFontProviderAdapter() == null &&
getColorProviderAdapter() == null &&
- getLabelProviderAdapter() == null)
+ getLabelProviderAdapter() == null) {
return false;
+ }
return true;
}
@@ -3411,8 +3562,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
BigInteger baseAddress = ((IMemoryBlockExtension)mb).getBigBaseAddress();
if (baseAddress != null)
{
- if (!baseAddress.equals(fContentInput.getContentBaseAddress()))
+ if (!baseAddress.equals(fContentInput.getContentBaseAddress())) {
return true;
+ }
}
}
} catch (DebugException e1) {
@@ -3529,23 +3681,28 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
private TableItem fTooltipItem = null;
private int fCol = -1;
+ @Override
public void mouseExit(MouseEvent e){
- if (!fToolTipShell.isDisposed())
+ if (!fToolTipShell.isDisposed()) {
fToolTipShell.setVisible(false);
+ }
fTooltipItem = null;
}
+ @Override
public void mouseHover(MouseEvent e){
Point hoverPoint = new Point(e.x, e.y);
Control control = null;
- if (e.widget instanceof Control)
+ if (e.widget instanceof Control) {
control = (Control)e.widget;
+ }
- if (control == null)
+ if (control == null) {
return;
+ }
hoverPoint = control.toDisplay(hoverPoint);
TableItem item = getItem(hoverPoint);
@@ -3599,8 +3756,9 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
start = fTableViewer.getTable().toDisplay(start);
Point end = new Point(start.x + items[i].getBounds(0).width, start.y + items[i].getBounds(0).height);
- if (start.y < point.y && point.y < end.y)
+ if (start.y < point.y && point.y < end.y) {
return items[i];
+ }
}
return null;
}
@@ -3652,6 +3810,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.IResettableMemoryRendering#resetRendering()
*/
+ @Override
public void resetRendering() throws DebugException {
resetToBaseAddress();
}
@@ -3686,14 +3845,16 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
String str = getToolTipText(address, bytes);
- if (str != null)
+ if (str != null) {
((Label) toolTipControl).setText(str);
+ }
} else {
String str = getToolTipText(address,
new MemoryByte[] {});
- if (str != null)
+ if (str != null) {
((Label) toolTipControl).setText(str);
+ }
}
}
}
@@ -3767,13 +3928,15 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
{
if (startOrEnd == BUFFER_START)
{
- if (BUFFER_THRESHOLD > fPreBuffer)
+ if (BUFFER_THRESHOLD > fPreBuffer) {
return fPreBuffer;
+ }
return BUFFER_THRESHOLD;
}
- if (BUFFER_THRESHOLD > fPostBuffer)
+ if (BUFFER_THRESHOLD > fPostBuffer) {
return fPostBuffer;
+ }
return BUFFER_THRESHOLD;
}
@@ -3791,6 +3954,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* Returns a string to pad the cell if the memory cannot be converted
* successfully.
*/
+ @Override
abstract public String getString(String renderingTypeId, BigInteger address, MemoryByte[] data);
/**
@@ -3807,6 +3971,7 @@ public abstract class AbstractTableRendering extends AbstractBaseTableRendering
* @param newValue the string to be converted to bytes
* @return the bytes converted from a string
*/
+ @Override
abstract public byte[] getBytes(String renderingTypeId, BigInteger address, MemoryByte[] currentValues, String newValue);
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java
index 97c7fbb70..fc5758bd8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/memory/AbstractTextRendering.java
@@ -84,6 +84,7 @@ abstract public class AbstractTextRendering extends AbstractTableRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.AbstractTableRendering#getString(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[])
*/
+ @Override
public String getString(String dataType, BigInteger address, MemoryByte[] data) {
try {
String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR);
@@ -127,6 +128,7 @@ abstract public class AbstractTextRendering extends AbstractTableRendering {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.memory.AbstractTableRendering#getBytes(java.lang.String, java.math.BigInteger, org.eclipse.debug.core.model.MemoryByte[], java.lang.String)
*/
+ @Override
public byte[] getBytes(String dataType, BigInteger address, MemoryByte[] currentValues, String data) {
try {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java
index 6a7a19fc6..2473d0717 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/AbstractSourceContainerBrowser.java
@@ -26,6 +26,7 @@ public class AbstractSourceContainerBrowser implements ISourceContainerBrowser {
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#addSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public ISourceContainer[] addSourceContainers(Shell shell, ISourceLookupDirector director) {
return new ISourceContainer[0];
}
@@ -36,12 +37,14 @@ public class AbstractSourceContainerBrowser implements ISourceContainerBrowser {
*
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#canAddSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector)
*/
+ @Override
public boolean canAddSourceContainers(ISourceLookupDirector director) {
return true;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#editSourceContainers(org.eclipse.swt.widgets.Shell, org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public ISourceContainer[] editSourceContainers(Shell shell, ISourceLookupDirector director, ISourceContainer[] containers) {
return new ISourceContainer[0];
}
@@ -52,6 +55,7 @@ public class AbstractSourceContainerBrowser implements ISourceContainerBrowser {
*
* @see org.eclipse.debug.internal.ui.sourcelookup.ISourceContainerBrowser#canEditSourceContainers(org.eclipse.debug.core.sourcelookup.ISourceLookupDirector, org.eclipse.debug.core.sourcelookup.ISourceContainer[])
*/
+ @Override
public boolean canEditSourceContainers(ISourceLookupDirector director, ISourceContainer[] containers) {
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
index 5eb24d2fb..36ef02631 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditor.java
@@ -75,18 +75,21 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#doSave(org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public void doSave(IProgressMonitor monitor) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#doSaveAs()
*/
+ @Override
public void doSaveAs() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
*/
+ @Override
public void init(IEditorSite site, IEditorInput input) throws PartInitException {
setSite(site);
setInput(input);
@@ -96,6 +99,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#isDirty()
*/
+ @Override
public boolean isDirty() {
return false;
}
@@ -103,6 +107,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
*/
+ @Override
public boolean isSaveAsAllowed() {
return false;
}
@@ -110,6 +115,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
GridLayout topLayout = new GridLayout();
GridData data = new GridData();
@@ -150,6 +156,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
button.setLayoutData(data);
button.setText(SourceLookupUIMessages.addSourceLocation_addButton2);
button.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent evt) {
editSourceLookupPath();
}
@@ -199,6 +206,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
/* (non-Javadoc)
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
if (fText != null) {
fText.setFocus();
@@ -208,6 +216,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
/* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#setInput(org.eclipse.ui.IEditorInput)
*/
+ @Override
public void setInput(IEditorInput input) {
super.setInput(input);
setPartName(input.getName());
@@ -234,6 +243,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
{
final IEditorPart editor = this;
DebugUIPlugin.getStandardDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
IWorkbenchWindow activeWorkbenchWindow = DebugUIPlugin.getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
@@ -252,6 +262,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
*
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
if (fLaunchesListener != null)
DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(fLaunchesListener);
@@ -282,6 +293,7 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
protected void initialize()
{
fLaunchesListener = new ILaunchesListener2() {
+ @Override
public void launchesTerminated(ILaunch[] launches) {
Object artifact = getArtifact();
if (artifact instanceof IDebugElement) {
@@ -296,13 +308,16 @@ public class CommonSourceNotFoundEditor extends EditorPart implements IReusableE
}
}
+ @Override
public void launchesRemoved(ILaunch[] launches) {
launchesTerminated(launches);
}
+ @Override
public void launchesAdded(ILaunch[] launches) {
}
+ @Override
public void launchesChanged(ILaunch[] launches) {
}};
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java
index 1dc8eed64..4529315d2 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/CommonSourceNotFoundEditorInput.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,8 +10,6 @@
*******************************************************************************/
package org.eclipse.debug.ui.sourcelookup;
-import com.ibm.icu.text.MessageFormat;
-
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.debug.internal.core.IInternalDebugCoreConstants;
import org.eclipse.debug.internal.ui.sourcelookup.SourceLookupUIMessages;
@@ -21,6 +19,8 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Editor input for the <code>CommonSourceNotFoundEditor</code>. The editor
* input can be created on an artifact that has a source association.
@@ -61,6 +61,7 @@ public class CommonSourceNotFoundEditorInput extends PlatformObject implements I
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#exists()
*/
+ @Override
public boolean exists() {
return false;
}
@@ -68,6 +69,7 @@ public class CommonSourceNotFoundEditorInput extends PlatformObject implements I
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getImageDescriptor()
*/
+ @Override
public ImageDescriptor getImageDescriptor() {
return DebugUITools.getDefaultImageDescriptor(fArtifact);
}
@@ -75,6 +77,7 @@ public class CommonSourceNotFoundEditorInput extends PlatformObject implements I
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getName()
*/
+ @Override
public String getName() {
return fLabel;
}
@@ -82,6 +85,7 @@ public class CommonSourceNotFoundEditorInput extends PlatformObject implements I
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getPersistable()
*/
+ @Override
public IPersistableElement getPersistable() {
return null;
}
@@ -89,8 +93,9 @@ public class CommonSourceNotFoundEditorInput extends PlatformObject implements I
/* (non-Javadoc)
* @see org.eclipse.ui.IEditorInput#getToolTipText()
*/
+ @Override
public String getToolTipText() {
- return MessageFormat.format(SourceLookupUIMessages.addSourceLocation_editorMessage, new String[] { fLabel });
+ return MessageFormat.format(SourceLookupUIMessages.addSourceLocation_editorMessage, new Object[] { fLabel });
}
/**
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java
index 7aa5cc772..4cc9f57b8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupDialog.java
@@ -65,6 +65,7 @@ public class SourceLookupDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createDialogArea(Composite parent) {
// create a composite with standard margins and spacing
setTitle(SourceLookupUIMessages.manageSourceDialog_description);
@@ -101,6 +102,7 @@ public class SourceLookupDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
+ @Override
protected void okPressed() {
ILaunchConfiguration config = fDirector.getLaunchConfiguration();
ILaunchConfigurationWorkingCopy copy = null;
@@ -118,6 +120,7 @@ public class SourceLookupDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(SourceLookupUIMessages.manageSourceDialog_title);
@@ -126,6 +129,7 @@ public class SourceLookupDialog extends TitleAreaDialog {
/* (non-Javadoc)
* @see org.eclipse.jface.window.Window#close()
*/
+ @Override
public boolean close() {
fPanel.dispose();
return super.close();
@@ -135,7 +139,8 @@ public class SourceLookupDialog extends TitleAreaDialog {
* @see org.eclipse.jface.dialogs.Dialog#getDialogBoundsSettings()
* @since 3.2
*/
- protected IDialogSettings getDialogBoundsSettings() {
+ @Override
+ protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = DebugUIPlugin.getDefault().getDialogSettings();
IDialogSettings section = settings.getSection(getClass().getName());
if (section == null) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java
index 26cb0af2a..af2f4edd6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/SourceLookupTab.java
@@ -56,6 +56,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
@@ -80,6 +81,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
}
@@ -87,6 +89,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
fSourceLookupPanel.initializeFrom(configuration);
}
@@ -94,6 +97,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
fSourceLookupPanel.performApply(configuration);
}
@@ -101,6 +105,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
*/
+ @Override
public String getId() {
return "org.eclipse.debug.ui.sourceLookupTab"; //$NON-NLS-1$
}
@@ -108,6 +113,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return SourceLookupUIMessages.sourceTab_tabTitle;
}
@@ -115,6 +121,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return DebugPluginImages.getImage(IInternalDebugUIConstants.IMG_SRC_LOOKUP_TAB);
}
@@ -122,6 +129,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
fSourceLookupPanel.activated(workingCopy);
}
@@ -129,6 +137,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
+ @Override
public void dispose() {
if (fSourceLookupPanel != null) {
if (fSourceLookupPanel.getDirector() != null) {
@@ -143,6 +152,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getErrorMessage()
*/
+ @Override
public String getErrorMessage() {
if (fSourceLookupPanel != null) {
return fSourceLookupPanel.getErrorMessage();
@@ -152,6 +162,7 @@ public class SourceLookupTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getMessage()
*/
+ @Override
public String getMessage() {
if (fSourceLookupPanel != null) {
return fSourceLookupPanel.getMessage();
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
index 5f8d0f05f..62ada047d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/sourcelookup/WorkingSetSourceContainer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
+ * Copyright (c) 2003, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.debug.ui.sourcelookup;
import java.util.ArrayList;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
@@ -53,6 +54,7 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getName()
*/
+ @Override
public String getName() {
return fWorkingSet.getName();
}
@@ -60,6 +62,7 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
if (obj != null && obj instanceof WorkingSetSourceContainer) {
return ((WorkingSetSourceContainer)obj).fWorkingSet.equals(fWorkingSet);
@@ -67,6 +70,7 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
return false;
}
+ @Override
public int hashCode() {
return fWorkingSet.hashCode();
}
@@ -74,6 +78,7 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.ISourceContainer#getType()
*/
+ @Override
public ISourceContainerType getType() {
return getSourceContainerType(TYPE_ID);
}
@@ -81,13 +86,15 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
/* (non-Javadoc)
* @see org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer#createSourceContainers()
*/
+ @Override
protected ISourceContainer[] createSourceContainers() throws CoreException {
IAdaptable[] elements = fWorkingSet.getElements();
- if(elements == null)
+ if(elements == null) {
return new ISourceContainer[0];
+ }
- ArrayList locationList = new ArrayList();
+ ArrayList<ISourceContainer> locationList = new ArrayList<ISourceContainer>();
for (int i = 0; i < elements.length; i++) {
IResource resource = (IResource) elements[i].getAdapter(IResource.class);
@@ -100,10 +107,11 @@ public class WorkingSetSourceContainer extends CompositeSourceContainer{
locationList.add(new ProjectSourceContainer((IProject)resource, true));
break;
//if the element corresponds to an IFile, do nothing
+ default:
+ break;
}
}
}
- return (ISourceContainer[])locationList.toArray(new ISourceContainer[locationList.size()]);
+ return locationList.toArray(new ISourceContainer[locationList.size()]);
}
-
}
diff --git a/org.eclipse.ui.console/.classpath b/org.eclipse.ui.console/.classpath
index ce7393340..ad32c83a7 100644
--- a/org.eclipse.ui.console/.classpath
+++ b/org.eclipse.ui.console/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/org.eclipse.ui.console/.settings/.api_filters b/org.eclipse.ui.console/.settings/.api_filters
new file mode 100644
index 000000000..2542cfd89
--- /dev/null
+++ b/org.eclipse.ui.console/.settings/.api_filters
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.ui.console" version="2">
+ <resource path="src/org/eclipse/ui/console/TextConsolePage.java" type="org.eclipse.ui.console.TextConsolePage">
+ <filter comment="Known illegal use" id="574668824">
+ <message_arguments>
+ <message_argument value="IPageBookViewPage"/>
+ <message_argument value="TextConsolePage"/>
+ <message_argument value="IPage"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.ui.console/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
diff --git a/org.eclipse.ui.console/META-INF/MANIFEST.MF b/org.eclipse.ui.console/META-INF/MANIFEST.MF
index 21638453f..2eaa3af35 100644
--- a/org.eclipse.ui.console/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.console/META-INF/MANIFEST.MF
@@ -14,7 +14,7 @@ Require-Bundle: org.eclipse.ui;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)"
+ org.eclipse.core.variables;bundle-version="[3.2.800,4.0.0)"
Bundle-ActivationPolicy: lazy
Import-Package: com.ibm.icu.text
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
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
index 99fb78418..772f7c15f 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/AbstractConsole.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,34 +29,35 @@ import org.eclipse.ui.internal.console.ConsoleMessages;
* @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 <code>init()</code>
* and <code>dispose()</code>.
*/
class Lifecycle implements IConsoleListener {
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void consolesAdded(IConsole[] consoles) {
for (int i = 0; i < consoles.length; i++) {
IConsole console = consoles[i];
@@ -70,6 +71,7 @@ public abstract class AbstractConsole implements IConsole {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void consolesRemoved(IConsole[] consoles) {
for (int i = 0; i < consoles.length; i++) {
IConsole console = consoles[i];
@@ -80,33 +82,35 @@ public abstract class AbstractConsole implements IConsole {
}
}
}
-
+
/**
* 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)
*/
+ @Override
public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.AbstractConsole_0, 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()
*/
+ @Override
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) {
@@ -118,14 +122,14 @@ public abstract class AbstractConsole implements IConsole {
for (int i= 0; i < copiedListeners.length; i++) {
fListener = (IPropertyChangeListener)copiedListeners[i];
SafeRunner.run(this);
- }
- fListener = null;
+ }
+ fListener = null;
}
- }
-
+ }
+
/**
* Constructs a new console with the given name and image.
- *
+ *
* @param name console name, cannot be <code>null</code>
* @param imageDescriptor image descriptor, or <code>null</code> if none
* @param autoLifecycle whether this console's lifecycle methods should be called
@@ -137,10 +141,10 @@ public abstract class AbstractConsole implements IConsole {
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 <code>null</code>
* @param type console type identifier or <code>null</code>
* @param imageDescriptor image descriptor, or <code>null</code> if none
@@ -157,13 +161,13 @@ public abstract class AbstractConsole implements IConsole {
if (autoLifecycle) {
ConsolePlugin.getDefault().getConsoleManager().addConsoleListener(new Lifecycle());
}
- }
-
+ }
+
/**
* Constructs a new console with the given name and image. The console's lifecycle
* methods <code>init()</code> and <code>dispose()</code> will be called when the
* console is added and removed from the console manager.
- *
+ *
* @param name console name, cannot be <code>null</code>
* @param imageDescriptor image descriptor, or <code>null</code> if none
*/
@@ -174,6 +178,7 @@ public abstract class AbstractConsole implements IConsole {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsole#getName()
*/
+ @Override
public String getName() {
return fName;
}
@@ -181,7 +186,7 @@ public abstract class AbstractConsole implements IConsole {
/**
* 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) {
@@ -191,39 +196,42 @@ public abstract class AbstractConsole implements IConsole {
firePropertyChange(this, IBasicPropertyConstants.P_TEXT, old, name);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsole#getImageDescriptor()
*/
+ @Override
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)
*/
+ @Override
public void addPropertyChangeListener(IPropertyChangeListener listener) {
if (fListeners == null) {
fListeners = new ListenerList();
}
- fListeners.add(listener);
+ fListeners.add(listener);
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsole#removePropertyChangeListener(org.eclipse.jface.util.IPropertyChangeListener)
*/
+ @Override
public void removePropertyChangeListener(IPropertyChangeListener listener) {
if (fListeners != null) {
fListeners.remove(listener);
@@ -232,8 +240,8 @@ public abstract class AbstractConsole implements IConsole {
/**
* Notify all listeners that the given property has changed.
- *
- * @param source the object on which a 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 <code>null</code>
* @param newValue the new value of the property, or <code>null</code>
@@ -245,19 +253,19 @@ public abstract class AbstractConsole implements IConsole {
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.
@@ -268,19 +276,19 @@ public abstract class AbstractConsole implements IConsole {
*/
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.
- *
+ * 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.
@@ -291,45 +299,46 @@ public abstract class AbstractConsole implements IConsole {
*/
protected void dispose() {
}
-
+
/**
* Shows this console in all console views. This console will be become visible
- * if another console is currently pinned.
- *
+ * 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
+ *
+ * @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() {
+ @Override
+ public String getType() {
return fType;
}
-
+
/**
* Returns the help context identifier for this console, or <code>null</code>
* if none. When a non-<code>null</code> value is returned the associated help
* will be installed for this console.
- *
+ *
* @return help context id or <code>null</code>
* @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
index df35a076f..67be06052 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/ConsolePlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -27,14 +27,14 @@ 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
*/
@@ -44,13 +44,13 @@ public class ConsolePlugin extends AbstractUIPlugin {
* The singleton console plug-in instance
*/
private static ConsolePlugin fgPlugin= null;
-
+
/**
* Unique identifier constant (value <code>"org.eclipse.ui.console"</code>)
* 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.
*/
@@ -62,7 +62,7 @@ public class ConsolePlugin extends AbstractUIPlugin {
super();
fgPlugin = this;
}
-
+
/**
* Convenience method which returns the unique identifier of this plug-in.
*/
@@ -72,7 +72,7 @@ public class ConsolePlugin extends AbstractUIPlugin {
/**
* Logs the specified status with this plug-in's log.
- *
+ *
* @param status status to log
*/
public static void log(IStatus status) {
@@ -81,8 +81,8 @@ public class ConsolePlugin extends AbstractUIPlugin {
/**
* Logs the specified throwable with this plug-in's log.
- *
- * @param t throwable to log
+ *
+ * @param t throwable to log
*/
public static void log(Throwable t) {
if (t instanceof CoreException) {
@@ -91,7 +91,7 @@ public class ConsolePlugin extends AbstractUIPlugin {
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
@@ -101,11 +101,11 @@ public class ConsolePlugin extends AbstractUIPlugin {
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
+ * Returns the console manager. The manager will be created lazily on
* the first access.
- *
+ *
* @return IConsoleManager
*/
public IConsoleManager getConsoleManager() {
@@ -119,9 +119,9 @@ public class ConsolePlugin extends AbstractUIPlugin {
* Returns the workbench display.
*/
public static Display getStandardDisplay() {
- return PlatformUI.getWorkbench().getDisplay();
+ return PlatformUI.getWorkbench().getDisplay();
}
-
+
/**
* Utility method with conventions
*/
@@ -132,19 +132,20 @@ public class ConsolePlugin extends AbstractUIPlugin {
// 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;
+ ErrorDialog.openError(shell, title, null, status);
+ return;
}
} else {
status= new Status(IStatus.ERROR, getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$
- log(status);
+ log(status);
}
ErrorDialog.openError(shell, title, message, status);
}
-
+
/**
* Returns the <code>Image</code> identified by the given key,
* or <code>null</code> if it does not exist.
- *
+ *
* @return the <code>Image</code> identified by the given key,
* or <code>null</code> if it does not exist
* @since 3.1
@@ -152,11 +153,11 @@ public class ConsolePlugin extends AbstractUIPlugin {
public static Image getImage(String key) {
return ConsolePluginImages.getImage(key);
}
-
+
/**
* Returns the <code>ImageDescriptor</code> identified by the given key,
* or <code>null</code> if it does not exist.
- *
+ *
* @return the <code>ImageDescriptor</code> identified by the given key,
* or <code>null</code> if it does not exist
* @since 3.1
@@ -164,11 +165,12 @@ public class ConsolePlugin extends AbstractUIPlugin {
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 {
+ @Override
+ public void stop(BundleContext context) throws Exception {
if (fConsoleManager != null) {
IConsole[] consoles = fConsoleManager.getConsoles();
if (consoles != null) {
@@ -176,7 +178,7 @@ public class ConsolePlugin extends AbstractUIPlugin {
}
}
super.stop(context);
- }
-
-
+ }
+
+
}
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
index 06d04d14b..dbf506f10 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -13,18 +13,18 @@ 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 <code>"org.eclipse.ui.console"</code>).
*/
public static final String PLUGIN_ID = ConsolePlugin.getUniqueIdentifier();
-
+
/**
* Console view identifier (value <code>"org.eclipse.ui.console.ConsoleView"</code>).
*/
@@ -35,16 +35,17 @@ public interface IConsoleConstants {
* @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 <code>"org.eclipse.ui.console.ConsoleFont"</code>).
- *
+ *
* @deprecated When a console is created, its font is set to the default text font as specified
* by <code>JFaceResources.TEXT_FONT</code>. Clients must provide their own infrastructure to
- * manage console specific fonts.
- */
+ * manage console specific fonts.
+ */
+ @Deprecated
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 <code>"launchGroup"</code>).
@@ -55,18 +56,18 @@ public interface IConsoleConstants {
* Menu group identifier for the console view context menu and toolbar, for actions pertaining to
* console output. (value<code>"outputGroup"</code>).
*/
- public static final String OUTPUT_GROUP = "outputGroup"; //$NON-NLS-1$
-
- /**
+ 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.
+
+ /**
+ * Clear action image identifier.
*/
public static final String IMG_LCL_CLEAR= "IMG_LCL_CLEAR"; //$NON-NLS-1$
-
+
/**
* Status code indicating an unexpected internal error.
*/
@@ -75,15 +76,15 @@ public interface IConsoleConstants {
/**
* Console pattern match listeners extension point identifier
* (value <code>"consolePatternMatchListeners"</code>).
- *
- * @since 3.1
+ *
+ * @since 3.1
*/
public static final String EXTENSION_POINT_CONSOLE_PATTERN_MATCH_LISTENERS = "consolePatternMatchListeners"; //$NON-NLS-1$
/**
* Console page participants extension point identifier
* (value <code>"consolePageParticipants"</code>).
- *
+ *
* @since 3.1
*/
public static final String EXTENSION_POINT_CONSOLE_PAGE_PARTICIPANTS = "consolePageParticipants"; //$NON-NLS-1$
@@ -91,64 +92,64 @@ public interface IConsoleConstants {
/**
* Console factories extension point identifier
* (value <code>"consoleFactories"</code>).
- *
+ *
* @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$
+ 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/IConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java
index e1bc354d6..709c2f7eb 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IConsoleView.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -19,72 +19,73 @@ import org.eclipse.ui.IViewPart;
* @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.
- *
+ * Has no effect if this console view has a pinned console.
+ *
* @param console console to display, cannot be <code>null</code>
*/
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 <code>true</code> to pin the current console to the
+ *
+ * @param pin <code>true</code> to pin the current console to the
* top of the stack, <code>false</code> 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 <code>null</code> un-pins this console
- *
+ *
* @param console console to pin, or <code>null</code> to un-pin
* @deprecated rather than pinning a specific console, a console view is
* pinned - use <code>setPinned(boolean)</code>
*/
- public void pin(IConsole console);
-
+ @Deprecated
+ 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 <code>null</code>
* if none
- *
+ *
* @return the console currently being displayed, or <code>null</code>
* 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);
-
+ public void warnOfContentChange(IConsole console);
+
/**
* Sets the scroll lock state of the currently active console.
- *
+ *
* @param scrollLock <code>true</code> to turn scroll lock on, otherwise <code>false</code>
* @since 3.1
*/
public void setScrollLock(boolean scrollLock);
-
+
/**
* Returns the scroll lock state of the currently active console.
- *
+ *
* @return <code>true</code> if scroll lock is on, <code>false</code> otherwise
* @since 3.1
*/
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
index 883332866..a28b64ded 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,8 +12,10 @@
package org.eclipse.ui.console;
+import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -36,27 +38,27 @@ 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;
+ private List<Closeable> openStreams = Collections.synchronizedList(new ArrayList<Closeable>());
/**
* 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 <code>null</code>
* @param imageDescriptor image to display for this console or <code>null</code>
@@ -69,7 +71,7 @@ public class IOConsole extends TextConsole {
/**
* 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 <code>null</code>
* @param imageDescriptor image to display for this console or <code>null</code>
@@ -83,48 +85,48 @@ public class IOConsole extends TextConsole {
if (encoding != null) {
fEncoding = encoding;
}
- openStreams = new ArrayList();
- inputStream = new IOConsoleInputStream(this);
synchronized (openStreams) {
- openStreams.add(inputStream);
+ inputStream = new IOConsoleInputStream(this);
+ 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 <code>null</code>
* @param imageDescriptor image to display for this console or <code>null</code>
*/
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 (<code>null</code>) type.
- *
+ *
* @param name name to display for this console
* @param imageDescriptor image to display for this console or <code>null</code>
*/
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) {
+ @Override
+ 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
@@ -145,10 +147,10 @@ public class IOConsole extends TextConsole {
}
return outputStream;
}
-
+
/**
* Returns the input stream connected to the keyboard.
- *
+ *
* @return the input stream connected to the keyboard.
*/
public IOConsoleInputStream getInputStream() {
@@ -157,10 +159,11 @@ public class IOConsole extends TextConsole {
/**
* Returns this console's document partitioner.
- *
+ *
* @return this console's document partitioner
*/
- protected IConsoleDocumentPartitioner getPartitioner() {
+ @Override
+ protected IConsoleDocumentPartitioner getPartitioner() {
return partitioner;
}
@@ -168,30 +171,30 @@ public class IOConsole extends TextConsole {
* 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
@@ -209,17 +212,19 @@ public class IOConsole extends TextConsole {
/**
* Check if all streams connected to this console are closed. If so,
- * notify the partitioner that this console is finished.
+ * notify the partitioner that this console is finished.
*/
private void checkFinished() {
- if (openStreams.isEmpty()) {
- partitioner.streamsClosed();
- }
+ synchronized (openStreams) {
+ 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) {
@@ -228,10 +233,10 @@ public class IOConsole extends TextConsole {
checkFinished();
}
}
-
+
/**
* Notification that the input stream connected to this console has been closed.
- *
+ *
* @param stream stream that closed
*/
void streamClosed(IOConsoleInputStream stream) {
@@ -240,49 +245,44 @@ public class IOConsole extends TextConsole {
checkFinished();
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.TextConsole#clearConsole()
*/
- public void clearConsole() {
+ @Override
+ public void clearConsole() {
if (partitioner != null) {
partitioner.clearBuffer();
}
}
-
+
/**
* Disposes this console.
*/
- protected void dispose() {
+ @Override
+ 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
+ //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) {
- }
- }
- }
+ synchronized (openStreams) {
+ List<Closeable> list = new ArrayList<Closeable>(openStreams);
+ for (Closeable closable : list) {
+ try {
+ closable.close();
+ } catch (IOException e) {
+ // e.printStackTrace();
+ }
+ }
+ }
inputStream = null;
}
/**
* Returns the encoding for this console, or <code>null</code> to indicate
* default encoding.
- *
+ *
* @return the encoding set for this console, or <code>null</code> to indicate
* default encoding
* @since 3.3
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
index f6933856b..b6da2a383 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,7 +18,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
/**
- * InputStream used to read input from an {@link IOConsole}.
+ * 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
@@ -31,44 +31,44 @@ 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.
+ * 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.
*/
@@ -77,23 +77,24 @@ public class IOConsoleInputStream extends InputStream {
/**
* 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 {
+ @Override
+ 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);
@@ -108,12 +109,13 @@ public class IOConsoleInputStream extends InputStream {
}
return toCopy;
}
-
+
/*
* (non-Javadoc)
* @see java.io.InputStream#read(byte[])
*/
- public int read(byte[] b) throws IOException {
+ @Override
+ public int read(byte[] b) throws IOException {
return read(b, 0, b.length);
}
@@ -121,12 +123,13 @@ public class IOConsoleInputStream extends InputStream {
* (non-Javadoc)
* @see java.io.InputStream#read()
*/
- public synchronized int read() throws IOException {
+ @Override
+ public synchronized int read() throws IOException {
waitForData();
- if (available() == -1) {
+ if (available() == -1) {
return -1;
}
-
+
byte b = input[outPointer];
outPointer++;
if (outPointer == input.length) {
@@ -135,7 +138,7 @@ public class IOConsoleInputStream extends InputStream {
size -= 1;
return b;
}
-
+
/**
* Blocks until data is available to be read.
* Ensure that the monitor for this object is obtained before
@@ -152,25 +155,26 @@ public class IOConsoleInputStream extends InputStream {
/**
* 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)
+ if (encoding!=null) {
try {
newData = text.getBytes(encoding);
} catch (UnsupportedEncodingException e) {
- newData = text.getBytes();
+ newData = text.getBytes();
}
- else
- 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;
@@ -186,13 +190,13 @@ public class IOConsoleInputStream extends InputStream {
inPointer = newData.length-(input.length-inPointer);
size += newData.length;
}
-
+
if (inPointer == input.length) {
inPointer = 0;
}
notifyAll();
}
-
+
/**
* Enlarges the buffer.
*/
@@ -212,7 +216,7 @@ public class IOConsoleInputStream extends InputStream {
/**
* Returns this stream's font style.
- *
+ *
* @return the font style used to decorate input in the associated console
*/
public int getFontStyle() {
@@ -221,7 +225,7 @@ public class IOConsoleInputStream extends InputStream {
/**
* 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) {
@@ -231,10 +235,10 @@ public class IOConsoleInputStream extends InputStream {
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) {
@@ -244,37 +248,39 @@ public class IOConsoleInputStream extends InputStream {
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 {
+ @Override
+ 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 {
+ @Override
+ public synchronized void close() throws IOException {
if(closed) {
throw new IOException("Input Stream Closed"); //$NON-NLS-1$
}
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
index 43e599c11..125c5f26d 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleOutputStream.java
@@ -14,7 +14,6 @@ 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;
@@ -22,7 +21,7 @@ import org.eclipse.ui.internal.console.IOConsolePartitioner;
* OutputStream used to write to an IOConsole.
* <p>
* Clients are not intended to instantiate this class directly, instead
- * use <code>IOConsole.newOutputStream()</code>.
+ * use <code>IOConsole.newOutputStream()</code>.
* </p>
* <p>
* Clients should avoid writing large amounts of output to this stream in the UI
@@ -44,23 +43,23 @@ public class IOConsoleOutputStream extends OutputStream {
* 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.
*/
@@ -72,10 +71,10 @@ public class IOConsoleOutputStream extends OutputStream {
private boolean fNeedsEncoding = false;
private boolean prependCR;
-
+
/**
* Constructs a new output stream on the given console.
- *
+ *
* @param console I/O console
*/
IOConsoleOutputStream(IOConsole console) {
@@ -85,16 +84,16 @@ public class IOConsoleOutputStream extends OutputStream {
/**
* 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) {
@@ -104,11 +103,11 @@ public class IOConsoleOutputStream extends OutputStream {
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.
*/
@@ -119,18 +118,18 @@ public class IOConsoleOutputStream extends OutputStream {
/**
* 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 <code>null</code> to indicate
* the default color.
- *
+ *
* @param newColor color of this stream, or <code>null</code>
*/
public void setColor(Color newColor) {
@@ -140,17 +139,17 @@ public class IOConsoleOutputStream extends OutputStream {
console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor);
}
}
-
+
/**
* Returns the color of this stream, or <code>null</code>
* if default.
- *
+ *
* @return the color of this stream, or <code>null</code>
*/
public Color getColor() {
return color;
}
-
+
/**
* Returns true if the stream has been closed
* @return true is the stream has been closed, false otherwise.
@@ -158,12 +157,13 @@ public class IOConsoleOutputStream extends OutputStream {
public synchronized boolean isClosed() {
return closed;
}
-
+
/*
* (non-Javadoc)
* @see java.io.OutputStream#close()
*/
- public synchronized void close() throws IOException {
+ @Override
+ public synchronized void close() throws IOException {
if(closed) {
throw new IOException("Output Stream is closed"); //$NON-NLS-1$
}
@@ -180,17 +180,19 @@ public class IOConsoleOutputStream extends OutputStream {
* (non-Javadoc)
* @see java.io.OutputStream#flush()
*/
- public void flush() throws IOException {
+ @Override
+ 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 {
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
if (fNeedsEncoding) {
encodedWrite(new String(b, off, len, fEncoding));
} else {
@@ -201,40 +203,43 @@ public class IOConsoleOutputStream extends OutputStream {
* (non-Javadoc)
* @see java.io.OutputStream#write(byte[])
*/
- public void write(byte[] b) throws IOException {
+ @Override
+ 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 {
+ @Override
+ 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 void write(String str) throws IOException {
encodedWrite(str);
}
-
+
private synchronized void encodedWrite(String encodedString) throws IOException {
if(closed) {
throw new IOException("Output Stream is closed"); //$NON-NLS-1$
}
+ String newencoding = encodedString;
if (prependCR){
- encodedString="\r"+encodedString; //$NON-NLS-1$
+ newencoding = "\r" + newencoding; //$NON-NLS-1$
prependCR=false;
}
- if (encodedString.endsWith("\r")) { //$NON-NLS-1$
+ if (newencoding.endsWith("\r")) { //$NON-NLS-1$
prependCR = true;
- encodedString = new String(encodedString.substring(0, encodedString.length()-1));
+ newencoding = new String(newencoding.substring(0, newencoding.length() - 1));
}
- notifyParitioner(encodedString);
+ notifyParitioner(newencoding);
}
private void notifyParitioner(String encodedString) throws IOException {
@@ -255,8 +260,8 @@ public class IOConsoleOutputStream extends OutputStream {
}
/**
- * Sets the character encoding used to interpret characters written to this steam.
- *
+ * Sets the character encoding used to interpret characters written to this steam.
+ *
* @param encoding encoding identifier
*/
public void setEncoding(String encoding) {
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
index b9f3071bf..d7ea0d0f2 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/MessageConsole.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import org.eclipse.ui.part.IPageBookViewPage;
/**
* A console that displays messages. A message console may have one or
* more streams connected to it (<code>MessageConsoleStream</code>).
- * Text written to streams is buffered and processed in a Job by the
+ * Text written to streams is buffered and processed in a Job by the
* console's document partitioner.
* <p>
* Clients may instantiate this class.
@@ -26,48 +26,52 @@ import org.eclipse.ui.part.IPageBookViewPage;
* @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}
+ * Property constant indicating the font of this console has changed.
+ *
+ * @deprecated use {@link IConsoleConstants#P_FONT}
*/
+ @Deprecated
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}
+ * Property constant indicating the color of a stream has changed.
+ *
+ * @deprecated use {@link IConsoleConstants#P_STREAM_COLOR}
*/
+ @Deprecated
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}
*/
+ @Deprecated
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;
+ @Deprecated
+ 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 <code>null</code>
*/
public MessageConsole(String name, ImageDescriptor imageDescriptor) {
this(name, imageDescriptor, true);
}
-
+
/**
* Constructs a message console.
- *
+ *
* @param name console name
* @param imageDescriptor console image descriptor or <code>null</code>
* @param autoLifecycle whether lifecycle methods should be called automatically
@@ -77,25 +81,25 @@ public class MessageConsole extends IOConsole {
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 <code>null</code>
* @param imageDescriptor console image descriptor or <code>null</code>
* @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 <code>null</code>
* @param imageDescriptor console image descriptor or <code>null</code>
@@ -108,7 +112,7 @@ public class MessageConsole extends IOConsole {
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.
* <p>
@@ -126,28 +130,31 @@ public class MessageConsole extends IOConsole {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView)
*/
- public IPageBookViewPage createPage(IConsoleView view) {
+ @Override
+ 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() {
+ @Override
+ 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
*/
+ @Deprecated
protected void appendToDocument(String text, MessageConsoleStream stream) {
- }
+ }
}
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
index 81561f9ff..aaae641eb 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsole.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -53,55 +53,56 @@ public abstract class TextConsole extends AbstractConsole {
* The current tab width
*/
private int fTabWidth;
- /**
+ /**
* The font used by this console
*/
- private Font fFont;
-
+ private Font fFont;
+
/**
* The background color used by this console or <code>null</code> 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 HashMap<String, Object> fAttributes = new HashMap<String, Object>();
+
private IConsoleManager fConsoleManager = ConsolePlugin.getDefault().getConsoleManager();
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.AbstractConsole#dispose()
*/
- protected void dispose() {
+ @Override
+ protected void dispose() {
super.dispose();
fFont = null;
synchronized(fAttributes) {
@@ -110,7 +111,7 @@ public abstract class TextConsole extends AbstractConsole {
}
/**
* 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 <code>null</code>
* @param imageDescriptor image to display for this console or <code>null</code>
@@ -129,10 +130,11 @@ public abstract class TextConsole extends AbstractConsole {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsole#createPage(org.eclipse.ui.console.IConsoleView)
*/
- public IPageBookViewPage createPage(IConsoleView view) {
+ @Override
+ public IPageBookViewPage createPage(IConsoleView view) {
return new TextConsolePage(this, view);
}
-
+
/**
* Returns this console's document.
* <p>
@@ -141,27 +143,27 @@ public abstract class TextConsole extends AbstractConsole {
* streams connected to it, and clients are not intended to modify the document's
* contents.
* </p>
- *
+ *
* @return this console's document
*/
public IDocument getDocument() {
return fDocument;
}
-
+
/**
- * Returns the current width of this console. A value of zero of less
+ * 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.
*/
@@ -169,40 +171,41 @@ public abstract class TextConsole extends AbstractConsole {
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
+ *
+ * @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));
+ @Override
+ 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() {
@@ -211,53 +214,55 @@ public abstract class TextConsole extends AbstractConsole {
}
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 <code>null</code> to use
* the default text font.
- *
+ *
* @param newFont font, or <code>null</code> 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();
+ Font font = newFont;
+ if (font == null) {
+ font = getDefaultFont();
}
// fire property change if required
- if (!fFont.equals(newFont)) {
+ if (!fFont.equals(font)) {
Font old = fFont;
- fFont = newFont;
+ fFont = font;
firePropertyChange(this, IConsoleConstants.P_FONT, old, fFont);
}
}
-
+
/**
* Sets the background color used by this console. Specify <code>null</code> to use
* the default background color.
- *
+ *
* @param background background color or <code>null</code> for default
* @since 3.3
* @deprecated use setBackground(Color) instead
*/
- public void setBackgrond(Color background) {
+ @Deprecated
+ public void setBackgrond(Color background) {
setBackground(background);
- }
-
+ }
+
/**
* Sets the background color used by this console. Specify <code>null</code> to use
* the default background color.
- *
+ *
* @param background background color or <code>null</code> for default
* @since 3.3
*/
@@ -272,19 +277,19 @@ public abstract class TextConsole extends AbstractConsole {
Color old = fBackground;
fBackground = background;
firePropertyChange(this, IConsoleConstants.P_BACKGROUND_COLOR, old, fBackground);
- }
-
+ }
+
/**
- * Returns the background color to use for this console or <code>null</code> for the
+ * Returns the background color to use for this console or <code>null</code> for the
* default background color.
- *
+ *
* @return background color or <code>null</code> for default
* @since 3.3
*/
public Color getBackground() {
return fBackground;
}
-
+
/**
* Clears the console.
* <p>
@@ -306,10 +311,10 @@ public abstract class TextConsole extends AbstractConsole {
* @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() {
@@ -325,10 +330,10 @@ public abstract class TextConsole extends AbstractConsole {
return new IHyperlink[0];
}
}
-
+
/**
* Returns the hyperlink at the given offset of <code>null</code> if none.
- *
+ *
* @param offset offset for which a hyperlink is requested
* @return the hyperlink at the given offset of <code>null</code> if none
*/
@@ -343,7 +348,7 @@ public abstract class TextConsole extends AbstractConsole {
}
}
} catch (BadPositionCategoryException e) {
- }
+ }
return null;
}
@@ -354,35 +359,38 @@ public abstract class TextConsole extends AbstractConsole {
* @return the position containing the offset, or <code>null</code>
*/
private Position findPosition(int offset, Position[] positions) {
-
- if (positions.length == 0)
+
+ 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)
+ if (left == mid) {
right= left;
- else
+ } else {
right= mid -1;
+ }
} else if (offset > (position.getOffset() + position.getLength() - 1)) {
- if (right == mid)
+ if (right == mid) {
left= right;
- else
+ } else {
left= mid +1;
+ }
} else {
left= right= mid;
}
}
-
+
position= positions[left];
if (offset >= position.getOffset() && (offset < (position.getOffset() + position.getLength()))) {
return position;
@@ -394,49 +402,51 @@ public abstract class TextConsole extends AbstractConsole {
* 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) {
+ @Override
+ public boolean contains(ISchedulingRule rule) {
return rule == this;
}
- public boolean isConflicting(ISchedulingRule rule) {
+ @Override
+ public boolean isConflicting(ISchedulingRule rule) {
if (contains(rule)) {
return true;
}
if (rule != this && rule instanceof MatcherSchedulingRule) {
- return (((MatcherSchedulingRule)rule).getConsole() == TextConsole.this);
+ 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.
@@ -453,17 +463,17 @@ public abstract class TextConsole extends AbstractConsole {
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.
+ * 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.
* <p>
@@ -475,7 +485,7 @@ public abstract class TextConsole extends AbstractConsole {
fDocument.removeDocumentListener(fPatternMatcher);
checkFinished();
}
-
+
/**
* Fires the console output complete property change event.
*/
@@ -485,10 +495,10 @@ public abstract class TextConsole extends AbstractConsole {
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
@@ -496,18 +506,18 @@ public abstract class TextConsole extends AbstractConsole {
*/
public void addHyperlink(IHyperlink hyperlink, int offset, int length) throws BadLocationException {
IDocument document = getDocument();
- ConsoleHyperlinkPosition hyperlinkPosition = new ConsoleHyperlinkPosition(hyperlink, offset, length);
+ 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.
*/
@@ -527,10 +537,10 @@ public abstract class TextConsole extends AbstractConsole {
}
return null;
}
-
+
/**
* Returns the attribute associated with the specified key.
- *
+ *
* @param key attribute key
* @return the attribute associated with the specified key
*/
@@ -539,10 +549,10 @@ public abstract class TextConsole extends AbstractConsole {
return fAttributes.get(key);
}
}
-
+
/**
* Sets an attribute value. Intended for client data.
- *
+ *
* @param key attribute key
* @param value attribute 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
index ae76fec0a..9a97a3085 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,17 +14,10 @@ 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;
@@ -32,17 +25,19 @@ 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.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+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.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -57,7 +52,6 @@ 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;
@@ -81,25 +75,27 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
private IConsoleView fConsoleView;
private TextConsoleViewer fViewer;
private MenuManager fMenuManager;
- protected Map fGlobalActions = new HashMap();
- protected ArrayList fSelectionActions = new ArrayList();
+ protected Map<String, IAction> fGlobalActions = new HashMap<String, IAction>();
+ protected ArrayList<String> fSelectionActions = new ArrayList<String>();
protected ClearOutputAction fClearOutputAction;
-
+
// text selection listener, used to update selection dependent actions on selection changes
private ISelectionChangedListener selectionChangedListener = new ISelectionChangedListener() {
+ @Override
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) {
+ @Override
+ 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) {
@@ -108,10 +104,10 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
}
}
};
-
+
/**
* 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
*/
@@ -119,30 +115,32 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
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() {
+ @Override
+ 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 {
+ @Override
+ public void init(IPageSite pageSite) throws PartInitException {
fSite = pageSite;
}
@@ -150,9 +148,8 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
* Updates selection dependent actions.
*/
protected void updateSelectionDependentActions() {
- Iterator iterator= fSelectionActions.iterator();
- while (iterator.hasNext()) {
- updateAction((String)iterator.next());
+ for (String string : fSelectionActions) {
+ updateAction(string);
}
}
@@ -160,13 +157,14 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
* (non-Javadoc)
* @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
*/
- public void createControl(Composite parent) {
+ @Override
+ 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$
@@ -174,19 +172,20 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
fMenuManager= new MenuManager("#ContextMenu", id); //$NON-NLS-1$
fMenuManager.setRemoveAllWhenShown(true);
fMenuManager.addMenuListener(new IMenuListener() {
+ @Override
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);
}
@@ -195,17 +194,18 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
* (non-Javadoc)
* @see org.eclipse.ui.part.IPage#dispose()
*/
- public void dispose() {
+ @Override
+ 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;
@@ -216,20 +216,23 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
* (non-Javadoc)
* @see org.eclipse.ui.part.IPage#getControl()
*/
- public Control getControl() {
+ @Override
+ 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) {
+ @Override
+ public void setActionBars(IActionBars actionBars) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.IPage#setFocus()
*/
- public void setFocus() {
+ @Override
+ public void setFocus() {
if (fViewer != null) {
fViewer.getTextWidget().setFocus();
}
@@ -239,11 +242,12 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ 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)) {
@@ -271,30 +275,30 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
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);
@@ -304,13 +308,13 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
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
@@ -323,7 +327,8 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
- public Object getAdapter(Class required) {
+ @Override
+ public Object getAdapter(Class required) {
if (IFindReplaceTarget.class.equals(required)) {
return fViewer.getFindReplaceTarget();
}
@@ -332,41 +337,41 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
}
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);
+ IAction action= fGlobalActions.get(actionId);
if (action instanceof IUpdate) {
((IUpdate) action).update();
}
}
-
+
/**
* Fill the context menu
- *
+ *
* @param menuManager menu
*/
protected void contextMenuAboutToShow(IMenuManager menuManager) {
@@ -375,16 +380,16 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
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(fGlobalActions.get(ActionFactory.CUT.getId()));
+ menuManager.add(fGlobalActions.get(ActionFactory.COPY.getId()));
+ menuManager.add(fGlobalActions.get(ActionFactory.PASTE.getId()));
+ menuManager.add(fGlobalActions.get(ActionFactory.SELECT_ALL.getId()));
+
menuManager.add(new Separator("FIND")); //$NON-NLS-1$
- menuManager.add((IAction)fGlobalActions.get(ActionFactory.FIND.getId()));
+ menuManager.add(fGlobalActions.get(ActionFactory.FIND.getId()));
menuManager.add(new FollowHyperlinkAction(fViewer));
menuManager.add(fClearOutputAction);
-
+
menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
@@ -395,16 +400,16 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
/**
* 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) {
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
index 68d61651a..82b775b8b 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsoleViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -61,7 +61,7 @@ import org.eclipse.ui.progress.WorkbenchJob;
* <p>
* Clients may subclass this class.
* </p>
- *
+ *
* @since 3.1
*/
public class TextConsoleViewer extends SourceViewer implements LineStyleListener, LineBackgroundListener, MouseTrackListener, MouseMoveListener, MouseListener {
@@ -83,15 +83,18 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
private IPropertyChangeListener propertyChangeListener;
private IDocumentListener documentListener = new IDocumentListener() {
- public void documentAboutToBeChanged(DocumentEvent event) {
+ @Override
+ public void documentAboutToBeChanged(DocumentEvent event) {
}
- public void documentChanged(DocumentEvent event) {
+ @Override
+ public void documentChanged(DocumentEvent event) {
updateLinks(event.fOffset);
}
};
// event listener used to send event to hyperlink for IHyperlink2
private Listener mouseUpListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
if (hyperlink != null) {
String selection = getTextWidget().getSelectionText();
@@ -109,7 +112,8 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
};
WorkbenchJob revealJob = new WorkbenchJob("Reveal End of Document") {//$NON-NLS-1$
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
StyledText textWidget = getTextWidget();
if (textWidget != null && !textWidget.isDisposed()) {
int lineCount = textWidget.getLineCount();
@@ -118,9 +122,10 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
return Status.OK_STATUS;
}
};
-
+
private IPositionUpdater positionUpdater = new IPositionUpdater() {
- public void update(DocumentEvent event) {
+ @Override
+ public void update(DocumentEvent event) {
try {
IDocument document = getDocument();
if (document != null) {
@@ -142,7 +147,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Constructs a new viewer in the given parent for the specified console.
- *
+ *
* @param parent
* containing widget
* @param console
@@ -176,7 +181,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Sets the tab width used by this viewer.
- *
+ *
* @param tabWidth
* the tab width used by this viewer
*/
@@ -190,7 +195,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Sets the font used by this viewer.
- *
+ *
* @param font
* the font used by this viewer
*/
@@ -214,13 +219,14 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.custom.LineStyleListener#lineGetStyle(org.eclipse.swt.custom.LineStyleEvent)
*/
- public void lineGetStyle(LineStyleEvent event) {
+ @Override
+ public void lineGetStyle(LineStyleEvent event) {
IDocument document = getDocument();
if (document != null && document.getLength() > 0) {
- ArrayList ranges = new ArrayList();
+ ArrayList<StyleRange> ranges = new ArrayList<StyleRange>();
int offset = event.lineOffset;
int length = event.lineText.length();
@@ -249,12 +255,12 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
}
if (ranges.size() > 0) {
- event.styles = (StyleRange[]) ranges.toArray(new StyleRange[ranges.size()]);
+ event.styles = ranges.toArray(new StyleRange[ranges.size()]);
}
}
}
- private void override(List ranges, StyleRange newRange) {
+ private void override(List<StyleRange> ranges, StyleRange newRange) {
if (ranges.isEmpty()) {
ranges.add(newRange);
return;
@@ -263,7 +269,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
int start = newRange.start;
int end = start + newRange.length;
for (int i = 0; i < ranges.size(); i++) {
- StyleRange existingRange = (StyleRange) ranges.get(i);
+ StyleRange existingRange = ranges.get(i);
int rEnd = existingRange.start + existingRange.length;
if (end <= existingRange.start || start >= rEnd) {
continue;
@@ -293,7 +299,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Binary search for the positions overlapping the given range
- *
+ *
* @param offset
* the offset of the range
* @param length
@@ -304,8 +310,9 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
*/
private Position[] findPosition(int offset, int length, Position[] positions) {
- if (positions.length == 0)
- return null;
+ if (positions.length == 0) {
+ return null;
+ }
int rangeEnd = offset + length;
int left = 0;
@@ -319,21 +326,23 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
position = positions[mid];
if (rangeEnd < position.getOffset()) {
- if (left == mid)
- right = left;
- else
- right = mid - 1;
+ 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;
+ if (right == mid) {
+ left = right;
+ } else {
+ left = mid + 1;
+ }
} else {
left = right = mid;
}
}
- List list = new ArrayList();
+ List<Position> list = new ArrayList<Position>();
int index = left - 1;
if (index >= 0) {
position = positions[index];
@@ -357,21 +366,22 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
if (list.isEmpty()) {
return null;
}
- return (Position[]) list.toArray(new Position[list.size()]);
+ return 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) {
+ @Override
+ public void lineGetBackground(LineBackgroundEvent event) {
event.lineBackground = null;
}
/**
* Returns the hand cursor.
- *
+ *
* @return the hand cursor
*/
protected Cursor getHandCursor() {
@@ -383,7 +393,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Returns the text cursor.
- *
+ *
* @return the text cursor
*/
protected Cursor getTextCursor() {
@@ -395,7 +405,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Notification a hyperlink has been entered.
- *
+ *
* @param link
* the link that was entered
*/
@@ -413,7 +423,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Notification a link was exited.
- *
+ *
* @param link
* the link that was exited
*/
@@ -428,19 +438,21 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.events.MouseTrackListener#mouseEnter(org.eclipse.swt.events.MouseEvent)
*/
- public void mouseEnter(MouseEvent e) {
+ @Override
+ 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) {
+ @Override
+ public void mouseExit(MouseEvent e) {
getTextWidget().removeMouseMoveListener(this);
if (hyperlink != null) {
linkExited(hyperlink);
@@ -449,18 +461,20 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.events.MouseTrackListener#mouseHover(org.eclipse.swt.events.MouseEvent)
*/
- public void mouseHover(MouseEvent e) {
+ @Override
+ public void mouseHover(MouseEvent e) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
*/
- public void mouseMove(MouseEvent e) {
+ @Override
+ public void mouseMove(MouseEvent e) {
int offset = -1;
try {
Point p = new Point(e.x, e.y);
@@ -474,7 +488,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* 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) {
@@ -495,7 +509,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Returns the currently active hyperlink or <code>null</code> if none.
- *
+ *
* @return the currently active hyperlink or <code>null</code> if none
*/
public IHyperlink getHyperlink() {
@@ -505,7 +519,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* Returns the hyperlink at the specified offset, or <code>null</code> if
* none.
- *
+ *
* @param offset
* offset at which a hyperlink has been requested
* @return hyperlink at the specified offset, or <code>null</code> if none
@@ -519,34 +533,38 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
*/
- public void mouseDoubleClick(MouseEvent e) {
+ @Override
+ public void mouseDoubleClick(MouseEvent e) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
*/
- public void mouseDown(MouseEvent e) {
+ @Override
+ public void mouseDown(MouseEvent e) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
*/
- public void mouseUp(MouseEvent e) {
+ @Override
+ public void mouseUp(MouseEvent e) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.text.TextViewer#createDocumentAdapter()
*/
- protected IDocumentAdapter createDocumentAdapter() {
+ @Override
+ protected IDocumentAdapter createDocumentAdapter() {
if (documentAdapter == null) {
documentAdapter = new ConsoleDocumentAdapter(consoleWidth = -1);
}
@@ -556,7 +574,7 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/**
* 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
*/
@@ -564,7 +582,8 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
if (consoleWidth != width) {
consoleWidth = width;
ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (documentAdapter != null) {
documentAdapter.setWidth(consoleWidth);
}
@@ -575,10 +594,11 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.text.TextViewer#handleDispose()
*/
- protected void handleDispose() {
+ @Override
+ protected void handleDispose() {
IDocument document = getDocument();
if (document != null) {
document.removeDocumentListener(documentListener);
@@ -603,12 +623,13 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
colorRegistry.removeListener(propertyChangeListener);
-
+
super.handleDispose();
}
class HyperlinkColorChangeListener implements IPropertyChangeListener {
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
if (event.getProperty().equals(JFacePreferences.ACTIVE_HYPERLINK_COLOR) || event.getProperty().equals(JFacePreferences.HYPERLINK_COLOR)) {
getTextWidget().redraw();
}
@@ -619,14 +640,16 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
/*
* work around to memory leak in TextViewer$WidgetCommand
*/
- protected void updateTextListeners(WidgetCommand cmd) {
+ @Override
+ protected void updateTextListeners(WidgetCommand cmd) {
super.updateTextListeners(cmd);
cmd.preservedText = null;
cmd.event = null;
cmd.text = null;
}
- protected void internalRevealRange(int start, int end) {
+ @Override
+ protected void internalRevealRange(int start, int end) {
StyledText textWidget = getTextWidget();
int startLine = documentAdapter.getLineAtOffset(start);
int endLine = documentAdapter.getLineAtOffset(end);
@@ -634,7 +657,8 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
int top = textWidget.getTopIndex();
if (top > -1) {
// scroll vertically
- int lines = getVisibleLinesInViewport();
+ @SuppressWarnings("deprecation")
+ int lines = getVisibleLinesInViewport();
int bottom = top + lines;
// two lines at the top and the bottom should always be left
@@ -682,12 +706,13 @@ public class TextConsoleViewer extends SourceViewer implements LineStyleListener
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;
+ if (startPixel < visibleStart) {
+ newOffset = startPixel;
+ } else if (selectionPixelWidth + bufferZone < visibleWidth) {
+ newOffset = endPixel + bufferZone - visibleWidth;
+ } else {
+ newOffset = startPixel;
+ }
float index = ((float) newOffset) / ((float) getAverageCharWidth());
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
index a1de229b5..fd36d38f4 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -39,23 +39,23 @@ public class ClearOutputAction extends Action {
/**
* 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));
+ 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);
+ 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 <code>IOConsole</code>, rather than clearing
* its document directly.
- *
+ *
* @param ioConsole I/O console the action is associated with
* @since 3.1
*/
@@ -63,11 +63,11 @@ public class ClearOutputAction extends Action {
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
+ *
+ * @param viewer viewer whose document this action is associated with
*/
public ClearOutputAction(ITextViewer viewer) {
this();
@@ -77,8 +77,10 @@ public class ClearOutputAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
BusyIndicator.showWhile(ConsolePlugin.getStandardDisplay(), new Runnable() {
+ @Override
public void run() {
if (fIOConsole == null) {
IDocument document = fViewer.getDocument();
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
index 8691ac226..f3a50bff2 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -26,16 +26,17 @@ import org.eclipse.ui.internal.console.IInternalConsoleConstants;
* @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);
+ super(ConsoleMessages.CloseConsoleAction_0, ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_CLOSE));
+ setToolTipText(ConsoleMessages.CloseConsoleAction_1);
fConsole = console;
}
- public void run() {
+ @Override
+ 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
index b3809ea13..fabd9bb48 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -31,7 +31,7 @@ public class TextViewerAction extends Action implements IUpdate {
/**
* Constructs a new action in the given text viewer with
* the specified operation code.
- *
+ *
* @param viewer
* @param operationCode
*/
@@ -43,12 +43,13 @@ public class TextViewerAction extends Action implements IUpdate {
/* (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)
*/
+ @Override
public void update() {
boolean wasEnabled= isEnabled();
@@ -59,19 +60,20 @@ public class TextViewerAction extends Action implements IUpdate {
firePropertyChange(ENABLED, wasEnabled ? Boolean.TRUE : Boolean.FALSE, isEnabled ? Boolean.TRUE : Boolean.FALSE);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
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
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
index b029804f5..020ae3b98 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,8 +11,6 @@
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;
@@ -24,6 +22,8 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.internal.console.ConsoleMessages;
+import com.ibm.icu.text.MessageFormat;
+
/**
* Action to position a text viewer to a specific line.
* <p>
@@ -36,19 +36,21 @@ 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
+ * dialog forms a valid line number, i.e. one to which can be
* jumped.
*/
class NumberValidator implements IInputValidator {
+ @Override
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;
+ 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 ConsoleMessages.TextViewerGotoLineAction_Not_a_number_2;
}
return null;
@@ -57,21 +59,22 @@ public class TextViewerGotoLineAction extends TextViewerAction {
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);
+ 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()
*/
+ @Override
public void update() {
}
@@ -87,21 +90,22 @@ public class TextViewerGotoLineAction extends TextViewerAction {
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); //
+ 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()
*/
+ @Override
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 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());
@@ -110,11 +114,11 @@ public class TextViewerGotoLineAction extends TextViewerAction {
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); //
+ 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); //
+ 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/internal/console/ConsoleDocument.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocument.java
index ddf2491c6..8eb24bb79 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -24,92 +24,107 @@ public class ConsoleDocument extends Document {
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#get(int, int)
*/
+ @Override
public synchronized String get(int pos, int length) throws BadLocationException {
return super.get(pos, length);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLength()
*/
+ @Override
public synchronized int getLength() {
return super.getLength();
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLineDelimiter(int)
*/
+ @Override
public synchronized String getLineDelimiter(int line) throws BadLocationException {
return super.getLineDelimiter(line);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLineInformation(int)
*/
+ @Override
public synchronized IRegion getLineInformation(int line) throws BadLocationException {
return super.getLineInformation(line);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLineInformationOfOffset(int)
*/
+ @Override
public synchronized IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
return super.getLineInformationOfOffset(offset);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLineLength(int)
*/
+ @Override
public synchronized int getLineLength(int line) throws BadLocationException {
return super.getLineLength(line);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLineOffset(int)
*/
+ @Override
public synchronized int getLineOffset(int line) throws BadLocationException {
return super.getLineOffset(line);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getLineOfOffset(int)
*/
+ @Override
public int getLineOfOffset(int pos) throws BadLocationException {
return super.getLineOfOffset(pos);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#getNumberOfLines()
*/
+ @Override
public synchronized int getNumberOfLines() {
return super.getNumberOfLines();
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocument#replace(int, int, java.lang.String)
*/
+ @Override
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) {
+ @Override
+ public synchronized void set(String text) {
super.set(text);
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.AbstractDocument#completeInitialization()
*/
- protected void completeInitialization() {
+ @Override
+ 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 {
+ */
+ @Override
+ 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 {
+ */
+ @Override
+ 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 {
+ */
+ @Override
+ 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
index 2b00475d4..486594d11 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,51 +11,48 @@
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;
+import org.eclipse.swt.custom.TextChangeListener;
+import org.eclipse.swt.custom.TextChangedEvent;
+import org.eclipse.swt.custom.TextChangingEvent;
/**
* 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 List<TextChangeListener> 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();
+ textChangeListeners = new ArrayList<TextChangeListener>();
consoleWidth = width;
}
-
+
/*
- * repairs lines list from the beginning of the line containing the offset of any
+ * 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) {
@@ -66,11 +63,11 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
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);
@@ -78,7 +75,7 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
int offset = nextOffset;
int length = document.getLineLength(i);
nextOffset += length;
-
+
if (length == 0) {
addRegion(offset, 0);
} else {
@@ -87,7 +84,7 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
String lineDelimiter = document.getLineDelimiter(i);
int lineDelimiterLength = 0;
if (lineDelimiter != null) {
- lineDelimiterLength = lineDelimiter.length();
+ lineDelimiterLength = lineDelimiter.length();
trimmedLength -= lineDelimiterLength;
}
@@ -105,12 +102,12 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
}
} catch (BadLocationException e) {
}
-
+
if (regionCount == 0) {
addRegion(0, document.getLength());
}
}
-
+
private void addRegion(int offset, int length) {
if (regionCount == 0) {
offsets[0] = offset;
@@ -124,17 +121,18 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
}
regionCount++;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentAdapter#setDocument(org.eclipse.jface.text.IDocument)
*/
- public void setDocument(IDocument doc) {
+ @Override
+ public void setDocument(IDocument doc) {
if (document != null) {
document.removeDocumentListener(this);
}
-
+
document = doc;
-
+
if (document != null) {
document.addDocumentListener(this);
repairLines(0);
@@ -144,17 +142,19 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#addTextChangeListener(org.eclipse.swt.custom.TextChangeListener)
*/
- public synchronized void addTextChangeListener(TextChangeListener listener) {
+ @Override
+ 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) {
+ @Override
+ public synchronized void removeTextChangeListener(TextChangeListener listener) {
if(textChangeListeners != null) {
Assert.isNotNull(listener);
textChangeListeners.remove(listener);
@@ -164,14 +164,16 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#getCharCount()
*/
- public int getCharCount() {
+ @Override
+ public int getCharCount() {
return document.getLength();
}
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#getLine(int)
*/
- public String getLine(int lineIndex) {
+ @Override
+ public String getLine(int lineIndex) {
try {
StringBuffer line = new StringBuffer(document.get(offsets[lineIndex], lengths[lineIndex]));
int index = line.length() - 1;
@@ -181,31 +183,32 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
return new String(line.substring(0, index+1));
} catch (BadLocationException e) {
}
- return ""; //$NON-NLS-1$
+ return ""; //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#getLineAtOffset(int)
*/
- public int getLineAtOffset(int offset) {
+ @Override
+ 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]) {
@@ -214,35 +217,39 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
return midIndex;
}
}
-
+
return midIndex;
}
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#getLineCount()
*/
- public int getLineCount() {
+ @Override
+ public int getLineCount() {
return regionCount;
}
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#getLineDelimiter()
*/
- public String getLineDelimiter() {
+ @Override
+ 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) {
+ @Override
+ 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) {
+ @Override
+ public String getTextRange(int start, int length) {
try {
return document.get(start, length);
} catch (BadLocationException e) {
@@ -253,7 +260,8 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#replaceTextRange(int, int, java.lang.String)
*/
- public void replaceTextRange(int start, int replaceLength, String text) {
+ @Override
+ public void replaceTextRange(int start, int replaceLength, String text) {
try {
document.replace(start, replaceLength, text);
} catch (BadLocationException e) {
@@ -263,44 +271,44 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
/* (non-Javadoc)
* @see org.eclipse.swt.custom.StyledTextContent#setText(java.lang.String)
*/
- public synchronized void setText(String text) {
+ @Override
+ 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);
- }
+ for (TextChangeListener listener : textChangeListeners) {
+ listener.textSet(changeEvent);
+ }
}
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
*/
- public synchronized void documentAboutToBeChanged(DocumentEvent event) {
+ @Override
+ 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);
- }
+
+ for (TextChangeListener listener : textChangeListeners) {
+ listener.textChanging(changeEvent);
+ }
}
private void growRegionArray(int minSize) {
@@ -315,8 +323,10 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
private int countNewLines(String string) {
int count = 0;
-
- if (string.length() == 0) return 0;
+
+ if (string.length() == 0) {
+ return 0;
+ }
// work around to
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4994840
@@ -328,29 +338,33 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
}
// 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);
+ String str = string;
+ if (offset < (str.length() - 1)) {
+ str = str.substring(0, offset);
}
-
+
int lastIndex = 0;
int index = 0;
-
- Matcher matcher = pattern.matcher(string);
-
+
+ Matcher matcher = pattern.matcher(str);
+
while (matcher.find()) {
index = matcher.start();
-
- if (index == 0)
+
+ if (index == 0) {
count++;
- else if (index!=string.length())
+ } else if (index != str.length()) {
count++;
-
+ }
+
if (consoleWidth > 0) {
int lineLen = index - lastIndex + 1;
- if (index == 0) lineLen += lengths[regionCount-1];
+ if (index == 0) {
+ lineLen += lengths[regionCount-1];
+ }
count += lineLen/consoleWidth;
}
-
+
lastIndex = index;
}
}
@@ -361,19 +375,19 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
/* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
*/
- public synchronized void documentChanged(DocumentEvent event) {
+ @Override
+ 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);
- }
+ for (TextChangeListener listener : textChangeListeners) {
+ listener.textChanged(changeEvent);
+ }
}
/**
@@ -385,10 +399,9 @@ public class ConsoleDocumentAdapter implements IDocumentAdapter, IDocumentListen
consoleWidth = width;
repairLines(0);
TextChangedEvent changeEvent = new TextChangedEvent(this);
- for (Iterator iter = textChangeListeners.iterator(); iter.hasNext();) {
- TextChangeListener element = (TextChangeListener) iter.next();
- element.textSet(changeEvent);
- }
+ for (TextChangeListener listener : textChangeListeners) {
+ listener.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
index d578e0e9e..2aa907a4b 100644
--- 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
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -36,10 +36,11 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
private IConsoleView fView;
private Menu fMenu;
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
public void update() {
IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
setEnabled(consoles.length > 1);
@@ -47,8 +48,8 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
public ConsoleDropDownAction(IConsoleView view) {
fView= view;
- setText(ConsoleMessages.ConsoleDropDownAction_0);
- setToolTipText(ConsoleMessages.ConsoleDropDownAction_1);
+ 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);
@@ -59,11 +60,12 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#dispose()
*/
+ @Override
public void dispose() {
if (fMenu != null) {
fMenu.dispose();
}
-
+
fView= null;
ConsolePlugin.getDefault().getConsoleManager().removeConsoleListener(this);
}
@@ -71,6 +73,7 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
+ @Override
public Menu getMenu(Menu parent) {
return null;
}
@@ -78,11 +81,12 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Control)
*/
+ @Override
public Menu getMenu(Control parent) {
if (fMenu != null) {
fMenu.dispose();
}
-
+
fMenu= new Menu(parent);
IConsole[] consoles= ConsolePlugin.getDefault().getConsoleManager().getConsoles();
IConsole current = fView.getConsole();
@@ -94,7 +98,7 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
}
return fMenu;
}
-
+
private void addActionToMenu(Menu parent, Action action, int accelerator) {
if (accelerator < 10) {
StringBuffer label= new StringBuffer();
@@ -112,6 +116,7 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
ConsoleView consoleView = (ConsoleView) fView;
boolean pinned = consoleView.isPinned();
@@ -140,12 +145,14 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
}
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void consolesAdded(IConsole[] consoles) {
UIJob job = new UIJob("") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
update();
return Status.OK_STATUS;
@@ -157,14 +164,16 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
}
/* (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[])
*/
+ @Override
public void consolesRemoved(IConsole[] consoles) {
UIJob job = new UIJob("") { //$NON-NLS-1$
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
if (fMenu != null) {
fMenu.dispose();
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
index 377d3d56d..379076fea 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,14 +46,16 @@ public class ConsoleFactoryExtension implements IPluginContribution {
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
- public String getLocalId() {
+ @Override
+ public String getLocalId() {
return fConfig.getAttribute("id"); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
- public String getPluginId() {
+ @Override
+ public String getPluginId() {
return fConfig.getContributor().getName();
}
@@ -62,7 +64,7 @@ public class ConsoleFactoryExtension implements IPluginContribution {
Expression enablementExpression = getEnablementExpression();
if (enablementExpression == null) {
return true;
- }
+ }
EvaluationContext context = new EvaluationContext(null, this);
EvaluationResult evaluationResult = enablementExpression.evaluate(context);
return evaluationResult != EvaluationResult.FALSE;
@@ -71,11 +73,11 @@ public class ConsoleFactoryExtension implements IPluginContribution {
return false;
}
}
-
+
public Expression getEnablementExpression() throws CoreException {
if (fEnablementExpression == null) {
IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT);
- IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
+ IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
if (enablement != null) {
fEnablementExpression = ExpressionConverter.getDefault().perform(enablement);
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
index b98df7300..841e2d3be 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -15,21 +15,21 @@ import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IHyperlink;
/**
- * Describes the postition of a hyperlink within the Console's document.
+ * Describes the position 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;
}
@@ -37,6 +37,7 @@ public class ConsoleHyperlinkPosition extends Position {
/**
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object arg) {
return arg instanceof ConsoleHyperlinkPosition && super.equals(arg) && getHyperLink().equals(((ConsoleHyperlinkPosition)arg).getHyperLink());
}
@@ -44,6 +45,7 @@ public class ConsoleHyperlinkPosition extends Position {
/**
* @see java.lang.Object#hashCode()
*/
+ @Override
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
index aea898a2f..fbc8a7a50 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2010 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -48,58 +48,59 @@ 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);
+ private List<IConsole> fConsoles = new ArrayList<IConsole>(10);
+
-
// change notification constants
private final static int ADDED = 1;
private final static int REMOVED = 2;
- private List fPatternMatchListeners;
+ private List<PatternMatchListenerExtension> fPatternMatchListeners;
+
+ private List<ConsolePageParticipantExtension> fPageParticipants;
- private List fPageParticipants;
+ private List<ConsoleFactoryExtension> fConsoleFactoryExtensions;
+
+ private List<IConsoleView> fConsoleViews = new ArrayList<IConsoleView>();
- 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();
+ private Set<IConsole> list = new HashSet<IConsole>();
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) {
+
+ @Override
+ 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];
@@ -125,27 +126,29 @@ public class ConsoleManager implements IConsoleManager {
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)
*/
+ @Override
public void handleException(Throwable exception) {
- IStatus status = new Status(IStatus.ERROR, ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.INTERNAL_ERROR, ConsoleMessages.ConsoleManager_0, 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()
*/
+ @Override
public void run() throws Exception {
switch (fType) {
case ADDED:
@@ -154,12 +157,14 @@ public class ConsoleManager implements IConsoleManager {
case REMOVED:
fListener.consolesRemoved(fChanged);
break;
+ default:
+ break;
}
}
/**
* Notifies the given listener of the adds/removes
- *
+ *
* @param consoles the consoles that changed
* @param update the type of change
*/
@@ -173,12 +178,12 @@ public class ConsoleManager implements IConsoleManager {
for (int i= 0; i < copiedListeners.length; i++) {
fListener = (IConsoleListener)copiedListeners[i];
SafeRunner.run(this);
- }
+ }
fChanged = null;
- fListener = null;
+ fListener = null;
}
- }
-
+ }
+
public void registerConsoleView(ConsoleView view) {
synchronized (fConsoleViews) {
fConsoleViews.add(view);
@@ -189,10 +194,11 @@ public class ConsoleManager implements IConsoleManager {
fConsoleViews.remove(view);
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#addConsoleListener(org.eclipse.ui.console.IConsoleListener)
*/
+ @Override
public void addConsoleListener(IConsoleListener listener) {
if (fListeners == null) {
fListeners = new ListenerList();
@@ -203,6 +209,7 @@ public class ConsoleManager implements IConsoleManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#removeConsoleListener(org.eclipse.ui.console.IConsoleListener)
*/
+ @Override
public void removeConsoleListener(IConsoleListener listener) {
if (fListeners != null) {
fListeners.remove(listener);
@@ -212,8 +219,9 @@ public class ConsoleManager implements IConsoleManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#addConsoles(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void addConsoles(IConsole[] consoles) {
- List added = new ArrayList(consoles.length);
+ List<IConsole> added = new ArrayList<IConsole>(consoles.length);
synchronized (fConsoles) {
for (int i = 0; i < consoles.length; i++) {
IConsole console = consoles[i];
@@ -225,18 +233,19 @@ public class ConsoleManager implements IConsoleManager {
fConsoles.add(console);
added.add(console);
}
- }
+ }
}
if (!added.isEmpty()) {
- fireUpdate((IConsole[])added.toArray(new IConsole[added.size()]), ADDED);
+ fireUpdate(added.toArray(new IConsole[added.size()]), ADDED);
}
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#removeConsoles(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void removeConsoles(IConsole[] consoles) {
- List removed = new ArrayList(consoles.length);
+ List<IConsole> removed = new ArrayList<IConsole>(consoles.length);
synchronized (fConsoles) {
for (int i = 0; i < consoles.length; i++) {
IConsole console = consoles[i];
@@ -246,43 +255,45 @@ public class ConsoleManager implements IConsoleManager {
}
}
if (!removed.isEmpty()) {
- fireUpdate((IConsole[])removed.toArray(new IConsole[removed.size()]), REMOVED);
+ fireUpdate(removed.toArray(new IConsole[removed.size()]), REMOVED);
}
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#getConsoles()
*/
+ @Override
public IConsole[] getConsoles() {
synchronized (fConsoles) {
- return (IConsole[])fConsoles.toArray(new IConsole[fConsoles.size()]);
+ return 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;
-
+ private IConsole console;
+
ShowConsoleViewJob() {
super("Show Console View"); //$NON-NLS-1$
setSystem(true);
setPriority(Job.SHORT);
}
-
+
void setConsole(IConsole console) {
this.console = console;
}
-
+
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
boolean consoleFound = false;
IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
@@ -290,9 +301,8 @@ public class ConsoleManager implements IConsoleManager {
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)) {
+ for (IConsoleView consoleView : fConsoleViews) {
+ if (consoleView.getSite().getPage().equals(page)) {
boolean consoleVisible = page.isPartVisible(consoleView);
if (consoleVisible) {
consoleFound = true;
@@ -303,9 +313,9 @@ public class ConsoleManager implements IConsoleManager {
consoleView.display(console);
}
}
- }
+ }
}
-
+
if (!consoleFound) {
try {
IConsoleView consoleView = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW, null, IWorkbenchPage.VIEW_CREATE);
@@ -313,7 +323,7 @@ public class ConsoleManager implements IConsoleManager {
if (bringToTop) {
page.bringToTop(consoleView);
}
- consoleView.display(console);
+ consoleView.display(console);
} catch (PartInitException pie) {
ConsolePlugin.log(pie);
}
@@ -322,18 +332,19 @@ public class ConsoleManager implements IConsoleManager {
}
console = null;
return Status.OK_STATUS;
- }
+ }
}
-
+
private ShowConsoleViewJob showJob = new ShowConsoleViewJob();
/**
* @see IConsoleManager#showConsoleView(IConsole)
*/
+ @Override
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
@@ -350,14 +361,16 @@ public class ConsoleManager implements IConsoleManager {
}
return bringToTop;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#warnOfContentChange(org.eclipse.ui.console.IConsole)
*/
+ @Override
public void warnOfContentChange(final IConsole console) {
if (!fWarnQueued) {
fWarnQueued = true;
Job job = new UIJob(ConsolePlugin.getStandardDisplay(), ConsoleMessages.ConsoleManager_consoleContentChangeJob) {
+ @Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchWindow window= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
@@ -367,8 +380,8 @@ public class ConsoleManager implements IConsoleManager {
if (consoleView != null) {
consoleView.warnOfContentChange(console);
}
- }
- }
+ }
+ }
fWarnQueued = false;
return Status.OK_STATUS;
}
@@ -381,26 +394,27 @@ public class ConsoleManager implements IConsoleManager {
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleManager#getPatternMatchListenerDelegates(org.eclipse.ui.console.IConsole)
*/
- public IPatternMatchListener[] createPatternMatchListeners(IConsole console) {
+ @Override
+ public IPatternMatchListener[] createPatternMatchListeners(IConsole console) {
if (fPatternMatchListeners == null) {
- fPatternMatchListeners = new ArrayList();
+ fPatternMatchListeners = new ArrayList<PatternMatchListenerExtension>();
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);
+ fPatternMatchListeners.add(extension);
}
}
- ArrayList list = new ArrayList();
- for(Iterator i = fPatternMatchListeners.iterator(); i.hasNext(); ) {
- PatternMatchListenerExtension extension = (PatternMatchListenerExtension) i.next();
+ ArrayList<PatternMatchListener> list = new ArrayList<PatternMatchListener>();
+ for (Iterator<PatternMatchListenerExtension> i = fPatternMatchListeners.iterator(); i.hasNext();) {
+ PatternMatchListenerExtension extension = 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);
@@ -416,7 +430,7 @@ public class ConsoleManager implements IConsoleManager {
ConsolePlugin.log(e);
}
}
- return (PatternMatchListener[])list.toArray(new PatternMatchListener[0]);
+ return list.toArray(new PatternMatchListener[0]);
}
/* (non-Javadoc)
@@ -424,7 +438,7 @@ public class ConsoleManager implements IConsoleManager {
*/
public IConsolePageParticipant[] getPageParticipants(IConsole console) {
if(fPageParticipants == null) {
- fPageParticipants = new ArrayList();
+ fPageParticipants = new ArrayList<ConsolePageParticipantExtension>();
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++) {
@@ -433,9 +447,9 @@ public class ConsoleManager implements IConsoleManager {
fPageParticipants.add(extension);
}
}
- ArrayList list = new ArrayList();
- for(Iterator i = fPageParticipants.iterator(); i.hasNext(); ) {
- ConsolePageParticipantExtension extension = (ConsolePageParticipantExtension) i.next();
+ ArrayList<IConsolePageParticipant> list = new ArrayList<IConsolePageParticipant>();
+ for (Iterator<ConsolePageParticipantExtension> i = fPageParticipants.iterator(); i.hasNext();) {
+ ConsolePageParticipantExtension extension = i.next();
try {
if (extension.isEnabledFor(console)) {
list.add(extension.createDelegate());
@@ -444,7 +458,7 @@ public class ConsoleManager implements IConsoleManager {
ConsolePlugin.log(e);
}
}
- return (IConsolePageParticipant[]) list.toArray(new IConsolePageParticipant[0]);
+ return list.toArray(new IConsolePageParticipant[0]);
}
/* (non-Javadoc)
@@ -452,20 +466,21 @@ public class ConsoleManager implements IConsoleManager {
*/
public ConsoleFactoryExtension[] getConsoleFactoryExtensions() {
if (fConsoleFactoryExtensions == null) {
- fConsoleFactoryExtensions = new ArrayList();
+ fConsoleFactoryExtensions = new ArrayList<ConsoleFactoryExtension>();
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]);
+ return fConsoleFactoryExtensions.toArray(new ConsoleFactoryExtension[0]);
}
-
-
- public void refresh(final IConsole console) {
+
+
+ @Override
+ public void refresh(final IConsole console) {
fRepaintJob.addConsole(console);
- fRepaintJob.schedule(50);
+ fRepaintJob.schedule(50);
}
}
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
index 37a522f51..9bf749569 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -33,31 +33,33 @@ public class ConsolePageParticipantExtension implements IPluginContribution {
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
- public String getLocalId() {
+ @Override
+ public String getLocalId() {
return fConfig.getAttribute("id"); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
- public String getPluginId() {
+ @Override
+ 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 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;
+ IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
if (enablement != null) {
fEnablementExpression = ExpressionConverter.getDefault().perform(enablement);
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
index e765d7a61..d445277c0 100644
--- 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
@@ -36,7 +36,7 @@ public class ConsolePatternMatcher implements IDocumentListener {
/**
* Collection of compiled pattern match listeners
*/
- private ArrayList fPatterns = new ArrayList();
+ private ArrayList<CompiledPatternMatchListener> fPatterns = new ArrayList<CompiledPatternMatchListener>();
private TextConsole fConsole;
@@ -56,10 +56,11 @@ public class ConsolePatternMatcher implements IDocumentListener {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
*/
- protected IStatus run(IProgressMonitor monitor) {
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
IDocument doc = fConsole.getDocument();
String text = null;
int prevBaseOffset = -1;
@@ -170,11 +171,12 @@ public class ConsolePatternMatcher implements IDocumentListener {
return Status.OK_STATUS;
}
- public boolean belongsTo(Object family) {
+ @Override
+ public boolean belongsTo(Object family) {
return family == fConsole;
}
-
-
+
+
}
private class CompiledPatternMatchListener {
@@ -203,21 +205,18 @@ public class ConsolePatternMatcher implements IDocumentListener {
/**
* 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;
- }
- }
-
+ for (CompiledPatternMatchListener listener : fPatterns) {
+ if (listener.listener == matchListener) {
+ return;
+ }
+ }
+
if (matchListener == null || matchListener.getPattern() == null) {
throw new IllegalArgumentException("Pattern cannot be null"); //$NON-NLS-1$
}
@@ -238,14 +237,14 @@ public class ConsolePatternMatcher implements IDocumentListener {
/**
* 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();
+ for (Iterator<CompiledPatternMatchListener> iter = fPatterns.iterator(); iter.hasNext();) {
+ CompiledPatternMatchListener element = iter.next();
if (element.listener == matchListener) {
iter.remove();
matchListener.disconnect();
@@ -257,46 +256,42 @@ public class ConsolePatternMatcher implements IDocumentListener {
public void disconnect() {
fMatchJob.cancel();
synchronized (fPatterns) {
- Iterator iterator = fPatterns.iterator();
- while (iterator.hasNext()) {
- CompiledPatternMatchListener notifier = (CompiledPatternMatchListener) iterator.next();
- notifier.dispose();
- }
+ for (CompiledPatternMatchListener listener : fPatterns) {
+ listener.dispose();
+ }
fPatterns.clear();
}
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.text.IDocumentListener#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
*/
- public void documentAboutToBeChanged(DocumentEvent event) {
+ @Override
+ public void documentAboutToBeChanged(DocumentEvent event) {
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.text.IDocumentListener#documentChanged(org.eclipse.jface.text.DocumentEvent)
*/
- public void documentChanged(DocumentEvent event) {
+ @Override
+ 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;
- }
+ for (CompiledPatternMatchListener notifier : fPatterns) {
+ notifier.end = 0;
+ }
} else {
- if (event.fOffset == 0) {
+ 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;
- }
+ for (CompiledPatternMatchListener notifier : fPatterns) {
+ notifier.end = notifier.end > event.fLength ? notifier.end - event.fLength : 0;
+ }
}
}
}
@@ -304,7 +299,7 @@ public class ConsolePatternMatcher implements IDocumentListener {
fMatchJob.schedule();
}
-
+
public void forceFinalMatching() {
fScheduleFinal = true;
fMatchJob.schedule();
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
index 46dc213fe..2909471c5 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -15,7 +15,7 @@ import org.eclipse.ui.console.IConsole;
/**
* Tests if an IOConsole's type matches the expected value
- *
+ *
* @since 3.1
*/
public class ConsoleTypePropertyTester extends PropertyTester {
@@ -23,7 +23,8 @@ 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) {
+ @Override
+ 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
index 45d9bc823..eb5ef07df 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,15 +18,6 @@ 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;
@@ -36,7 +27,13 @@ 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.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.ui.IPartListener2;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IViewSite;
@@ -63,55 +60,55 @@ 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();
-
+ private List<IConsole> fStack = new ArrayList<IConsole>();
+
/**
* The console being displayed, or <code>null</code> if none
*/
private IConsole fActiveConsole = null;
-
+
/**
* Map of consoles to dummy console parts (used to close pages)
*/
- private Map fConsoleToPart;
-
+ private Map<IConsole, ConsoleWorkbenchPart> fConsoleToPart;
+
/**
* Map of consoles to array of page participants
*/
- private Map fConsoleToPageParticipants;
-
+ private Map<IConsole, ListenerList> fConsoleToPageParticipants;
+
/**
* Map of parts to consoles
*/
- private Map fPartToConsole;
-
+ private Map<ConsoleWorkbenchPart, IConsole> fPartToConsole;
+
/**
* Whether this view is active
*/
private boolean fActive = false;
-
+
/**
* 'In Console View' context
*/
private IContextActivation fActivatedContext;
-
+
// actions
- private PinConsoleAction fPinAction = null;
+ private PinConsoleAction fPinAction = null;
private ConsoleDropDownAction fDisplayConsoleAction = null;
-
+
private OpenConsoleAction fOpenConsoleAction = null;
private boolean fScrollLock;
@@ -123,6 +120,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
*/
+ @Override
public void propertyChange(PropertyChangeEvent event) {
Object source = event.getSource();
if (source instanceof IConsole && event.getProperty().equals(IBasicPropertyConstants.P_TEXT)) {
@@ -136,6 +134,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
public void partClosed(IWorkbenchPart part) {
super.partClosed(part);
fPinAction.update();
@@ -144,6 +143,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.console.IConsoleView#getConsole()
*/
+ @Override
public IConsole getConsole() {
return fActiveConsole;
}
@@ -151,27 +151,28 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#showPageRec(org.eclipse.ui.part.PageBookView.PageRec)
*/
+ @Override
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);
+ IConsole console = fPartToConsole.get(pageRec.part);
if (!fStack.contains(console)) {
fStack.add(console);
}
return;
}
-
- IConsole recConsole = (IConsole)fPartToConsole.get(pageRec.part);
+
+ IConsole recConsole = 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);
+ tos = fStack.get(0);
}
if (tos != null && !tos.equals(fActiveConsole) && fActive) {
deactivateParticipants(tos);
@@ -181,7 +182,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
fStack.add(0,fActiveConsole);
activateParticipants(fActiveConsole);
}
- updateTitle();
+ updateTitle();
updateHelp();
// update console actions
if (fPinAction != null) {
@@ -192,10 +193,10 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
((IOConsolePage)page).setAutoScroll(!fScrollLock);
}
}
-
+
/**
* Activates the participants for the given console, if any.
- *
+ *
* @param console
*/
private void activateParticipants(IConsole console) {
@@ -207,9 +208,11 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
for (int i = 0; i < participants.length; i++) {
final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
participant.activated();
}
+ @Override
public void handleException(Throwable exception) {
ConsolePlugin.log(exception);
listeners.remove(participant);
@@ -222,10 +225,10 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/**
* 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() {
+ protected List<IConsole> getConsoleStack() {
return fStack;
}
@@ -235,16 +238,16 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
protected void updateTitle() {
IConsole console = getConsole();
if (console == null) {
- setContentDescription(ConsoleMessages.ConsoleView_0);
+ setContentDescription(ConsoleMessages.ConsoleView_0);
} else {
String newName = console.getName();
String oldName = getContentDescription();
if (newName!=null && !(newName.equals(oldName))) {
- setContentDescription(console.getName());
+ setContentDescription(console.getName());
}
}
}
-
+
protected void updateHelp() {
IConsole console = getConsole();
String helpContextId = null;
@@ -261,19 +264,22 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#doDestroyPage(org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.part.PageBookView.PageRec)
*/
+ @Override
protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- IConsole console = (IConsole)fPartToConsole.get(part);
-
+ IConsole console = fPartToConsole.get(part);
+
// dispose page participants
- ListenerList listeners = (ListenerList) fConsoleToPageParticipants.remove(console);
+ ListenerList listeners = 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() {
+ @Override
public void run() throws Exception {
participant.dispose();
}
+ @Override
public void handleException(Throwable exception) {
ConsolePlugin.log(exception);
}
@@ -285,31 +291,32 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
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();
+ fPinAction.update();
}
-
+
/**
* Returns the page participants registered for the given console, or <code>null</code>
- *
+ *
* @param console
* @return registered page participants or <code>null</code>
*/
private ListenerList getParticipants(IConsole console) {
- return (ListenerList) fConsoleToPageParticipants.get(console);
+ return fConsoleToPageParticipants.get(console);
}
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#doCreatePage(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected PageRec doCreatePage(IWorkbenchPart dummyPart) {
ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)dummyPart;
final IConsole console = part.getConsole();
@@ -317,7 +324,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
initPage(page);
page.createControl(getPageBook());
console.addPropertyChangeListener(this);
-
+
// initialize page participants
IConsolePageParticipant[] consoleParticipants = ((ConsoleManager)getConsoleManager()).getPageParticipants(console);
final ListenerList participants = new ListenerList();
@@ -329,16 +336,18 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
for (int i = 0; i < listeners.length; i++) {
final IConsolePageParticipant participant = (IConsolePageParticipant) listeners[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
participant.init(page, console);
}
+ @Override
public void handleException(Throwable exception) {
ConsolePlugin.log(exception);
participants.remove(participant);
}
});
}
-
+
PageRec rec = new PageRec(dummyPart, page);
return rec;
}
@@ -346,6 +355,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#isImportant(org.eclipse.ui.IWorkbenchPart)
*/
+ @Override
protected boolean isImportant(IWorkbenchPart part) {
return part instanceof ConsoleWorkbenchPart;
}
@@ -353,6 +363,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
IViewSite site = getViewSite();
if(site != null) {
@@ -360,13 +371,13 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
}
super.dispose();
ConsoleManager consoleManager = (ConsoleManager) ConsolePlugin.getDefault().getConsoleManager();
- consoleManager.removeConsoleListener(this);
+ consoleManager.removeConsoleListener(this);
consoleManager.unregisterConsoleView(this);
}
/**
* Returns the console manager.
- *
+ *
* @return the console manager
*/
private IConsoleManager getConsoleManager() {
@@ -376,6 +387,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#createDefaultPage(org.eclipse.ui.part.PageBook)
*/
+ @Override
protected IPage createDefaultPage(PageBook book) {
MessagePage page = new MessagePage();
page.createControl(getPageBook());
@@ -386,9 +398,11 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesAdded(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void consolesAdded(final IConsole[] consoles) {
if (isAvailable()) {
Runnable r = new Runnable() {
+ @Override
public void run() {
for (int i = 0; i < consoles.length; i++) {
if (isAvailable()) {
@@ -417,15 +431,17 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleListener#consolesRemoved(org.eclipse.ui.console.IConsole[])
*/
+ @Override
public void consolesRemoved(final IConsole[] consoles) {
if (isAvailable()) {
Runnable r = new Runnable() {
+ @Override
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);
+ ConsoleWorkbenchPart part = fConsoleToPart.get(console);
if (part != null) {
partClosed(part);
}
@@ -448,14 +464,14 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
*/
public ConsoleView() {
super();
- fConsoleToPart = new HashMap();
- fPartToConsole = new HashMap();
- fConsoleToPageParticipants = new HashMap();
-
+ fConsoleToPart = new HashMap<IConsole, ConsoleWorkbenchPart>();
+ fPartToConsole = new HashMap<ConsoleWorkbenchPart, IConsole>();
+ fConsoleToPageParticipants = new HashMap<IConsole, ListenerList>();
+
ConsoleManager consoleManager = (ConsoleManager) ConsolePlugin.getDefault().getConsoleManager();
consoleManager.registerConsoleView(this);
}
-
+
protected void createActions() {
fPinAction = new PinConsoleAction(this);
fDisplayConsoleAction = new ConsoleDropDownAction(this);
@@ -477,6 +493,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
ToolBarManager tbm= (ToolBarManager) mgr;
final ToolBar tb= tbm.getControl();
tb.addMouseListener(new MouseAdapter() {
+ @Override
public void mouseDown(MouseEvent e) {
ToolItem ti= tb.getItem(new Point(e.x, e.y));
if (ti != null) {
@@ -501,6 +518,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#display(org.eclipse.ui.console.IConsole)
*/
+ @Override
public void display(IConsole console) {
if (fPinned && fActiveConsole != null) {
return;
@@ -508,7 +526,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
if (console.equals(fActiveConsole)) {
return;
}
- ConsoleWorkbenchPart part = (ConsoleWorkbenchPart)fConsoleToPart.get(console);
+ ConsoleWorkbenchPart part = fConsoleToPart.get(console);
if (part != null) {
partActivated(part);
}
@@ -517,6 +535,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/*/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#pin(org.eclipse.ui.console.IConsole)
*/
+ @Override
public void setPinned(boolean pin) {
fPinned = pin;
if (fPinAction != null) {
@@ -527,6 +546,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#isPinned()
*/
+ @Override
public boolean isPinned() {
return fPinned;
}
@@ -534,14 +554,15 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.part.PageBookView#getBootstrapPart()
*/
+ @Override
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) {
@@ -549,7 +570,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
getPageBook().getDisplay().asyncExec(r);
}
}
-
+
/**
* Creates this view's underlying viewer and actions.
* Hooks a pop-up menu to the underlying viewer's control,
@@ -566,6 +587,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
* </ul>
* @see IWorkbenchPart#createPartControl(Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
createActions();
@@ -577,34 +599,40 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
getViewSite().getPage().addPartListener((IPartListener2)this);
initPageSwitcher();
}
-
+
/**
* Initialize the PageSwitcher.
*/
private void initPageSwitcher() {
new PageSwitcher(this) {
+ @Override
public void activatePage(Object page) {
ShowConsoleAction.showConsole((IConsole) page, ConsoleView.this);
}
+ @Override
public ImageDescriptor getImageDescriptor(Object page) {
return ((IConsole) page).getImageDescriptor();
}
+ @Override
public String getName(Object page) {
return ((IConsole) page).getName();
}
+ @Override
public Object[] getPages() {
return getConsoleManager().getConsoles();
}
-
+
+ @Override
public int getCurrentPageIndex() {
IConsole currentConsole= getConsole();
IConsole[] consoles= getConsoleManager().getConsoles();
for (int i= 0; i < consoles.length; i++) {
- if (consoles[i].equals(currentConsole))
+ if (consoles[i].equals(currentConsole)) {
return i;
+ }
}
return super.getCurrentPageIndex();
}
@@ -620,14 +648,15 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
IConsole[] consoles = manager.getConsoles();
consolesAdded(consoles);
// add as a listener
- manager.addConsoleListener(this);
- }
-
+ manager.addConsoleListener(this);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#warnOfContentChange(org.eclipse.ui.console.IConsole)
*/
+ @Override
public void warnOfContentChange(IConsole console) {
- IWorkbenchPart part = (IWorkbenchPart)fConsoleToPart.get(console);
+ IWorkbenchPart part = fConsoleToPart.get(console);
if (part != null) {
IWorkbenchSiteProgressService service = (IWorkbenchSiteProgressService) part.getSite().getAdapter(IWorkbenchSiteProgressService.class);
if (service != null) {
@@ -635,8 +664,9 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
}
}
}
-
- public Object getAdapter(Class key) {
+
+ @Override
+ public Object getAdapter(Class key) {
Object adpater = super.getAdapter(key);
if (adpater == null) {
IConsole console = getConsole();
@@ -661,6 +691,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partActivated(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
fActive = true;
@@ -675,18 +706,21 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partBroughtToTop(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partClosed(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partDeactivated(IWorkbenchPartReference partRef) {
if (isThisPart(partRef)) {
fActive = false;
@@ -697,10 +731,10 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
}
}
}
-
+
/**
- * Returns if the specified part reference is to this view part (if the part
- * reference is the console view or not)
+ * 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
*/
@@ -724,7 +758,7 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/**
* Deactivates participants for the given console, if any.
- *
+ *
* @param console console to deactivate
*/
private void deactivateParticipants(IConsole console) {
@@ -736,9 +770,11 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
for (int i = 0; i < participants.length; i++) {
final IConsolePageParticipant participant = (IConsolePageParticipant) participants[i];
SafeRunner.run(new ISafeRunnable() {
+ @Override
public void run() throws Exception {
participant.deactivated();
}
+ @Override
public void handleException(Throwable exception) {
ConsolePlugin.log(exception);
listeners.remove(participant);
@@ -752,31 +788,36 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partOpened(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partHidden(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference)
*/
+ @Override
public void partVisible(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference)
*/
- public void partInputChanged(IWorkbenchPartReference partRef) {
+ @Override
+ public void partInputChanged(IWorkbenchPartReference partRef) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#setScrollLock(boolean)
*/
- public void setScrollLock(boolean scrollLock) {
+ @Override
+ public void setScrollLock(boolean scrollLock) {
fScrollLock = scrollLock;
IPage page = getCurrentPage();
@@ -788,14 +829,16 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#getScrollLock()
*/
- public boolean getScrollLock() {
+ @Override
+ public boolean getScrollLock() {
return fScrollLock;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleView#pin(org.eclipse.ui.console.IConsole)
*/
- public void pin(IConsole console) {
+ @Override
+ public void pin(IConsole console) {
if (console == null) {
setPinned(false);
} else {
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
index 8a32fc8c1..5fe80b8df 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,10 +24,11 @@ public class ConsoleViewConsoleFactory implements IConsoleFactory {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.console.IConsoleFactory#openConsole()
*/
- public void openConsole() {
+ @Override
+ public void openConsole() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
IWorkbenchPage page = window.getActivePage();
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
index e3377a4dc..5a9acda45 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,10 +24,11 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
private IConsole fConsole = null;
private IWorkbenchPartSite fSite = null;
-
+
/* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object)
*/
+ @Override
public boolean equals(Object obj) {
return (obj instanceof ConsoleWorkbenchPart) &&
fConsole.equals(((ConsoleWorkbenchPart)obj).fConsole);
@@ -36,6 +37,7 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see java.lang.Object#hashCode()
*/
+ @Override
public int hashCode() {
return fConsole.hashCode();
}
@@ -52,24 +54,28 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#addPropertyListener(org.eclipse.ui.IPropertyListener)
*/
+ @Override
public void addPropertyListener(IPropertyListener listener) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createPartControl(Composite parent) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getSite()
*/
+ @Override
public IWorkbenchPartSite getSite() {
return fSite;
}
@@ -77,6 +83,7 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getTitle()
*/
+ @Override
public String getTitle() {
return ""; //$NON-NLS-1$
}
@@ -84,6 +91,7 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getTitleImage()
*/
+ @Override
public Image getTitleImage() {
return null;
}
@@ -91,6 +99,7 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#getTitleToolTip()
*/
+ @Override
public String getTitleToolTip() {
return ""; //$NON-NLS-1$
}
@@ -98,25 +107,28 @@ public class ConsoleWorkbenchPart implements IWorkbenchPart {
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#removePropertyListener(org.eclipse.ui.IPropertyListener)
*/
+ @Override
public void removePropertyListener(IPropertyListener listener) {
}
/* (non-Javadoc)
* @see org.eclipse.ui.IWorkbenchPart#setFocus()
*/
+ @Override
public void setFocus() {
}
/* (non-Javadoc)
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
*/
+ @Override
public Object getAdapter(Class adapter) {
return null;
}
/**
* Returns the console associated with this part.
- *
+ *
* @return console associated with this part
*/
protected IConsole getConsole() {
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
index 492dfd552..5a735ccf9 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,7 @@ import org.eclipse.ui.console.TextConsoleViewer;
/**
* Follows a hyperlink in the console
- *
+ *
* @since 3.1
*/
public class FollowHyperlinkAction extends Action {
@@ -28,8 +28,8 @@ public class FollowHyperlinkAction extends Action {
* Constructs a follow link action
*/
public FollowHyperlinkAction(TextConsoleViewer consoleViewer) {
- super(ConsoleMessages.FollowHyperlinkAction_0);
- setToolTipText(ConsoleMessages.FollowHyperlinkAction_1);
+ super(ConsoleMessages.FollowHyperlinkAction_0);
+ setToolTipText(ConsoleMessages.FollowHyperlinkAction_1);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_OPEN_LINK_ACTION);
this.viewer = consoleViewer;
}
@@ -37,14 +37,16 @@ public class FollowHyperlinkAction extends Action {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#isEnabled()
*/
- public boolean isEnabled() {
+ @Override
+ public boolean isEnabled() {
return viewer.getHyperlink() != null;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
IHyperlink link = viewer.getHyperlink();
if (link != null) {
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
index 3ed6aa714..0c78ed550 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others.
+ * Copyright (c) 2007, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,11 +12,10 @@ 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 {
@@ -32,6 +31,7 @@ public class HyperlinkUpdater extends DefaultPositionUpdater {
*
* @return <code>true</code> if position has NOT been deleted
*/
+ @Override
protected boolean notDeleted() {
int positionEnd = fPosition.offset + fPosition.length - 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
index 3f8d72fe9..3d8a1de56 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,9 +24,9 @@ import org.eclipse.ui.console.TextConsoleViewer;
/**
* A page for an IOConsole
- *
+ *
* @since 3.1
- *
+ *
*/
public class IOConsolePage extends TextConsolePage {
@@ -40,7 +40,8 @@ public class IOConsolePage extends TextConsolePage {
super(console, view);
fPropertyChangeListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
+ @Override
+ public void propertyChange(PropertyChangeEvent event) {
String property = event.getProperty();
if (property.equals(IConsoleConstants.P_CONSOLE_OUTPUT_COMPLETE)) {
setReadOnly();
@@ -52,10 +53,11 @@ public class IOConsolePage extends TextConsolePage {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.part.IPage#createControl(org.eclipse.swt.widgets.Composite)
*/
- public void createControl(Composite parent) {
+ @Override
+ public void createControl(Composite parent) {
super.createControl(parent);
if (fReadOnly) {
IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
@@ -65,11 +67,12 @@ public class IOConsolePage extends TextConsolePage {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.console.TextConsolePage#createViewer(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.console.TextConsole)
*/
- protected TextConsoleViewer createViewer(Composite parent) {
+ @Override
+ protected TextConsoleViewer createViewer(Composite parent) {
return new IOConsoleViewer(parent, (TextConsole)getConsole());
}
@@ -95,7 +98,8 @@ public class IOConsolePage extends TextConsolePage {
/* (non-Javadoc)
* @see org.eclipse.ui.console.TextConsolePage#createActions()
*/
- protected void createActions() {
+ @Override
+ protected void createActions() {
super.createActions();
fScrollLockAction = new ScrollLockAction(getConsoleView());
setAutoScroll(!fScrollLockAction.isChecked());
@@ -104,7 +108,8 @@ public class IOConsolePage extends TextConsolePage {
/* (non-Javadoc)
* @see org.eclipse.ui.console.TextConsolePage#contextMenuAboutToShow(org.eclipse.jface.action.IMenuManager)
*/
- protected void contextMenuAboutToShow(IMenuManager menuManager) {
+ @Override
+ protected void contextMenuAboutToShow(IMenuManager menuManager) {
super.contextMenuAboutToShow(menuManager);
menuManager.add(fScrollLockAction);
IOConsoleViewer viewer = (IOConsoleViewer) getViewer();
@@ -116,20 +121,22 @@ public class IOConsolePage extends TextConsolePage {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.console.TextConsolePage#configureToolBar(org.eclipse.jface.action.IToolBarManager)
*/
- protected void configureToolBar(IToolBarManager mgr) {
+ @Override
+ 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() {
+ @Override
+ public void dispose() {
if (fScrollLockAction != null) {
fScrollLockAction.dispose();
fScrollLockAction = null;
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
index 519cbc76b..bd20169be 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2004, 2008 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -19,7 +19,7 @@ import org.eclipse.ui.console.IOConsoleOutputStream;
/**
* A region in an IOConsole's document.
- *
+ *
* @since 3.1
*/
public class IOConsolePartition implements ITypedRegion {
@@ -37,14 +37,14 @@ public class IOConsolePartition implements ITypedRegion {
* 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.
*/
@@ -54,7 +54,7 @@ public class IOConsolePartition implements ITypedRegion {
this.type = OUTPUT_PARTITION_TYPE;
this.readOnly = true;
}
-
+
/**
* Creates a new partition to contain input from a console
*/
@@ -65,7 +65,7 @@ public class IOConsolePartition implements ITypedRegion {
this.type = INPUT_PARTITION_TYPE;
this.readOnly = false;
}
-
+
/**
* Inserts a string into this partition.
* @param s The string to insert
@@ -75,7 +75,7 @@ public class IOConsolePartition implements ITypedRegion {
buffer.insert(insertOffset, s);
length += s.length();
}
-
+
/**
* Deletes data from this partition.
* @param delOffset
@@ -85,12 +85,13 @@ public class IOConsolePartition implements ITypedRegion {
buffer.delete(delOffset, delOffset+delLength);
length -= delLength;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.ITypedRegion#getType()
*/
- public String getType() {
+ @Override
+ public String getType() {
return type;
}
@@ -98,7 +99,8 @@ public class IOConsolePartition implements ITypedRegion {
* (non-Javadoc)
* @see org.eclipse.jface.text.IRegion#getLength()
*/
- public int getLength() {
+ @Override
+ public int getLength() {
return length;
}
@@ -106,28 +108,29 @@ public class IOConsolePartition implements ITypedRegion {
* (non-Javadoc)
* @see org.eclipse.jface.text.IRegion#getOffset()
*/
- public int getOffset() {
+ @Override
+ 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.
@@ -135,7 +138,7 @@ public class IOConsolePartition implements ITypedRegion {
public String getString() {
return buffer.toString();
}
-
+
/**
* Returns a StyleRange object which may be used for setting the style
* of this partition in a viewer.
@@ -145,46 +148,46 @@ public class IOConsolePartition implements ITypedRegion {
}
/**
- * Returns the font of the input stream if the type of the partition
- * is <code>INPUT_PARTITION_TYPE</code>, otherwise it returns the output
+ * Returns the font of the input stream if the type of the partition
+ * is <code>INPUT_PARTITION_TYPE</code>, 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 <code>INPUT_PARTITION_TYPE</code>, otherwise it returns the output
+ * Returns the colour of the input stream if the type of the partition
+ * is <code>INPUT_PARTITION_TYPE</code>, 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 <code>true</code>.
- *
+ *
* @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
*/
public void setReadOnly() {
@@ -197,10 +200,10 @@ public class IOConsolePartition implements ITypedRegion {
public void clearBuffer() {
buffer.setLength(0);
}
-
+
/**
* Returns the underlying output stream
- *
+ *
* @return the underlying output stream
*/
IOConsoleOutputStream getStream() {
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
index 5a74807b2..6f32defb7 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -46,15 +46,15 @@ import org.eclipse.ui.progress.WorkbenchJob;
public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocumentPartitionerExtension {
private PendingPartition consoleClosedPartition;
private IDocument document;
- private ArrayList partitions;
+ private ArrayList<IOConsolePartition> partitions;
/**
* Blocks of data that have not yet been appended to the document.
*/
- private ArrayList pendingPartitions;
+ private ArrayList<PendingPartition> pendingPartitions;
/**
* A list of PendingPartitions to be appended by the updateJob
*/
- private ArrayList updatePartitions;
+ private ArrayList<PendingPartition> updatePartitions;
/**
* The last partition appended to the document
*/
@@ -62,7 +62,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
/**
* Job that appends pending partitions to the document.
*/
- private QueueProcessingJob queueJob;
+ private QueueProcessingJob queueJob;
/**
* The input stream attached to this document.
*/
@@ -75,7 +75,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
* A list of partitions containing input from the console, that have
* not been appended to the input stream yet.
*/
- private ArrayList inputPartitions;
+ private ArrayList<IOConsolePartition> inputPartitions;
/**
* offset used by updateJob
*/
@@ -89,64 +89,66 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
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.
+ * job and handling buffer overflow/clearing of the console.
*/
private Object overflowLock = new Object();
-
-
- private int fBuffer;
-
+
+
+ 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)
*/
+ @Override
public void connect(IDocument doc) {
document = doc;
document.setDocumentPartitioner(this);
lld = document.getLegalLineDelimiters();
- partitions = new ArrayList();
- pendingPartitions = new ArrayList();
- inputPartitions = new ArrayList();
+ partitions = new ArrayList<IOConsolePartition>();
+ pendingPartitions = new ArrayList<PendingPartition>();
+ inputPartitions = new ArrayList<IOConsolePartition>();
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() {
+ @Override
public void run() {
checkBufferSize();
}
});
}
-
+
/**
* Notification from the console that all of its streams have been closed.
*/
@@ -157,13 +159,14 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
queueJob.schedule(); //ensure that all pending partitions are processed.
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentPartitioner#disconnect()
*/
+ @Override
public void disconnect() {
- synchronized (overflowLock) {
+ synchronized (overflowLock) {
document = null;
partitions.clear();
connected = false;
@@ -173,112 +176,120 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
}
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentPartitioner#documentAboutToBeChanged(org.eclipse.jface.text.DocumentEvent)
*/
+ @Override
public void documentAboutToBeChanged(DocumentEvent event) {
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentPartitioner#documentChanged(org.eclipse.jface.text.DocumentEvent)
*/
+ @Override
public boolean documentChanged(DocumentEvent event) {
return documentChanged2(event) != null;
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentPartitioner#getLegalContentTypes()
*/
+ @Override
public String[] getLegalContentTypes() {
return new String[] { IOConsolePartition.OUTPUT_PARTITION_TYPE, IOConsolePartition.INPUT_PARTITION_TYPE };
}
-
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentPartitioner#getContentType(int)
*/
+ @Override
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) {
+ @Override
+ 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)};
+ return new IOConsolePartition[]{partitions.get(0)};
}
while (left < right) {
-
+
mid= (left + right) / 2;
-
- position= (IOConsolePartition) partitions.get(mid);
+
+ position= partitions.get(mid);
if (rangeEnd < position.getOffset()) {
- if (left == mid)
+ if (left == mid) {
right= left;
- else
+ } else {
right= mid -1;
+ }
} else if (offset > (position.getOffset() + position.getLength() - 1)) {
- if (right == mid)
+ if (right == mid) {
left= right;
- else
+ } else {
left= mid +1;
+ }
} else {
left= right= mid;
}
}
-
-
- List list = new ArrayList();
+
+
+ List<IOConsolePartition> list = new ArrayList<IOConsolePartition>();
int index = left - 1;
if (index >= 0) {
- position= (IOConsolePartition) partitions.get(index);
+ position= partitions.get(index);
while (index >= 0 && (position.getOffset() + position.getLength()) > offset) {
index--;
if (index >= 0) {
- position= (IOConsolePartition) partitions.get(index);
+ position= partitions.get(index);
}
- }
+ }
}
index++;
- position= (IOConsolePartition) partitions.get(index);
+ position= partitions.get(index);
while (index < partitions.size() && (position.getOffset() < rangeEnd)) {
list.add(position);
index++;
if (index < partitions.size()) {
- position= (IOConsolePartition) partitions.get(index);
+ position= partitions.get(index);
}
}
-
- return (ITypedRegion[]) list.toArray(new IOConsolePartition[list.size()]);
- }
-
+ return list.toArray(new IOConsolePartition[list.size()]);
+ }
+
+
/*
* (non-Javadoc)
* @see org.eclipse.jface.text.IDocumentPartitioner#getPartition(int)
*/
+ @Override
public ITypedRegion getPartition(int offset) {
for (int i = 0; i < partitions.size(); i++) {
- ITypedRegion partition = (ITypedRegion) partitions.get(i);
+ ITypedRegion partition = 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$
@@ -289,11 +300,11 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
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
+ * 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() {
@@ -307,7 +318,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
}
}
-
+
/**
* Clears the console
*/
@@ -317,12 +328,13 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
trimJob.schedule();
}
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.text.IDocumentPartitionerExtension#documentChanged2(org.eclipse.jface.text.DocumentEvent)
*/
+ @Override
public IRegion documentChanged2(DocumentEvent event) {
if (document == null) {
return null; //another thread disconnected the partitioner
@@ -337,52 +349,51 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
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) {
+ for (PendingPartition pp : updatePartitions) {
+ 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);
+ partition.setOffset(firstOffset);
lastPartition = partition;
partitions.add(partition);
}
firstOffset += ppLen;
- }
+ }
}
}
} else {// user input.
int amountDeleted = event.getLength() ;
-
+
if (amountDeleted > 0) {
- int offset = event.fOffset;
+ 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 = 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++) {
@@ -397,9 +408,9 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
if (lastLineDelimiter != -1) {
StringBuffer input = new StringBuffer();
- Iterator it = inputPartitions.iterator();
+ Iterator<IOConsolePartition> it = inputPartitions.iterator();
while (it.hasNext()) {
- IOConsolePartition partition = (IOConsolePartition) it.next();
+ IOConsolePartition partition = it.next();
if (partition.getOffset() + partition.getLength() <= event.fOffset + lastLineDelimiter) {
if (partition == lastPartition) {
lastPartition = null;
@@ -431,19 +442,19 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
}
- }
-
+ }
+
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
+ * 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.
@@ -453,7 +464,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
throw new IOException("Document is closed"); //$NON-NLS-1$
}
synchronized(pendingPartitions) {
- PendingPartition last = (PendingPartition) (pendingPartitions.size() > 0 ? pendingPartitions.get(pendingPartitions.size()-1) : null);
+ PendingPartition last = pendingPartitions.size() > 0 ? pendingPartitions.get(pendingPartitions.size()-1) : null;
if (last != null && last.stream == stream) {
last.append(s);
} else {
@@ -464,7 +475,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
queueJob.schedule(50);
}
}
-
+
if (fBuffer > 160000) {
if(Display.getCurrent() == null){
try {
@@ -481,29 +492,29 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
}
}
-
+
/**
* 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
+ * Updates the document. Will append everything that is available before
* finishing.
*/
private class QueueProcessingJob extends UIJob {
@@ -511,32 +522,34 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
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) {
+ @Override
+ 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() {
+ @Override
+ public boolean shouldRun() {
boolean shouldRun = connected && pendingPartitions != null && pendingPartitions.size() > 0;
return shouldRun;
}
}
-
+
void processQueue() {
synchronized (overflowLock) {
- ArrayList pendingCopy = new ArrayList();
+ ArrayList<PendingPartition> pendingCopy = new ArrayList<PendingPartition>();
StringBuffer buffer = null;
boolean consoleClosed = false;
synchronized(pendingPartitions) {
@@ -547,22 +560,19 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
// determine buffer size
int size = 0;
- for (Iterator i = pendingCopy.iterator(); i.hasNext(); ) {
- PendingPartition pp = (PendingPartition) i.next();
- if (pp != consoleClosedPartition) {
+ for (PendingPartition pp : pendingCopy) {
+ 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) {
+ for (PendingPartition pp : pendingCopy) {
+ if (pp != consoleClosedPartition) {
buffer.append(pp.text);
} else {
consoleClosed = true;
}
}
-
if (connected) {
setUpdateInProgress(true);
updatePartitions = pendingCopy;
@@ -583,18 +593,18 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
}
}
-
+
/**
* 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.
*/
@@ -602,10 +612,10 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
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) {
@@ -615,7 +625,8 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
/* (non-Javadoc)
* @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
*/
- public IStatus runInUIThread(IProgressMonitor monitor) {
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
IJobManager jobManager = Job.getJobManager();
try {
jobManager.join(console, monitor);
@@ -627,7 +638,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
if (document == null) {
return Status.OK_STATUS;
}
-
+
int length = document.getLength();
if (truncateOffset < length) {
synchronized (overflowLock) {
@@ -637,7 +648,7 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
setUpdateInProgress(true);
document.set(""); //$NON-NLS-1$
setUpdateInProgress(false);
- partitions.clear();
+ partitions.clear();
} else {
// overflow
int cutoffLine = document.getLineOfOffset(truncateOffset);
@@ -647,20 +658,19 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
// 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();
+ for (IOConsolePartition p : partitions) {
p.setOffset(offset);
offset += p.getLength();
}
@@ -676,20 +686,22 @@ public class IOConsolePartitioner implements IConsoleDocumentPartitioner, IDocum
/* (non-Javadoc)
* @see org.eclipse.ui.console.IConsoleDocumentPartitioner#isReadOnly(int)
*/
- public boolean isReadOnly(int offset) {
+ @Override
+ 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) {
+ @Override
+ 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++) {
+ 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);
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
index e686955f0..6ea0498e1 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,7 +24,7 @@ import org.eclipse.ui.console.TextConsoleViewer;
/**
* Viewer used to display an IOConsole
- *
+ *
* @since 3.1
*/
public class IOConsoleViewer extends TextConsoleViewer {
@@ -34,7 +34,7 @@ public class IOConsoleViewer extends TextConsoleViewer {
private boolean fAutoScroll = true;
private IDocumentListener fDocumentListener;
-
+
public IOConsoleViewer(Composite parent, TextConsole console) {
super(parent, console);
}
@@ -49,10 +49,11 @@ public class IOConsoleViewer extends TextConsoleViewer {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.text.TextViewer#handleVerifyEvent(org.eclipse.swt.events.VerifyEvent)
*/
- protected void handleVerifyEvent(VerifyEvent e) {
+ @Override
+ protected void handleVerifyEvent(VerifyEvent e) {
IDocument doc = getDocument();
String[] legalLineDelimiters = doc.getLegalLineDelimiters();
String eventString = e.text;
@@ -94,7 +95,8 @@ public class IOConsoleViewer extends TextConsoleViewer {
*/
public void setReadOnly() {
ConsolePlugin.getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
StyledText text = getTextWidget();
if (text != null && !text.isDisposed()) {
text.setEditable(false);
@@ -109,15 +111,16 @@ public class IOConsoleViewer extends TextConsoleViewer {
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) {
+ @Override
+ public void setDocument(IDocument document) {
IDocument oldDocument= getDocument();
-
+
super.setDocument(document);
-
+
if (oldDocument != null) {
oldDocument.removeDocumentListener(getDocumentListener());
}
@@ -125,14 +128,16 @@ public class IOConsoleViewer extends TextConsoleViewer {
document.addDocumentListener(getDocumentListener());
}
}
-
+
private IDocumentListener getDocumentListener() {
if (fDocumentListener == null) {
fDocumentListener= new IDocumentListener() {
- public void documentAboutToBeChanged(DocumentEvent event) {
+ @Override
+ public void documentAboutToBeChanged(DocumentEvent event) {
}
- public void documentChanged(DocumentEvent event) {
+ @Override
+ public void documentChanged(DocumentEvent event) {
if (fAutoScroll) {
revealEndOfDocument();
}
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
index ab8d900a7..e43768493 100644
--- 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
@@ -1,29 +1,26 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies 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.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
+import org.eclipse.jface.resource.ImageDescriptor;
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;
@@ -39,45 +36,48 @@ public class OpenConsoleAction extends Action implements IMenuCreator {
public OpenConsoleAction() {
fFactoryExtensions = ((ConsoleManager)ConsolePlugin.getDefault().getConsoleManager()).getConsoleFactoryExtensions();
- setText(ConsoleMessages.OpenConsoleAction_0);
- setToolTipText(ConsoleMessages.OpenConsoleAction_1);
+ 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() {
+ @Override
+ 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) {
+ @Override
+ 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) {
+ @Override
+ 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++) {
@@ -91,7 +91,7 @@ public class OpenConsoleAction extends Action implements IMenuCreator {
}
return fMenu;
}
-
+
private void addActionToMenu(Menu parent, Action action, int accelerator) {
if (accelerator < 10) {
StringBuffer label= new StringBuffer();
@@ -102,7 +102,7 @@ public class OpenConsoleAction extends Action implements IMenuCreator {
label.append(action.getText());
action.setText(label.toString());
}
-
+
ActionContributionItem item= new ActionContributionItem(action);
item.fill(parent, -1);
}
@@ -110,12 +110,13 @@ public class OpenConsoleAction extends Action implements IMenuCreator {
/* (non-Javadoc)
* @see org.eclipse.jface.action.IMenuCreator#getMenu(org.eclipse.swt.widgets.Menu)
*/
- public Menu getMenu(Menu parent) {
+ @Override
+ public Menu getMenu(Menu parent) {
return null;
}
-
+
private class ConsoleFactoryAction extends Action {
-
+
private ConsoleFactoryExtension fConfig;
private IConsoleFactory fFactory;
@@ -126,27 +127,29 @@ public class OpenConsoleAction extends Action implements IMenuCreator {
}
fConfig = extension;
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
- public void run() {
+ @Override
+ 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) {
+ @Override
+ 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
index eab75136a..aaf415555 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -20,50 +20,56 @@ 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() {
+ @Override
+ public String getPattern() {
return fExtension.getPattern();
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#getCompilerFlags()
*/
- public int getCompilerFlags() {
+ @Override
+ 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) {
+ @Override
+ 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) {
+ @Override
+ public void connect(TextConsole console) {
fDelegate.connect(console);
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#disconnect()
*/
- public void disconnect() {
+ @Override
+ public void disconnect() {
fDelegate.disconnect();
}
/* (non-Javadoc)
* @see org.eclipse.ui.console.IPatternMatchListener#getQuickPattern()
*/
+ @Override
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
index b4081dfe6..869129180 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -36,10 +36,10 @@ public class PatternMatchListenerExtension implements IPluginContribution {
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.
@@ -51,12 +51,12 @@ public class PatternMatchListenerExtension implements IPluginContribution {
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$
-
+ String flags = flagsElement.replaceAll("Pattern.", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ String[] tokens = flags.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);
@@ -70,25 +70,25 @@ public class PatternMatchListenerExtension implements IPluginContribution {
}
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$
+ String message = MessageFormat.format("{0} " + getLocalId() + " {1} " + getPluginId() + " {2}", new Object[] { 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;
+ IConfigurationElement enablement = elements.length > 0 ? elements[0] : null;
if (enablement != null) {
fEnablementExpression = ExpressionConverter.getDefault().perform(enablement);
@@ -96,7 +96,7 @@ public class PatternMatchListenerExtension implements IPluginContribution {
}
return fEnablementExpression;
}
-
+
/*
* returns the regular expression to be matched.
*/
@@ -122,18 +122,20 @@ public class PatternMatchListenerExtension implements IPluginContribution {
}
return fFlags;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getLocalId()
*/
- public String getLocalId() {
+ @Override
+ public String getLocalId() {
return fConfig.getAttribute("id"); //$NON-NLS-1$
}
/* (non-Javadoc)
* @see org.eclipse.ui.IPluginContribution#getPluginId()
*/
- public String getPluginId() {
+ @Override
+ public String getPluginId() {
return fConfig.getContributor().getName();
}
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
index 61d307407..94e5d51e0 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -20,15 +20,15 @@ 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);
+ 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));
@@ -36,17 +36,19 @@ public class PinConsoleAction extends Action implements IUpdate {
fView = view;
update();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
public void run() {
fView.setPinned(isChecked());
}
-
+
/* (non-Javadoc)
* @see org.eclipse.ui.texteditor.IUpdate#update()
*/
+ @Override
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
index e0b2ad268..07d13c7b8 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -16,33 +16,34 @@ 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);
+ super(ConsoleMessages.ScrollLockAction_0);
fConsoleView = consoleView;
-
- setToolTipText(ConsoleMessages.ScrollLockAction_1);
- setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_LCL_LOCK));
+
+ 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();
+ boolean checked = fConsoleView.getScrollLock();
setChecked(checked);
}
/**
* @see org.eclipse.jface.action.IAction#run()
*/
+ @Override
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
index ed846b0cf..ea09fb14e 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
package org.eclipse.ui.internal.console;
import org.eclipse.jface.action.Action;
-
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleView;
@@ -19,20 +18,21 @@ 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()
*/
+ @Override
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
*/
@@ -44,14 +44,14 @@ public class ShowConsoleAction extends Action {
}
consoleView.display(console);
if (pinned) {
- consoleView.setPinned(true);
+ 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
*/
diff --git a/org.eclipse.ui.externaltools/.classpath b/org.eclipse.ui.externaltools/.classpath
index 435706608..c2eb13176 100644
--- a/org.eclipse.ui.externaltools/.classpath
+++ b/org.eclipse.ui.externaltools/.classpath
@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="External Tools Base"/>
- <classpathentry kind="src" path="Program Tools Support"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="External Tools Base"/>
+ <classpathentry kind="src" path="Program Tools Support"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.ui.externaltools/.settings/.api_filters b/org.eclipse.ui.externaltools/.settings/.api_filters
new file mode 100644
index 000000000..8203854ac
--- /dev/null
+++ b/org.eclipse.ui.externaltools/.settings/.api_filters
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.ui.externaltools" version="2">
+ <resource path="External Tools Base/org/eclipse/ui/externaltools/internal/menu/OpenExternalToolsConfigurations.java" type="org.eclipse.ui.externaltools.internal.menu.OpenExternalToolsConfigurations">
+ <filter comment="Known illegal extension" id="571473929">
+ <message_arguments>
+ <message_argument value="OpenLaunchDialogAction"/>
+ <message_argument value="OpenExternalToolsConfigurations"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs
index 5d7a22fe3..74c3aeb02 100644
--- a/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.ui.externaltools/.settings/org.eclipse.jdt.core.prefs
@@ -14,17 +14,17 @@ org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonN
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.6
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.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -33,9 +33,9 @@ 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.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=error
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
@@ -53,10 +53,10 @@ 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.missingDefaultCase=ignore
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
-org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
@@ -65,7 +65,7 @@ org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
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.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
@@ -78,11 +78,11 @@ org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+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.potentiallyUnclosedCloseable=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=error
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
@@ -91,18 +91,18 @@ org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=enabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
-org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=disabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=error
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=error
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
@@ -119,9 +119,9 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.6
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
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
index 3610f2b95..6b5596b70 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -57,29 +57,30 @@ import org.eclipse.ui.model.WorkbenchLabelProvider;
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();
-
+ private List<IProject> fProjects = new ArrayList<IProject>();
+
class ProjectsContentProvider implements IStructuredContentProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
*/
+ @Override
public Object[] getElements(Object inputElement) {
return ((IWorkspace)inputElement).getRoot().getProjects();
}
@@ -87,27 +88,30 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#dispose()
*/
+ @Override
public void dispose() {
}
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)
*/
+ @Override
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
-
+
}
-
+
/**
* Constructor
*/
public ExternalToolsBuildTab() {
setHelpContextId(IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_BUILD_TAB);
}
-
+
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite mainComposite = new Composite(parent, SWT.NONE);
setControl(mainComposite);
@@ -117,15 +121,16 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
mainComposite.setLayout(layout);
mainComposite.setLayoutData(gd);
mainComposite.setFont(parent.getFont());
-
+
fBuildButton = createCheckButton(mainComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_1);
fBuildButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateEnabledState();
updateLaunchConfigurationDialog();
}
});
-
+
fGroup = new Group(mainComposite, SWT.NONE);
fGroup.setFont(mainComposite.getFont());
layout = new GridLayout();
@@ -137,6 +142,7 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
fGroup.setLayoutData(gd);
SelectionAdapter adapter = new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
if (((Button)e.getSource()).getSelection()) {
updateEnabledState();
@@ -144,34 +150,35 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
}
}
};
-
+
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.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);
-
+ fSpecificProjectsButton.addSelectionListener(adapter);
+
fSelectButton = createPushButton(fGroup, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_5, null);
gd = (GridData)fSelectButton.getLayoutData();
gd.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END;
fSelectButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
selectResources();
}
});
-
+
createVerticalSpacer(mainComposite, 1);
fReferencedProjects = createCheckButton(mainComposite, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_6);
}
@@ -186,28 +193,30 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
return;
}
Object[] res = dialog.getResult();
- fProjects = new ArrayList(res.length);
+ fProjects = new ArrayList<IProject>(res.length);
for (int i = 0; i < res.length; i++) {
- fProjects.add(res[i]);
+ fProjects.add((IProject) res[i]);
}
updateLaunchConfigurationDialog();
}
-
+
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
}
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
updateScope(configuration);
updateReferencedProjects(configuration);
- updateEnabledState();
+ updateEnabledState();
}
-
+
private void updateReferencedProjects(ILaunchConfiguration configuration) {
boolean ref = false;
try {
@@ -245,7 +254,7 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
} else if (scope.startsWith("${projects:")) { //$NON-NLS-1$
fSpecificProjectsButton.setSelection(true);
IProject[] projects = getBuildProjects(configuration, IExternalToolConstants.ATTR_BUILD_SCOPE);
- fProjects = new ArrayList(projects.length);
+ fProjects = new ArrayList<IProject>(projects.length);
for (int i = 0; i < projects.length; i++) {
fProjects.add(projects[i]);
}
@@ -255,6 +264,7 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String scope = generateScopeMemento();
configuration.setAttribute(IExternalToolConstants.ATTR_BUILD_SCOPE, scope);
@@ -281,7 +291,7 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
return getBuildScopeAttribute(fProjects);
}
return null;
-
+
}
return "${none}"; //$NON-NLS-1$
}
@@ -289,10 +299,11 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return ExternalToolsLaunchConfigurationMessages.ExternalToolsBuildTab_8;
}
-
+
/**
* Updates the enablement state of the fields.
*/
@@ -314,14 +325,16 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
}
fReferencedProjects.setEnabled(fBuildButton.getSelection() && (fProjectButton.getSelection() || fSpecificProjectsButton.getSelection()));
}
-
+
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
public Image getImage() {
return ExternalToolsImages.getImage(org.eclipse.ui.externaltools.internal.model.IExternalToolConstants.IMG_TAB_BUILD);
}
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
@@ -331,10 +344,10 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
}
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) {
@@ -342,11 +355,11 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
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
@@ -355,20 +368,20 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
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) {
+ public static String getBuildScopeAttribute(List<IProject> projects) {
StringBuffer buf = new StringBuffer();
buf.append("${projects:"); //$NON-NLS-1$
- Iterator iterator = projects.iterator();
+ Iterator<IProject> iterator = projects.iterator();
while (iterator.hasNext()) {
- IProject project = (IProject) iterator.next();
+ IProject project = iterator.next();
buf.append(project.getName());
if (iterator.hasNext()) {
buf.append(","); //$NON-NLS-1$
@@ -377,10 +390,11 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
buf.append("}"); //$NON-NLS-1$
return buf.toString();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing on activation
}
@@ -388,6 +402,7 @@ public class ExternalToolsBuildTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
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
index cc6aea404..dc1563edc 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -67,11 +67,11 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
protected Button workingSetButton;
protected Button specifyResources;
protected Button fLaunchInBackgroundButton;
- protected IWorkingSet workingSet;
+ protected IWorkingSet workingSet;
protected ILaunchConfiguration fConfiguration;
-
+
private boolean fCreateBuildScheduleComponent= true;
-
+
// Console Output widgets
private Button fConsoleOutput;
private Button fFileOutput;
@@ -80,14 +80,14 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
private Button fVariables;
private Button fAppend;
private Button fWorkspaceBrowse;
-
+
/**
* Constructor
*/
public ExternalToolsBuilderTab() {
setHelpContextId(IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_BUILDER_TAB);
}
-
+
/**
* Constructor
* @param createBuildScheduleComponent
@@ -96,11 +96,12 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
fCreateBuildScheduleComponent= createBuildScheduleComponent;
setHelpContextId(IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_BUILDER_TAB);
}
-
+
protected SelectionListener selectionListener= new SelectionAdapter() {
/* (non-Javadoc)
* @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
*/
+ @Override
public void widgetSelected(SelectionEvent e) {
boolean enabled= !fCreateBuildScheduleComponent || autoBuildButton.getSelection() || manualBuild.getSelection();
workingSetButton.setEnabled(enabled);
@@ -109,11 +110,12 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
}
};
+ @Override
public void createControl(Composite parent) {
Composite mainComposite = new Composite(parent, SWT.NONE);
setControl(mainComposite);
PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), getHelpContextId());
-
+
GridLayout layout = new GridLayout();
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 2;
@@ -126,7 +128,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
createLaunchInBackgroundComposite(mainComposite);
createBuildScheduleComponent(mainComposite);
}
-
+
/**
* Creates the controls needed to edit the launch in background
* attribute of an external tool
@@ -139,12 +141,13 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
data.horizontalSpan = 2;
fLaunchInBackgroundButton.setLayoutData(data);
fLaunchInBackgroundButton.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
}
-
+
protected void createBuildScheduleComponent(Composite parent) {
if (fCreateBuildScheduleComponent) {
Label label= new Label(parent, SWT.NONE);
@@ -152,17 +155,18 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
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);
+ 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() {
+ @Override
public void widgetSelected(SelectionEvent e) {
selectResources();
}
@@ -171,54 +175,56 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
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);
+ 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);
+
+ 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) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
-
- fFileOutput = createCheckButton(group, ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_19);
+
+ 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);
+ 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);
+ 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) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
boolean enabled = fFileOutput.getSelection();
fFileText.setEnabled(enabled);
fFileBrowse.setEnabled(enabled);
@@ -228,19 +234,21 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
});
-
+
fAppend.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
updateLaunchConfigurationDialog();
}
});
-
+
fWorkspaceBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ 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.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) {
@@ -251,27 +259,30 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
}
}
});
-
+
fFileBrowse.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ 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) {
+ @Override
+ public void modifyText(ModifyEvent e) {
updateLaunchConfigurationDialog();
}
});
-
+
fVariables.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
StringVariableSelectionDialog dialog = new StringVariableSelectionDialog(getShell());
dialog.open();
String variable = dialog.getVariableExpression();
@@ -279,11 +290,12 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
fFileText.insert(variable);
}
}
- public void widgetDefaultSelected(SelectionEvent e) {
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
}
});
}
-
+
/*
* Creates a check button in the given composite with the given text
*/
@@ -300,11 +312,12 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
StringBuffer buffer= new StringBuffer(IExternalToolConstants.BUILD_TYPE_FULL);
buffer.append(',');
buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL);
- buffer.append(',');
+ 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);
@@ -313,6 +326,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
fConfiguration= configuration;
if (fCreateBuildScheduleComponent) {
@@ -329,14 +343,14 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
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++) {
@@ -353,10 +367,12 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
case IncrementalProjectBuilder.CLEAN_BUILD:
fDuringClean.setSelection(true);
break;
+ default:
+ break;
}
}
}
-
+
boolean enabled= true;
if (fCreateBuildScheduleComponent) {
enabled= autoBuildButton.getSelection() || manualBuild.getSelection();
@@ -366,23 +382,23 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
updateRunInBackground(configuration);
updateConsoleOutput(configuration);
}
-
- protected void updateRunInBackground(ILaunchConfiguration 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;
@@ -400,19 +416,20 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
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(',');
- }
+ 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);
}
@@ -425,7 +442,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
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;
@@ -445,7 +462,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
} else {
configuration.setAttribute(IDebugUIConstants.ATTR_CAPTURE_IN_FILE, (String)null);
}
-
+
if (!captureOutput) {
configuration.setAttribute(DebugPlugin.ATTR_CAPTURE_OUTPUT, false);
} else {
@@ -456,20 +473,23 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_Build_Options_9;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
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)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
@@ -484,12 +504,13 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_16);
return false;
}
-
+
return validateRedirectFile();
}
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
*/
+ @Override
public boolean canSave() {
return isValid(null);
}
@@ -499,14 +520,14 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
*/
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();
-
+ dialog.create();
+
if (dialog.open() == Window.CANCEL) {
return;
}
@@ -516,6 +537,7 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
// do nothing on activation
}
@@ -523,15 +545,16 @@ public class ExternalToolsBuilderTab extends AbstractLaunchConfigurationTab {
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
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);
+ setErrorMessage(ExternalToolsLaunchConfigurationMessages.ExternalToolsBuilderTab_26);
return false;
}
}
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
index 56fe08449..a23aa54db 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -72,16 +72,17 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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 {
+ @Override
public void modifyText(ModifyEvent e) {
if (!fInitializing) {
setDirty(true);
@@ -89,6 +90,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
updateLaunchConfigurationDialog();
}
}
+ @Override
public void widgetSelected(SelectionEvent e) {
setDirty(true);
Object source= e.getSource();
@@ -110,10 +112,11 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
public void createControl(Composite parent) {
Composite mainComposite = new Composite(parent, SWT.NONE);
setControl(mainComposite);
@@ -128,14 +131,14 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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) {
@@ -143,41 +146,41 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
String locationLabel = getLocationLabel();
group.setText(locationLabel);
GridLayout layout = new GridLayout();
- layout.numColumns = 1;
+ 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.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);
+ 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.
*/
@@ -188,7 +191,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
/**
* 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) {
@@ -200,14 +203,14 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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;
@@ -217,20 +220,20 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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.
@@ -238,7 +241,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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
@@ -248,30 +251,31 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
protected void createArgumentComponent(Composite parent) {
Group group = new Group(parent, SWT.NONE);
String groupName = ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Arguments___1;
- group.setText(groupName);
+ 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);
argumentField.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent event) {
if (event.detail == SWT.TRAVERSE_RETURN && (event.stateMask & SWT.MODIFIER_MASK) != 0) {
event.doit= true;
}
}
});
-
+
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;
@@ -281,7 +285,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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
@@ -292,10 +296,11 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
gridData.horizontalSpan = 2;
instruction.setLayoutData(gridData);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
configuration.setAttribute(FIRST_EDIT, true);
}
@@ -303,6 +308,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public void initializeFrom(ILaunchConfiguration configuration) {
fInitializing= true;
updateLocation(configuration);
@@ -311,29 +317,29 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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= IExternalToolConstants.EMPTY_STRING;
+ String workingDir= IExternalToolConstants.EMPTY_STRING;
try {
- workingDir= configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, IExternalToolConstants.EMPTY_STRING);
+ workingDir= configuration.getAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, IExternalToolConstants.EMPTY_STRING);
} 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= IExternalToolConstants.EMPTY_STRING;
+ String location= IExternalToolConstants.EMPTY_STRING;
try {
- location= configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, IExternalToolConstants.EMPTY_STRING);
+ location= configuration.getAttribute(IExternalToolConstants.ATTR_LOCATION, IExternalToolConstants.EMPTY_STRING);
} catch (CoreException ce) {
ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_10, ce);
}
@@ -345,9 +351,9 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
* configuration.
*/
protected void updateArgument(ILaunchConfiguration configuration) {
- String arguments= IExternalToolConstants.EMPTY_STRING;
+ String arguments= IExternalToolConstants.EMPTY_STRING;
try {
- arguments= configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, IExternalToolConstants.EMPTY_STRING);
+ arguments= configuration.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, IExternalToolConstants.EMPTY_STRING);
} catch (CoreException ce) {
ExternalToolsPlugin.getDefault().log(ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_Error_reading_configuration_7, ce);
}
@@ -357,6 +363,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String location= locationField.getText().trim();
if (location.length() == 0) {
@@ -364,7 +371,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
} else {
configuration.setAttribute(IExternalToolConstants.ATTR_LOCATION, location);
}
-
+
String workingDirectory= workDirectoryField.getText().trim();
if (workingDirectory.length() == 0) {
configuration.setAttribute(IExternalToolConstants.ATTR_WORKING_DIRECTORY, (String)null);
@@ -378,7 +385,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
} else {
configuration.setAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, arguments);
}
-
+
if(userEdited) {
configuration.setAttribute(FIRST_EDIT, (String)null);
}
@@ -387,13 +394,15 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
+ @Override
public String getName() {
return ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab__Main_17;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
+ @Override
public boolean isValid(ILaunchConfiguration launchConfig) {
setErrorMessage(null);
setMessage(null);
@@ -405,7 +414,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
return validateLocation(newConfig) && validateWorkDirectory();
}
-
+
/**
* Validates the content of the location field.
*/
@@ -421,7 +430,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
return false;
}
-
+
String expandedLocation= null;
try {
expandedLocation= resolveValue(location);
@@ -432,7 +441,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
setErrorMessage(e.getStatus().getMessage());
return false;
}
-
+
File file = new File(expandedLocation);
if (!file.exists()) { // The file does not exist.
if (!newConfig) {
@@ -448,10 +457,10 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
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
*/
@@ -459,7 +468,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
manager.validateStringVariables(expression);
}
-
+
private String resolveValue(String expression) throws CoreException {
String expanded= null;
try {
@@ -470,10 +479,10 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
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
@@ -502,7 +511,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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);
@@ -514,7 +523,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
return true;
}
-
+
/**
* Prompts the user to choose a location from the filesystem and
* sets the location as the full path of the selected file.
@@ -527,7 +536,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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
@@ -544,7 +553,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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
@@ -553,7 +562,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
protected void handleWorkspaceWorkingDirectoryButtonSelected() {
ContainerSelectionDialog containerDialog;
containerDialog = new ContainerSelectionDialog(
- getShell(),
+ getShell(),
ResourcesPlugin.getWorkspace().getRoot(),
false,
ExternalToolsLaunchConfigurationMessages.ExternalToolsMainTab_23);
@@ -567,7 +576,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
workDirectoryField.setText(text);
}
}
-
+
/**
* Returns a new variable expression with the given variable and the given argument.
* @see IStringVariableManager#generateVariableExpression(String, String)
@@ -575,7 +584,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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.
*/
@@ -588,7 +597,7 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
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
@@ -610,26 +619,29 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
dialog.open();
return dialog.getVariableExpression();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
+ @Override
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)
*/
+ @Override
public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
+ @Override
public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
}
-
+
/*
* Fix for Bug 60163 Accessibility: New Builder Dialog missing object info for textInput controls
*/
@@ -642,15 +654,17 @@ public abstract class ExternalToolsMainTab extends AbstractLaunchConfigurationTa
}
control.getAccessible().addAccessibleListener(new ControlAccessibleListener(stripped.toString()));
}
-
+
private class ControlAccessibleListener extends AccessibleAdapter {
private String controlName;
ControlAccessibleListener(String name) {
controlName = name;
}
+
+ @Override
public void getName(AccessibleEvent e) {
e.result = controlName;
}
-
+
}
}
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
index ab3f41e18..84aef55ad 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -12,25 +12,27 @@ package org.eclipse.ui.externaltools.internal.launchConfigurations;
import java.util.Comparator;
-public class IgnoreWhiteSpaceComparator implements Comparator {
+public class IgnoreWhiteSpaceComparator implements Comparator<String> {
- /* (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;
+ @Override
+ public int compare(String o1, String o2) {
+ if (o1 == null || o2 == null) {
+ if (o1 == o2) {
+ return 0;
+ }
+ return -1;
+ }
int i1 = 0;
int i2 = 0;
- int l1 = one.length();
- int l2 = two.length();
+ int l1 = o1.length();
+ int l2 = o2.length();
char ch1 = ' ';
char ch2 = ' ';
while (i1 < l1 && i2 < l2) {
- while (i1 < l1 && Character.isWhitespace(ch1 = one.charAt(i1))) {
+ while (i1 < l1 && Character.isWhitespace(ch1 = o1.charAt(i1))) {
i1++;
}
- while (i2 < l2 && Character.isWhitespace(ch2 = two.charAt(i2))) {
+ while (i2 < l2 && Character.isWhitespace(ch2 = o2.charAt(i2))) {
i2++;
}
if (i1 == l1 && i2 == l2) {
@@ -38,7 +40,7 @@ public class IgnoreWhiteSpaceComparator implements Comparator {
}
if (ch1 != ch2) {
return -1;
- }
+ }
i1++;
i2++;
}
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
index a92fc2da6..52c784d2e 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -19,27 +19,26 @@ import org.eclipse.ui.IWorkingSet;
* Comparator for refresh scope launch configuration attribute
* <code>ATTR_REFRESH_SCOPE</code>.
*/
-public class WorkingSetComparator implements Comparator {
+public class WorkingSetComparator implements Comparator<String> {
/* (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) {
+ @Override
+ public int compare(String o1, String o2) {
+ if (o1 == null || o2 == null) {
+ if (o1 == o2) {
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 (o1.startsWith("${working_set:") && o2.startsWith("${working_set:")) { //$NON-NLS-1$//$NON-NLS-2$
+ IWorkingSet workingSet1 = RefreshTab.getWorkingSet(o1);
+ IWorkingSet workingSet2 = RefreshTab.getWorkingSet(o2);
if (workingSet1 == null || workingSet2 == null) {
if (workingSet1 == workingSet2) {
return 0;
- }
+ }
return -1;
}
if (workingSet1.equals(workingSet2)) {
@@ -47,6 +46,6 @@ public class WorkingSetComparator implements Comparator {
}
return -1;
}
- return one.compareTo(two);
+ return o1.compareTo(o2);
}
}
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
index a5dc2081c..dc7bf2816 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -21,17 +21,18 @@ import org.eclipse.ui.externaltools.internal.model.IExternalToolConstants;
* 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()
*/
+ @Override
protected IAction getOpenDialogAction() {
IAction action= new OpenExternalToolsConfigurations();
action.setActionDefinitionId("org.eclipse.ui.externalTools.commands.OpenExternalToolsConfigurations"); //$NON-NLS-1$
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
index 82115029d..10c4c91f3 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -31,28 +31,28 @@ 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$
+ 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
* <code>null</code> if not possible.
*/
- public static ILaunchConfiguration configFromBuildCommandArgs(IProject project, Map commandArgs, String[] version) {
+ public static ILaunchConfiguration configFromBuildCommandArgs(IProject project, Map<String, String> commandArgs, String[] version) {
return BuilderCoreUtils.configFromBuildCommandArgs(project, commandArgs, version);
}
/**
* Returns an <code>ICommand</code> 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. <code>null</code> can be returned if problems occur during
@@ -73,7 +73,7 @@ public class BuilderUtils {
}
return newCommand;
}
-
+
public static void configureTriggers(ILaunchConfiguration config, ICommand newCommand) throws CoreException {
BuilderCoreUtils.configureTriggers(config, newCommand);
}
@@ -101,14 +101,14 @@ public class BuilderUtils {
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);
+ 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;
@@ -143,7 +143,7 @@ public class BuilderUtils {
* IExternalToolConstants.EXTENSION_POINT_CONFIGURATION_DUPLICATION_MAPS.
*/
public static ILaunchConfiguration duplicateConfiguration(IProject project, ILaunchConfiguration config) throws CoreException {
- Map attributes= config.getAttributes();
+ Map<String, Object> attributes = config.getAttributes();
String newName= new StringBuffer(config.getName()).append(ExternalToolsModelMessages.BuilderUtils_7).toString();
newName= DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(newName);
ILaunchConfigurationType newType= getConfigurationDuplicationType(config);
@@ -160,7 +160,7 @@ public class BuilderUtils {
* 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
@@ -171,7 +171,7 @@ public class BuilderUtils {
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.
@@ -181,5 +181,5 @@ public class BuilderUtils {
*/
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/ExternalToolsPlugin.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ExternalToolsPlugin.java
index 16c945a2e..3cafc26f2 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -42,14 +42,14 @@ import org.osgi.framework.BundleContext;
*/
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, IExternalToolConstants.EMPTY_STRING, null);
-
+
private static ExternalToolsPlugin plugin;
private static IWindowListener fWindowListener;
@@ -61,12 +61,15 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
* workbench closes. Programs are killed when the VM exits.
*/
private class ProgramLaunchWindowListener implements IWindowListener {
+ @Override
public void windowActivated(IWorkbenchWindow window) {
}
+ @Override
public void windowDeactivated(IWorkbenchWindow window) {
}
+ @Override
public void windowClosed(IWorkbenchWindow window) {
IWorkbenchWindow windows[] = PlatformUI.getWorkbench()
.getWorkbenchWindows();
@@ -107,6 +110,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
}
}
+ @Override
public void windowOpened(IWorkbenchWindow window) {
}
}
@@ -132,8 +136,8 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
*/
public static IStatus newErrorStatus(String message, Throwable exception) {
if (message == null) {
- return new Status(IStatus.ERROR, PLUGIN_ID, 0, IExternalToolConstants.EMPTY_STRING, exception);
- }
+ return new Status(IStatus.ERROR, PLUGIN_ID, 0, IExternalToolConstants.EMPTY_STRING, exception);
+ }
return new Status(IStatus.ERROR, PLUGIN_ID, 0, message, exception);
}
@@ -146,14 +150,14 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
/**
* 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
@@ -162,7 +166,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
/**
* Returns the ImageDescriptor for the icon with the given path
- *
+ *
* @return the ImageDescriptor object
*/
public ImageDescriptor getImageDescriptor(String path) {
@@ -182,7 +186,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
public static IWorkbenchWindow getActiveWorkbenchWindow() {
return getDefault().getWorkbench().getActiveWorkbenchWindow();
}
-
+
/**
* Returns the active workbench page or <code>null</code> if none.
*/
@@ -193,7 +197,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
}
return null;
}
-
+
/**
* Returns the active workbench shell or <code>null</code> if none.
*/
@@ -221,6 +225,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry()
*/
+ @Override
protected ImageRegistry createImageRegistry() {
return ExternalToolsImages.initializeImageRegistry();
}
@@ -228,6 +233,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
/* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
try {
ExternalToolsImages.disposeImageDescriptorRegistry();
@@ -236,6 +242,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
}
}
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
// Listen to launches to lazily create "launch processors"
@@ -255,6 +262,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchAdded(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchAdded(ILaunch launch) {
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
try {
@@ -275,12 +283,14 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin implements
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchChanged(org.eclipse.debug.core.ILaunch)
*/
+ @Override
public void launchChanged(ILaunch launch) {
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.ILaunchListener#launchRemoved(org.eclipse.debug.core.ILaunch)
*/
+ @Override
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
index b7bbb8b37..e91aadaa1 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * Copyright (c) 2004, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -21,9 +21,10 @@ public class ExternalToolsPreferenceInitializer extends AbstractPreferenceInitia
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
*/
+ @Override
public void initializeDefaultPreferences() {
IPreferenceStore prefs = ExternalToolsPlugin.getDefault().getPreferenceStore();
prefs.setDefault(IPreferenceConstants.PROMPT_FOR_TOOL_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
index 4c8dd3ca1..d31770464 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -34,33 +34,39 @@ public interface IExternalToolConstants {
* Variable that expands to the workspace root object (value <code>workspace</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_WORKSPACE}
*/
+ @Deprecated
public static final String VAR_WORKSPACE = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_WORKSPACE;
/**
* Variable that expands to the project resource (value <code>project</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_PROJECT}
*/
+ @Deprecated
public static final String VAR_PROJECT = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_PROJECT;
/**
* Variable that expands to the container resource (value <code>container</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_CONTAINER}
*/
+ @Deprecated
public static final String VAR_CONTAINER = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_CONTAINER;
/**
* Variable that expands to a resource (value <code>resource</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_RESOURCE}
*/
+ @Deprecated
public static final String VAR_RESOURCE = org.eclipse.core.externaltools.internal.IExternalToolConstants.VAR_RESOURCE;
/**
* Variable that expands to the working set object (value <code>working_set</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#VAR_WORKING_SET}
*/
+ @Deprecated
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,
+ * External tool type for programs such as executables, batch files,
* shell scripts, etc (value <code>programType</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#TOOL_TYPE_PROGRAM}
*/
+ @Deprecated
public static final String TOOL_TYPE_PROGRAM = org.eclipse.core.externaltools.internal.IExternalToolConstants.TOOL_TYPE_PROGRAM;
// ------- Build Types -------
@@ -69,6 +75,7 @@ public interface IExternalToolConstants {
* the external tool running as a builder (value <code>incremental</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_INCREMENTAL}
*/
+ @Deprecated
public static final String BUILD_TYPE_INCREMENTAL = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_INCREMENTAL;
/**
@@ -76,6 +83,7 @@ public interface IExternalToolConstants {
* the external tool running as a builder (value <code>full</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_FULL}
*/
+ @Deprecated
public static final String BUILD_TYPE_FULL = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_FULL;
/**
@@ -83,13 +91,15 @@ public interface IExternalToolConstants {
* the external tool running as a builder (value <code>auto</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_AUTO}
*/
+ @Deprecated
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 <code>clean</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_CLEAN}
*/
+ @Deprecated
public static final String BUILD_TYPE_CLEAN = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_CLEAN;
/**
@@ -97,6 +107,7 @@ public interface IExternalToolConstants {
* the external tool running as a builder (value <code>none</code>).
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#BUILD_TYPE_NONE}
*/
+ @Deprecated
public static final String BUILD_TYPE_NONE = org.eclipse.core.externaltools.internal.IExternalToolConstants.BUILD_TYPE_NONE;
// ------- Images -------
@@ -116,15 +127,17 @@ public interface IExternalToolConstants {
* Program launch configuration type identifier.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_PROGRAM_LAUNCH_CONFIGURATION_TYPE}
*/
+ @Deprecated
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}
*/
+ @Deprecated
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
@@ -132,6 +145,7 @@ public interface IExternalToolConstants {
* launch configuration dialog should belong to this category.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY}
*/
+ @Deprecated
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.
@@ -139,6 +153,7 @@ public interface IExternalToolConstants {
* belong to this category.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY}
*/
+ @Deprecated
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 --------
@@ -160,12 +175,14 @@ public interface IExternalToolConstants {
* Default value is <code>false</code>.
* @deprecated since 3.1 Replaced by <code>org.eclipse.debug.core.DebugPlugin.ATTR_CAPTURE_OUTPUT</code>
*/
+ @Deprecated
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 <code>null</code>. Encoding is tool specific.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_LOCATION}
*/
+ @Deprecated
public static final String ATTR_LOCATION = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_LOCATION;
/**
@@ -174,28 +191,32 @@ public interface IExternalToolConstants {
* THIS ATTRIBUTE IS NOT USED.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_PROMPT_FOR_ARGUMENTS}
*/
+ @Deprecated
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
+ * String attribute identifying the scope of resources that should trigger an
* external tool to run. Default value is <code>null</code>
* indicating that the builder will be triggered for all changes.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_BUILDER_SCOPE}
*/
+ @Deprecated
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}
*/
+ @Deprecated
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 <code>false</code>.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_SHOW_CONSOLE}
*/
+ @Deprecated
public static final String ATTR_SHOW_CONSOLE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_SHOW_CONSOLE;
/**
@@ -203,6 +224,7 @@ public interface IExternalToolConstants {
* tool. Default value is <code>null</code>, and encoding is tool specific.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_TOOL_ARGUMENTS}
*/
+ @Deprecated
public static final String ATTR_TOOL_ARGUMENTS = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_TOOL_ARGUMENTS;
/**
@@ -211,20 +233,23 @@ public interface IExternalToolConstants {
* directory, which is tool specific.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_WORKING_DIRECTORY}
*/
+ @Deprecated
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 <code>true</code>, 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}
*/
+ @Deprecated
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}
*/
+ @Deprecated
public static final int ERR_INTERNAL_ERROR = org.eclipse.core.externaltools.internal.IExternalToolConstants.ERR_INTERNAL_ERROR;
/**
@@ -232,14 +257,16 @@ public interface IExternalToolConstants {
* The value is the name of the disabled builder.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_DISABLED_BUILDER}
*/
+ @Deprecated
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 <code>ICommand.setBuilding(int)</code> mechanism
* @since 3.1
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_TRIGGERS_CONFIGURED}
*/
+ @Deprecated
public static final String ATTR_TRIGGERS_CONFIGURED = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_TRIGGERS_CONFIGURED;
/**
@@ -247,13 +274,15 @@ public interface IExternalToolConstants {
* <code>null</code> indicates the default workspace build.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_BUILD_SCOPE}
*/
+ @Deprecated
public static final String ATTR_BUILD_SCOPE = org.eclipse.core.externaltools.internal.IExternalToolConstants.ATTR_BUILD_SCOPE;
/**
- * Attribute identifier specifying whether referenced projects should be
+ * Attribute identifier specifying whether referenced projects should be
* considered when computing the projects to build. Default value is
* <code>true</code>.
* @deprecated use {@link org.eclipse.core.externaltools.internal.IExternalToolConstants#ATTR_INCLUDE_REFERENCED_PROJECTS}
*/
+ @Deprecated
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/ImageDescriptorRegistry.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/ImageDescriptorRegistry.java
index 346f60c85..f82f2c25f 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,9 +10,8 @@
*******************************************************************************/
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;
@@ -24,9 +23,9 @@ import org.eclipse.swt.widgets.Display;
*/
public class ImageDescriptorRegistry {
- private HashMap fRegistry= new HashMap(10);
+ private HashMap<ImageDescriptor, Image> fRegistry = new HashMap<ImageDescriptor, Image>(10);
private Display fDisplay;
-
+
/**
* Creates a new image descriptor registry for the current or default display,
* respectively.
@@ -34,57 +33,56 @@ public class ImageDescriptorRegistry {
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
+ *
+ * @param display the display the images managed by this registry are allocated for
*/
public ImageDescriptorRegistry(Display display) {
fDisplay= display;
Assert.isNotNull(fDisplay);
hookDisplay();
}
-
+
/**
* Returns the image associated with the given image descriptor.
- *
+ *
* @param descriptor the image descriptor for which the registry manages an image
* @return the image associated with the image descriptor or <code>null</code>
* if the image descriptor can't create the requested image.
*/
public Image get(ImageDescriptor descriptor) {
- if (descriptor == null)
- descriptor= ImageDescriptor.getMissingImageDescriptor();
-
- Image result= (Image)fRegistry.get(descriptor);
- if (result != null)
+ Image result = fRegistry.get(descriptor != null ? descriptor : ImageDescriptor.getMissingImageDescriptor());
+ if (result != null) {
return result;
-
+ }
+
Assert.isTrue(fDisplay == ExternalToolsPlugin.getStandardDisplay(), ExternalToolsModelMessages.ImageDescriptorRegistry_Allocating_image_for_wrong_display_1);
- result= descriptor.createImage();
- if (result != null)
+ result = descriptor != null ? descriptor.createImage() : ImageDescriptor.getMissingImageDescriptor().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();
+ for (Image image : fRegistry.values()) {
image.dispose();
}
fRegistry.clear();
}
-
+
private void hookDisplay() {
fDisplay.disposeExec(new Runnable() {
+ @Override
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
index 3d6dc5b61..77fbd4f81 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,7 +34,8 @@ class BuilderLabelProvider extends LabelProvider {
private Image builderImage = ExternalToolsPlugin.getDefault().getImageDescriptor(IMG_BUILDER).createImage();
private Image invalidBuildToolImage = ExternalToolsPlugin.getDefault().getImageDescriptor(IMG_INVALID_BUILD_TOOL).createImage();
-
+
+ @Override
public String getText(Object element) {
if (element instanceof ICommand) {
return getCommandText((ICommand) element);
@@ -45,7 +46,8 @@ class BuilderLabelProvider extends LabelProvider {
}
return super.getText(element);
}
-
+
+ @Override
public Image getImage(Object element) {
if (element instanceof ICommand) {
return getCommandImage();
@@ -56,12 +58,12 @@ class BuilderLabelProvider extends LabelProvider {
}
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);
@@ -73,16 +75,16 @@ class BuilderLabelProvider extends LabelProvider {
}
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.
@@ -102,7 +104,7 @@ class BuilderLabelProvider extends LabelProvider {
}
return debugModelPresentation.getText(element);
}
-
+
/**
* Returns an image for the given object from a debug
* model presentation.
@@ -125,6 +127,7 @@ class BuilderLabelProvider extends LabelProvider {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.IBaseLabelProvider#dispose()
*/
+ @Override
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
index caac40406..483b652c6 100644
--- 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
@@ -95,22 +95,22 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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 List<ILaunchConfiguration> configsToBeDeleted = null;
+ private List<ICommand> commandsToBeDeleted = null;
+
private CheckboxTableViewer viewer= null;
-
+
private boolean fWarned = false;
/**
* Flag to know if we can perform an edit of the selected element(s)
*/
private boolean fCanEdit = false;
-
+
private ILabelProvider labelProvider= new BuilderLabelProvider();
-
+
/**
* Error configs are objects representing entries pointing to
* invalid launch configurations
@@ -124,23 +124,24 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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 List<ILaunchConfiguration> newConfigList = new ArrayList<ILaunchConfiguration>();
+
private SelectionListener buttonListener= new SelectionAdapter() {
+ @Override
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
@@ -153,6 +154,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
* movedFrom a configuration in the tree, replace the old config with
* the new.
*/
+ @Override
public void launchConfigurationAdded(final ILaunchConfiguration configuration) {
ILaunchManager manager= DebugPlugin.getDefault().getLaunchManager();
final ILaunchConfiguration oldConfig= manager.getMovedFrom(configuration);
@@ -163,15 +165,16 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
if (newConfigList.remove(oldConfig)) {
newConfigList.add(configuration);
}
-
- Display.getDefault().asyncExec(new Runnable() {
+
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
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
+ // Found the movedFrom config in the tree. Replace it with the new config
item.setData(configuration);
viewer.update(configuration, null);
break;
@@ -180,8 +183,10 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
});
}
+ @Override
public void launchConfigurationChanged(ILaunchConfiguration configuration) {
}
+ @Override
public void launchConfigurationRemoved(ILaunchConfiguration configuration) {
}
};
@@ -210,7 +215,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
handleException(e);
return;
}
-
+
boolean projectNeedsMigration= false;
for (int i = 0; i < commands.length; i++) {
String[] version= new String[] {IExternalToolConstants.EMPTY_STRING};
@@ -290,14 +295,15 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
data.widthHint = Math.max(widthHint, button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x);
return button;
}
-
+
/* (non-Javadoc)
* Method declared on PreferencePage.
*/
+ @Override
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);
@@ -328,12 +334,14 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
builderTable.setLayoutData(new GridData(GridData.FILL_BOTH));
builderTable.setFont(font);
builderTable.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
handleTableSelectionChanged();
}
});
-
+
builderTable.addListener(SWT.MouseDoubleClick, new Listener() {
+ @Override
public void handleEvent(Event event) {
//we must not allow editing of elements that cannot be edited via the selection changed logic
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=386820
@@ -342,7 +350,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
}
});
-
+
//button area
Composite buttonArea = new Composite(tableAndButtons, SWT.NONE);
layout = new GridLayout();
@@ -362,12 +370,12 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
newButton.setEnabled(true);
importButton.setEnabled(true);
- //populate widget contents
+ //populate widget contents
addBuildersToTable();
return topLevel;
}
-
+
/**
* Turns auto-building on or off in the workspace.
*/
@@ -424,6 +432,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ICheckStateListener#checkStateChanged(org.eclipse.jface.viewers.CheckStateChangedEvent)
*/
+ @Override
public void checkStateChanged(CheckStateChangedEvent event) {
Object element= event.getElement();
boolean checked = event.getChecked();
@@ -441,7 +450,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
if(MessageDialog.openConfirm(shell, ExternalToolsUIMessages.BuilderPropertyPage_6, ExternalToolsUIMessages.BuilderPropertyPage_7)) {
fWarned = true;
}
- }
+ }
if(fWarned) {
enableCommand((ICommand)element, checked);
}
@@ -450,7 +459,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
viewer.setChecked(element, true);
viewer.addCheckStateListener(this);
}
-
+
}
}
@@ -478,11 +487,11 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
userHasMadeChanges= true;
}
-
+
private void enableCommand(ICommand command, boolean enable) {
- Map/*<String, String>*/ args= command.getArguments();
+ Map<String, String> args = command.getArguments();
if (args == null) {
- args= new HashMap(1);
+ args = new HashMap<String, String>(1);
}
args.put(COMMAND_ENABLED, Boolean.toString(enable));
command.setArguments(args);
@@ -492,15 +501,14 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
/**
* 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()) {
+ List<ILaunchConfigurationType> toolTypes = getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_LAUNCH_CATEGORY);
+ List<ILaunchConfiguration> configurations = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfigurationType type : toolTypes) {
try {
- ILaunchConfiguration[] configs= manager.getLaunchConfigurations((ILaunchConfigurationType) iter.next());
+ ILaunchConfiguration[] configs = manager.getLaunchConfigurations(type);
for (int i = 0; i < configs.length; i++) {
ILaunchConfiguration launchConfiguration = configs[i];
if (!DebugUITools.isPrivate(launchConfiguration)) {
@@ -547,7 +555,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
newConfigList.add(newConfig);
}
}
-
+
/**
* The user has pressed the remove button. Delete the selected builder.
*/
@@ -556,25 +564,25 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
if (selection != null) {
int numSelected= selection.size();
userHasMadeChanges= true;
- Iterator iterator= selection.iterator();
+ Iterator<?> iterator = selection.iterator();
while (iterator.hasNext()) {
Object item= iterator.next();
if (item instanceof ILaunchConfiguration) {
if (configsToBeDeleted == null) {
- configsToBeDeleted= new ArrayList(numSelected);
+ configsToBeDeleted = new ArrayList<ILaunchConfiguration>(numSelected);
}
- configsToBeDeleted.add(item);
+ configsToBeDeleted.add((ILaunchConfiguration) item);
} else if (item instanceof ICommand) {
if (commandsToBeDeleted == null) {
- commandsToBeDeleted= new ArrayList(numSelected);
+ commandsToBeDeleted = new ArrayList<ICommand>(numSelected);
}
- commandsToBeDeleted.add(item);
+ commandsToBeDeleted.add((ICommand) 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.
@@ -588,8 +596,8 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
try {
ILaunchConfigurationWorkingCopy workingCopy = null;
String name= DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(ExternalToolsUIMessages.BuilderPropertyPage_New_Builder_7);
- workingCopy = type.newInstance(BuilderUtils.getBuilderFolder(getInputProject(), true), name);
-
+ workingCopy = type.newInstance(BuilderUtils.getBuilderFolder(getInputProject(), true), name);
+
StringBuffer buffer= new StringBuffer(IExternalToolConstants.BUILD_TYPE_FULL);
buffer.append(',');
buffer.append(IExternalToolConstants.BUILD_TYPE_INCREMENTAL);
@@ -611,7 +619,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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);
+ config= newConfigList.get(newConfigList.size() - 1);
viewer.add(config);
viewer.setChecked(config, isEnabled(config));
}
@@ -625,7 +633,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
}
}
-
+
/**
* Prompts the user to edit the given launch configuration. Returns the
* return code from opening the launch configuration dialog.
@@ -641,17 +649,17 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
manager.removeLaunchConfigurationListener(configurationListener);
return code;
}
-
+
/**
* Prompts the user to choose a launch configuration type to create and
* returns the type the user selected or <code>null</code> if the user
* cancelled.
- *
+ *
* @return the configuration type selected by the user or <code>null</code>
* if the user cancelled.
*/
private ILaunchConfigurationType promptForConfigurationType() {
- List externalToolTypes= getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY);
+ List<ILaunchConfigurationType> externalToolTypes = getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY);
Shell shell= getShell();
if (shell == null) {
return null;
@@ -668,13 +676,13 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
return (ILaunchConfigurationType) result[0];
}
-
+
/**
* Returns the launch configuration types of the given category
*/
- private List getConfigurationTypes(String category) {
+ private List<ILaunchConfigurationType> getConfigurationTypes(String category) {
ILaunchConfigurationType types[] = DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationTypes();
- List externalToolTypes = new ArrayList();
+ List<ILaunchConfigurationType> externalToolTypes = new ArrayList<ILaunchConfigurationType>();
for (int i = 0; i < types.length; i++) {
ILaunchConfigurationType configurationType = types[i];
if (category.equals(configurationType.getCategory())) {
@@ -683,7 +691,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
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.
@@ -729,13 +737,13 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
ICommand command= (ICommand) data;
if (command.isConfigurable()) {
if (editCommand(command)) {
- userHasMadeChanges= true;
+ userHasMadeChanges= true;
}
}
}
}
}
-
+
private boolean editCommand(ICommand data) {
EditCommandDialog dialog= new EditCommandDialog(getShell(), data);
return Window.OK == dialog.open();
@@ -745,7 +753,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
* 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() {
@@ -758,12 +766,12 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
return false;
}
// Warn the user that editing an old config will cause storage migration.
- MessageDialogWithToggle dialog= MessageDialogWithToggle.openYesNoQuestion(getShell(),
+ MessageDialogWithToggle dialog= MessageDialogWithToggle.openYesNoQuestion(getShell(),
ExternalToolsUIMessages.BuilderPropertyPage_Migrate_project_builder_10,
ExternalToolsUIMessages.BuilderPropertyPage_Not_Support,
ExternalToolsUIMessages.BuilderPropertyPage_Prompt,
false,
- ExternalToolsPlugin.getDefault().getPreferenceStore(),
+ ExternalToolsPlugin.getDefault().getPreferenceStore(),
IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION);
return dialog.getReturnCode() == IDialogConstants.YES_ID;
}
@@ -779,7 +787,8 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
status[0] = new Status(IStatus.ERROR, ExternalToolsPlugin.PLUGIN_ID, 0, ExternalToolsUIMessages.BuilderPropertyPage_statusMessage, e);
}
Display.getDefault().asyncExec(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
Shell shell= getShell();
if (shell != null) {
ErrorDialog.openError(shell, ExternalToolsUIMessages.BuilderPropertyPage_errorTitle,
@@ -851,18 +860,18 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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) {
ICommand command = (ICommand) element;
- String val = (String)command.getArguments().get(COMMAND_ENABLED);
+ String val = command.getArguments().get(COMMAND_ENABLED);
if(val != null) {
//null means enabled, see #doPerformOk
Boolean enabled = new Boolean(val);
@@ -931,6 +940,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
if (!userHasMadeChanges) {
return super.performOk();
@@ -943,6 +953,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
itemData[i]= builderTable.getItem(i).getData();
}
IRunnableWithProgress runnable= new IRunnableWithProgress() {
+ @Override
public void run(IProgressMonitor monitor)
throws InvocationTargetException, InterruptedException {
doPerformOk(monitor, itemData);
@@ -951,28 +962,28 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
}
};
-
+
IProgressService service= PlatformUI.getWorkbench().getProgressService();
try {
service.busyCursorWhile(runnable);
} catch (InvocationTargetException e) {
return false;
} catch (InterruptedException e) {
- return false;
+ 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);
+ List<ICommand> possibleCommands = new ArrayList<ICommand>(numCommands);
for (int i = 0; i < numCommands; i++) {
Object data = itemData[i];
if (data instanceof ICommand) {
@@ -982,8 +993,8 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
continue;
}
ICommand command= (ICommand)data;
- Map/*<String, String>*/ args = command.getArguments();
- String val = (String)args.get(COMMAND_ENABLED);
+ Map<String, String> args = command.getArguments();
+ String val = args.get(COMMAND_ENABLED);
if(val != null) {
Boolean enabled = new Boolean(val);
if (!enabled.booleanValue()) {
@@ -1007,7 +1018,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
} catch (CoreException e1) {
}
-
+
if (!BuilderUtils.isUnmigratedConfig(config) && (config instanceof ILaunchConfigurationWorkingCopy)) {
ILaunchConfigurationWorkingCopy workingCopy= ((ILaunchConfigurationWorkingCopy) config);
// Save any changes to the config (such as enable/disable)
@@ -1026,8 +1037,8 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
} else if (data instanceof ErrorConfig) {
data= ((ErrorConfig) data).getCommand();
}
- if (data != null) {
- possibleCommands.add(data);
+ if (data instanceof ICommand) {
+ possibleCommands.add((ICommand) data);
}
monitor.worked(1);
}
@@ -1044,13 +1055,13 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
performCancel();
}
}
-
+
if (configsToBeDeleted != null) {
deleteConfigurations();
}
monitor.done();
}
-
+
private void checkBuilderFolder() {
try {
IFolder builderFolder= BuilderUtils.getBuilderFolder(getInputProject(), false);
@@ -1072,12 +1083,12 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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));
-
+ Map<String, String> args = config.getAttribute(IExternalToolConstants.ATTR_TOOL_ARGUMENTS, new HashMap<String, String>(0));
+
newCommand.setBuilderName(builderName);
newCommand.setArguments(args);
if (configsToBeDeleted == null) {
- configsToBeDeleted= new ArrayList();
+ configsToBeDeleted = new ArrayList<ILaunchConfiguration>();
}
configsToBeDeleted.add(config);
return newCommand;
@@ -1089,21 +1100,22 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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.
+ * Disables a builder by wrapping 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/*<String, String>*/ arguments= command.getArguments();
+ Map<String, String> arguments = command.getArguments();
if (arguments != null) {
arguments.remove(COMMAND_ENABLED);
}
- List externalToolTypes= getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY);
+ List<ILaunchConfigurationType> externalToolTypes = getConfigurationTypes(IExternalToolConstants.ID_EXTERNAL_TOOLS_BUILDER_LAUNCH_CATEGORY);
if (externalToolTypes.size() == 0) {
return null;
}
- ILaunchConfigurationType type= (ILaunchConfigurationType)externalToolTypes.get(0);
+ ILaunchConfigurationType type= externalToolTypes.get(0);
if (type == null) {
return null;
}
@@ -1112,8 +1124,8 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
ILaunchConfigurationWorkingCopy workingCopy = null;
String builderName = command.getBuilderName();
String name= DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(builderName);
- workingCopy = type.newInstance(BuilderUtils.getBuilderFolder(getInputProject(), true), name);
-
+ 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);
@@ -1134,18 +1146,14 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
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();
+ for (ILaunchConfiguration config : configsToBeDeleted) {
+ config.delete();
}
-
checkBuilderFolder();
} catch (CoreException e) {
handleException(e);
@@ -1157,7 +1165,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
}
}
}
-
+
/**
* Returns whether any of the commands have changed.
*/
@@ -1176,12 +1184,12 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
if (oldName == null && newName != null) {
return true;
}
-
+
if(oldName != null && !oldName.equals(newName)) {
return true;
}
- Map/*<String, String>*/ oldArgs= oldCommand.getArguments();
- Map/*<String, String>*/ newArgs= newCommand.getArguments();
+ Map<String, String> oldArgs = oldCommand.getArguments();
+ Map<String, String> newArgs = newCommand.getArguments();
if (oldArgs == null) {
if(newArgs != null) {
return true;
@@ -1191,20 +1199,11 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
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)){
+ for (String key : oldArgs.keySet()) {
+ if (comparator.compare(oldArgs.get(key), newArgs.get(key)) != 0) {
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)
@@ -1215,24 +1214,23 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
} catch (CoreException ce) {
return true;
}
- return false;
+ return false;
}
/* (non-Javadoc)
* @see org.eclipse.jface.preference.IPreferencePage#performCancel()
*/
+ @Override
public boolean performCancel() {
- Iterator iter= newConfigList.iterator();
- while (iter.hasNext()) {
+ for (ILaunchConfiguration config : newConfigList) {
try {
- ((ILaunchConfiguration) iter.next()).delete();
+ config.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();
@@ -1240,15 +1238,16 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta
Object data = builderTable.getItem(i).getData();
if (data instanceof ICommand) {
ICommand command= (ICommand)data;
- Map/*<String, String>*/ args= command.getArguments();
+ Map<String, String> args = command.getArguments();
args.remove(COMMAND_ENABLED);
command.setArguments(args);
}
}
return super.performCancel();
}
-
- public Shell getShell() {
+
+ @Override
+ public Shell getShell() {
if (getControl().isDisposed()) {
return null;
}
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
index 4a2befedc..320d15bb6 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -29,25 +29,26 @@ public class EditCommandDialog extends Dialog {
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)
*/
+ @Override
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));
@@ -57,23 +58,24 @@ public class EditCommandDialog extends Dialog {
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()
*/
+ @Override
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
index 6c804b821..7b9fc3d42 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
* Frederic Gurr - Fixed restore default behavior (bug 346082)
@@ -33,7 +33,7 @@ public class ExternalToolsPreferencePage extends PreferencePage implements IWork
private Button promptForToolMigrationButton;
private Button promptForProjectMigrationButton;
-
+
public ExternalToolsPreferencePage() {
setPreferenceStore(ExternalToolsPlugin.getDefault().getPreferenceStore());
setDescription(ExternalToolsUIMessages.ExternalToolsPreferencePage_External_tool_project_builders_migration_2);
@@ -42,6 +42,7 @@ public class ExternalToolsPreferencePage extends PreferencePage implements IWork
/**
* @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
*/
+ @Override
protected Control createContents(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IExternalToolsHelpContextIds.EXTERNAL_TOOLS_PREFERENCE_PAGE);
//The main composite
@@ -51,15 +52,15 @@ public class ExternalToolsPreferencePage extends PreferencePage implements IWork
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.
*/
@@ -71,16 +72,18 @@ public class ExternalToolsPreferencePage extends PreferencePage implements IWork
button.setSelection(getPreferenceStore().getBoolean(preferenceKey));
return button;
}
-
+
/**
* @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
+ @Override
public void init(IWorkbench workbench) {
}
/**
* @see org.eclipse.jface.preference.PreferencePage#performOk()
*/
+ @Override
public boolean performOk() {
getPreferenceStore().setValue(IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION, promptForToolMigrationButton.getSelection());
getPreferenceStore().setValue(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION, promptForProjectMigrationButton.getSelection());
@@ -90,6 +93,7 @@ public class ExternalToolsPreferencePage extends PreferencePage implements IWork
/**
* @see org.eclipse.jface.preference.PreferencePage#performDefaults()
*/
+ @Override
protected void performDefaults() {
promptForToolMigrationButton.setSelection(getPreferenceStore().getDefaultBoolean(IPreferenceConstants.PROMPT_FOR_TOOL_MIGRATION));
promptForProjectMigrationButton.setSelection(getPreferenceStore().getDefaultBoolean(IPreferenceConstants.PROMPT_FOR_PROJECT_MIGRATION));
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
index db5a4b10d..db51b499e 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -13,6 +13,7 @@ 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;
@@ -60,7 +61,7 @@ public class FileSelectionDialog extends MessageDialog {
private Pattern fPattern;
/**
* Creates a resource selection dialog rooted at the given element.
- *
+ *
* @param parentShell
* the parent shell
* @param rootElement
@@ -74,12 +75,12 @@ public class FileSelectionDialog extends MessageDialog {
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 <code>null</code>
* to display all files. If a pattern is supplied, only files
@@ -100,23 +101,26 @@ public class FileSelectionDialog extends MessageDialog {
fPattern = null;
}
}
-
+
/*
* (non-Javadoc) Method declared in Window.
*/
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
PlatformUI.getWorkbench().getHelpSystem().setHelp(shell, IExternalToolsHelpContextIds.FILE_SELECTION_DIALOG);
}
+ @Override
protected void createButtonsForButtonBar(Composite parent) {
super.createButtonsForButtonBar(parent);
initializeDialog();
}
-
+
/*
* (non-Javadoc) Method declared on Dialog.
*/
+ @Override
protected Control createDialogArea(Composite parent) {
// page group
Composite composite = (Composite) super.createDialogArea(parent);
@@ -138,10 +142,12 @@ public class FileSelectionDialog extends MessageDialog {
// size, otherwise it will open too small
SIZING_SELECTION_WIDGET_WIDTH, SIZING_SELECTION_WIDGET_HEIGHT,
allowMultiselection);
-
+
composite.addControlListener(new ControlListener() {
+ @Override
public void controlMoved(ControlEvent e) {
}
+ @Override
public void controlResized(ControlEvent e) {
//Also try and reset the size of the columns as appropriate
TableColumn[] columns =
@@ -160,28 +166,27 @@ public class FileSelectionDialog extends MessageDialog {
*/
private ITreeContentProvider getResourceProvider(final int resourceType) {
return new WorkbenchContentProvider() {
+ @Override
public Object[] getChildren(Object o) {
if (o instanceof IContainer) {
IResource[] members = null;
try {
members = ((IContainer) o).members();
- List accessibleMembers = new ArrayList(members.length);
+ List<IResource> accessibleMembers = new ArrayList<IResource>(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()]);
+ members = 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();
+ ArrayList<IResource> results = new ArrayList<IResource>();
for (int i = 0; i < members.length; i++) {
//And the test bits with the resource types to see if
// they are what we want
@@ -196,7 +201,7 @@ public class FileSelectionDialog extends MessageDialog {
}
return results.toArray();
}
-
+
return new Object[0];
}
};
@@ -207,12 +212,14 @@ public class FileSelectionDialog extends MessageDialog {
private void initializeDialog() {
selectionGroup
.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
getButton(IDialogConstants.OK_ID).setEnabled(
!selectionGroup.getListTableSelection().isEmpty());
}
});
selectionGroup.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
buttonPressed(IDialogConstants.OK_ID);
}
@@ -228,6 +235,7 @@ public class FileSelectionDialog extends MessageDialog {
return result;
}
+ @Override
protected void buttonPressed(int buttonId) {
if (buttonId == IDialogConstants.OK_ID) {
result= selectionGroup.getListTableSelection();
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
index 0c3f2cf17..4b50ef916 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -12,7 +12,6 @@ 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;
@@ -43,8 +42,8 @@ import org.eclipse.ui.views.navigator.ResourceComparator;
public class TreeAndListGroup implements ISelectionChangedListener {
private Object root;
private Object currentTreeSelection;
- private List selectionChangedListeners = new ArrayList();
- private List doubleClickListeners= new ArrayList();
+ private List<ISelectionChangedListener> selectionChangedListeners = new ArrayList<ISelectionChangedListener>();
+ private List<IDoubleClickListener> doubleClickListeners = new ArrayList<IDoubleClickListener>();
private ITreeContentProvider treeContentProvider;
private IStructuredContentProvider listContentProvider;
@@ -101,11 +100,11 @@ public class TreeAndListGroup implements 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) {
@@ -117,20 +116,18 @@ public class TreeAndListGroup implements ISelectionChangedListener {
* viewer
*/
protected void notifySelectionListeners(SelectionChangedEvent event) {
- Iterator iter = selectionChangedListeners.iterator();
- while (iter.hasNext()) {
- ((ISelectionChangedListener) iter.next()).selectionChanged(event);
+ for (ISelectionChangedListener listener : selectionChangedListeners) {
+ listener.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);
+ for (IDoubleClickListener listener : doubleClickListeners) {
+ listener.doubleClick(event);
}
}
@@ -178,11 +175,13 @@ public class TreeAndListGroup implements ISelectionChangedListener {
listViewer.setLabelProvider(listLabelProvider);
listViewer.setComparator(new ResourceComparator(ResourceComparator.NAME));
listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
notifySelectionListeners(event);
}
});
listViewer.addDoubleClickListener(new IDoubleClickListener() {
+ @Override
public void doubleClick(DoubleClickEvent event) {
if (!event.getSelection().isEmpty()) {
notifyDoubleClickListeners(event);
@@ -207,30 +206,30 @@ public class TreeAndListGroup implements ISelectionChangedListener {
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);
@@ -247,6 +246,7 @@ public class TreeAndListGroup implements ISelectionChangedListener {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
*/
+ @Override
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
Object selectedElement = selection.getFirstElement();
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
index 88960d6b3..53e189243 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2009 Matthew Conway and others.
+ * Copyright (c) 2007, 2013 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
@@ -7,6 +7,7 @@
*
* Contributors:
* Matthew Conway - initial API and implementation
+ * IBM Corporation - bug fixing
*******************************************************************************/
package org.eclipse.ui.externaltools.internal.variables;
@@ -33,16 +34,17 @@ public class BuildFilesResolver implements IDynamicVariableResolver
// 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
+ @Override
+ 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();
-
+ final Set<String> changedResources = new LinkedHashSet<String>();
+
// Use the argument to determine which deltas to visit - if none,
// then defaults to all
int deltas = 0;
@@ -52,17 +54,17 @@ public class BuildFilesResolver implements IDynamicVariableResolver
// Check delta kinds
if (argument.indexOf(ARG_ADDED) > -1)
{
- deltas |= IResourceDelta.ADDED;
+ deltas |= IResourceDelta.ADDED;
}
if (argument.indexOf(ARG_CHANGED) > -1)
{
- deltas |= IResourceDelta.CHANGED;
+ deltas |= IResourceDelta.CHANGED;
}
if (argument.indexOf(ARG_REMOVED) > -1)
{
- deltas |= IResourceDelta.REMOVED;
+ deltas |= IResourceDelta.REMOVED;
}
-
+
// Check wether to include files and/or directories
if (argument.indexOf(ARG_DIRS) > -1)
{
@@ -86,14 +88,15 @@ public class BuildFilesResolver implements IDynamicVariableResolver
final int trackDeltas = deltas;
final boolean trackDirs = dirs;
final boolean trackFiles = files;
-
-
+
+
buildDelta.accept(new IResourceDeltaVisitor()
{
- public boolean visit(IResourceDelta delta) throws CoreException
+ @Override
+ 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)
@@ -103,7 +106,7 @@ public class BuildFilesResolver implements IDynamicVariableResolver
// 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)
{
@@ -114,7 +117,7 @@ public class BuildFilesResolver implements IDynamicVariableResolver
{
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
@@ -130,7 +133,7 @@ public class BuildFilesResolver implements IDynamicVariableResolver
}, 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
index e44873975..53009f683 100644
--- 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -29,6 +29,7 @@ public class BuildProjectResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
public String resolveValue(IDynamicVariable variable, String argument) throws CoreException {
IResource resource= ExternalToolBuilder.getBuildProject();
if (argument != null && resource != null) {
@@ -40,22 +41,22 @@ public class BuildProjectResolver implements IDynamicVariableResolver {
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 <code>null</code>
+ * @param exception underlying exception or <code>null</code>
* @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, <code>${var_name:arg}</code>.
- *
+ *
* @param variable referenced variable
* @param argument referenced argument or <code>null</code>
* @return vraiable reference expression
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
index 64f8d47a1..0cebaa27e 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -20,6 +20,7 @@ public class BuildTypeResolver implements IDynamicVariableResolver {
/* (non-Javadoc)
* @see org.eclipse.core.variables.IDynamicVariableResolver#resolveValue(org.eclipse.core.variables.IDynamicVariable, java.lang.String)
*/
+ @Override
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
index dbcfce370..e35286bef 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 IBM Corporation and others.
+ * Copyright (c) 2005, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -25,22 +25,23 @@ 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)
*/
+ @Override
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$
+ Map<String, String> map = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironment();
+ String path= 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$
+ String pathext = map.get("PATHEXT"); //$NON-NLS-1$
StringTokenizer tokenizer= new StringTokenizer(path, File.pathSeparator);
while (tokenizer.hasMoreTokens()) {
String pathElement= tokenizer.nextToken();
@@ -63,5 +64,5 @@ public class SystemPathResolver implements IDynamicVariableResolver {
}
}
return argument;
- }
+ }
}
diff --git a/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF b/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
index 4a37b5cf4..305020967 100644
--- a/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.externaltools/META-INF/MANIFEST.MF
@@ -14,11 +14,11 @@ Export-Package: org.eclipse.ui.externaltools.internal.launchConfigurations;x-fri
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.core.variables;bundle-version="[3.2.800,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.debug.core;bundle-version="[3.9.0,4.0.0)",
+ org.eclipse.debug.ui;bundle-version="[3.10.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)"
+ org.eclipse.core.externaltools;bundle-version="[1.0.300,2.0.0)"
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
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
index 67394415e..522ef24af 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -24,6 +24,7 @@ public class ProgramBuilderTabGroup extends AbstractLaunchConfigurationTabGroup
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
*/
+ @Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
RefreshTab refresh = new RefreshTab();
refresh.setHelpContextId(IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_REFRESH_TAB);
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
index 6969274f6..daf5d4269 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -27,6 +27,7 @@ public class ProgramMainTab extends ExternalToolsMainTab {
* location as a String containing the workspace_loc variable or
* <code>null</code> if no location was obtained from the user.
*/
+ @Override
protected void handleWorkspaceLocationButtonSelected() {
FileSelectionDialog dialog;
dialog = new FileSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), ExternalToolsProgramMessages.ProgramMainTab_Select);
@@ -44,11 +45,12 @@ public class ProgramMainTab extends ExternalToolsMainTab {
locationField.setText(expression.toString());
}
}
-
-
+
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
+ @Override
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
index eddfb76b9..444a70bf2 100644
--- 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
@@ -1,10 +1,10 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.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
@@ -25,6 +25,7 @@ public class ProgramTabGroup extends AbstractLaunchConfigurationTabGroup {
/**
* @see org.eclipse.debug.ui.ILaunchConfigurationTabGroup#createTabs(org.eclipse.debug.ui.ILaunchConfigurationDialog, java.lang.String)
*/
+ @Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
RefreshTab refresh = new RefreshTab();
refresh.setHelpContextId(IExternalToolsHelpContextIds.EXTERNAL_TOOLS_LAUNCH_CONFIGURATION_DIALOG_REFRESH_TAB);
diff --git a/org.eclipse.ui.externaltools/buildfiles/exportplugin.xml b/org.eclipse.ui.externaltools/buildfiles/exportplugin.xml
deleted file mode 100644
index 6444f3f83..000000000
--- a/org.eclipse.ui.externaltools/buildfiles/exportplugin.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- Export a jar of .class files for the org.eclipse.ui.externaltools Eclipse plug-in
- along with other important plugin files to the "plugin-export" subdirectory
- of the target Eclipse installation
-
- -->
-<project name="Export externaltools" default="export" basedir="..">
-
- <!-- Set the timestamp and important properties -->
- <target name="init">
- <tstamp/>
- <property name="destdir" value="../../plugin-export" />
- <property name="dest" value="${destdir}/org.eclipse.ui.externaltools_3.0.0" />
- </target>
-
- <!-- Create the jar of .class files, and copy other important files to export dir -->
- <target name="export" depends="init">
- <mkdir dir="${destdir}" />
- <delete dir="${dest}" />
- <mkdir dir="${dest}" />
- <jar destfile="${dest}/externaltools.jar">
- <fileset dir="bin">
- </fileset>
- </jar>
- <!-- Create the source zip -->
- <zip destfile="${dest}/externaltoolssrc.zip">
- <fileset dir="External Tools Base"/>
- <fileset dir="Program Tools Support"/>
- </zip>
- <copy file="plugin.xml" todir="${dest}"/>
- <copy file="plugin.properties" todir="${dest}"/>
- <copy file=".classpath" todir="${dest}"/>
- <copy file=".options" todir="${dest}"/>
- <copy todir="${dest}/icons">
- <fileset dir="icons" />
- </copy>
- </target>
-
-</project>

Back to the top